diff options
| author | Alexander Kassouni <alex@kassouni.net> | 2026-11-12 00:52:56 -0800 |
|---|---|---|
| committer | Alexander Kassouni <alex@kassouni.net> | 2026-11-12 00:52:56 -0800 |
| commit | 59fc4ae24c02a4057982259809c490564648690b (patch) | |
| tree | 88c0f4bf1047697fe11d55f266338815fdf19773 | |
| parent | 2286ab880c94e17a29ad99561f87b2e357d4a780 (diff) | |
cors on policy
| -rw-r--r-- | pgp/default.nix | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pgp/default.nix b/pgp/default.nix index 3fd5961..1eedf4d 100644 --- a/pgp/default.nix +++ b/pgp/default.nix @@ -6,6 +6,9 @@ let pubkey = pkgs.runCommandLocal "wkd-key-${domain}" { nativeBuildInputs = [ pkgs.gnupg ]; } '' gpg --dearmor < ${./pubkey.asc} > $out ''; + cors = '' + add_header Access-Control-Allow-Origin "*" always; + ''; in { services.nginx.virtualHosts.${domain}.locations = { @@ -13,11 +16,14 @@ in alias = "${pubkey}"; extraConfig = '' default_type application/octet-stream; - add_header Access-Control-Allow-Origin "*" always; + ${cors} ''; }; - "= /.well-known/openpgpkey/policy".alias = "${pkgs.emptyFile}"; + "= /.well-known/openpgpkey/policy" = { + alias = "${pkgs.emptyFile}"; + extraConfig = cors; + }; "= /pubkey.asc".alias = "${./pubkey.asc}"; }; |