From b8cf4dd74ef2f2dc0ff6d5a6354aa6a7dbce4fb4 Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Wed, 16 Oct 2024 16:56:56 +0700 Subject: [PATCH] couchdb: added cors configuration for Obsidian --- system/services/couchdb.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/system/services/couchdb.nix b/system/services/couchdb.nix index e3bb7a0..513cfe0 100644 --- a/system/services/couchdb.nix +++ b/system/services/couchdb.nix @@ -39,10 +39,13 @@ in }; services.caddy.virtualHosts."couchdb.tigor.web.id".extraConfig = '' - @origin header Origin {args[0]} - header @origin { - Access-Control-Allow-Origin "{args[0]}" + @obsidian header Origin "app://obsidian.md" + header @obsidian { + Access-Control-Allow-Origin "app://obsidian.md" Access-Control-Allow-Methods "OPTIONS,HEAD,GET,POST,PUT,PATCH,DELETE" + Access-Control-Allow-Credentials "true" + Access-Control-Allow-Headers "Authorization,Content-Type" + defer } @options method OPTIONS respond @options 204