From a910bc81467ed9032b5c35eb8525a239bbd5886a Mon Sep 17 00:00:00 2001 From: arcnmx Date: Fri, 10 May 2024 09:49:22 -0700 Subject: [PATCH] nixos/keycloak: relax hostname settings assertion The `hostname-strict` setting enables dynamic hostname resolution. --- nixos/modules/services/web-apps/keycloak.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/web-apps/keycloak.nix b/nixos/modules/services/web-apps/keycloak.nix index 36bae2575974..5d429675bafc 100644 --- a/nixos/modules/services/web-apps/keycloak.nix +++ b/nixos/modules/services/web-apps/keycloak.nix @@ -328,7 +328,7 @@ in }; hostname = mkOption { - type = str; + type = nullOr str; example = "keycloak.example.com"; description = '' The hostname part of the public URL used as base for @@ -477,6 +477,10 @@ in assertion = createLocalPostgreSQL -> config.services.postgresql.settings.standard_conforming_strings or true; message = "Setting up a local PostgreSQL db for Keycloak requires `standard_conforming_strings` turned on to work reliably"; } + { + assertion = cfg.settings.hostname != null || ! cfg.settings.hostname-strict or true; + message = "Setting the Keycloak hostname is required, see `services.keycloak.settings.hostname`"; + } { assertion = cfg.settings.hostname-url or null == null; message = ''