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
keycloak
|
@ -7,6 +7,7 @@
|
||||||
, group
|
, group
|
||||||
, dbPasswordFile
|
, dbPasswordFile
|
||||||
, postgresServiceName
|
, postgresServiceName
|
||||||
|
, initialAdminUsername ? "admin"
|
||||||
, initialAdminFile ? null
|
, initialAdminFile ? null
|
||||||
|
|
||||||
, dependsOn ? {}
|
, dependsOn ? {}
|
||||||
|
@ -14,10 +15,12 @@
|
||||||
{
|
{
|
||||||
inherit name configDir configFile;
|
inherit name configDir configFile;
|
||||||
|
|
||||||
|
inherit initialAdminUsername;
|
||||||
|
|
||||||
pkg = KeycloakService {
|
pkg = KeycloakService {
|
||||||
inherit configDir configFile;
|
inherit configDir configFile;
|
||||||
inherit user group;
|
inherit user group;
|
||||||
inherit dbPasswordFile initialAdminFile;
|
inherit dbPasswordFile initialAdminUsername initialAdminFile;
|
||||||
inherit postgresServiceName;
|
inherit postgresServiceName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
, dbType ? "postgres"
|
, dbType ? "postgres"
|
||||||
, dbPasswordFile
|
, dbPasswordFile
|
||||||
, postgresServiceName
|
, postgresServiceName
|
||||||
|
, initialAdminUsername ? null
|
||||||
, initialAdminFile ? null
|
, initialAdminFile ? null
|
||||||
}:
|
}:
|
||||||
{ ... }:
|
{ ... }:
|
||||||
|
@ -39,6 +40,7 @@ utils.systemd.mkService rec {
|
||||||
Group=${group}
|
Group=${group}
|
||||||
|
|
||||||
EnvironmentFile=${dbPasswordFile}
|
EnvironmentFile=${dbPasswordFile}
|
||||||
|
${if initialAdminFile != null then "Environment=KEYCLOAK_ADMIN="+initialAdminUsername else ""}
|
||||||
${if initialAdminFile != null then "EnvironmentFile="+initialAdminFile else ""}
|
${if initialAdminFile != null then "EnvironmentFile="+initialAdminFile else ""}
|
||||||
Environment=PATH=${pkgs.coreutils}/bin
|
Environment=PATH=${pkgs.coreutils}/bin
|
||||||
Environment=KC_HOME_DIR="/run/keycloak"
|
Environment=KC_HOME_DIR="/run/keycloak"
|
||||||
|
|
Loading…
Add table
Reference in a new issue