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
ccf607f1
Commit
ccf607f1
authored
3 years ago
by
Florian Sesser
Browse files
Options
Downloads
Patches
Plain Diff
Add optionality and customizable vpnEndpoint to make-storage.nix
parent
bc3ce5bb
No related branches found
No related tags found
3 merge requests
!108
Merge staging into production
,
!107
Merge develop into staging
,
!91
Integrate monitoring into production
Pipeline
#602
failed
3 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
morph/lib/make-storage.nix
+31
-6
31 additions, 6 deletions
morph/lib/make-storage.nix
with
31 additions
and
6 deletions
morph/lib/make-storage.nix
+
31
−
6
View file @
ccf607f1
...
...
@@ -11,11 +11,36 @@
# to avoid breaking some software such as
# database servers. You should change this only
# after NixOS release notes say you should.
,
monitoringvpnKeyDir
# The directory that holds the VPN keys.
,
monitoringvpnIPv4
# This node's IP in the monitoring VPN.
,
monitoringvpnEndpoint
# The VPN server and port.
,
monitoringvpnKeyDir
?
null
# The directory that holds the VPN keys.
,
monitoringvpnIPv4
?
null
# This node's IP in the monitoring VPN.
,
monitoringvpnEndpoint
?
null
# The VPN server and port.
,
...
}:
rec
{
}:
let
enableVpn
=
monitoringvpnKeyDir
!=
null
&&
monitoringvpnIPv4
!=
null
&&
monitoringvpnEndpoint
!=
null
;
vpnSecrets
=
if
!
enableVpn
then
{}
else
{
"monitoringvpn-secret-key"
=
{
source
=
monitoringvpnKeyDir
+
"/
${
monitoringvpnIPv4
}
.key"
;
destination
=
"/run/keys/monitoringvpn/client.key"
;
owner
.
user
=
"root"
;
owner
.
group
=
"root"
;
permissions
=
"0400"
;
action
=
[
"sudo"
"systemctl"
"restart"
"wireguard-monitoringvpn.service"
];
};
"monitoringvpn-preshared-key"
=
{
source
=
monitoringvpnKeyDir
+
"/preshared.key"
;
destination
=
"/run/keys/monitoringvpn/preshared.key"
;
owner
.
user
=
"root"
;
owner
.
group
=
"root"
;
permissions
=
"0400"
;
action
=
[
"sudo"
"systemctl"
"restart"
"wireguard-monitoringvpn.service"
];
};
};
in
rec
{
deployment
=
{
targetHost
=
cfg
.
publicIPv4
;
...
...
@@ -31,7 +56,7 @@
# extract it from the tahoe-lafs nixos module somehow?
action
=
[
"sudo"
"systemctl"
"restart"
"tahoe.storage.service"
];
};
};
}
//
vpnSecrets
;
};
# Any extra NixOS modules to load on this server.
...
...
@@ -75,7 +100,7 @@
system
.
stateVersion
=
stateVersion
;
services
.
private-storage
.
monitoring
.
vpn
.
client
=
{
services
.
private-storage
.
monitoring
.
vpn
.
client
=
if
!
enableVpn
then
{}
else
{
enable
=
true
;
ip
=
monitoringvpnIPv4
;
endpoint
=
monitoringvpnEndpoint
;
...
...
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