Skip to content
This repository was archived by the owner on Jan 7, 2024. It is now read-only.

Commit 113dfec

Browse files
authored
Merge pull request #198 from linuxserver/run
2 parents c86d281 + 267e53e commit 113dfec

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
270270

271271
## Versions
272272

273+
* **10.03.23:** - Test writing to /run/unifi and symlink to /config/run if it fails.
273274
* **20.02.23:** - Migrate to s6v3, install deb package on build, fix permissions.
274275
* **23.01.23:** - Exclude `run` from `/config` volume.
275276
* **30.11.22:** - Bump JRE to 11.

readme-vars.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ app_setup_block_enabled: true
5151
app_setup_block: |
5252
The webui is at https://ip:8443, setup with the first run wizard.
5353
54-
For Unifi to adopt other devices, e.g. an Access Point, it is required to change the inform IP address. Because Unifi runs inside Docker by default it uses an IP address not accessible by other devices. To change this go to Settings > System Settings > Controller Configuration and set the Controller Hostname/IP to a hostname or IP address accessible by your devices. Additionally the checkbox "Override inform host with controller hostname/IP" has to be checked, so that devices can connect to the controller during adoption (devices use the inform-endpoint during adoption).
54+
### Please note, Unifi change the location of this option every few releases so if it's not where it says, search for "Inform" or "Inform Host" in the settings.
55+
56+
For Unifi to adopt other devices, e.g. an Access Point, it is required to change the inform IP address. Because Unifi runs inside Docker by default it uses an IP address not accessible by other devices. To change this go to Settings > System > Advanced and set the Inform Host to a hostname or IP address accessible by your devices. Additionally the checkbox "Override" has to be checked, so that devices can connect to the controller during adoption (devices use the inform-endpoint during adoption).
5557
5658
In order to manually adopt a device take these steps:
5759
@@ -66,6 +68,7 @@ app_setup_block: |
6668
6769
# changelog
6870
changelogs:
71+
- { date: "10.03.23:", desc: "Test writing to /run/unifi and symlink to /config/run if it fails."}
6972
- { date: "20.02.23:", desc: "Migrate to s6v3, install deb package on build, fix permissions."}
7073
- { date: "23.01.23:", desc: "Exclude `run` from `/config` volume."}
7174
- { date: "30.11.22:", desc: "Bump JRE to 11."}

root/etc/s6-overlay/s6-rc.d/init-unifi-controller-config/run

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,27 @@ fi
8383

8484
# permissions
8585
lsiown -R abc:abc \
86-
/config \
87-
/run/unifi
86+
/config
8887

8988
lsiown abc:abc \
90-
/config/data/keystore
89+
/config/data/keystore \
90+
/run/unifi \
91+
/var/run/unifi
92+
93+
if ! s6-setuidgid abc touch /run/unifi/mongo.test 2>/dev/null; then
94+
if [[ ${S6_VERBOSITY} -ge 2 ]]; then
95+
echo "Write test to /run/unifi failed, symlinking to /config/run."
96+
fi
97+
if [[ -L "/usr/lib/unifi/run" ]]; then
98+
unlink "/usr/lib/unifi/run"
99+
fi
100+
mkdir -p /config/run
101+
ln -s "/config/run" "/usr/lib/unifi/run"
102+
chown abc:abc /usr/lib/unifi/run
103+
else
104+
if [[ ${S6_VERBOSITY} -ge 2 ]]; then
105+
echo "Write test to /run/unifi succeeded."
106+
fi
107+
chown abc:abc /usr/lib/unifi/run
108+
rm /run/unifi/mongo.test
109+
fi

0 commit comments

Comments
 (0)