about summary refs log tree commit diff
path: root/modules/obsidian-livesync.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/obsidian-livesync.nix')
-rw-r--r--modules/obsidian-livesync.nix25
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 = {