Skip to content

Commit aa97996

Browse files
Update README.md
1 parent 3956f33 commit aa97996

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Mailauth
22

3-
Mailauth is a Mailbox Manager which enables you too select between your Mailboxes and authenticate with your Mailserver, like [mailcow](https://github.com/mailcow/mailcow-dockerized)
3+
Mailauth is a Mailbox Manager which enables you too select between your Mailboxes and authenticate with your Mailserver (like [mailcow](https://github.com/mailcow/mailcow-dockerized))
44

55
## Showcase
66

@@ -131,13 +131,17 @@ And set Redirect URI to the one from your `.env` file.
131131
Next create `init-mongo.js` in your working directory:
132132

133133
```js
134-
// This is only for initializing the db and creating the mailauth user
134+
const PASSWORD = process.env.MONGO_PW
135+
const USER = process.env.MONGO_USER
136+
const DB = process.env.MONGO_INITDB_DATABASE
135137
136-
db = db.getSiblingDB("mailauth")
138+
db = db.getSiblingDB(DB) // Switch to your target database
137139
db.createUser({
138-
user: "mailauth",
139-
pwd: "SECURE_PW", // This should match the one in your env
140-
roles: [{ role: "readWrite", db: "mailauth" }],
140+
user: USER,
141+
pwd: PASSWORD,
142+
roles: [
143+
{ role: "readWrite", db: DB }, // Give read/write access to 'mailauth'
144+
],
141145
})
142146
```
143147

0 commit comments

Comments
 (0)