Skip to content

Commit 5a0ea67

Browse files
committed
Updated documentation
1 parent 2289151 commit 5a0ea67

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,12 @@ services:
147147
- TZ=Etc/UTC
148148
- MONGO_USER=unifi
149149
- MONGO_PASS=
150-
- MONGO_HOST=unifi-db
151-
- MONGO_PORT=27017
150+
- MONGO_HOST=unifi-db[,unifi-db2[,unifi-db3]]
151+
- MONGO_PORT=27017[,27017[,27017]]
152152
- MONGO_DBNAME=unifi
153153
- MEM_LIMIT=1024 #optional
154154
- MEM_STARTUP=1024 #optional
155+
- MONGO_REPLICASET= #optional
155156
- MONGO_TLS= #optional
156157
- MONGO_AUTHSOURCE= #optional
157158
volumes:
@@ -179,11 +180,12 @@ docker run -d \
179180
-e TZ=Etc/UTC \
180181
-e MONGO_USER=unifi \
181182
-e MONGO_PASS= \
182-
-e MONGO_HOST=unifi-db \
183-
-e MONGO_PORT=27017 \
183+
-e MONGO_HOST=unifi-db[,unifi-db2[,unifi-db3]] \
184+
-e MONGO_PORT=27017[,27017[,27017]] \
184185
-e MONGO_DBNAME=unifi \
185186
-e MEM_LIMIT=1024 `#optional` \
186187
-e MEM_STARTUP=1024 `#optional` \
188+
-e MONGO_REPLICASET= `#optional` \
187189
-e MONGO_TLS= `#optional` \
188190
-e MONGO_AUTHSOURCE= `#optional` \
189191
-p 8443:8443 \
@@ -220,11 +222,12 @@ Containers are configured using parameters passed at runtime (such as those abov
220222
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
221223
| `-e MONGO_USER=unifi` | Mongodb Username. Only evaluated on first run. **Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding)**. |
222224
| `-e MONGO_PASS=` | Mongodb Password. Only evaluated on first run. **Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding)**. |
223-
| `-e MONGO_HOST=unifi-db` | Mongodb Hostname. Only evaluated on first run. |
224-
| `-e MONGO_PORT=27017` | Mongodb Port. Only evaluated on first run. |
225+
| `-e MONGO_HOST=unifi-db[,unifi-db2[,unifi-db3]]` | Mongodb Hostname (multiple hosts separated with comma allowed if MONGO_REPLICASET is set). Only evaluated on first run. |
226+
| `-e MONGO_PORT=27017[,27017[,27017]]` | Mongodb Port (multiple ports separated with comma allowed if MONGO_REPLICASET is set). Only evaluated on first run. |
225227
| `-e MONGO_DBNAME=unifi` | Mongodb Database Name (stats DB is automatically suffixed with `_stat`). Only evaluated on first run. |
226228
| `-e MEM_LIMIT=1024` | Optionally change the Java memory limit (in Megabytes). Set to `default` to reset to default |
227229
| `-e MEM_STARTUP=1024` | Optionally change the Java initial/minimum memory (in Megabytes). Set to `default` to reset to default |
230+
| `-e MONGO_REPLICASET=` | Name of Mongodb (existing) [replicaset](https://www.mongodb.com/docs/manual/reference/connection-string/#replica-set-option). Only evaluated on first run. |
228231
| `-e MONGO_TLS=` | Mongodb enable [TLS](https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-urioption-urioption.tls). Only evaluated on first run. |
229232
| `-e MONGO_AUTHSOURCE=` | 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. |
230233
| `-v /config` | All Unifi data stored here |
@@ -391,5 +394,6 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
391394
## Versions
392395

393396
* **04.03.24:** - Install from zip package instead of deb.
397+
* **17.02.24:** - Add environment variables for replicaSet.
394398
* **17.10.23:** - Add environment variables for TLS and authSource to support Atlas and new MongoDB versions.
395399
* **05.09.23:** - Initial release.

readme-vars.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ param_env_vars:
3333
- { 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)**." }
3434
- { 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)**." }
3535
- { env_var: "MONGO_HOST", env_value: "unifi-db[,unifi-db2[,unifi-db3]]", desc: "Mongodb Hostname (multiple hosts separated with comma allowed if MONGO_REPLICASET is set). Only evaluated on first run." }
36-
- { env_var: "MONGO_PORT", env_value: "27017[,unifi-db2 port[,unifi-db3 port]]", desc: "Mongodb Port (multiple ports separated with comma allowed if MONGO_REPLICASET is set). Only evaluated on first run." }
36+
- { env_var: "MONGO_PORT", env_value: "27017[,27017[,27017]]", desc: "Mongodb Port (multiple ports separated with comma allowed if MONGO_REPLICASET is set). Only evaluated on first run." }
3737
- { env_var: "MONGO_DBNAME", env_value: "unifi", desc: "Mongodb Database Name (stats DB is automatically suffixed with `_stat`). Only evaluated on first run." }
3838

3939
# optional container parameters
4040
opt_param_usage_include_env: true
4141
opt_param_env_vars:
4242
- { env_var: "MEM_LIMIT", env_value: "1024", desc: "Optionally change the Java memory limit (in Megabytes). Set to `default` to reset to default" }
4343
- { 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_REPLICASET", env_value: "", desc: "Name of Mongodb [replicaset](https://www.mongodb.com/docs/manual/reference/connection-string/#replica-set-option). Only evaluated on first run." }
44+
- { env_var: "MONGO_REPLICASET", env_value: "", desc: "Name of Mongodb (existing) [replicaset](https://www.mongodb.com/docs/manual/reference/connection-string/#replica-set-option). Only evaluated on first run." }
4545
- { 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." }
4646
- { 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." }
4747

0 commit comments

Comments
 (0)