Skip to content

Commit 4d1e1d0

Browse files
committedJul 17, 2017
nixos/taskserver: Fix manual PKI management
The helper tool had a very early check whether the automatically created CA key/cert are available and thus it would abort if the key was unavailable even though we don't need or even want to have the CA key. Unfortunately our NixOS test didn't catch this, because it was just switching from a configuration with an automatically created CA to a manual configuration without deleting the generated keys and certs. This is done now in the tests and it's also fixed in the helper tool. Reported-by: @jpotier Signed-off-by: aszlig <aszlig@redmoonstudios.org> Tested-by: @jpotier (cherry picked from commit b618843)
1 parent 292343c commit 4d1e1d0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
 

‎nixos/modules/services/misc/taskserver/helper-tool.py

+2
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@ def cli(ctx):
448448
"""
449449
Manage Taskserver users and certificates
450450
"""
451+
if not IS_AUTO_CONFIG:
452+
return
451453
for path in (CA_KEY, CA_CERT, CRL_FILE):
452454
if not os.path.exists(path):
453455
msg = "CA setup not done or incomplete, missing file {}."

‎nixos/tests/taskserver.nix

+4
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ in {
246246
};
247247
248248
subtest "check manual configuration", sub {
249+
# Remove the keys from automatic CA creation, to make sure the new
250+
# generation doesn't use keys from before.
251+
$server->succeed('rm -rf ${cfg.dataDir}/keys/* >&2');
252+
249253
$server->succeed('${switchToNewServer} >&2');
250254
$server->waitForUnit("taskserver.service");
251255
$server->waitForOpenPort(${portStr});

0 commit comments

Comments
 (0)
Please sign in to comment.