Skip to content

Commit

Permalink
Setup CORS in couchdb
Browse files Browse the repository at this point in the history
  • Loading branch information
pniedzwiedzinski committed Oct 17, 2024
1 parent d524bf8 commit d4b09c5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions modules/obsidian-livesync.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit d4b09c5

Please sign in to comment.