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
PrivateStorage
PrivateStorageio
Commits
f76108f0
Commit
f76108f0
authored
5 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
comments
parent
18c404a5
No related branches found
Branches containing commit
No related tags found
1 merge request
!4
Configurable public address
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nixos/modules/private-storage.nix
+34
-4
34 additions, 4 deletions
nixos/modules/private-storage.nix
with
34 additions
and
4 deletions
nixos/modules/private-storage.nix
+
34
−
4
View file @
f76108f0
...
...
@@ -2,23 +2,26 @@
# preferred configuration for the Private Storage grid.
{
pkgs
,
lib
,
config
,
...
}:
let
# Derive a brand new version of pkgs which has our overlay applied. The
# overlay defines a new version of Tahoe-LAFS and some of its dependencies
# and maybe other useful Private Storage customizations.
pspkgs
=
import
pkgs
.
path
{
overlays
=
[
(
import
./overlays.nix
)
];
};
# Grab the configuration for this module for convenient access below.
cfg
=
config
.
services
.
private-storage
;
in
{
# Upstream tahoe-lafs module conflicts with ours (since ours is a
# copy/paste/edit of upstream's...). Disable
# it.
# copy/paste/edit of upstream's...). Disable it.
#
# https://nixos.org/nixos/manual/#sec-replace-modules
disabledModules
=
[
"services/network-filesystems/tahoe.nix"
];
# Load our tahoe-lafs module.
# Load our tahoe-lafs module. It is configurable in the way I want it to be
# configurable.
imports
=
[
./tahoe.nix
];
...
...
@@ -50,26 +53,53 @@ in
''
;
};
};
# 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"
=
{
package
=
config
.
services
.
private-storage
.
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.
#
# We just populate this according to policy/preference of Private
# Storage.
sections
=
{
node
=
# XXX Should try to name that is unique across the grid.
{
nickname
=
"storage"
;
# We have the web port active because the CLI uses it. We may
# eventually turn this off, or at least have it off by default (with
# an option to turn it on). I don't know how much we'll use the CLI
# on the nodes. Maybe very little? Or maybe it will be part of a
# health check for the node... In any case, we tell it to bind to
# localhost so no one *else* can use it. And the principle of the
# web interface is that merely having access to it doesn't grant
# access to any data. It does grant access to storage capabilities
# but with our plugin configuration you still need ZKAPs to use
# those...
"web.port"
=
"tcp:3456:interface=127.0.0.1"
;
# We have to tell Tahoe-LAFS where to listen for Foolscap
# connections for the storage protocol. We have to tell it twice.
# First, in the syntax which it uses to listen.
"tub.port"
=
"tcp:
${
toString
cfg
.
publicStoragePort
}
"
;
# Second, in the syntax it advertises to in the fURL.
"tub.location"
=
"tcp:
${
cfg
.
publicIPv4
}
:
${
toString
cfg
.
publicStoragePort
}
"
;
};
storage
=
{
enabled
=
true
;
# Turn on our plugin.
plugins
=
"privatestorageio-zkapauthz-v1"
;
};
# It doesn't have any configuration *yet*.
"storageserver.plugins.privatestorageio-zkapauthz-v1"
=
{
};
};
};
# Let traffic destined for the storage node's Foolscap server through.
networking
.
firewall
.
allowedTCPPorts
=
[
cfg
.
publicStoragePort
];
};
...
...
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