Server/caddy: add downloads page

This commit is contained in:
Toast 2024-07-26 02:16:12 +02:00
parent 301a1bfa9b
commit 7006a7ff93

View file

@ -4,6 +4,7 @@
...
}: let
manualHostname = "manual.everest.tailscale";
downloadsHostname = "dl.everest.tailscale";
in {
services.caddy = {
enable = true;
@ -20,16 +21,29 @@ in {
bind 100.73.96.48
}
'';
virtualHosts.nixos-manual = {
hostName = manualHostname;
extraConfig = ''
import tailscale
file_server
root * ${config.system.build.manual.manualHTML}/share/doc/nixos
'';
virtualHosts = {
nixos-manual = {
hostName = manualHostname;
extraConfig = ''
import tailscale
file_server
root * ${config.system.build.manual.manualHTML}/share/doc/nixos
'';
};
downloads = {
hostName = downloadsHostname;
extraConfig = ''
import tailscale
file_server browse
root * /srv/dl/
'';
};
};
};
services.dnsmasq.settings.cname = ["${manualHostname},everest"];
services.dnsmasq.settings.cname = [
"${manualHostname},everest"
"${downloadsHostname},everest"
];
systemd = {
units.tailscaled.requiredBy = ["caddy.service"];
# We have somewhat frequent power outages, and our ISP router takes