Skip to content
Snippets Groups Projects
Unverified Commit e3b293ac authored by Jean-Paul Calderone's avatar Jean-Paul Calderone Committed by GitHub
Browse files

Merge pull request #48 from PrivateStorageio/295.MB-pass-value

Configure 1 SI MB pass value
parents f669b30d ae923c6e
No related branches found
No related tags found
No related merge requests found
{ "publicStoragePort": 8898
, "ristrettoSigningKeyPath": "../../PrivateStorageSecrets/ristretto.signing-key"
, "stripeSecretKeyPath": "../../PrivateStorageSecrets/stripe.secret"
, "passValue": 1000000
, "issuerDomain": "payments.privatestorage.io"
, "letsEncryptAdminEmail": "jean-paul@privatestorage.io"
, "allowedChargeOrigins": [
......
{ "publicStoragePort": 8898
, "ristrettoSigningKeyPath": "../../PrivateStorageSecrets/ristretto.signing-key"
, "stripeSecretKeyPath": "../../PrivateStorageSecrets/privatestorageio-testing-stripe.secret"
, "passValue": 1000000
, "issuerDomain": "payments.privatestorage-staging.com"
, "letsEncryptAdminEmail": "jean-paul@privatestorage.io"
, "allowedChargeOrigins": [
......
......@@ -3,6 +3,7 @@
, hardware # The path to the hardware configuration for this node.
, publicStoragePort # The storage port number on which to accept connections.
, ristrettoSigningKeyPath # The *local* path to the Ristretto signing key file.
, passValue # Bytes component of size×time value of passes.
, sshUsers # Users for which to configure SSH access to this node.
, stateVersion # The value for system.stateVersion on this node.
# This value determines the NixOS release with
......@@ -57,6 +58,8 @@
inherit publicStoragePort;
# Give it the Ristretto signing key, too, to support authorization.
ristrettoSigningKeyPath = deployment.secrets.ristretto-signing-key.destination;
# Assign the configured pass value.
inherit passValue;
# It gets the users, too.
inherit sshUsers;
};
......
{ publicIPv4, hardware, publicStoragePort, ristrettoSigningKeyPath, sshUsers, stateVersion, ... }: rec {
{ publicIPv4, hardware, publicStoragePort, ristrettoSigningKeyPath, passValue, sshUsers, stateVersion, ... }: rec {
deployment = {
secrets = {
......@@ -26,6 +26,7 @@
inherit publicIPv4;
inherit publicStoragePort;
ristrettoSigningKeyPath = deployment.secrets.ristretto-signing-key.destination;
inherit passValue;
inherit sshUsers;
};
......
......@@ -78,13 +78,22 @@ in
The path to the Ristretto signing key for the service.
'';
};
services.private-storage.passValue = lib.mkOption
{ default = null;
type = lib.types.nullOr lib.types.int;
example = lib.literalExample (1000 * 1000);
description = ''
The bytes component of the bytes×time value of a single pass which
storage servers will use when making pricing decisions.
'';
};
};
# Define configuration based on values given for our options - starting with
# the option that says whether this is even turned on.
config = lib.mkIf cfg.enable
{ services.tahoe.nodes."${storage-node-name}" =
{ package = config.services.private-storage.tahoe.package;
{ package = cfg.tahoe.package;
# Each attribute in this set corresponds to a section in the tahoe.cfg
# file. Attributes on those sets correspond to individual assignments
# in those sections.
......@@ -126,7 +135,11 @@ in
"storageserver.plugins.privatestorageio-zkapauthz-v1" =
{ "ristretto-issuer-root-url" = cfg.issuerRootURL;
"ristretto-signing-key-path" = cfg.ristrettoSigningKeyPath;
};
} // (
if cfg.passValue == null
then {}
else { "pass-value" = (toString cfg.passValue); }
);
};
};
......
......@@ -4,6 +4,6 @@ in
pkgs.fetchFromGitHub {
owner = "PrivateStorageio";
repo = "ZKAPAuthorizer";
rev = "27a2f31e5483fa732785cf550e3beef09d67c398";
sha256 = "10x28f1iplhskbaqxqcd68kz0llssvn261b87x1aaay3959s8ama";
rev = "7b4796470764f47f6b2f57d7678cc2311e5bd18e";
sha256 = "1b5z7mha8sak46b2sxdd44hqc0a1wx7frcydzgzs25ncq4a516aa";
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment