mirror of
https://github.com/linuxserver/docker-unifi-network-application.git
synced 2025-03-05 20:59:58 -08:00
Compare commits
3 commits
1bafbe7ee9
...
003188da8b
Author | SHA1 | Date | |
---|---|---|---|
|
003188da8b | ||
|
d17dfc82c3 | ||
|
6c7856b9e8 |
20
README.md
20
README.md
|
@ -172,12 +172,14 @@ services:
|
||||||
- PUID=1000
|
- PUID=1000
|
||||||
- PGID=1000
|
- PGID=1000
|
||||||
- TZ=Etc/UTC
|
- TZ=Etc/UTC
|
||||||
- MONGO_USER=unifi
|
|
||||||
- MONGO_PASS=
|
|
||||||
- MONGO_HOST=unifi-db
|
- MONGO_HOST=unifi-db
|
||||||
- MONGO_PORT=27017
|
- MONGO_PORT=27017
|
||||||
- MONGO_DBNAME=unifi
|
- MONGO_DBNAME=unifi
|
||||||
- MONGO_AUTHSOURCE=admin
|
- MONGO_STATDBNAME=unifi_stat #optional
|
||||||
|
- MONGO_USER=unifi #optional
|
||||||
|
- MONGO_PASS= #optional
|
||||||
|
- MONGO_AUTHSOURCE=admin #optional
|
||||||
|
- MONGO_AUTHMECHANISM=SCRAM-SHA-256 #optional
|
||||||
- MEM_LIMIT=1024 #optional
|
- MEM_LIMIT=1024 #optional
|
||||||
- MEM_STARTUP=1024 #optional
|
- MEM_STARTUP=1024 #optional
|
||||||
- MONGO_TLS= #optional
|
- MONGO_TLS= #optional
|
||||||
|
@ -204,12 +206,14 @@ 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_PASS= \
|
|
||||||
-e MONGO_HOST=unifi-db \
|
-e MONGO_HOST=unifi-db \
|
||||||
-e MONGO_PORT=27017 \
|
-e MONGO_PORT=27017 \
|
||||||
-e MONGO_DBNAME=unifi \
|
-e MONGO_DBNAME=unifi \
|
||||||
-e MONGO_AUTHSOURCE=admin \
|
-e MONGO_STATDBNAME=unifi_stat `#optional` \
|
||||||
|
-e MONGO_USER=unifi `#optional` \
|
||||||
|
-e MONGO_PASS= `#optional` \
|
||||||
|
-e MONGO_AUTHSOURCE=admin `#optional` \
|
||||||
|
-e MONGO_AUTHMECHANISM=SCRAM-SHA-256 `#optional` \
|
||||||
-e MEM_LIMIT=1024 `#optional` \
|
-e MEM_LIMIT=1024 `#optional` \
|
||||||
-e MEM_STARTUP=1024 `#optional` \
|
-e MEM_STARTUP=1024 `#optional` \
|
||||||
-e MONGO_TLS= `#optional` \
|
-e MONGO_TLS= `#optional` \
|
||||||
|
@ -249,7 +253,9 @@ Containers are configured using parameters passed at runtime (such as those abov
|
||||||
| `-e MONGO_PASS=` | Mongodb Password. Only evaluated on first run. **Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding)**. |
|
| `-e MONGO_PASS=` | Mongodb Password. Only evaluated on first run. **Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding)**. |
|
||||||
| `-e MONGO_HOST=unifi-db` | Mongodb Hostname. Only evaluated on first run. |
|
| `-e MONGO_HOST=unifi-db` | Mongodb Hostname. Only evaluated on first run. |
|
||||||
| `-e MONGO_PORT=27017` | Mongodb Port. Only evaluated on first run. |
|
| `-e MONGO_PORT=27017` | Mongodb Port. Only evaluated on first run. |
|
||||||
| `-e MONGO_DBNAME=unifi` | Mongodb Database Name (stats DB is automatically suffixed with `_stat`). Only evaluated on first run. |
|
| `-e MONGO_DBNAME=unifi` | Mongodb Database Name. Only evaluated on first run. |
|
||||||
|
| `-e MONGO_STATDBNAME=unifi_stat` | Mongodb stats Database Name. If not specified will use MONGO_DBNAME with `_stat` suffix. Only evaluated on first run. |
|
||||||
|
| `-e MONGO_AUTHMECHANISM=SCRAM-SHA-256` | Mongodb [authMechanism](https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/auth/). For FerretDB with Postgres set to `PLAIN`. Only evaluated on first run. |
|
||||||
| `-e MONGO_AUTHSOURCE=admin` | Mongodb [authSource](https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-urioption-urioption.authSource). For Atlas set to `admin`. Only evaluated on first run. |
|
| `-e MONGO_AUTHSOURCE=admin` | Mongodb [authSource](https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-urioption-urioption.authSource). For Atlas set to `admin`. Only evaluated on first run. |
|
||||||
| `-e MEM_LIMIT=1024` | Optionally change the Java memory limit (in Megabytes). Set to `default` to reset to default |
|
| `-e MEM_LIMIT=1024` | Optionally change the Java memory limit (in Megabytes). Set to `default` to reset to default |
|
||||||
| `-e MEM_STARTUP=1024` | Optionally change the Java initial/minimum memory (in Megabytes). Set to `default` to reset to default |
|
| `-e MEM_STARTUP=1024` | Optionally change the Java initial/minimum memory (in Megabytes). Set to `default` to reset to default |
|
||||||
|
|
|
@ -150,7 +150,7 @@ jstun 0.7.4 jav
|
||||||
jsvc 1.0.15-11build1 deb
|
jsvc 1.0.15-11build1 deb
|
||||||
jul-to-slf4j 2.0.16 java-archive
|
jul-to-slf4j 2.0.16 java-archive
|
||||||
keyboxd 2.4.4-2ubuntu17 deb
|
keyboxd 2.4.4-2ubuntu17 deb
|
||||||
krb5-locales 1.20.1-6ubuntu2.3 deb
|
krb5-locales 1.20.1-6ubuntu2.4 deb
|
||||||
lazysodium-java 5.1.4 java-archive
|
lazysodium-java 5.1.4 java-archive
|
||||||
libacl1 2.3.2-1build1.1 deb
|
libacl1 2.3.2-1build1.1 deb
|
||||||
libapt-pkg6.0t64 2.7.14build2 deb
|
libapt-pkg6.0t64 2.7.14build2 deb
|
||||||
|
@ -179,16 +179,16 @@ libgcrypt20 1.10.3-2build1 deb
|
||||||
libgmp10 2:6.3.0+dfsg-2ubuntu6.1 deb
|
libgmp10 2:6.3.0+dfsg-2ubuntu6.1 deb
|
||||||
libgnutls30t64 3.8.3-1.1ubuntu3.2 deb
|
libgnutls30t64 3.8.3-1.1ubuntu3.2 deb
|
||||||
libgpg-error0 1.47-3build2.1 deb
|
libgpg-error0 1.47-3build2.1 deb
|
||||||
libgssapi-krb5-2 1.20.1-6ubuntu2.3 deb
|
libgssapi-krb5-2 1.20.1-6ubuntu2.4 deb
|
||||||
libhogweed6t64 3.9.1-2.2build1.1 deb
|
libhogweed6t64 3.9.1-2.2build1.1 deb
|
||||||
libidn2-0 2.3.7-2build1.1 deb
|
libidn2-0 2.3.7-2build1.1 deb
|
||||||
libjpeg-turbo8 2.1.5-2ubuntu2 deb
|
libjpeg-turbo8 2.1.5-2ubuntu2 deb
|
||||||
libjpeg8 8c-2ubuntu11 deb
|
libjpeg8 8c-2ubuntu11 deb
|
||||||
libjq1 1.7.1-3build1 deb
|
libjq1 1.7.1-3build1 deb
|
||||||
libk5crypto3 1.20.1-6ubuntu2.3 deb
|
libk5crypto3 1.20.1-6ubuntu2.4 deb
|
||||||
libkeyutils1 1.6.3-3build1 deb
|
libkeyutils1 1.6.3-3build1 deb
|
||||||
libkrb5-3 1.20.1-6ubuntu2.3 deb
|
libkrb5-3 1.20.1-6ubuntu2.4 deb
|
||||||
libkrb5support0 1.20.1-6ubuntu2.3 deb
|
libkrb5support0 1.20.1-6ubuntu2.4 deb
|
||||||
libksba8 1.6.6-1build1 deb
|
libksba8 1.6.6-1build1 deb
|
||||||
liblcms2-2 2.14-2build1 deb
|
liblcms2-2 2.14-2build1 deb
|
||||||
libldap-common 2.6.7+dfsg-1~exp1ubuntu8.1 deb
|
libldap-common 2.6.7+dfsg-1~exp1ubuntu8.1 deb
|
||||||
|
|
|
@ -24,15 +24,17 @@ param_ports:
|
||||||
- {external_port: "8080", internal_port: "8080", port_desc: "Required for device communication"}
|
- {external_port: "8080", internal_port: "8080", port_desc: "Required for device communication"}
|
||||||
param_usage_include_env: true
|
param_usage_include_env: true
|
||||||
param_env_vars:
|
param_env_vars:
|
||||||
- {env_var: "MONGO_USER", env_value: "unifi", desc: "Mongodb Username. Only evaluated on first run. **Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding)**."}
|
|
||||||
- {env_var: "MONGO_PASS", env_value: "", desc: "Mongodb Password. Only evaluated on first run. **Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding)**."}
|
|
||||||
- {env_var: "MONGO_HOST", env_value: "unifi-db", desc: "Mongodb Hostname. Only evaluated on first run."}
|
- {env_var: "MONGO_HOST", env_value: "unifi-db", desc: "Mongodb Hostname. Only evaluated on first run."}
|
||||||
- {env_var: "MONGO_PORT", env_value: "27017", desc: "Mongodb Port. Only evaluated on first run."}
|
- {env_var: "MONGO_PORT", env_value: "27017", desc: "Mongodb Port. Only evaluated on first run."}
|
||||||
- {env_var: "MONGO_DBNAME", env_value: "unifi", desc: "Mongodb Database Name (stats DB is automatically suffixed with `_stat`). Only evaluated on first run."}
|
- {env_var: "MONGO_DBNAME", env_value: "unifi", desc: "Mongodb Database Name. Only evaluated on first run."}
|
||||||
- {env_var: "MONGO_AUTHSOURCE", env_value: "admin", desc: "Mongodb [authSource](https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-urioption-urioption.authSource). For Atlas set to `admin`. Only evaluated on first run."}
|
|
||||||
# optional container parameters
|
# optional container parameters
|
||||||
opt_param_usage_include_env: true
|
opt_param_usage_include_env: true
|
||||||
opt_param_env_vars:
|
opt_param_env_vars:
|
||||||
|
- {env_var: "MONGO_USER", env_value: "unifi", desc: "Mongodb Username. Only evaluated on first run. **Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding)**."}
|
||||||
|
- {env_var: "MONGO_PASS", env_value: "", desc: "Mongodb Password. Only evaluated on first run. **Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding)**."}
|
||||||
|
- {env_var: "MONGO_STATDBNAME", env_value: "unifi_stat", desc: "Mongodb stats Database Name. If not specified will use MONGO_DBNAME with `_stat` suffix. Only evaluated on first run."}
|
||||||
|
- {env_var: "MONGO_AUTHSOURCE", env_value: "admin", desc: "Mongodb [authSource](https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-urioption-urioption.authSource). For Atlas set to `admin`. Only evaluated on first run."}
|
||||||
|
- {env_var: "MONGO_AUTHMECHANISM", env_value: "SCRAM-SHA-256", desc: "Mongodb [authMechanism](https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/auth/). For FerretDB with Postgres set to `PLAIN`. Only evaluated on first run."}
|
||||||
- {env_var: "MEM_LIMIT", env_value: "1024", desc: "Optionally change the Java memory limit (in Megabytes). Set to `default` to reset to default"}
|
- {env_var: "MEM_LIMIT", env_value: "1024", desc: "Optionally change the Java memory limit (in Megabytes). Set to `default` to reset to default"}
|
||||||
- {env_var: "MEM_STARTUP", env_value: "1024", desc: "Optionally change the Java initial/minimum memory (in Megabytes). Set to `default` to reset to default"}
|
- {env_var: "MEM_STARTUP", env_value: "1024", desc: "Optionally change the Java initial/minimum memory (in Megabytes). Set to `default` to reset to default"}
|
||||||
- {env_var: "MONGO_TLS", env_value: "", desc: "Mongodb enable [TLS](https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-urioption-urioption.tls). Only evaluated on first run."}
|
- {env_var: "MONGO_TLS", env_value: "", desc: "Mongodb enable [TLS](https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-urioption-urioption.tls). Only evaluated on first run."}
|
||||||
|
|
|
@ -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=mongodb://~MONGO_CREDS~~MONGO_HOST~:~MONGO_PORT~/~MONGO_DBNAME~?tls=~MONGO_TLS~~MONGO_AUTHSOURCE~~MONGO_AUTHMECHANISM~
|
||||||
statdb.mongo.uri=mongodb://~MONGO_USER~:~MONGO_PASS~@~MONGO_HOST~:~MONGO_PORT~/~MONGO_DBNAME~_stat?tls=~MONGO_TLS~~MONGO_AUTHSOURCE~
|
statdb.mongo.uri=mongodb://~MONGO_CREDS~~MONGO_HOST~:~MONGO_PORT~/~MONGO_STATDBNAME~?tls=~MONGO_TLS~~MONGO_AUTHSOURCE~~MONGO_AUTHMECHANISM~
|
||||||
unifi.db.name=~MONGO_DBNAME~
|
unifi.db.name=~MONGO_DBNAME~
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
|
STATDB_NAME=${MONGO_STATDBNAME:-${MONGO_DBNAME}_stat}
|
||||||
|
|
||||||
# create our folders
|
# create our folders
|
||||||
mkdir -p \
|
mkdir -p \
|
||||||
/run/unifi/work/ROOT \
|
/run/unifi/work/ROOT \
|
||||||
|
@ -45,11 +47,15 @@ if [[ ! -e /config/data/system.properties ]]; then
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
sed -i "s/~MONGO_USER~/${MONGO_USER}/" /defaults/system.properties
|
if [[ -n "${MONGO_USER}" || -n "${MONGO_PASS}" ]]; then
|
||||||
|
sed -i "s/~MONGO_CREDS~/${MONGO_USER}:${MONGO_PASS}@/" /defaults/system.properties
|
||||||
|
else
|
||||||
|
sed -i "s/~MONGO_CREDS~//" /defaults/system.properties
|
||||||
|
fi
|
||||||
sed -i "s/~MONGO_HOST~/${MONGO_HOST}/" /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_PORT~/${MONGO_PORT}/" /defaults/system.properties
|
||||||
sed -i "s/~MONGO_DBNAME~/${MONGO_DBNAME}/" /defaults/system.properties
|
sed -i "s/~MONGO_DBNAME~/${MONGO_DBNAME}/" /defaults/system.properties
|
||||||
sed -i "s/~MONGO_PASS~/${MONGO_PASS}/" /defaults/system.properties
|
sed -i "s/~MONGO_STATDBNAME~/${STATDB_NAME}/" /defaults/system.properties
|
||||||
if [[ "${MONGO_TLS,,}" = "true" ]]; then
|
if [[ "${MONGO_TLS,,}" = "true" ]]; then
|
||||||
sed -i "s/~MONGO_TLS~/true/" /defaults/system.properties
|
sed -i "s/~MONGO_TLS~/true/" /defaults/system.properties
|
||||||
else
|
else
|
||||||
|
@ -60,6 +66,11 @@ if [[ ! -e /config/data/system.properties ]]; then
|
||||||
else
|
else
|
||||||
sed -i "s/~MONGO_AUTHSOURCE~/\&authSource=${MONGO_AUTHSOURCE}/" /defaults/system.properties
|
sed -i "s/~MONGO_AUTHSOURCE~/\&authSource=${MONGO_AUTHSOURCE}/" /defaults/system.properties
|
||||||
fi
|
fi
|
||||||
|
if [[ -z "${MONGO_AUTHMECHANISM}" ]]; then
|
||||||
|
sed -i "s/~MONGO_AUTHMECHANISM~//" /defaults/system.properties
|
||||||
|
else
|
||||||
|
sed -i "s/~MONGO_AUTHMECHANISM~/\&authMechanism=${MONGO_AUTHMECHANISM}/" /defaults/system.properties
|
||||||
|
fi
|
||||||
cp /defaults/system.properties /config/data
|
cp /defaults/system.properties /config/data
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue