yep, more dotfiles

server: proxy github pages for website

wiro.world 683e0b04 cde7d900

verified
+69 -8
+69 -8
nixos/profiles/server.nix
··· 1 1 { self 2 2 , config 3 + , pkgs 3 4 , upkgs 4 5 , ... 5 6 }: ··· 15 16 external-netmask6 = 64; 16 17 external-gw6 = "fe80::1"; 17 18 18 - # website-port = 3000; 19 - # website-hostname = "wiro.world"; 19 + well-known-discord-dir = pkgs.writeTextDir ".well-known/discord" '' 20 + dh=919234284ceb2aba439d15b9136073eb2308989b 21 + ''; 22 + webfinger-dir = pkgs.writeTextDir ".well-known/webfinger" '' 23 + { 24 + "subject": "acct:milo@wiro.world", 25 + "aliases": [ 26 + "mailto:milo@wiro.world", 27 + "https://wiro.world/" 28 + ], 29 + "links": [ 30 + { 31 + "rel": "http://wiro.world/rel/avatar", 32 + "href": "https://wiro.world/logo.jpg", 33 + "type": "image/jpeg" 34 + }, 35 + { 36 + "rel": "http://webfinger.net/rel/profile-page", 37 + "href": "https://wiro.world/", 38 + "type": "text/html" 39 + }, 40 + { 41 + "rel": "http://openid.net/specs/connect/1.0/issuer", 42 + "href": "https://auth.wiro.world" 43 + } 44 + ] 45 + } 46 + ''; 47 + website-hostname = "wiro.world"; 20 48 21 49 pds-port = 3001; 22 50 pds-hostname = "pds.wiro.world"; ··· 119 147 } 120 148 ''; 121 149 122 - # TODO: add webfinger 123 - # https://willnorris.com/2023/caddy-snippets/#webfinger 124 - 125 - # virtualHosts.${website-hostname}.extraConfig = '' 126 - # reverse_proxy http://localhost:${toString website-port} 127 - # ''; 150 + virtualHosts.${website-hostname}.extraConfig = 151 + '' 152 + @discord { 153 + path /.well-known/discord 154 + method GET HEAD 155 + } 156 + route @discord { 157 + header { 158 + Access-Control-Allow-Origin "*" 159 + X-Robots-Tag "noindex" 160 + } 161 + root ${well-known-discord-dir} 162 + file_server 163 + } 164 + '' + 165 + '' 166 + @webfinger { 167 + path /.well-known/webfinger 168 + method GET HEAD 169 + query resource=acct:milo@wiro.world 170 + query resource=mailto:milo@wiro.world 171 + query resource=https://wiro.world 172 + query resource=https://wiro.world/ 173 + } 174 + route @webfinger { 175 + header { 176 + Content-Type "application/jrd+json" 177 + Access-Control-Allow-Origin "*" 178 + X-Robots-Tag "noindex" 179 + } 180 + root ${webfinger-dir} 181 + file_server 182 + } 183 + '' + 184 + '' 185 + reverse_proxy https://mrnossiom.github.io { 186 + header_up Host {http.request.host} 187 + } 188 + ''; 128 189 129 190 virtualHosts.${grafana-hostname}.extraConfig = '' 130 191 reverse_proxy http://localhost:${toString grafana-port}