my nixos config
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

the website's caddyfile has been moved to its repo

chfour fc570b9f d913d988

+6 -16
+6 -16
machines/fovps/services/caddy/website.nix
··· 2 2 3 3 # TODO: maybe make this into a module or sth 4 4 let 5 - source = "git+https://tangled.org/did:plc:mlyxfgbugroxjmo7berpnowb/website3#website"; 5 + source = "git+https://tangled.org/did:plc:mlyxfgbugroxjmo7berpnowb/website3#caddyfile"; 6 6 dataDir = "/var/lib/website"; 7 7 user = config.services.caddy.user; 8 8 group = config.services.caddy.group; ··· 18 18 import bots 19 19 20 20 handle { 21 - # super secret sticker on my laptop 22 - # todo make actual nice link redirector service 23 - redir /l/hi0 / 24 - 25 - root * ${dataDir}/current/var/www 26 - encode zstd gzip 27 - header { 28 - -Last-modified 29 - import ${dataDir}/etag 30 - } 31 - file_server 21 + import ${dataDir}/current/etc/caddy/Caddyfile 32 22 } 33 23 ''; 34 24 }; ··· 50 40 51 41 # atomically swap 52 42 mv -T next current 53 - echo 'Etag "\"'"''${nextPath##*/}"'\""' > ${dataDir}/etag 54 43 ''; 55 44 }; 56 45 in { ··· 67 56 sudo -u ${user} -g ${group} \ 68 57 ${updater-unpriv}/bin/website-updater-unpriv 69 58 70 - # reload bc etag changed 59 + # reload because config changed 71 60 systemctl is-active --quiet caddy.service && 72 61 systemctl reload --no-block caddy.service || true 73 62 ''; 74 63 # --no-block because it seems systemd blocks 75 64 # the reload until this service finishes... 76 65 # so it deadlocks here if caddy is running 77 - # it's also fine because we only change Etag 78 - # which shouldn't have any syntax errors... 66 + # it's also fine because we only change 67 + # the config which should already be validated 68 + # and formatted 79 69 # so it's not really our problem if something 80 70 # shits the bed 81 71 serviceConfig = {