Ensure database exists before starting kdc init

This commit is contained in:
niten 2023-10-15 20:34:16 -07:00
parent e3955ba861
commit 4697e09741
4 changed files with 25 additions and 30 deletions

View File

@ -52,22 +52,14 @@ in {
config = { config = {
# All Fudo hosts should redirect selby.ca to the selbyhomecentre website. # All Fudo hosts should redirect selby.ca to the selbyhomecentre website.
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"selby.ca" = { "selby.ca".locations."/".return =
enableACME = true; "301 https://selbyhomecentre.com$request_uri";
locations."/".return = "301 https://selbyhomecentre.com$request_uri"; "www.selby.ca".locations."/".return =
}; "301 https://selbyhomecentre.com$request_uri";
"www.selby.ca" = { "selbyhomecentre.com".locations."/".return =
enableACME = true; "301 https://selbyhomecentre.com$request_uri";
locations."/".return = "301 https://selbyhomecentre.com$request_uri"; "www.selbyhomecentre.com".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";
};
}; };
fudo.services = { fudo.services = {
@ -88,7 +80,7 @@ in {
}; };
"selby.ca" = { "selby.ca" = {
default-host = "germany"; default-host = "germany";
ksk = config.fudo.secrets.files.dns.key-signing-keys."selby.ca"; ksk = null;
}; };
"selbyhomecentre.com" = { "selbyhomecentre.com" = {
default-host = "germany"; default-host = "germany";

View File

@ -23,9 +23,9 @@ in {
prefixLength = 28; prefixLength = 28;
}]; }];
}; };
firewall.enable = { firewall = {
enable = false; enable = false;
interface.podman0.allowedUDPPorts = [ 53 ]; interfaces.podman0.allowedUDPPorts = [ 53 ];
}; };
}; };

View File

@ -90,13 +90,16 @@ in {
]; ];
description = "Initialize and update the Heimdal KDC database."; description = "Initialize and update the Heimdal KDC database.";
path = with pkgs; [ kdcMergePrincipals coreutils ]; path = with pkgs; [ kdcMergePrincipals coreutils ];
serviceConfig = { serviceConfig = let
User = krb-user;
Group = krb-group;
ExecStart = let
db = config.fudo.auth.kerberos.kdc.database; db = config.fudo.auth.kerberos.kdc.database;
principals = host-secrets.kdc-principals.target-file; principals = host-secrets.kdc-principals.target-file;
master-key = host-secrets.realm-master-key.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
init-db-cmd = concatStringsSep " " [ init-db-cmd = concatStringsSep " " [
"${pkgs.kdcMergePrincipals}/bin/kdc-merge-principals" "${pkgs.kdcMergePrincipals}/bin/kdc-merge-principals"
"--create" "--create"

View File

@ -2984,11 +2984,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1697257997, "lastModified": 1697412875,
"narHash": "sha256-oVRwU9XkWzhfRFrvNzNLSS6YUIyFiFX/uVt/WrFRxZw=", "narHash": "sha256-rJmQ1+5mDuA4nskjnDQ6KVRIS0c8nJ3SJaOrpdIx+I0=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "34b51d34b9f339f12e4111d4d6e5b00b8752f6bc", "rev": "af3dbd0bed0da50d8b13d01256a328b15d9eb7c5",
"revCount": 241, "revCount": 245,
"type": "git", "type": "git",
"url": "https://git.fudo.org/fudo-public/mail-server.git" "url": "https://git.fudo.org/fudo-public/mail-server.git"
}, },
@ -3548,11 +3548,11 @@
}, },
"nixpkgs_21": { "nixpkgs_21": {
"locked": { "locked": {
"lastModified": 1696983906, "lastModified": 1697226376,
"narHash": "sha256-L7GyeErguS7Pg4h8nK0wGlcUTbfUMDu+HMf1UcyP72k=", "narHash": "sha256-cumLLb1QOUtWieUnLGqo+ylNt3+fU8Lcv5Zl+tYbRUE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bd1cde45c77891214131cbbea5b1203e485a9d51", "rev": "898cb2064b6e98b8c5499f37e81adbdf2925f7c5",
"type": "github" "type": "github"
}, },
"original": { "original": {