added lifetime option
This commit is contained in:
@@ -35,6 +35,10 @@ let
|
||||
type = lib.types.str;
|
||||
default = "admin";
|
||||
};
|
||||
lifetime = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "6h";
|
||||
};
|
||||
renew = {
|
||||
enable = lib.mkOption {
|
||||
description = "Enable automatic mTLS certificate renewal using a systemd timer.";
|
||||
@@ -224,6 +228,7 @@ in
|
||||
--ca-url ${cfg.caURL} \
|
||||
--root ${rootCA} \
|
||||
--provisioner ${cfg.provisioner} \
|
||||
--not-before=-5m --not-after=${cfg.lifetime} \
|
||||
${sanArgs} \
|
||||
"$@"
|
||||
cat ${tlsCert} ${tlsKey} > ${mtlsBundle}
|
||||
@@ -272,9 +277,11 @@ in
|
||||
(writeShellScriptBin "mtls-generate" ''
|
||||
set -euo pipefail
|
||||
${lib.getExe pkgs.step-cli} ca certificate \
|
||||
john-pc-ubuntu ${tlsCert} ${tlsKey} \
|
||||
${cfg.subject} ${tlsCert} ${tlsKey} \
|
||||
--not-before=-5m --not-after=${cfg.lifetime} \
|
||||
--provisioner ${cfg.provisioner} \
|
||||
${sanArgs}
|
||||
${sanArgs} \
|
||||
"$@"
|
||||
cat ${tlsCert} ${tlsKey} > ${mtlsBundle}
|
||||
'')
|
||||
(writeShellScriptBin "mtls-check" ''
|
||||
|
||||
Reference in New Issue
Block a user