Unifi: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
Line 7: Line 7:


== Dockerized ==
== Dockerized ==
2019-06-26 upgraded the AP firmware
2019-06-26 changed from the docker config described below to one that lives in docker-compose. I had problems so I did two things: I "abandoned" the AP
2019-06-26 changed from the docker config described below to one that lives in docker-compose. I had problems so I did two things: I "abandoned" the AP
and readopted it. I used ssh to connect to the AP (same user/pass as unifi) and issued this command (once before and once after adoption in Unifi)
and readopted it. I used ssh to connect to the AP (same user/pass as unifi) and issued this command (once before and once after adoption in Unifi)

Revision as of 02:52, 27 June 2019

I use a Ubiquiti WAP and it talks Unifi. I run the controller here: https://bellman:8443/ and I have a page on its features Presence detection

My access point's MAC is 80:2a:a8:90:cd:65 and I can see (on Debian anyway) that MAC when the Debian system tries to connect to it.

Dockerized

2019-06-26 upgraded the AP firmware

2019-06-26 changed from the docker config described below to one that lives in docker-compose. I had problems so I did two things: I "abandoned" the AP and readopted it. I used ssh to connect to the AP (same user/pass as unifi) and issued this command (once before and once after adoption in Unifi)

set-inform http://192.168.123.2:8080/inform

I also changed the network mode in Unifi docker to network-mode: "host" and restarted it. I think this might actually be what did the trick, I think the AP could not see Unifi.

This is what my ~/source/docker/docker-compose.yml looks like today:

version: '3.7'
services:
  unifi:
    container_name: unifi
    image: jacobalberty/unifi
    environment:
      TZ: "Americas/Los_Angeles"
    network_mode: "host"
    ports:
      - "8080:8080"
      - "8443:8443"
      - "3478:3478"
      - "10001:10001"
    volumes:
      - unifi_data:/var/lib/unifi
      - unifi_log:/var/unifi/data
    restart: unless-stopped

volumes:
  unifi_data:
    name: unifi_data
  unifi_log:
    name: unifi_log

2019-02-20 removed systemctl files and changed to using 'restart'. Moved to the volumes documented below, used to use system files in /var/log/unifi and /home/unifi. Removed port 8080

2018-03-21 built a systemctl file for it

2017-08-16 it's now dockerized.

Originally I ran Unifi locally so I just reused its data and log folders. Today I copied them into Docker volumes instead.

Here is how I copied the log files into the volume

cd /var/log/unifi
docker run -v unifi_data:/data busybox helper
docker cp . helper:/data
docker stop helper
docker rm helper

When I started it up it migrated my old database to the 5.5 version of UniFi. It was able to successfully detect my UniFi AP and updated its IP address to my new address scheme and then provisioned it. EXCELLENT.

See https://hub.docker.com/r/jacobalberty/unifi/

docker volume create unifi_data
docker volume create unifi_logs
docker run -d --dns=192.168.123.2 -p 8443:8443 -p 3478:3478 -p 10001:10001 -e TZ='Americas/Los_Angeles' \
-v unifi_data:/var/lib/unifi -v unifi_logs:/var/log/unifi --name=unifi jacobalberty/unifi
docker update --restart always unifi

Troubleshooting

Watch the daemon.log on Bellman and you can watch devices try to associate with the WAP.