set keycloak initial admin user through env var
This commit is contained in:
parent
e862324afa
commit
5b7e7cd6a8
2 changed files with 6 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
, group
|
||||
, dbPasswordFile
|
||||
, postgresServiceName
|
||||
, initialAdminUsername ? "admin"
|
||||
, initialAdminFile ? null
|
||||
|
||||
, dependsOn ? {}
|
||||
|
@ -14,10 +15,12 @@
|
|||
{
|
||||
inherit name configDir configFile;
|
||||
|
||||
inherit initialAdminUsername;
|
||||
|
||||
pkg = KeycloakService {
|
||||
inherit configDir configFile;
|
||||
inherit user group;
|
||||
inherit dbPasswordFile initialAdminFile;
|
||||
inherit dbPasswordFile initialAdminUsername initialAdminFile;
|
||||
inherit postgresServiceName;
|
||||
};
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
, dbType ? "postgres"
|
||||
, dbPasswordFile
|
||||
, postgresServiceName
|
||||
, initialAdminUsername ? null
|
||||
, initialAdminFile ? null
|
||||
}:
|
||||
{ ... }:
|
||||
|
@ -39,6 +40,7 @@ utils.systemd.mkService rec {
|
|||
Group=${group}
|
||||
|
||||
EnvironmentFile=${dbPasswordFile}
|
||||
${if initialAdminFile != null then "Environment=KEYCLOAK_ADMIN="+initialAdminUsername else ""}
|
||||
${if initialAdminFile != null then "EnvironmentFile="+initialAdminFile else ""}
|
||||
Environment=PATH=${pkgs.coreutils}/bin
|
||||
Environment=KC_HOME_DIR="/run/keycloak"
|
||||
|
|
Loading…
Reference in a new issue