couchdb: added cors configuration for Obsidian

This commit is contained in:
Tigor Hutasuhut 2024-10-16 16:56:56 +07:00
parent 4ea9b683d5
commit b8cf4dd74e

View file

@ -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