marcoraddatz / homebridge-docker

Dockerized Homebridge. No plugins pre-defined, hassle-free setup. Read instructions!
Apache License 2.0
127 stars 47 forks source link

QNAP setup using Container Station #46

Closed davidjgonzalez closed 6 years ago

davidjgonzalez commented 6 years ago

Thanks for this project! Adding instructions for QNAP setup.

Setting up Homebridge using QNAP Containers

  1. Ensure that Container Station is installed via the QNAP App Center
  2. Create a new container for using this projects docker container hb-1
  3. Create a friendly name (can be anything), make sure "auto start" is selected, and adjust the container's resources based on that you can afford allocating. hb-2
  4. Click Advanced Settings > Network and change the Network Mode to Bridge. I found if you do not do this your phone will not be able to communicate w Homebridge, and scanning the QR Code will result in the iOS Homekit app spinning. hb-3
  5. Click Advanced Settings > Shared Folders and map a QNAP folder to /root/.homebridge. If you want to create a special folder, open QNAP's File Station, and make a new folder (I created one named "Homebridge". This shared folder will let you modify the Homebridge config files without dealing ssh'ing into the docker container. hb-4
  6. Create the docker container; this may take some time (its 1.1GB) so check the Container Station background tasks to quickly see the status.
  7. Once the container is up, SFTP your homebridge files into the shared folder (Step 5), and restart the container via the Container Station WebUI, and watch the console until the QR Code appears.
  8. Open Homekit app on your iOS (making sure that the iOS device is on the same network at the QNAP adapter bridged to this container in Step 4) scan the QR code in the container console and everything should link up!
marcoraddatz commented 6 years ago

Hey David, this is awesome! I will split the readme into a separate site and create wiki entries for Synology and QNAP! Many thanks!

j796160836 commented 6 years ago

Here is how I do for setup homebridge with QANP NAS. I use type command via ssh for setup homebridge.

Setup homebridge with QANP NAS via command line

  1. Put package.json, install.sh and config.json files to a shared folder in your NAS. (for example, my path is /share/homes/admin/Docker/homebridge/)

  2. Go to ControlPanel > [Network & File Services sections] > Telnet/ SSH Make sure your NAS ssh is open and you know the port number. (for example, my NAS IP is: 192.168.1.2 port: 22)

  3. Open a terminal, link to your nas via ssh. (For windows users, you may need Putty)

    $ ssh -p 22 admin@192.168.1.2
    admin@192.168.1.2's password: <type your account password, it will not shown>
  4. there is either or two method, choose it you like.

4A. Run it using docker run command

Use docker command for start the homebridge

[~] # docker run -d --restart=always --net=host -p 51826:51826 -v /share/homes/admin/Docker/homebridge:/root/.homebridge marcoraddatz/homebridge:latest

Then, you will see a new running container in Container Station web interface.

4B. Setup using docker-compose

Create a new plain text file named docker-compose.yml in the same folder.

[~] # cd /share/homes/admin/Docker/
[/share/homes/admin/Docker/homebridge] # vi docker-compose.yml

the contents is

version: '2'
services:
  homebridge:
    image: marcoraddatz/homebridge:latest
    restart: always
    network_mode: host
    ports:
      - "51826:51826"
    volumes:
      - /share/homes/admin/Docker/homebridge:/root/.homebridge

then using the command to start

[/share/homes/admin/Docker/homebridge] # docker-compose up -d

when you to want to stop container, using this command

[/share/homes/admin/Docker/homebridge] # docker-compose down

it will stop container and remove that.

also, you can hand over to Container Station web interface do the remaining stuff.

marcoraddatz commented 6 years ago

I've added two new pages to the wiki:

Feel free to commit changes and many thanks! Will update the readme soon.

gwurb commented 6 years ago

Could you please give more information on step 5?

I get the following: /root/.homebridge/.env not found.
Default env variables will be used.
/root/.homebridge/package.json not found.
Installing plugins from /root/.homebridge/install.sh.
/root/.homebridge/install.sh: line 2: $'\r': command not found

In the container settings I have: Shared Folders    
/root/.homebridge /share/containerconfigdata Read/Write

Thank you

CharlesWiltgen commented 6 years ago

At Step 4, I recommend clicking the spinner control on "Container MAC Address" to set a consistent MAC address when creating the container. Otherwise this will appear as a new device on every restart, which can cause problems.

(In my case specifically it appeared to be causing issues with Wink authentication, and freaked out the Circle device on my network.)

codylegger commented 5 years ago

So, do I need to delete the install.sh file after if has installed? After a reboot it runs this script again and reinstalls everything, is that normal?

ALSO- how do I edit the code to allow Homebridge to run in insecure mode?

davidjgonzalez commented 5 years ago

@codylegger install.sh runs every time it starts up. Containers are based on images - so every time you restart a container, it’s like it’s the first time starting it. You COULD create an image front a configured container but that’s not in scope of this repo - and TBH not necessary. Just let the install run on eveey restart and you’re fine. Nest is the only annoying config I’ve ran into since it requires a new key in each restart (not sure if there’s some way around this now)

Hth

jimmyktm commented 5 years ago

Hi all, i m trying to setup on my Qnap TS-128 but i always have this error standard_init_linux.go:187 standard_init_linux.go:187 Where i did mistake ?

Thanks

rjkelly1894 commented 5 years ago

So, I have followed all of these steps and when I start the container, it immediately stops again. Any ideas?

alanpang1990301 commented 5 years ago

no advance setting do not see the button advance setting, what can i do?