mirror of
https://github.com/linuxserver/docker-unifi-network-application.git
synced 2024-11-09 23:24:08 -08:00
Merge pull request #2 from linuxserver/init-order
Sed password last to avoid issues with special characters
This commit is contained in:
commit
fe3ded98af
|
@ -61,6 +61,8 @@ app_setup_block: |
|
|||
|
||||
Formally only mongodb 3.6 through 4.4 are supported, however, it has been reported that newer versions will work. If you choose to use a newer version be aware that you will not be operating a supported configuration.
|
||||
|
||||
**Make sure you pin your database image version and do not use `latest`, as mongodb does not support automatic upgrades between major versions.**
|
||||
|
||||
If you are using the [official mongodb container](https://hub.docker.com/_/mongo/), you can create your databases using an `init-mongo.js` file with the following contents:
|
||||
|
||||
```js
|
||||
|
|
|
@ -25,10 +25,10 @@ if [[ ! -e /config/data/system.properties ]]; then
|
|||
exit 1
|
||||
else
|
||||
sed -i "s/~MONGO_USER~/${MONGO_USER}/" /defaults/system.properties
|
||||
sed -i "s/~MONGO_PASS~/${MONGO_PASS}/" /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
|
||||
cp /defaults/system.properties /config/data
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue