Skip to content

Pre-seeding Users

Drop a users.json file into your data directory before first start and Grimoire will create those accounts automatically. The file is renamed to users.json.imported afterwards and never processed again.

Format

json
[
  {
    "username": "admin",
    "password": "changeme",
    "role": "admin"
  },
  {
    "username": "gm",
    "password": "$bcrypt-sha256$v=2,t=2b,r=12$...",
    "role": "gm"
  },
  {
    "username": "alice",
    "password": "alicepassword",
    "role": "player",
    "denyExplicit": true
  }
]
FieldRequiredDescription
usernameYesLogin username
passwordYesPlaintext password or a pre-hashed $bcrypt-sha256$ string
roleNoadmin, gm, or player — defaults to player
denyExplicitNotrue to restrict explicit content — defaults to false

Rules

  • At least one entry must have "role": "admin" — the file is rejected otherwise.
  • Entries whose username already exists are silently skipped.
  • On parse or validation errors the file is left untouched so you can fix and restart.

Pre-hashing passwords

Pre-hashing avoids storing plaintext passwords in the JSON file. Grimoire uses passlib's bcrypt_sha256 scheme:

bash
python3 -c "from passlib.hash import bcrypt_sha256; print(bcrypt_sha256.hash('yourpassword'))"

Copy the output (starts with $bcrypt-sha256$) into the password field.

Docker example

bash
cp users.json /path/to/grimoire/data/users.json
docker compose up -d

Released under the GNU GPL v3.0 License.