Ensure database exists before starting kdc init

This commit is contained in:
2023-10-15 20:34:16 -07:00
parent e3955ba861
commit 4697e09741
4 changed files with 25 additions and 30 deletions
+9 -17
View File
@@ -52,22 +52,14 @@ in {
config = {
# All Fudo hosts should redirect selby.ca to the selbyhomecentre website.
services.nginx.virtualHosts = {
"selby.ca" = {
enableACME = true;
locations."/".return = "301 https://selbyhomecentre.com$request_uri";
};
"www.selby.ca" = {
enableACME = true;
locations."/".return = "301 https://selbyhomecentre.com$request_uri";
};
"selbyhomecentre.com" = {
enableACME = true;
locations."/".return = "301 https://selbyhomecentre.com$request_uri";
};
"www.selbyhomecentre.com" = {
enableACME = true;
locations."/".return = "301 https://selbyhomecentre.com$request_uri";
};
"selby.ca".locations."/".return =
"301 https://selbyhomecentre.com$request_uri";
"www.selby.ca".locations."/".return =
"301 https://selbyhomecentre.com$request_uri";
"selbyhomecentre.com".locations."/".return =
"301 https://selbyhomecentre.com$request_uri";
"www.selbyhomecentre.com".locations."/".return =
"301 https://selbyhomecentre.com$request_uri";
};
fudo.services = {
@@ -88,7 +80,7 @@ in {
};
"selby.ca" = {
default-host = "germany";
ksk = config.fudo.secrets.files.dns.key-signing-keys."selby.ca";
ksk = null;
};
"selbyhomecentre.com" = {
default-host = "germany";
+2 -2
View File
@@ -23,9 +23,9 @@ in {
prefixLength = 28;
}];
};
firewall.enable = {
firewall = {
enable = false;
interface.podman0.allowedUDPPorts = [ 53 ];
interfaces.podman0.allowedUDPPorts = [ 53 ];
};
};
+7 -4
View File
@@ -90,13 +90,16 @@ in {
];
description = "Initialize and update the Heimdal KDC database.";
path = with pkgs; [ kdcMergePrincipals coreutils ];
serviceConfig = {
serviceConfig = let
db = config.fudo.auth.kerberos.kdc.database;
principals = host-secrets.kdc-principals.target-file;
master-key = host-secrets.realm-master-key.target-file;
in {
User = krb-user;
Group = krb-group;
Restart = "always";
ConditionPathExists = [ db principals master-key ];
ExecStart = let
db = config.fudo.auth.kerberos.kdc.database;
principals = host-secrets.kdc-principals.target-file;
master-key = host-secrets.realm-master-key.target-file;
init-db-cmd = concatStringsSep " " [
"${pkgs.kdcMergePrincipals}/bin/kdc-merge-principals"
"--create"