From 51b981bd6727357538b3b3b26e3ce9824d02d2a6 Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@privatestorage.io>
Date: Tue, 1 Jun 2021 09:38:10 +0000
Subject: [PATCH] Add symlink to secrets

More flexibility and less dots in config files.
Implements #65.
---
 morph/grid/production/config.json | 4 ++--
 morph/grid/production/grid.nix    | 2 +-
 morph/grid/production/secrets     | 1 +
 morph/grid/testing/config.json    | 4 ++--
 morph/grid/testing/grid.nix       | 2 +-
 morph/grid/testing/secrets        | 1 +
 6 files changed, 8 insertions(+), 6 deletions(-)
 create mode 120000 morph/grid/production/secrets
 create mode 120000 morph/grid/testing/secrets

diff --git a/morph/grid/production/config.json b/morph/grid/production/config.json
index 11ce70c0..b91d7d2e 100644
--- a/morph/grid/production/config.json
+++ b/morph/grid/production/config.json
@@ -1,6 +1,6 @@
 { "publicStoragePort": 8898
-, "ristrettoSigningKeyPath": "../../PrivateStorageSecrets/ristretto.signing-key"
-, "stripeSecretKeyPath": "../../PrivateStorageSecrets/stripe.secret"
+, "ristrettoSigningKeyPath": "./secrets/ristretto.signing-key"
+, "stripeSecretKeyPath": "./secrets/stripe.secret"
 , "passValue": 1000000
 , "issuerDomain": "payments.privatestorage.io"
 , "letsEncryptAdminEmail": "jean-paul@privatestorage.io"
diff --git a/morph/grid/production/grid.nix b/morph/grid/production/grid.nix
index 7c9abe14..c65f6832 100644
--- a/morph/grid/production/grid.nix
+++ b/morph/grid/production/grid.nix
@@ -6,7 +6,7 @@ import ../../lib/make-grid.nix {
   config = ./config.json;
   nodes = cfg:
     let
-      sshUsers = import ../../../../PrivateStorageSecrets/production-users.nix;
+      sshUsers = import ./secrets/production-users.nix;
     in {
     # Here are the hosts that are in this morph network.  This is sort of like
     # a server manifest.  We try to keep as many of the specific details as
diff --git a/morph/grid/production/secrets b/morph/grid/production/secrets
new file mode 120000
index 00000000..523a2201
--- /dev/null
+++ b/morph/grid/production/secrets
@@ -0,0 +1 @@
+../../../../PrivateStorageSecrets/
\ No newline at end of file
diff --git a/morph/grid/testing/config.json b/morph/grid/testing/config.json
index e9b3b969..d1840bea 100644
--- a/morph/grid/testing/config.json
+++ b/morph/grid/testing/config.json
@@ -1,6 +1,6 @@
 { "publicStoragePort": 8898
-, "ristrettoSigningKeyPath": "../../PrivateStorageSecrets/ristretto.signing-key"
-, "stripeSecretKeyPath": "../../PrivateStorageSecrets/privatestorageio-testing-stripe.secret"
+, "ristrettoSigningKeyPath": "./secrets/ristretto.signing-key"
+, "stripeSecretKeyPath": "./secrets/privatestorageio-testing-stripe.secret"
 , "passValue": 1000000
 , "issuerDomain": "payments.privatestorage-staging.com"
 , "letsEncryptAdminEmail": "jean-paul@privatestorage.io"
diff --git a/morph/grid/testing/grid.nix b/morph/grid/testing/grid.nix
index c1a9f60a..16673c62 100644
--- a/morph/grid/testing/grid.nix
+++ b/morph/grid/testing/grid.nix
@@ -11,7 +11,7 @@ import ../../lib/make-grid.nix {
       then import path
       else default
     );
-    sshUsers = importDef {} ../../../../PrivateStorageSecrets/staging-users.nix;
+    sshUsers = importDef {} ./secrets/staging-users.nix;
   in {
     "payments" = import ../../lib/make-issuer.nix ({
       publicIPv4 = "18.197.42.120";
diff --git a/morph/grid/testing/secrets b/morph/grid/testing/secrets
new file mode 120000
index 00000000..523a2201
--- /dev/null
+++ b/morph/grid/testing/secrets
@@ -0,0 +1 @@
+../../../../PrivateStorageSecrets/
\ No newline at end of file
-- 
GitLab