Skip to content

Commit 8417511

Browse files
committed
tangled.sh knot
1 parent 122afcd commit 8417511

File tree

5 files changed

+147
-0
lines changed

5 files changed

+147
-0
lines changed

flake.lock

Lines changed: 103 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
nix-rpi5.url = "gitlab:vriska/nix-rpi5?ref=main";
2222
nur.url = "github:nix-community/NUR/e9e77b7985ef9bdeca12a38523c63d47555cc89b";
2323
timewall.url = "github:bcyran/timewall/";
24+
tangled.url = "github:RyanGibb/tangled/";
2425

2526
# deduplicate flake inputs
2627
eilean.inputs.nixpkgs.follows = "nixpkgs";
@@ -38,6 +39,7 @@
3839
nix-rpi5.inputs.nixpkgs.follows = "nixpkgs";
3940
nur.inputs.nixpkgs.follows = "nixpkgs";
4041
timewall.inputs.nixpkgs.follows = "nixpkgs";
42+
tangled.inputs.nixpkgs.follows = "nixpkgs";
4143
};
4244

4345
outputs =

hosts/owl/default.nix

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ in
5353
../../modules/ryan-website.nix
5454
../../modules/alec-website.nix
5555
../../modules/fn06-website.nix
56+
inputs.tangled.nixosModules.knotserver
5657
];
5758

5859
environment.systemPackages = with pkgs; [
@@ -241,6 +242,12 @@ in
241242
value = "vps";
242243
}
243244

245+
{
246+
name = "knot";
247+
type = "CNAME";
248+
value = "vps";
249+
}
250+
244251
# generate with
245252
# sudo openssl x509 -in /var/lib/acme/mail.freumh.org/fullchain.pem -pubkey -noout | openssl pkey -pubin -outform der | sha256sum | awk '{print "3 1 1", $1}'
246253
{
@@ -406,6 +413,7 @@ in
406413
security.acme-eon.nginxCerts = [
407414
"capybara.fn06.org"
408415
"shrew.freumh.org"
416+
"knot.freumh.org"
409417
];
410418
services.nginx.virtualHosts."capybara.fn06.org" = {
411419
forceSSL = true;
@@ -508,4 +516,30 @@ in
508516
networking.firewall.allowedTCPPorts = [ 7001 ];
509517

510518
services.openssh.openFirewall = true;
519+
520+
age.secrets.tangled = {
521+
file = ../../secrets/tangled.age;
522+
mode = "660";
523+
owner = "git";
524+
group = "git";
525+
};
526+
services.tangled-knotserver = {
527+
enable = true;
528+
repo.mainBranch = "master";
529+
server.hostname = "knot.freumh.org";
530+
server = {
531+
secretFile = config.age.secrets.tangled.path;
532+
listenAddr = "127.0.0.1:5555";
533+
internalListenAddr = "127.0.0.1:5444";
534+
};
535+
};
536+
services.nginx.virtualHosts."knot.freumh.org" = {
537+
forceSSL = true;
538+
locations."/" = {
539+
proxyPass = ''
540+
http://${config.services.tangled-knotserver.server.listenAddr}
541+
'';
542+
proxyWebsockets = true;
543+
};
544+
};
511545
}

secrets/secrets.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ in
4747
owl
4848
];
4949
"eon-sirref-primary.cap.age".publicKeys = user ++ [ owl ];
50+
"tangled.age".publicKeys = user ++ [ owl ];
5051
}

secrets/tangled.age

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
age-encryption.org/v1
2+
-> ssh-ed25519 2wDnOw Ttbl5LTzHDAP3kG7kbRErJr+ayerVYZIWZeLPmZmD0U
3+
Uvon5zchwp3jwP/wHJ5/jIrmDhSVOxGKEhLGPtnQj9w
4+
-> ssh-ed25519 suwb0g N+Z7lyQailIdkJMiCuFapSN3LhYphejMvB0x4Au1zBI
5+
dC6ju3bdhzyLB19/WFwgmr+HxTG9vd2fO/EB/WYjodM
6+
--- s2WjTwvpTi8jhAn0/yqBcTmzh77wbpYulovyEdGE7KQ
7+
G����}w����{� n�od&i,V���U��%�'!R46�{>� )>to�]Hh�����2F��A����Tv�!�;��)R�lM%U=|W"?*��e��"���i�KB�F

0 commit comments

Comments
 (0)