1
0
Fork 0

set keycloak initial admin user through env var

This commit is contained in:
ibizaman 2022-10-14 22:06:37 -07:00
parent e862324afa
commit 5b7e7cd6a8
2 changed files with 6 additions and 1 deletions

View file

@ -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;
};

View file

@ -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"