forked from fediversity/fediversity
mv out acme logic
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
parent
a2acc86350
commit
9118e9ab2d
2 changed files with 31 additions and 43 deletions
|
@ -82,39 +82,39 @@ in
|
||||||
|
|
||||||
nodes =
|
nodes =
|
||||||
{
|
{
|
||||||
deployer = {
|
deployer = lib.mkMerge [
|
||||||
imports = [ ./deployerNode.nix ];
|
{
|
||||||
_module.args = { inherit inputs sources; };
|
imports = [ ./deployerNode.nix ];
|
||||||
enableAcme = config.enableAcme;
|
_module.args = { inherit inputs sources; };
|
||||||
acmeNodeIP = config.nodes.acme.networking.primaryIPAddress;
|
enableAcme = config.enableAcme;
|
||||||
|
acmeNodeIP = config.nodes.acme.networking.primaryIPAddress;
|
||||||
|
}
|
||||||
|
(lib.mkIf config.enableAcme {
|
||||||
|
security.acme = {
|
||||||
|
acceptTerms = true;
|
||||||
|
defaults.email = "test@test.com";
|
||||||
|
defaults.server = "https://acme.test/dir";
|
||||||
|
};
|
||||||
|
security.pki.certificateFiles = [
|
||||||
|
(import "${inputs.nixpkgs}/nixos/tests/common/acme/server/snakeoil-certs.nix").ca.cert
|
||||||
|
];
|
||||||
|
networking.extraHosts = "${config.acmeNodeIP} acme.test";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
acme = lib.mkIf config.enableAcme {
|
||||||
|
## FIXME: This makes `nodes.acme` into a local resolver. Maybe this will
|
||||||
|
## break things once we play with DNS?
|
||||||
|
imports = [ "${inputs.nixpkgs}/nixos/tests/common/acme/server" ];
|
||||||
|
## We aren't testing ACME - we just want certificates.
|
||||||
|
systemd.services.pebble.environment.PEBBLE_VA_ALWAYS_VALID = "1";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
// genAttrs config.targetMachines (_: {
|
||||||
//
|
imports = [ ./targetNode.nix ];
|
||||||
|
_module.args = { inherit inputs sources; };
|
||||||
(
|
enableAcme = config.enableAcme;
|
||||||
if config.enableAcme then
|
acmeNodeIP = if config.enableAcme then config.nodes.acme.networking.primaryIPAddress else null;
|
||||||
{
|
});
|
||||||
acme = {
|
|
||||||
## FIXME: This makes `nodes.acme` into a local resolver. Maybe this will
|
|
||||||
## break things once we play with DNS?
|
|
||||||
imports = [ "${inputs.nixpkgs}/nixos/tests/common/acme/server" ];
|
|
||||||
## We aren't testing ACME - we just want certificates.
|
|
||||||
systemd.services.pebble.environment.PEBBLE_VA_ALWAYS_VALID = "1";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ }
|
|
||||||
)
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
genAttrs config.targetMachines (_: {
|
|
||||||
imports = [ ./targetNode.nix ];
|
|
||||||
_module.args = { inherit inputs sources; };
|
|
||||||
enableAcme = config.enableAcme;
|
|
||||||
acmeNodeIP = if config.enableAcme then config.nodes.acme.networking.primaryIPAddress else null;
|
|
||||||
});
|
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
${forConcat (attrNames config.nodes) (n: ''
|
${forConcat (attrNames config.nodes) (n: ''
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
inputs,
|
|
||||||
lib,
|
lib,
|
||||||
hostPkgs,
|
hostPkgs,
|
||||||
config,
|
config,
|
||||||
|
@ -151,17 +150,6 @@ in
|
||||||
(import ../../../panel { }).module
|
(import ../../../panel { }).module
|
||||||
];
|
];
|
||||||
|
|
||||||
## FIXME: This should be in the common stuff.
|
|
||||||
security.acme = {
|
|
||||||
acceptTerms = true;
|
|
||||||
defaults.email = "test@test.com";
|
|
||||||
defaults.server = "https://acme.test/dir";
|
|
||||||
};
|
|
||||||
security.pki.certificateFiles = [
|
|
||||||
(import "${inputs.nixpkgs}/nixos/tests/common/acme/server/snakeoil-certs.nix").ca.cert
|
|
||||||
];
|
|
||||||
networking.extraHosts = "${config.acmeNodeIP} acme.test";
|
|
||||||
|
|
||||||
services.panel = {
|
services.panel = {
|
||||||
enable = true;
|
enable = true;
|
||||||
production = true;
|
production = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue