Skip to content

Commit 1a53803

Browse files
committed
Add new environment variables to README.md
1 parent 41b3671 commit 1a53803

File tree

2 files changed

+14
-25
lines changed

2 files changed

+14
-25
lines changed

README.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,11 @@ services:
145145
- PUID=1000
146146
- PGID=1000
147147
- TZ=Etc/UTC
148-
- MONGO_USER=unifi
149-
- MONGO_PASS=
150-
- MONGO_HOST=unifi-db
151-
- MONGO_PORT=27017
148+
- MONGO_URI=mongodb+srv://unifi:[email protected]/unifi?retryWrites=true&w=majority&appName=unifi
149+
- STAT_MONGO_URI=mongodb+srv://unifi:[email protected]/unifi_stats?retryWrites=true&w=majority&appName=unifi
152150
- MONGO_DBNAME=unifi
153151
- MEM_LIMIT=1024 #optional
154152
- MEM_STARTUP=1024 #optional
155-
- MONGO_TLS= #optional
156-
- MONGO_AUTHSOURCE= #optional
157153
volumes:
158154
- /path/to/unifi-network-application/data:/config
159155
ports:
@@ -177,15 +173,11 @@ docker run -d \
177173
-e PUID=1000 \
178174
-e PGID=1000 \
179175
-e TZ=Etc/UTC \
180-
-e MONGO_USER=unifi \
181-
-e MONGO_PASS= \
182-
-e MONGO_HOST=unifi-db \
183-
-e MONGO_PORT=27017 \
176+
-e MONGO_URI=mongodb+srv://unifi:[email protected]/?retryWrites=true&w=majority&appName=unifi \
177+
-e STAT_MONGO_URI=mongodb+srv://unifi:[email protected]/?retryWrites=true&w=majority&appName=unifi \
184178
-e MONGO_DBNAME=unifi \
185179
-e MEM_LIMIT=1024 `#optional` \
186180
-e MEM_STARTUP=1024 `#optional` \
187-
-e MONGO_TLS= `#optional` \
188-
-e MONGO_AUTHSOURCE= `#optional` \
189181
-p 8443:8443 \
190182
-p 3478:3478/udp \
191183
-p 10001:10001/udp \

readme-vars.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,15 @@ param_ports:
3030

3131
param_usage_include_env: true
3232
param_env_vars:
33-
- { 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)**." }
34-
- { 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)**." }
35-
- { env_var: "MONGO_HOST", env_value: "unifi-db", desc: "Mongodb Hostname. Only evaluated on first run." }
36-
- { env_var: "MONGO_PORT", env_value: "27017", desc: "Mongodb Port. Only evaluated on first run." }
37-
- { env_var: "MONGO_DBNAME", env_value: "unifi", desc: "Mongodb Database Name (stats DB is automatically suffixed with `_stat`). Only evaluated on first run." }
33+
- { env_var: "MONGO_URI", env_value: "unifi", desc: "MongoDB URI. Only evaluated on first run." }
34+
- { env_var: "STAT_MONGO_URI", env_value: "", desc: "MongoDB stat URI. Only evaluated on first run." }
35+
- { env_var: "MONGO_DBNAME", env_value: "unifi", desc: "MongoDB Database Name (stats DB is automatically suffixed with `_stat`). Only evaluated on first run." }
3836

3937
# optional container parameters
4038
opt_param_usage_include_env: true
4139
opt_param_env_vars:
4240
- { env_var: "MEM_LIMIT", env_value: "1024", desc: "Optionally change the Java memory limit (in Megabytes). Set to `default` to reset to default" }
4341
- { env_var: "MEM_STARTUP", env_value: "1024", desc: "Optionally change the Java initial/minimum memory (in Megabytes). Set to `default` to reset to default" }
44-
- { 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." }
45-
- { env_var: "MONGO_AUTHSOURCE", env_value: "", desc: "Mongodb [authSource](https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-urioption-urioption.authSource). For Atlas set to `admin`.Defaults to `MONGO_DBNAME`.Only evaluated on first run." }
4642

4743
opt_param_usage_include_ports: true
4844
opt_param_ports:
@@ -57,15 +53,15 @@ app_setup_block_enabled: true
5753
app_setup_block: |
5854
After setup, the web UI is available at https://ip:8443. The application can be configured, or a backup restored, using the first run wizard.
5955
60-
**This container requires an external mongodb database instance.**
56+
**This container requires an external MongoDB database instance.**
6157
6258
### Setting Up Your External Database
6359
64-
Starting with version 8.1 of Unifi Network Application, mongodb 3.6 through 7.0 are supported.
60+
Starting with version 8.1 of Unifi Network Application, MongoDB 3.6 through 7.0 are supported.
6561
66-
**Make sure you pin your database image version and do not use `latest`, as mongodb does not support automatic upgrades between major versions.**
62+
**Make sure you pin your database image version and do not use `latest`, as MongoDB does not support automatic upgrades between major versions.**
6763
68-
If you are using the [official mongodb container](https://hub.docker.com/_/mongo/), you can create your user using an `init-mongo.js` file with the following contents:
64+
If you are using the [official MongoDB container](https://hub.docker.com/_/mongo/), you can create your user using an `init-mongo.js` file with the following contents:
6965
7066
```js
7167
db.getSiblingDB("MONGO_DBNAME").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME"}]});
@@ -86,7 +82,7 @@ app_setup_block: |
8682
restart: unless-stopped
8783
```
8884
89-
*Note that the init script method will only work on first run. If you start the mongodb container without an init script it will generate test data automatically and you will have to manually create your databases, or restart with a clean `/data/db` volume and an init script mounted.*
85+
*Note that the init script method will only work on first run. If you start the MongoDB container without an init script it will generate test data automatically and you will have to manually create your databases, or restart with a clean `/data/db` volume and an init script mounted.*
9086
9187
*If you are using the init script method do not also set `MONGO_INITDB_ROOT_USERNAME`, `MONGO_INITDB_ROOT_PASSWORD`, or any other "INITDB" values as they will cause conflicts.*
9288
@@ -123,6 +119,7 @@ app_setup_block: |
123119
124120
# changelog
125121
changelogs:
126-
- { date: "04.03.24:", desc: "Install from zip package instead of deb." }
122+
- { date: "20.03.24:", desc: "Change environment variables" }
123+
- { date: "04.02.24:", desc: "Install from zip package instead of deb." }
127124
- { date: "17.10.23:", desc: "Add environment variables for TLS and authSource to support Atlas and new MongoDB versions." }
128125
- { date: "05.09.23:", desc: "Initial release." }

0 commit comments

Comments
 (0)