From e571e57f0c383514ba1ae6fca2082500263fce0a Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Mon, 20 Dec 2021 15:45:01 -0500
Subject: [PATCH] rename things with `voucher` in them for more clarity

The point is this is where PaymentServer's persistent state goes.  That
includes vouchers but might include more stuff too.
---
 DEPLOYMENT-NOTES.rst           | 4 ++--
 morph/lib/hardware-vagrant.nix | 4 ++--
 morph/lib/issuer-aws.nix       | 4 ++--
 morph/lib/issuer.nix           | 2 +-
 nixos/modules/issuer.nix       | 8 ++++----
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/DEPLOYMENT-NOTES.rst b/DEPLOYMENT-NOTES.rst
index cf447ece..d5e7d88b 100644
--- a/DEPLOYMENT-NOTES.rst
+++ b/DEPLOYMENT-NOTES.rst
@@ -19,11 +19,11 @@ Deployment notes
 
   3. Create a labeled filesystem on the partition ::
 
-    mkfs.ext4 -L voucher-database /dev/nvme1n1p1
+    mkfs.ext4 -L zkapissuer-database /dev/nvme1n1p1
 
   4. Mount the new filesystem ::
 
-    systemctl restart var-lib-voucher-database.mount
+    systemctl restart var-lib-zkapissuer-database.mount
 
   5. Deploy the PrivateStorageio update.
 
diff --git a/morph/lib/hardware-vagrant.nix b/morph/lib/hardware-vagrant.nix
index 11fda31f..36ecc5b6 100644
--- a/morph/lib/hardware-vagrant.nix
+++ b/morph/lib/hardware-vagrant.nix
@@ -37,12 +37,12 @@
     # (maybe it could?  but why bother?) we do a bind-mount here so there is a
     # configured value readable.  The database won't really have a dedicated
     # volume but it will sort of appear as if it does.
-    services.private-storage-issuer.voucherFileSystem = {
+    services.private-storage-issuer.databaseFileSystem = {
       device = "/var/lib/origin-zkapissuer-v2";
       options = ["bind"];
     };
 
-    # XXX This should be handled by the storage module like voucher-database
+    # XXX This should be handled by the storage module like zkapissuer-database
     # is handled by the issuer module.
     fileSystems."/storage" = { fsType = "tmpfs"; };
 
diff --git a/morph/lib/issuer-aws.nix b/morph/lib/issuer-aws.nix
index 7c8f22a1..85070bd9 100644
--- a/morph/lib/issuer-aws.nix
+++ b/morph/lib/issuer-aws.nix
@@ -22,8 +22,8 @@
   # beyond control of this particular part of the system) for the
   # PaymentServer voucher database.  This makes it easier to manage for
   # tasks like backup/recovery and encryption.
-  services.private-storage-issuer.voucherFileSystem = {
-    label = "voucher-database";
+  services.private-storage-issuer.databaseFileSystem = {
+    label = "zkapissuer-database";
   };
 
   # Clean up packages after a while
diff --git a/morph/lib/issuer.nix b/morph/lib/issuer.nix
index 925d2bbf..c4515b37 100644
--- a/morph/lib/issuer.nix
+++ b/morph/lib/issuer.nix
@@ -55,6 +55,6 @@ in {
     ristrettoSigningKeyPath = config.deployment.secrets.ristretto-signing-key.destination;
     stripeSecretKeyPath = config.deployment.secrets.stripe-secret-key.destination;
     database = "SQLite3";
-    databasePath = "${config.fileSystems."voucher-database".mountPoint}/vouchers.sqlite3";
+    databasePath = "${config.fileSystems."zkapissuer-database".mountPoint}/vouchers.sqlite3";
   };
 }
diff --git a/nixos/modules/issuer.nix b/nixos/modules/issuer.nix
index 66d799c8..82a28622 100644
--- a/nixos/modules/issuer.nix
+++ b/nixos/modules/issuer.nix
@@ -81,13 +81,13 @@ in {
         The kind of voucher database to use.
       '';
     };
-    services.private-storage-issuer.voucherFileSystem = lib.mkOption {
+    services.private-storage-issuer.databaseFileSystem = lib.mkOption {
       # Logically, the type is the type of an entry in fileSystems - but we'll
       # just let the type system enforce that when we pass the value on to
       # fileSystems.
       description = ''
-        Configuration for a filesystem to mount which will hold the voucher
-        database.
+        Configuration for a filesystem to mount which will hold the issuer's
+        internal state database.
       '';
     };
     services.private-storage-issuer.databasePath = lib.mkOption {
@@ -135,7 +135,7 @@ in {
     in lib.mkIf cfg.enable {
     # Make sure the voucher database filesystem is mounted.
     fileSystems = {
-      "voucher-database" = cfg.voucherFileSystem // {
+      "zkapissuer-database" = cfg.databaseFileSystem // {
         mountPoint = "/var/lib/${stateDirectory}";
       };
     };
-- 
GitLab