forgejo reactivate

This commit is contained in:
John Lancaster
2026-07-10 00:04:34 -05:00
parent b21bfd6bb4
commit 25ecb7ad06
5 changed files with 151 additions and 45 deletions
+5
View File
@@ -28,6 +28,11 @@
type = lib.types.str;
default = "${config.certDir}/mtls.pem";
};
certGroup = lib.mkOption {
description = "Group that should be granted read access to generated certificate material.";
type = lib.types.str;
default = "mtls";
};
subject = lib.mkOption {
description = "Subject for the cert";
type = lib.types.str;
+13 -1
View File
@@ -11,7 +11,11 @@ in
binName = "mtls-generate";
package = config.pkgs.step-cli;
extraPackages = with config.pkgs; [ coreutils step-cli systemd ];
preHook = "mkdir -p ${config.certDir}";
preHook = ''
mkdir -p "${config.certDir}"
chgrp "${config.certGroup}" "${config.certDir}"
chmod 0750 "${config.certDir}"
'';
args = [
"ca" "certificate"
"${config.subject}" "${config.certFile}" "${config.keyFile}"
@@ -25,7 +29,11 @@ in
++ lib.optionals config.overwrite [ "-f" ]
++ mkSANArgs config.SANs;
postHook = ''
chgrp "${config.certGroup}" "${config.certFile}" "${config.keyFile}"
chmod 0640 "${config.certFile}" "${config.keyFile}"
(umask 077; cat "${config.certFile}" "${config.keyFile}" > "${config.bundleFile}")
chgrp "${config.certGroup}" "${config.bundleFile}"
chmod 0640 "${config.bundleFile}"
'';
};
});
@@ -45,7 +53,11 @@ in
"${config.certFile}" "${config.keyFile}"
];
postHook = ''
chgrp "${config.certGroup}" "${config.certFile}" "${config.keyFile}"
chmod 0640 "${config.certFile}" "${config.keyFile}"
(umask 077; cat "${config.certFile}" "${config.keyFile}" > "${config.bundleFile}")
chgrp "${config.certGroup}" "${config.bundleFile}"
chmod 0640 "${config.bundleFile}"
'';
systemd = {