File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
nixos/modules/services/web-apps Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 249249 package = mkPackageOption pkgs "keycloak" { } ;
250250
251251 initialAdminPassword = mkOption {
252- type = str ;
253- default = "changeme" ;
252+ type = nullOr str ;
253+ default = null ;
254254 description = ''
255- Initial password set for the `admin`
256- user. The password is not stored safely and should be changed
255+ Initial password set for the temporary `admin` user.
256+ The password is not stored safely and should be changed
257257 immediately in the admin panel.
258+
259+ See [Admin bootstrap and recovery](https://www.keycloak.org/server/bootstrap-admin-recovery) for details.
258260 '' ;
259261 } ;
260262
620622 environment = {
621623 KC_HOME_DIR = "/run/keycloak" ;
622624 KC_CONF_DIR = "/run/keycloak/conf" ;
625+ } // lib . optionalAttrs ( cfg . initialAdminPassword != null ) {
626+ KC_BOOTSTRAP_ADMIN_USERNAME = "admin" ;
627+ KC_BOOTSTRAP_ADMIN_PASSWORD = cfg . initialAdminPassword ;
623628 } ;
624629 serviceConfig = {
625630 LoadCredential =
660665 mkdir -p /run/keycloak/ssl
661666 cp $CREDENTIALS_DIRECTORY/ssl_{cert,key} /run/keycloak/ssl/
662667 '' + ''
663- export KC_BOOTSTRAP_ADMIN_USERNAME=admin
664- export KC_BOOTSTRAP_ADMIN_PASSWORD=${ escapeShellArg cfg . initialAdminPassword }
665668 kc.sh --verbose start --optimized
666669 '' ;
667670 } ;
You can’t perform that action at this time.
0 commit comments