Compare commits

...

17 commits

Author SHA1 Message Date
Roman d1df8ccf4f
Merge a60a8bd34f into 2493d03013 2024-09-12 08:29:36 +03:00
LinuxServer-CI 2493d03013
Bot Updating Package Versions 2024-09-10 17:30:49 +00:00
sturman a60a8bd34f Merge remote-tracking branch 'origin/main' into replace-placeholers-in-proeprties 2024-08-27 09:24:48 +03:00
sturman 61c4b501a0 Merge remote-tracking branch 'origin/main' into replace-placeholers-in-proeprties
# Conflicts:
#	README.md
#	readme-vars.yml
2024-08-17 10:39:00 +03:00
sturman 76bcaf322d Merge remote-tracking branch 'origin/main' into replace-placeholers-in-proeprties 2024-07-17 22:15:18 +03:00
sturman 4ea124f871 Merge remote-tracking branch 'origin/main' into replace-placeholers-in-proeprties 2024-06-04 15:27:21 +03:00
sturman 96d3003d43 Merge remote-tracking branch 'origin/main' into replace-placeholers-in-proeprties
# Conflicts:
#	readme-vars.yml
2024-05-21 16:10:51 +03:00
sturman 9f8030f07a Merge remote-tracking branch 'origin/main' into replace-placeholers-in-proeprties 2024-04-29 15:19:50 +03:00
sturman 1a538030be Add new environment variables to README.md 2024-03-20 12:27:16 +02:00
sturman 41b367182a Merge remote-tracking branch 'origin/main' into replace-placeholers-in-proeprties 2024-03-20 12:20:41 +02:00
sturman 27594b95a8 Sort dependencies 2024-02-24 21:51:16 +02:00
sturman 36abd4e762 Revert "Install envsubst alternative (Go version)"
This reverts commit 62dab7b4
2024-02-24 21:50:33 +02:00
sturman 3be04fb262 Fix log message 2024-02-24 20:55:31 +02:00
sturman a1b59c28ec Set DEBIAN_FRONTEND environment variable 2024-02-24 20:38:41 +02:00
sturman 62dab7b4c2 Install envsubst alternative (Go version) 2024-02-24 20:35:15 +02:00
sturman 1146ec48fd Install envsubst 2024-02-24 20:20:02 +02:00
sturman fb1bd160e3 Use envsubst to replace placeholders in system.properties 2024-02-24 20:19:53 +02:00
7 changed files with 13 additions and 40 deletions

View file

@ -17,6 +17,7 @@ RUN \
echo "**** install packages ****" && \
apt-get update && \
apt-get install --no-install-recommends -y \
gettext \
jsvc \
logrotate \
openjdk-17-jre-headless \

View file

@ -17,6 +17,7 @@ RUN \
echo "**** install packages ****" && \
apt-get update && \
apt-get install --no-install-recommends -y \
gettext \
jsvc \
logrotate \
openjdk-17-jre-headless \

View file

@ -201,10 +201,8 @@ docker run -d \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e MONGO_USER=unifi \
-e MONGO_PASS= \
-e MONGO_HOST=unifi-db \
-e MONGO_PORT=27017 \
-e MONGO_URI=mongodb+srv://unifi:password@unifi.mongodb.net/?retryWrites=true&w=majority&appName=unifi \
-e STAT_MONGO_URI=mongodb+srv://unifi:password@unifi.mongodb.net/?retryWrites=true&w=majority&appName=unifi \
-e MONGO_DBNAME=unifi \
-e MONGO_AUTHSOURCE=admin \
-e MEM_LIMIT=1024 `#optional` \

View file

@ -228,7 +228,7 @@ libsmartcols1 2.39.3-9ubuntu6.1 deb
libsqlite3-0 3.45.1-1ubuntu2 deb
libss2 1.47.0-2.4~exp1ubuntu4.1 deb
libssh-4 0.10.6-2build2 deb
libssl3t64 3.0.13-0ubuntu3.3 deb
libssl3t64 3.0.13-0ubuntu3.4 deb
libstdc++6 14-20240412-0ubuntu1 deb
libsystemd0 255.4-1ubuntu8.4 deb
libtasn1-6 4.19.0-3build1 deb
@ -260,7 +260,7 @@ ncurses-bin 6.4+20240113-1ubuntu2 deb
netcat-openbsd 1.226-1ubuntu2 deb
openjdk-17-jre-headless 17.0.12+7-1ubuntu2~24.04 deb
openssh 1.0 java-archive
openssl 3.0.13-0ubuntu3.3 deb
openssl 3.0.13-0ubuntu3.4 deb
org.eclipse.paho.client.mqttv3 1.1.0 java-archive
owasp-java-html-sanitizer 20240325.1 java-archive
passwd 1:4.13+dfsg1-4ubuntu3 deb

View file

@ -144,6 +144,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "17.08.24:", desc: "Change environment variables" }
- { date: "11.08.24:", desc: "**Important**: The mongodb init instructions have been updated to enable auth ([RBAC](https://www.mongodb.com/docs/manual/core/authorization/#role-based-access-control)). We have been notified that if RBAC is not enabled, the official mongodb container allows remote access to the db contents over port 27017 without credentials. If you set up the mongodb container with the old instructions we provided, you should not map or expose port 27017. If you would like to enable auth, the easiest way is to create new instances of both unifi and mongodb with the new instructions and restore unifi from a backup." }
- { date: "11.08.24:", desc: "Rebase to Ubuntu Noble." }
- { date: "04.03.24:", desc: "Install from zip package instead of deb." }

View file

@ -41,6 +41,6 @@
# unifi.throughput.port=6789
#
db.mongo.local=false
db.mongo.uri=mongodb://~MONGO_USER~:~MONGO_PASS~@~MONGO_HOST~:~MONGO_PORT~/~MONGO_DBNAME~?tls=~MONGO_TLS~~MONGO_AUTHSOURCE~
statdb.mongo.uri=mongodb://~MONGO_USER~:~MONGO_PASS~@~MONGO_HOST~:~MONGO_PORT~/~MONGO_DBNAME~_stat?tls=~MONGO_TLS~~MONGO_AUTHSOURCE~
unifi.db.name=~MONGO_DBNAME~
db.mongo.uri=$MONGO_URI
statdb.mongo.uri=$STAT_MONGO_URI
unifi.db.name=$MONGO_DBNAME

View file

@ -28,39 +28,11 @@ if [[ ! -L "/usr/lib/unifi/run" ]]; then
fi
if [[ ! -e /config/data/system.properties ]]; then
if [[ -z "${MONGO_HOST}" ]]; then
echo "*** No MONGO_HOST set, cannot configure database settings. ***"
if [[ -z "${MONGO_URI}" || -z "${STAT_MONGO_URI}" || -z "${MONGO_DBNAME}" ]]; then
echo "*** Required environment variables are not set, cannot configure database settings. ***"
sleep infinity
else
echo "*** Waiting for MONGO_HOST ${MONGO_HOST} to be reachable. ***"
DBCOUNT=0
while true; do
if nc -w1 "${MONGO_HOST}" "${MONGO_PORT}" >/dev/null 2>&1; then
break
fi
DBCOUNT=$((DBCOUNT+1))
if [[ ${DBCOUNT} -gt 6 ]]; then
echo "*** Defined MONGO_HOST ${MONGO_HOST} is not reachable, cannot proceed. ***"
sleep infinity
fi
sleep 5
done
sed -i "s/~MONGO_USER~/${MONGO_USER}/" /defaults/system.properties
sed -i "s/~MONGO_HOST~/${MONGO_HOST}/" /defaults/system.properties
sed -i "s/~MONGO_PORT~/${MONGO_PORT}/" /defaults/system.properties
sed -i "s/~MONGO_DBNAME~/${MONGO_DBNAME}/" /defaults/system.properties
sed -i "s/~MONGO_PASS~/${MONGO_PASS}/" /defaults/system.properties
if [[ "${MONGO_TLS,,}" = "true" ]]; then
sed -i "s/~MONGO_TLS~/true/" /defaults/system.properties
else
sed -i "s/~MONGO_TLS~/false/" /defaults/system.properties
fi
if [[ -z "${MONGO_AUTHSOURCE}" ]]; then
sed -i "s/~MONGO_AUTHSOURCE~//" /defaults/system.properties
else
sed -i "s/~MONGO_AUTHSOURCE~/\&authSource=${MONGO_AUTHSOURCE}/" /defaults/system.properties
fi
cp /defaults/system.properties /config/data
envsubst < /defaults/system.properties > /config/data/system.properties
fi
fi