Skip to content

Commit

Permalink
Merge pull request #2 from linuxserver/init-order
Browse files Browse the repository at this point in the history
Sed password last to avoid issues with special characters
  • Loading branch information
drizuid authored Sep 7, 2023
2 parents 42b093a + e4cdf59 commit fe3ded9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe3ded9

Please sign in to comment.