Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PrivateStorageio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tom Prince
PrivateStorageio
Commits
0c7c27ac
Commit
0c7c27ac
authored
5 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
Add morph for the PaymentServer deployment
parent
3ce91e7f
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
morph/grid.nix
+5
-0
5 additions, 0 deletions
morph/grid.nix
morph/issuer-aws.nix
+4
-0
4 additions, 0 deletions
morph/issuer-aws.nix
morph/issuer.nix
+33
-0
33 additions, 0 deletions
morph/issuer.nix
nixos/modules/issuer.nix
+22
-3
22 additions, 3 deletions
nixos/modules/issuer.nix
with
64 additions
and
3 deletions
morph/grid.nix
+
5
−
0
View file @
0c7c27ac
...
...
@@ -16,6 +16,11 @@ import ./make-grid.nix {
# doesn't specify one.
#
# The names must be unique!
"issuer"
=
import
./issuer.nix
({
hardware
=
./issuer-aws.nix
;
stateVersion
=
"19.03"
;
}
//
cfg
);
"storage001"
=
import
./make-storage.nix
({
cfg
=
import
./storage001-config.nix
;
hardware
=
./storage001-hardware.nix
;
...
...
This diff is collapsed.
Click to expand it.
morph/issuer-aws.nix
0 → 100644
+
4
−
0
View file @
0c7c27ac
{
imports
=
[
<
nixpkgs/nixos/modules/virtualisation/amazon-image.nix
>
];
ec2
.
hvm
=
true
;
}
This diff is collapsed.
Click to expand it.
morph/issuer.nix
0 → 100644
+
33
−
0
View file @
0c7c27ac
{
hardware
,
ristrettoSigningKeyPath
,
stateVersion
,
...
}:
{
deployment
=
{
secrets
=
{
"ristretto-signing-key"
=
{
source
=
ristrettoSigningKeyPath
;
destination
=
"/var/secrets/ristretto.signing-key"
;
owner
.
user
=
"root"
;
owner
.
group
=
"root"
;
permissions
=
"0400"
;
action
=
[
"sudo"
"systemctl"
"restart"
"zkapissuer.service"
];
};
};
};
imports
=
[
hardware
../nixos/modules/issuer.nix
];
services
.
private-storage-issuer
=
{
enable
=
true
;
# XXX This should be passed as a path.
ristrettoSigningKey
=
builtins
.
readFile
(
./..
+
ristrettoSigningKeyPath
);
database
=
"SQLite3"
;
databasePath
=
"/var/db/vouchers.sqlite3"
;
};
system
.
stateVersion
=
stateVersion
;
}
This diff is collapsed.
Click to expand it.
nixos/modules/issuer.nix
+
22
−
3
View file @
0c7c27ac
...
...
@@ -17,7 +17,7 @@ in {
};
services
.
private-storage-issuer
.
issuer
=
lib
.
mkOption
{
default
=
"Ristretto"
;
type
=
lib
.
types
.
str
;
type
=
lib
.
types
.
enum
[
" Trivial"
"Ristretto"
]
;
example
=
lib
.
literalExample
"Trivial"
;
description
=
''
The issuer algorithm to use. Either Trivial for a fake no-crypto
...
...
@@ -32,6 +32,21 @@ in {
``Ristretto``.
''
;
};
services
.
private-storage-issuer
.
database
=
lib
.
mkOption
{
default
=
"Memory"
;
type
=
lib
.
types
.
enum
[
"Memory"
"SQLite3"
];
description
=
''
The kind of voucher database to use.
''
;
};
services
.
private-storage-issuer
.
databasePath
=
lib
.
mkOption
{
default
=
null
;
type
=
lib
.
types
.
str
;
description
=
''
The path to a database file in the filesystem, if the SQLite3 database
type is being used.
''
;
};
};
config
=
lib
.
mkIf
cfg
.
enable
{
...
...
@@ -47,12 +62,16 @@ in {
let
# Compute the right command line arguments to pass to it. The
# signing key is only supplied when using the Ristretto issuer.
a
rgs
=
issuerA
rgs
=
if
cfg
.
issuer
==
"Trivial"
then
"--issuer Trivial"
else
"--issuer Ristretto --signing-key
${
cfg
.
ristrettoSigningKey
}
"
;
databaseArgs
=
if
cfg
.
database
==
"Memory"
then
"--database Memory"
else
"--database SQLite3 --database-path
${
cfg
.
databasePath
}
"
;
in
"
${
cfg
.
package
}
/bin/PaymentServer-exe
${
a
rgs
}
"
;
"
${
cfg
.
package
}
/bin/PaymentServer-exe
${
issuerArgs
}
${
databaseA
rgs
}
"
;
Type
=
"simple"
;
# It really shouldn't ever exit on its own! If it does, it's a bug
# we'll have to fix. Restart it and hope it doesn't happen too much
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment