feat: add radicle to bekkalokk #141

Merged
adriangl merged 1 commits from radicle into main 2026-05-31 02:05:12 +02:00
2 changed files with 44 additions and 0 deletions
+1
View File
@@ -7,6 +7,7 @@
./services/alps.nix
./services/bluemap.nix
./services/radicle.nix
./services/idp-simplesamlphp
./services/kerberos.nix
./services/mediawiki
+43
View File
@@ -0,0 +1,43 @@
{ config, lib, ... }:
let
domain = "dav.pvv.ntnu.no";
radicalePort = 5232;
in {
services.radicale = {
enable = true;
settings = {
server = {
hosts = [ "127.0.0.1:${toString radicalePort}" ];
};
auth = {
type = "imap";
imap_host = "imap.pvv.ntnu.no";
imap_security = "tls";
};
storage = {
filesystem_folder = "/var/lib/radicale/collections";
};
};
};
services.nginx.virtualHosts."${domain}" = {
forceSSL = true;
enableACME = true;
Review

acme-order-renew-dav.pvv.ntnu.no.service failed because LE failed to resolve the DNS pointer;

During secondary validation: DNS problem: NXDOMAIN looking up A for dav.pvv.ntnu.no - check that a DNS record exists for this domain; DNS problem: NXDOMAIN looking up AAAA for dav.pvv.ntnu.no - check that a DNS record exists for this domain

Therefore, we are still using a self signed cert:

[nix-shell:~]$ sudo openssl x509 -in /var/lib/acme/dav.pvv.ntnu.no/fullchain.pem -text | grep -i issuer
        Issuer: CN=minica root ca 769d0f
`acme-order-renew-dav.pvv.ntnu.no.service` failed because LE failed to resolve the DNS pointer; > During secondary validation: DNS problem: NXDOMAIN looking up A for dav.pvv.ntnu.no - check that a DNS record exists for this domain; DNS problem: NXDOMAIN looking up AAAA for dav.pvv.ntnu.no - check that a DNS record exists for this domain Therefore, we are still using a self signed cert: ``` [nix-shell:~]$ sudo openssl x509 -in /var/lib/acme/dav.pvv.ntnu.no/fullchain.pem -text | grep -i issuer Issuer: CN=minica root ca 769d0f ```
kTLS = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString radicalePort}";
extraConfig = ''
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Review
I think we can use https://github.com/NixOS/nixpkgs/blob/83801da137050a7c1b0242976c06a4d5e36f4402/nixos/modules/services/web-servers/nginx/default.nix#L59 instead, and only add the Authorization-header with extraConfig.
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_pass_header Authorization;
'';
};
};
networking.firewall.allowedTCPPorts = [ radicalePort ];
}