-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from ideafast/mongo
Added MongoDB to middleware
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## MongoDB Authentication | ||
|
||
Authentication is disabled in mongodb by default, and will need to be setup to access the db remotely. To do that: | ||
|
||
1. Remove `command: [--auth]` from the `docker-compose.yml`. | ||
2. Run `docker compose up -d` to see the changes. | ||
3. Enter the docker container: `docker exec -it mongo bash` | ||
4. Run `mongo` from the command line and create two users as follows: | ||
|
||
```bash | ||
use admin | ||
db.createUser( | ||
{ | ||
user: "ADMIN_USER", | ||
pwd: "ROOT_PASSWORD", | ||
roles:["root"] | ||
} | ||
); | ||
|
||
use dtransfer | ||
db.createUser( | ||
{ | ||
user: "DT_USER", | ||
pwd: "DT_PASSWORD", | ||
roles:[ | ||
{ | ||
role: "readWrite", | ||
db: "dtransfer" | ||
} | ||
] | ||
} | ||
); | ||
``` | ||
|
||
**Note**: change `user` and `pwd` with desired secrets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters