Skip to content

Commit

Permalink
Allow to set the admin email
Browse files Browse the repository at this point in the history
  • Loading branch information
abbradar committed Sep 28, 2024
1 parent 966386b commit 1391bfb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ services:
KEYCLOAK_ADMIN_PASSWORD: "${KEYCLOAK_ADMIN_PASSWORD}"

EXTERNAL_ORIGIN: "${EXTERNAL_ORIGIN:-http://localhost:9080}"
ADMIN_EMAIL: "${ADMIN_EMAIL:[email protected]}"
volumes:
- ./docker/keycloak-realm.json:/etc/keycloak/realm.json:ro
- ./docker/keycloak-entrypoint.sh:/usr/local/bin/entrypoint.sh
Expand Down
1 change: 1 addition & 0 deletions docker/keycloak-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e
mkdir -p /opt/keycloak/data/import
sed /etc/keycloak/realm.json \
-e 's,{EXTERNAL_ORIGIN},'"$EXTERNAL_ORIGIN"',g' \
-e 's,{ADMIN_EMAIL},'"$ADMIN_EMAIL"',g' \
> /opt/keycloak/data/import/realm.json

exec /opt/keycloak/bin/kc.sh "$@"
4 changes: 2 additions & 2 deletions docker/keycloak-realm.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
"users": [
{
"id": "admin",
"username": "[email protected]",
"email": "[email protected]",
"username": "{ADMIN_EMAIL}",
"email": "{ADMIN_EMAIL}",
"emailVerified": true,
"enabled": true,
"credentials": [
Expand Down
1 change: 1 addition & 0 deletions env.production
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[email protected]
# Set this to a secret password
KEYCLOAK_ADMIN_PASSWORD=
# For production:
Expand Down

0 comments on commit 1391bfb

Please sign in to comment.