Compare commits

...

16 commits

Author SHA1 Message Date
Roman e21026c191
Merge 61c4b501a0 into 28ff550ce9 2024-08-26 11:20:55 -04:00
LinuxServer-CI 28ff550ce9
Bot Updating Package Versions 2024-08-26 13:05:35 +00: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 51 additions and 79 deletions

View file

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

View file

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

View file

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

View file

@ -37,12 +37,12 @@ commons-beanutils 1.9.4 jav
commons-cli 1.4 java-archive commons-cli 1.4 java-archive
commons-codec 1.16.1 java-archive commons-codec 1.16.1 java-archive
commons-daemon 1.0.15 java-archive commons-daemon 1.0.15 java-archive
commons-io 2.16.0 java-archive commons-io 2.16.1 java-archive
commons-lang3 3.13.0 java-archive commons-lang3 3.13.0 java-archive
commons-logging 1.3.0 java-archive commons-logging 1.3.2 java-archive
commons-net 3.10.0 java-archive commons-net 3.11.1 java-archive
commons-text 1.11.0 java-archive commons-text 1.12.0 java-archive
commons-validator 1.8.0 java-archive commons-validator 1.9.0 java-archive
compiler 0.9.6 java-archive compiler 0.9.6 java-archive
coreutils 9.4-3ubuntu6 deb coreutils 9.4-3ubuntu6 deb
cron 3.0pl1-184ubuntu2 deb cron 3.0pl1-184ubuntu2 deb
@ -55,11 +55,11 @@ debianutils 5.17build1 deb
diffutils 1:3.10-1build1 deb diffutils 1:3.10-1build1 deb
dirmngr 2.4.4-2ubuntu17 deb dirmngr 2.4.4-2ubuntu17 deb
dom4j 2.1.4 java-archive dom4j 2.1.4 java-archive
dpkg 1.22.6ubuntu6 deb dpkg 1.22.6ubuntu6.1 deb
e2fsprogs 1.47.0-2.4~exp1ubuntu4 deb e2fsprogs 1.47.0-2.4~exp1ubuntu4 deb
ecj 3.33.0 java-archive ecj 3.33.0 java-archive
eddsa 0.3.0 java-archive eddsa 0.3.0 java-archive
error_prone_annotations 2.26.1 java-archive error_prone_annotations 2.27.0 java-archive
failureaccess 1.0.2 java-archive failureaccess 1.0.2 java-archive
findutils 4.9.0-5build1 deb findutils 4.9.0-5build1 deb
gax 1.31.0 java-archive gax 1.31.0 java-archive
@ -91,8 +91,8 @@ gpgconf 2.4.4-2ubuntu17 deb
gpgsm 2.4.4-2ubuntu17 deb gpgsm 2.4.4-2ubuntu17 deb
gpgv 2.4.4-2ubuntu17 deb gpgv 2.4.4-2ubuntu17 deb
grep 3.11-4build1 deb grep 3.11-4build1 deb
gson 2.9.0 java-archive gson 2.11.0 java-archive
guava 33.1.0-jre java-archive guava 33.2.1-jre java-archive
gzip 1.12-1ubuntu3 deb gzip 1.12-1ubuntu3 deb
hibernate-validator 8.0.1.Final java-archive hibernate-validator 8.0.1.Final java-archive
hostname 3.23+nmu2ubuntu2 deb hostname 3.23+nmu2ubuntu2 deb
@ -139,7 +139,7 @@ jgrapht-ext 1.0.1 jav
jgraphx 2.0.0.1 java-archive jgraphx 2.0.0.1 java-archive
jmdns 3.4.1 java-archive jmdns 3.4.1 java-archive
jna 5.12.1 java-archive jna 5.12.1 java-archive
joda-time 2.10.4 java-archive joda-time 2.12.7 java-archive
jq 1.7.1-3build1 deb jq 1.7.1-3build1 deb
jrt-fs 17.0.12 java-archive jrt-fs 17.0.12 java-archive
json 20231013 java-archive json 20231013 java-archive
@ -249,11 +249,10 @@ login 1:4.13+dfsg1-4ubuntu3 deb
logrotate 3.21.0-2build1 deb logrotate 3.21.0-2build1 deb
logsave 1.47.0-2.4~exp1ubuntu4 deb logsave 1.47.0-2.4~exp1ubuntu4 deb
mawk 1.3.4.20240123-1build1 deb mawk 1.3.4.20240123-1build1 deb
micrometer-commons 1.12.5 java-archive micrometer-commons 1.12.7 java-archive
micrometer-observation 1.12.5 java-archive micrometer-observation 1.12.7 java-archive
minimal-json 0.9.5 java-archive minimal-json 0.9.5 java-archive
mongodb-driver-core 4.11.2 java-archive mongodb-driver-core 4.11.2 java-archive
mongodb-driver-legacy 4.11.2 java-archive
mongodb-driver-sync 4.11.2 java-archive mongodb-driver-sync 4.11.2 java-archive
mount 2.39.3-9ubuntu6 deb mount 2.39.3-9ubuntu6 deb
ncurses-base 6.4+20240113-1ubuntu2 deb ncurses-base 6.4+20240113-1ubuntu2 deb
@ -277,7 +276,7 @@ publicsuffix 20231001.0357-0.1 deb
pull-parser 2.1.10 java-archive pull-parser 2.1.10 java-archive
radclient4 4.0 java-archive radclient4 4.0 java-archive
reactive-streams 1.0.4 java-archive reactive-streams 1.0.4 java-archive
reactor-core 3.6.5 java-archive reactor-core 3.6.7 java-archive
readline-common 8.2-4build1 deb readline-common 8.2-4build1 deb
relaxngDatatype 20020414 java-archive relaxngDatatype 20020414 java-archive
resource-loader 2.0.2 java-archive resource-loader 2.0.2 java-archive
@ -287,38 +286,38 @@ slf4j-api 2.0.13 jav
smtp 2.0.3 java-archive smtp 2.0.3 java-archive
snakeyaml 2.2 java-archive snakeyaml 2.2 java-archive
snappy-java 1.1.10.5 java-archive snappy-java 1.1.10.5 java-archive
spring-aop 6.1.6 java-archive spring-aop 6.1.10 java-archive
spring-beans 6.1.6 java-archive spring-beans 6.1.10 java-archive
spring-boot 3.2.5 java-archive spring-boot 3.2.7 java-archive
spring-boot-autoconfigure 3.2.5 java-archive spring-boot-autoconfigure 3.2.7 java-archive
spring-boot-starter 3.2.5 java-archive spring-boot-starter 3.2.7 java-archive
spring-boot-starter-data-mongodb 3.2.5 java-archive spring-boot-starter-data-mongodb 3.2.7 java-archive
spring-boot-starter-json 3.2.5 java-archive spring-boot-starter-json 3.2.7 java-archive
spring-boot-starter-logging 3.2.5 java-archive spring-boot-starter-logging 3.2.7 java-archive
spring-boot-starter-tomcat 3.2.5 java-archive spring-boot-starter-tomcat 3.2.7 java-archive
spring-boot-starter-validation 3.2.5 java-archive spring-boot-starter-validation 3.2.7 java-archive
spring-boot-starter-web 3.2.5 java-archive spring-boot-starter-web 3.2.7 java-archive
spring-boot-starter-websocket 3.2.5 java-archive spring-boot-starter-websocket 3.2.7 java-archive
spring-context 6.1.6 java-archive spring-context 6.1.10 java-archive
spring-core 6.1.6 java-archive spring-core 6.1.10 java-archive
spring-data-commons 3.2.5 java-archive spring-data-commons 3.2.7 java-archive
spring-data-mongodb 4.2.5 java-archive spring-data-mongodb 4.2.7 java-archive
spring-expression 6.1.6 java-archive spring-expression 6.1.10 java-archive
spring-messaging 6.1.6 java-archive spring-messaging 6.1.10 java-archive
spring-tx 6.1.6 java-archive spring-tx 6.1.10 java-archive
spring-web 6.1.6 java-archive spring-web 6.1.10 java-archive
spring-webmvc 6.1.6 java-archive spring-webmvc 6.1.10 java-archive
spring-websocket 6.1.6 java-archive spring-websocket 6.1.10 java-archive
sshj 0.38.0 java-archive sshj 0.38.0 java-archive
stax-api 1.0-2 java-archive stax-api 1.0-2 java-archive
systemd-standalone-sysusers 255.4-1ubuntu8.2 deb systemd-standalone-sysusers 255.4-1ubuntu8.2 deb
sysvinit-utils 3.08-6ubuntu3 deb sysvinit-utils 3.08-6ubuntu3 deb
tar 1.35+dfsg-3build1 deb tar 1.35+dfsg-3build1 deb
tomcat-annotations-api 10.1.20 java-archive tomcat-annotations-api 10.1.25 java-archive
tomcat-embed-core 10.1.20 java-archive tomcat-embed-core 10.1.25 java-archive
tomcat-embed-el 10.1.20 java-archive tomcat-embed-el 10.1.25 java-archive
tomcat-embed-jasper 10.1.20 java-archive tomcat-embed-jasper 10.1.25 java-archive
tomcat-embed-websocket 10.1.20 java-archive tomcat-embed-websocket 10.1.25 java-archive
txw2 4.0.5 java-archive txw2 4.0.5 java-archive
tzdata 2024a-3ubuntu1.1 deb tzdata 2024a-3ubuntu1.1 deb
ubuntu-keyring 2023.11.28.1 deb ubuntu-keyring 2023.11.28.1 deb

View file

@ -144,6 +144,7 @@ app_setup_block: |
# changelog # changelog
changelogs: 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: "**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: "11.08.24:", desc: "Rebase to Ubuntu Noble." }
- { date: "04.03.24:", desc: "Install from zip package instead of deb." } - { date: "04.03.24:", desc: "Install from zip package instead of deb." }

View file

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

View file

@ -28,39 +28,11 @@ if [[ ! -L "/usr/lib/unifi/run" ]]; then
fi fi
if [[ ! -e /config/data/system.properties ]]; then if [[ ! -e /config/data/system.properties ]]; then
if [[ -z "${MONGO_HOST}" ]]; then if [[ -z "${MONGO_URI}" || -z "${STAT_MONGO_URI}" || -z "${MONGO_DBNAME}" ]]; then
echo "*** No MONGO_HOST set, cannot configure database settings. ***" echo "*** Required environment variables are not set, cannot configure database settings. ***"
sleep infinity sleep infinity
else else
echo "*** Waiting for MONGO_HOST ${MONGO_HOST} to be reachable. ***" envsubst < /defaults/system.properties > /config/data/system.properties
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
fi fi
fi fi