From c1093ad8df69d5fe294811641c101a1da9cf4ad9 Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@privatestorage.io>
Date: Tue, 25 May 2021 21:52:37 +0000
Subject: [PATCH] fix vpn private key path pointers

---
 morph/grid/local/config.json  | 2 +-
 morph/lib/make-issuer.nix     | 4 ++--
 morph/lib/make-monitoring.nix | 4 ++--
 morph/lib/make-testing.nix    | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/morph/grid/local/config.json b/morph/grid/local/config.json
index b0bd66f3..0f44cd70 100644
--- a/morph/grid/local/config.json
+++ b/morph/grid/local/config.json
@@ -1,7 +1,7 @@
 { "publicStoragePort": 8898
 , "ristrettoSigningKeyPath": "../../PrivateStorageSecrets/ristretto.signing-key"
 , "stripeSecretKeyPath": "../../PrivateStorageSecrets/privatestorageio-testing-stripe.secret"
-, "monitoringvpnSecretKeyPath": "../../PrivateStorageSecrets/monitoringvpn/server.key"
+, "monitoringvpnSecretKeyDir": "../../PrivateStorageSecrets/monitoringvpn/"
 , "monitoringvpnPresharedKeyPath" : "../../PrivateStorageSecrets/monitoringvpn/preshared.key"
 , "passValue": 1000000
 , "issuerDomain": "payments.localdev"
diff --git a/morph/lib/make-issuer.nix b/morph/lib/make-issuer.nix
index 82b19484..f6899fe8 100644
--- a/morph/lib/make-issuer.nix
+++ b/morph/lib/make-issuer.nix
@@ -1,7 +1,7 @@
 { hardware
 , ristrettoSigningKeyPath
 , stripeSecretKeyPath
-, monitoringvpnSecretKeyPath
+, monitoringvpnSecretKeyDir
 , monitoringvpnPresharedKeyPath
 , issuerDomain
 , letsEncryptAdminEmail
@@ -33,7 +33,7 @@
         action = ["sudo" "systemctl" "restart" "zkapissuer.service"];
       };
       "monitoringvpn-secret-key" = {
-        source = monitoringvpnSecretKeyPath;
+        source = monitoringvpnSecretKeyDir + "/${monitoringvpnIPv4}.key";
         destination = "/run/keys/monitoringvpn/client.key";
         owner.user = "root";
         owner.group = "root";
diff --git a/morph/lib/make-monitoring.nix b/morph/lib/make-monitoring.nix
index 19e1dcbe..9a0f297b 100644
--- a/morph/lib/make-monitoring.nix
+++ b/morph/lib/make-monitoring.nix
@@ -2,7 +2,7 @@
 , hardware
 , publicStoragePort
 , ristrettoSigningKeyPath
-, monitoringvpnSecretKeyPath
+, monitoringvpnSecretKeyDir
 , monitoringvpnPresharedKeyPath
 , passValue
 , sshUsers
@@ -16,7 +16,7 @@
 
     secrets = {
       "monitoringvpn-private-key" = {
-        source = monitoringvpnSecretKeyPath;
+        source = monitoringvpnSecretKeyDir + "/server.key";
         destination = "/run/keys/monitoringvpn/server.key";
         owner.user = "root";
         owner.group = "root";
diff --git a/morph/lib/make-testing.nix b/morph/lib/make-testing.nix
index 7cd3c80a..35c70f8f 100644
--- a/morph/lib/make-testing.nix
+++ b/morph/lib/make-testing.nix
@@ -2,7 +2,7 @@
 , hardware
 , publicStoragePort
 , ristrettoSigningKeyPath
-, monitoringvpnSecretKeyPath
+, monitoringvpnSecretKeyDir
 , monitoringvpnPresharedKeyPath
 , passValue
 , sshUsers
@@ -26,7 +26,7 @@
         action = ["sudo" "systemctl" "restart" "tahoe.storage.service"];
       };
       "monitoringvpn-secret-key" = {
-        source = monitoringvpnSecretKeyPath;
+        source = monitoringvpnSecretKeyDir + "/${monitoringvpnIPv4}.key";
         destination = "/run/keys/monitoringvpn/client.key";
         owner.user = "root";
         owner.group = "root";
-- 
GitLab