diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2024-10-17 11:33:30 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2024-10-17 11:39:38 +0200 |
commit | d4b09c5c4be6cd3eb6810d34ef5308100187a2ef (patch) | |
tree | a4503038e3082c29653a7b370d202637ac672303 | |
parent | d524bf8cc771732b3b400c7f6fc9a485110a4524 (diff) | |
download | dots-d4b09c5c4be6cd3eb6810d34ef5308100187a2ef.tar.gz dots-d4b09c5c4be6cd3eb6810d34ef5308100187a2ef.zip |
Setup CORS in couchdb
-rw-r--r-- | modules/obsidian-livesync.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/obsidian-livesync.nix b/modules/obsidian-livesync.nix index 163c60d..c103165 100644 --- a/modules/obsidian-livesync.nix +++ b/modules/obsidian-livesync.nix @@ -32,6 +32,31 @@ in enable = true; adminPass = cfg.couchdb.adminPass; databaseDir = cfg.couchdb.databaseDir; + extraConfig = '' + [couchdb] + single_node=true + max_document_size = 50000000 + + [chttpd] + require_valid_user = true + max_http_request_size = 4294967296 + enable_cors = true + + [chttpd_auth] + require_valid_user = true + authentication_redirect = /_utils/session.html + + [httpd] + WWW-Authenticate = Basic realm="couchdb" + 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 + ''; }; services.nginx = { |