From c5ec691a7c7c5774366de3354c9d16786b617a90 Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Sat, 31 Jan 2026 14:36:40 +0100 Subject: [PATCH 1/2] hugo chat permissive cors --- nix/apps/hugo-chat/default.nix | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/nix/apps/hugo-chat/default.nix b/nix/apps/hugo-chat/default.nix index 986d9b7..2229650 100644 --- a/nix/apps/hugo-chat/default.nix +++ b/nix/apps/hugo-chat/default.nix @@ -62,35 +62,27 @@ in "api.hugo-chat.noratrieb.dev" = let cors = pkgs.writeText "cors" '' - # https://gist.github.com/ryanburnette/d13575c9ced201e73f8169d3a793c1a3 - @cors_preflight{args[0]} method OPTIONS - @cors{args[0]} header Origin {args[0]} - - handle @cors_preflight{args[0]} { - header { - Access-Control-Allow-Origin "{args[0]}" - Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS" - Access-Control-Allow-Credentials "false" - Access-Control-Allow-Headers "$${args[1]}" - Access-Control-Max-Age "86400" - defer - } - respond "" 204 + @cors_preflight { + method OPTIONS + header Origin * } - handle @cors{args[0]} { + handle @cors_preflight { header { - Access-Control-Allow-Origin "{args[0]}" - Access-Control-Expose-Headers * - defer + Access-Control-Allow-Origin "*" + Access-Control-Allow-Methods "*" + Access-Control-Allow-Headers "content-type" } + respond 204 } + + ''; in { logFormat = ""; extraConfig = '' - import ${cors} https://hugo-chat.noratrieb.dev "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type" + import ${cors} encode zstd gzip reverse_proxy * localhost:5001 ''; From d39236947371b2f5d2f76429cb2cb7e5cc53ce43 Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Sat, 31 Jan 2026 15:04:01 +0100 Subject: [PATCH 2/2] update --- nix/nixpkgs.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix/nixpkgs.json b/nix/nixpkgs.json index c3d3918..1efe252 100644 --- a/nix/nixpkgs.json +++ b/nix/nixpkgs.json @@ -1,10 +1,10 @@ { "nixos-25.05": { - "lastUpdated": "2025-12-22T11:35:31.967Z", - "commit": "2b0d2b456e4e8452cf1c16d00118d145f31160f9" + "lastUpdated": "2026-01-31T13:55:04.757Z", + "commit": "ac62194c3917d5f474c1a844b6fd6da2db95077d" }, "nixos-25.11": { - "lastUpdated": "2025-12-22T11:35:32.154Z", - "commit": "b3aad468604d3e488d627c0b43984eb60e75e782" + "lastUpdated": "2026-01-31T13:55:04.922Z", + "commit": "fa83fd837f3098e3e678e6cf017b2b36102c7211" } }