You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-28Lines changed: 22 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,21 +70,20 @@ Starting with version 8.1 of Unifi Network Application, mongodb 3.6 through 7.0
70
70
71
71
**MongoDB >4.4 on X86_64 Hardware needs a CPU with AVX support. Some lower end Intel CPU models like Celeron and Pentium (before Tiger-Lake) more Details: [Advanced Vector Extensions - Wikipedia](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX) don't support AVX, but you can still use MongoDB 4.4.**
72
72
73
-
If you are using the [official mongodb container](https://hub.docker.com/_/mongo/) in Version >=6, you can create your user using an `init-mongo.js` file with the following contents:
73
+
If you are using the [official mongodb container](https://hub.docker.com/_/mongo/), you can create your user using an `init-mongo.sh` file with the following contents (do not modify; copy/paste as is):
*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.*
125
120
126
-
*If you are using the init JS method do not also set `MONGO_INITDB_ROOT_USERNAME`, `MONGO_INITDB_ROOT_PASSWORD`, or any other "INITDB" values as they will cause conflicts. Setting these variables for the .sh file is necessary*
127
-
128
121
You can also run the commands directly against the database using either `mongo` (< 6.0) or `mongosh` (>= 6.0).
129
122
130
123
### Device Adoption
@@ -182,10 +175,10 @@ services:
182
175
- MONGO_HOST=unifi-db
183
176
- MONGO_PORT=27017
184
177
- MONGO_DBNAME=unifi
178
+
- MONGO_AUTHSOURCE=admin
185
179
- MEM_LIMIT=1024 #optional
186
180
- MEM_STARTUP=1024 #optional
187
181
- MONGO_TLS= #optional
188
-
- MONGO_AUTHSOURCE= #optional
189
182
volumes:
190
183
- /path/to/unifi-network-application/data:/config
191
184
ports:
@@ -214,10 +207,10 @@ docker run -d \
214
207
-e MONGO_HOST=unifi-db \
215
208
-e MONGO_PORT=27017 \
216
209
-e MONGO_DBNAME=unifi \
210
+
-e MONGO_AUTHSOURCE=admin \
217
211
-e MEM_LIMIT=1024 `#optional` \
218
212
-e MEM_STARTUP=1024 `#optional` \
219
213
-e MONGO_TLS= `#optional` \
220
-
-e MONGO_AUTHSOURCE= `#optional` \
221
214
-p 8443:8443 \
222
215
-p 3478:3478/udp \
223
216
-p 10001:10001/udp \
@@ -255,10 +248,10 @@ Containers are configured using parameters passed at runtime (such as those abov
255
248
|`-e MONGO_HOST=unifi-db`| Mongodb Hostname. Only evaluated on first run. |
256
249
|`-e MONGO_PORT=27017`| Mongodb Port. Only evaluated on first run. |
257
250
|`-e MONGO_DBNAME=unifi`| Mongodb Database Name (stats DB is automatically suffixed with `_stat`). Only evaluated on first run. |
251
+
|`-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. |
258
252
|`-e MEM_LIMIT=1024`| Optionally change the Java memory limit (in Megabytes). Set to `default` to reset to default |
259
253
|`-e MEM_STARTUP=1024`| Optionally change the Java initial/minimum memory (in Megabytes). Set to `default` to reset to default |
260
254
|`-e MONGO_TLS=`| Mongodb enable [TLS](https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-urioption-urioption.tls). Only evaluated on first run. |
261
-
|`-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. |
262
255
|`-v /config`| Persistent config files |
263
256
264
257
## Environment variables from files (Docker secrets)
@@ -422,7 +415,8 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
422
415
423
416
## Versions
424
417
425
-
***18.07.24:** - Rebase to Ubuntu Noble.
418
+
***11.08.24:** - **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.
419
+
***11.08.24:** - Rebase to Ubuntu Noble.
426
420
***04.03.24:** - Install from zip package instead of deb.
427
421
***17.10.23:** - Add environment variables for TLS and authSource to support Atlas and new MongoDB versions.
Copy file name to clipboardExpand all lines: readme-vars.yml
+20-26Lines changed: 20 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -32,14 +32,14 @@ param_env_vars:
32
32
- { env_var: "MONGO_HOST", env_value: "unifi-db", desc: "Mongodb Hostname. Only evaluated on first run." }
33
33
- { env_var: "MONGO_PORT", env_value: "27017", desc: "Mongodb Port. Only evaluated on first run." }
34
34
- { env_var: "MONGO_DBNAME", env_value: "unifi", desc: "Mongodb Database Name (stats DB is automatically suffixed with `_stat`). Only evaluated on first run." }
35
+
- { 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." }
35
36
36
37
# optional container parameters
37
38
opt_param_usage_include_env: true
38
39
opt_param_env_vars:
39
40
- { env_var: "MEM_LIMIT", env_value: "1024", desc: "Optionally change the Java memory limit (in Megabytes). Set to `default` to reset to default" }
40
41
- { env_var: "MEM_STARTUP", env_value: "1024", desc: "Optionally change the Java initial/minimum memory (in Megabytes). Set to `default` to reset to default" }
41
42
- { 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." }
42
-
- { 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." }
43
43
44
44
opt_param_usage_include_ports: true
45
45
opt_param_ports:
@@ -64,21 +64,20 @@ app_setup_block: |
64
64
65
65
**MongoDB >4.4 on X86_64 Hardware needs a CPU with AVX support. Some lower end Intel CPU models like Celeron and Pentium (before Tiger-Lake) more Details: [Advanced Vector Extensions - Wikipedia](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX) don't support AVX, but you can still use MongoDB 4.4.**
66
66
67
-
If you are using the [official mongodb container](https://hub.docker.com/_/mongo/) in Version >=6, you can create your user using an `init-mongo.js` file with the following contents:
67
+
If you are using the [official mongodb container](https://hub.docker.com/_/mongo/), you can create your user using an `init-mongo.sh` file with the following contents (do not modify; copy/paste as is):
*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.*
119
114
120
-
*If you are using the init JS method do not also set `MONGO_INITDB_ROOT_USERNAME`, `MONGO_INITDB_ROOT_PASSWORD`, or any other "INITDB" values as they will cause conflicts. Setting these variables for the .sh file is necessary*
121
-
122
115
You can also run the commands directly against the database using either `mongo` (< 6.0) or `mongosh` (>= 6.0).
123
116
124
117
### Device Adoption
@@ -152,7 +145,8 @@ app_setup_block: |
152
145
153
146
# changelog
154
147
changelogs:
155
-
- { date: "18.07.24:", desc: "Rebase to Ubuntu Noble." }
148
+
- { 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." }
149
+
- { date: "11.08.24:", desc: "Rebase to Ubuntu Noble." }
156
150
- { date: "04.03.24:", desc: "Install from zip package instead of deb." }
157
151
- { date: "17.10.23:", desc: "Add environment variables for TLS and authSource to support Atlas and new MongoDB versions." }
0 commit comments