chore: add v7 fallback

This commit is contained in:
LRVT
2026-02-22 17:58:55 +01:00
parent 5cc15d7d29
commit 11e70400c5
2 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#!/bin/bash
set -e
: "${MONGO_USER:?Missing MONGO_USER}"
: "${MONGO_PASS:?Missing MONGO_PASS}"
: "${MONGO_DBNAME:?Missing MONGO_DBNAME}"
mongo --quiet <<EOF
db.getSiblingDB("${MONGO_DBNAME}").createUser({
user: "${MONGO_USER}",
pwd: "${MONGO_PASS}",
roles: [{ role: "readWrite", db: "${MONGO_DBNAME}" }]
});
db.getSiblingDB("${MONGO_DBNAME}_stat").createUser({
user: "${MONGO_USER}",
pwd: "${MONGO_PASS}",
roles: [{ role: "readWrite", db: "${MONGO_DBNAME}_stat" }]
});
EOF