diff options
author | Patryk Niedźwiedziński <patryk@niedzwiedzinski.cyou> | 2024-10-17 17:58:50 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <patryk@niedzwiedzinski.cyou> | 2024-10-17 17:58:50 +0200 |
commit | ec2d857194a8c573cdcb76a59eada6a8e150ed19 (patch) | |
tree | 68e4d9d75461eed0cdf3bc8170d1749f924f8122 /modules | |
parent | 63df6f75b532931a1353884a883fb8425455bc26 (diff) | |
download | dots-ec2d857194a8c573cdcb76a59eada6a8e150ed19.tar.gz dots-ec2d857194a8c573cdcb76a59eada6a8e150ed19.zip |
Setup obsidian-livesync
Diffstat (limited to 'modules')
-rw-r--r-- | modules/obsidian-livesync.nix | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/modules/obsidian-livesync.nix b/modules/obsidian-livesync.nix index 5841202..cfad4f3 100644 --- a/modules/obsidian-livesync.nix +++ b/modules/obsidian-livesync.nix @@ -58,14 +58,12 @@ in [httpd] WWW-Authenticate = Basic realm="couchdb" + enable_cors = true bind_address = 127.0.0.1 - + [cors] - origins = app://obsidian.md, capacitor://localhost, http://localhost - credentials = true - headers = accept, authorization, content-type, origin, referer - methods = GET,PUT,POST,HEAD,DELETE - max_age = 3600 + #origins = app://obsidian.md,capacitor://localhost,http://localhost + #credentials = true ''; }; @@ -81,17 +79,13 @@ in proxy_set_header X-Real-IP "$remote_addr"; proxy_set_header X-Forwarded-For "$proxy_add_x_forwarded_for"; proxy_set_header X-Forwarded-Proto "$scheme"; - add_header Access-Control-Allow-Origin "app://obsidian.md"; - add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"; - add_header Access-Control-Allow-Headers "Content-Type, Authorization"; - add_header Access-Control-Allow-Credentials "true"; - add_header Access-Control-Max-Age 86400; + add_header Access-Control-Allow-Origin "app://obsidian.md" always; + add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" always; + add_header Access-Control-Allow-Headers "Content-Type, Authorization" always; + add_header Access-Control-Allow-Credentials "true" always; + add_header Access-Control-Max-Age 86400 always; if ($request_method = OPTIONS) { - add_header Access-Control-Allow-Origin "app://obsidian.md"; - add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"; - add_header Access-Control-Allow-Headers "Content-Type, Authorization"; - add_header Access-Control-Allow-Credentials "true"; return 204; } ''; |