Compare commits

..

No commits in common. "d39236947371b2f5d2f76429cb2cb7e5cc53ce43" and "ac0860cd052b39f129d0a8743f328f267b631f91" have entirely different histories.

2 changed files with 23 additions and 15 deletions

View file

@ -62,27 +62,35 @@ in
"api.hugo-chat.noratrieb.dev" = "api.hugo-chat.noratrieb.dev" =
let let
cors = pkgs.writeText "cors" '' cors = pkgs.writeText "cors" ''
@cors_preflight { # https://gist.github.com/ryanburnette/d13575c9ced201e73f8169d3a793c1a3
method OPTIONS @cors_preflight{args[0]} method OPTIONS
header Origin * @cors{args[0]} header Origin {args[0]}
}
handle @cors_preflight { handle @cors_preflight{args[0]} {
header { header {
Access-Control-Allow-Origin "*" Access-Control-Allow-Origin "{args[0]}"
Access-Control-Allow-Methods "*" Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS"
Access-Control-Allow-Headers "content-type" Access-Control-Allow-Credentials "false"
Access-Control-Allow-Headers "$${args[1]}"
Access-Control-Max-Age "86400"
defer
} }
respond 204 respond "" 204
} }
handle @cors{args[0]} {
header {
Access-Control-Allow-Origin "{args[0]}"
Access-Control-Expose-Headers *
defer
}
}
''; '';
in in
{ {
logFormat = ""; logFormat = "";
extraConfig = '' extraConfig = ''
import ${cors} import ${cors} https://hugo-chat.noratrieb.dev "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type"
encode zstd gzip encode zstd gzip
reverse_proxy * localhost:5001 reverse_proxy * localhost:5001
''; '';

View file

@ -1,10 +1,10 @@
{ {
"nixos-25.05": { "nixos-25.05": {
"lastUpdated": "2026-01-31T13:55:04.757Z", "lastUpdated": "2025-12-22T11:35:31.967Z",
"commit": "ac62194c3917d5f474c1a844b6fd6da2db95077d" "commit": "2b0d2b456e4e8452cf1c16d00118d145f31160f9"
}, },
"nixos-25.11": { "nixos-25.11": {
"lastUpdated": "2026-01-31T13:55:04.922Z", "lastUpdated": "2025-12-22T11:35:32.154Z",
"commit": "fa83fd837f3098e3e678e6cf017b2b36102c7211" "commit": "b3aad468604d3e488d627c0b43984eb60e75e782"
} }
} }