Install couchdb
Step 1: Create local config
Edit the local.ini
[couchdb]
single_node=true
max_document_size = 50000000
[chttpd]
require_valid_user = true
max_http_request_size = 4294967296
[chttpd_auth]
require_valid_user = true
authentication_redirect = /e=_/_utils/session.html
[httpd]
WWW-Authenticate = Basic realm="couchdb"
enable_cors = true
[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
If your are going to bind with physical directory, put your local.ini
inside the physical directory.
Step 2: Deploy couchdb with docker compose
Edit the docker-compose.yml
# If bind with named volumes
volumes:
couchdb:
name: couchdb
services:
couchdb:
image: docker.kamasylvia.com/couchdb:3.4.3
container_name: couchdb
ports:
- "5984:5984"
environment:
- COUCHDB_USER=<Your username>
- COUCHDB_PASSWORD=<Your password>
- TZ=Asia/Shanghai
volumes:
# The files' owner will be id:5984 when you launch the image.
# Because CouchDB writes on-the-fly configurations into local.ini.
# So when you want to perform git pull or change something, you have to change owners back.
- couchdb:/opt/couchdb
# If bind with local directory, use the following.
# - ./data:/opt/couchdb/data
# - ./conf/local.ini:/opt/couchdb/etc/local.ini
# If you want to use named volume with subpath
# - type: volume
# source: couchdb
# volume:
# subpath: opt/couchdb/data
# target: /opt/couchdb/data
# - type: volume
# source: couchdb
# volume:
# subpath: opt/couchdb/etc/local.ini
# target: /opt/couchdb/etc/local.ini
restart: unless-stopped
If bind with docker volume, copy the local.ini
into couchdb
container.
docker cp path/to/local.ini couchdb:/opt/couchdb/etc/local.ini
Then restart couchdb
container.
Step 3: LiveSync configs
- Install LiveSync plugin.
- Manual setup.
- Remote type: CouchDB
- Server URI: your couchdb URL
- Use JWT instead of Basic Authentication: Off
- Username: your username
- Password: your password
- Database name: obsidian
- Database name can be changed as you like.
- There is no need to create a database in advance.
- The database name must be in lowercase.
- Test -> Check -> Apply
- End-to-End encryption: On
- Passphrase: your passphrase
- Path obfuscation: On
- Sync settings:\
- Deletion propagation\
- Use the trash bin: On\
- Keep empty folder: On\
- Hidden files: Enabled\
- Scan for hidden files before replication: On
- Customization sync:\
- Enable customization sync: On