Create the first superadmin from DOCWELL_ADMIN_EMAIL on start

When DOCWELL_ADMIN_EMAIL and DOCWELL_ADMIN_PASSWORD are set (and
optionally DOCWELL_ADMIN_NAME), docwell-server creates that account as
superadmin on start while the instance has no accounts. Once any account
exists it changes nothing, so restarts never reset the password or a role
changed in the admin panel. Without them, the first sign-up still wins.

Pass the variables through every compose file, document them in the
.env examples and the configuration, access and quick-start guides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-11-13 22:32:29 +01:00
1 parent b9be8be156
commit 3c7403ddf9
27 files changed
+239 -3

No files matched your search

+7
View File
@@ -26,6 +26,13 @@ DOCWELL_SIGNUP_ENABLED=true
# Comma-separated email domains allowed to sign up (empty = any).
DOCWELL_SIGNUP_DOMAINS=
# Optional: the first account, created as superadmin on start while the
# instance has no accounts. Later starts leave it alone (change it in the
# admin panel). Password: 8 characters or more. Blank = first sign-up wins.
DOCWELL_ADMIN_EMAIL=
DOCWELL_ADMIN_PASSWORD=
DOCWELL_ADMIN_NAME=
# Email (verification, password reset, sign-in codes), sent by PocketBase.
# Empty host = email off. For local testing run `docker compose --profile dev up`
# with DOCWELL_SMTP_HOST=mailpit and DOCWELL_SMTP_PORT=1025, then open
+7
View File
@@ -52,6 +52,13 @@ DOCWELL_SIGNUP_ENABLED=true
# Comma-separated email domains allowed to sign up (blank = any).
DOCWELL_SIGNUP_DOMAINS=
# Optional: the first account, created as superadmin on start while the
# instance has no accounts. Later starts leave it alone (change it in the
# admin panel). Password: 8 characters or more. Blank = first sign-up wins.
DOCWELL_ADMIN_EMAIL=
DOCWELL_ADMIN_PASSWORD=
DOCWELL_ADMIN_NAME=
# Largest attachment in MB (1-100).
DOCWELL_MAX_UPLOAD_MB=50
# Days to keep audit log entries. Blank = 365, 0 = forever.
+7
View File
@@ -52,6 +52,13 @@ DOCWELL_SIGNUP_ENABLED=true
# Comma-separated email domains allowed to sign up (blank = any).
DOCWELL_SIGNUP_DOMAINS=
# Optional: the first account, created as superadmin on start while the
# instance has no accounts. Later starts leave it alone (change it in the
# admin panel). Password: 8 characters or more. Blank = first sign-up wins.
DOCWELL_ADMIN_EMAIL=
DOCWELL_ADMIN_PASSWORD=
DOCWELL_ADMIN_NAME=
# Largest attachment in MB (1-100).
DOCWELL_MAX_UPLOAD_MB=50
# Days to keep audit log entries. Blank = 365, 0 = forever.
+7
View File
@@ -52,6 +52,13 @@ DOCWELL_SIGNUP_ENABLED=true
# Comma-separated email domains allowed to sign up (blank = any).
DOCWELL_SIGNUP_DOMAINS=
# Optional: the first account, created as superadmin on start while the
# instance has no accounts. Later starts leave it alone (change it in the
# admin panel). Password: 8 characters or more. Blank = first sign-up wins.
DOCWELL_ADMIN_EMAIL=
DOCWELL_ADMIN_PASSWORD=
DOCWELL_ADMIN_NAME=
# Largest attachment in MB (1-100).
DOCWELL_MAX_UPLOAD_MB=50
# Days to keep audit log entries. Blank = 365, 0 = forever.
+7
View File
@@ -52,6 +52,13 @@ DOCWELL_SIGNUP_ENABLED=true
# Comma-separated email domains allowed to sign up (blank = any).
DOCWELL_SIGNUP_DOMAINS=
# Optional: the first account, created as superadmin on start while the
# instance has no accounts. Later starts leave it alone (change it in the
# admin panel). Password: 8 characters or more. Blank = first sign-up wins.
DOCWELL_ADMIN_EMAIL=
DOCWELL_ADMIN_PASSWORD=
DOCWELL_ADMIN_NAME=
# Largest attachment in MB (1-100).
DOCWELL_MAX_UPLOAD_MB=50
# Days to keep audit log entries. Blank = 365, 0 = forever.
+4
View File
@@ -95,6 +95,10 @@ services:
DOCWELL_CORS_ORIGINS: "${DOCWELL_CORS_ORIGINS:-${DOCWELL_WEB_URL:-http://localhost:3000}}"
# Defaults until a superadmin saves sign-up rules in the admin panel.
DOCWELL_SIGNUP_ENABLED: "${DOCWELL_SIGNUP_ENABLED:-true}"
# Optional: creates the first account as superadmin while there are no accounts.
DOCWELL_ADMIN_EMAIL: "${DOCWELL_ADMIN_EMAIL:-}"
DOCWELL_ADMIN_PASSWORD: "${DOCWELL_ADMIN_PASSWORD:-}"
DOCWELL_ADMIN_NAME: "${DOCWELL_ADMIN_NAME:-}"
DOCWELL_SIGNUP_DOMAINS: "${DOCWELL_SIGNUP_DOMAINS:-}"
DOCWELL_MAX_UPLOAD_MB: "${DOCWELL_MAX_UPLOAD_MB:-50}"
DOCWELL_AUDIT_RETENTION_DAYS: "${DOCWELL_AUDIT_RETENTION_DAYS:-}"
@@ -263,6 +263,10 @@ services:
DOCWELL_CORS_ORIGINS: "${DOCWELL_CORS_ORIGINS:-${DOCWELL_WEB_URL:-http://localhost:3000}}"
# Defaults until a superadmin saves sign-up rules in the admin panel.
DOCWELL_SIGNUP_ENABLED: "${DOCWELL_SIGNUP_ENABLED:-true}"
# Optional: creates the first account as superadmin while there are no accounts.
DOCWELL_ADMIN_EMAIL: "${DOCWELL_ADMIN_EMAIL:-}"
DOCWELL_ADMIN_PASSWORD: "${DOCWELL_ADMIN_PASSWORD:-}"
DOCWELL_ADMIN_NAME: "${DOCWELL_ADMIN_NAME:-}"
DOCWELL_SIGNUP_DOMAINS: "${DOCWELL_SIGNUP_DOMAINS:-}"
DOCWELL_MAX_UPLOAD_MB: "${DOCWELL_MAX_UPLOAD_MB:-50}"
DOCWELL_AUDIT_RETENTION_DAYS: "${DOCWELL_AUDIT_RETENTION_DAYS:-}"
+4
View File
@@ -139,6 +139,10 @@ services:
DOCWELL_CORS_ORIGINS: "${DOCWELL_CORS_ORIGINS:-${DOCWELL_WEB_URL:-http://localhost:3000}}"
# Defaults until a superadmin saves sign-up rules in the admin panel.
DOCWELL_SIGNUP_ENABLED: "${DOCWELL_SIGNUP_ENABLED:-true}"
# Optional: creates the first account as superadmin while there are no accounts.
DOCWELL_ADMIN_EMAIL: "${DOCWELL_ADMIN_EMAIL:-}"
DOCWELL_ADMIN_PASSWORD: "${DOCWELL_ADMIN_PASSWORD:-}"
DOCWELL_ADMIN_NAME: "${DOCWELL_ADMIN_NAME:-}"
DOCWELL_SIGNUP_DOMAINS: "${DOCWELL_SIGNUP_DOMAINS:-}"
DOCWELL_MAX_UPLOAD_MB: "${DOCWELL_MAX_UPLOAD_MB:-50}"
DOCWELL_AUDIT_RETENTION_DAYS: "${DOCWELL_AUDIT_RETENTION_DAYS:-}"
+4
View File
@@ -82,6 +82,10 @@ services:
DOCWELL_CORS_ORIGINS: "${DOCWELL_CORS_ORIGINS:-${DOCWELL_WEB_URL:-http://localhost:3000}}"
# Defaults until a superadmin saves sign-up rules in the admin panel.
DOCWELL_SIGNUP_ENABLED: "${DOCWELL_SIGNUP_ENABLED:-true}"
# Optional: creates the first account as superadmin while there are no accounts.
DOCWELL_ADMIN_EMAIL: "${DOCWELL_ADMIN_EMAIL:-}"
DOCWELL_ADMIN_PASSWORD: "${DOCWELL_ADMIN_PASSWORD:-}"
DOCWELL_ADMIN_NAME: "${DOCWELL_ADMIN_NAME:-}"
DOCWELL_SIGNUP_DOMAINS: "${DOCWELL_SIGNUP_DOMAINS:-}"
DOCWELL_MAX_UPLOAD_MB: "${DOCWELL_MAX_UPLOAD_MB:-50}"
DOCWELL_AUDIT_RETENTION_DAYS: "${DOCWELL_AUDIT_RETENTION_DAYS:-}"
+4
View File
@@ -40,6 +40,10 @@ services:
DOCWELL_CORS_ORIGINS: ${DOCWELL_WEB_URL:-http://localhost:3000}
# Defaults until a superadmin saves signup rules in the admin panel.
DOCWELL_SIGNUP_ENABLED: ${DOCWELL_SIGNUP_ENABLED:-true}
# Optional: creates the first account as superadmin while there are no accounts.
DOCWELL_ADMIN_EMAIL: ${DOCWELL_ADMIN_EMAIL:-}
DOCWELL_ADMIN_PASSWORD: ${DOCWELL_ADMIN_PASSWORD:-}
DOCWELL_ADMIN_NAME: ${DOCWELL_ADMIN_NAME:-}
DOCWELL_SIGNUP_DOMAINS: ${DOCWELL_SIGNUP_DOMAINS:-}
DOCWELL_MAX_UPLOAD_MB: ${DOCWELL_MAX_UPLOAD_MB:-50}
# Written into PocketBase on every start. PocketBase sends the auth