alpha
Login
or
Join now
lass.pds.lassul.us
/
superconfig
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
1
Pipelines
green: add zerotier
author
lassulus
date
2 years ago
(Jan 8, 2024, 3:10 PM CET)
commit
9a81313e
9a81313eb8eced0af6d3d002b225c50d87bd40e8
parent
05d7c1f5
05d7c1f57fc777ea13a8e20e88de919049816dd3
+36
-2
7 changed files
Expand all
Collapse all
Unified
Split
2configs
zerotier.nix
machines
aergia
facts
network.id
zerotier.network.id
green
config.nix
facts
zerotier-ip
zerotier-meshname
zerotier-network-id
+31
2configs/zerotier.nix
View file
Reviewed
···
1
1
+
{ pkgs, ... }:
2
2
+
{
3
3
+
clan.networking.zerotier = {
4
4
+
controller = {
5
5
+
enable = true;
6
6
+
public = false;
7
7
+
};
8
8
+
};
9
9
+
environment.systemPackages = [
10
10
+
# pkgs.zerocli
11
11
+
pkgs.jq
12
12
+
(pkgs.writers.writeDashBin "zt-member-ls" ''
13
13
+
set -eu
14
14
+
NETWORK_ID=''${NETWORK_ID:-$(zerotier-cli listnetworks -j | jq -r '.[0] | .id')}
15
15
+
cat /var/lib/zerotier-one/controller.d/network/$NETWORK_ID/member/* | jq -s
16
16
+
'')
17
17
+
(pkgs.writers.writeDashBin "zt-member-auth" ''
18
18
+
set -efux
19
19
+
MEMBER_ID=$1
20
20
+
if ! printf '%s' $MEMBER_ID | grep -q '^[0-9a-f]\{10\}$'; then
21
21
+
echo '$MEMBER_ID is not a valid member id'
22
22
+
exit 1
23
23
+
fi
24
24
+
URL='http://localhost:9993/controller/'
25
25
+
TOKEN=''${TOKEN:-$(cat /var/lib/zerotier-one/authtoken.secret)}
26
26
+
NETWORK_ID=''${NETWORK_ID:-$(zerotier-cli listnetworks -j | jq -r '.[0] | .id')}
27
27
+
28
28
+
curl -fSs -H "X-ZT1-AUTH: $TOKEN" "$URL/network/$NETWORK_ID/member/$MEMBER_ID" -d '{"authorized": true}'
29
29
+
'')
30
30
+
];
31
31
+
}
+2
machines/green/config.nix
View file
Reviewed
···
18
18
../../2configs/consul.nix
19
19
20
20
../../2configs/atuin-server.nix
21
21
+
22
22
+
../../2configs/zerotier.nix
21
23
];
22
24
23
25
clanCore.secretsUploadDirectory = lib.mkForce "/var/state/secrets";
-1
machines/aergia/facts/network.id
Reviewed
···
1
1
-
a27b7e6445c85e08
-1
machines/aergia/facts/zerotier.network.id
Reviewed
···
1
1
-
970db1b038cdf332
+1
machines/green/facts/zerotier-ip
View file
Reviewed
···
1
1
+
fd7c:31a2:1e86:f9a7:5c99:937c:31a2:1e86
+1
machines/green/facts/zerotier-meshname
View file
Reviewed
···
1
1
+
7v6ddiq6q342oxezsn6ddiq6qy
+1
machines/green/facts/zerotier-network-id
View file
Reviewed
···
1
1
+
7c31a21e86f9a75c