From 5f53df0070412368dda7246793d3abe90cef6513 Mon Sep 17 00:00:00 2001 From: ginnoir Date: Sat, 6 Jun 2026 03:15:17 -0500 Subject: [PATCH] feat(notes): add Obsidian livesync stack (CouchDB) + Caddy entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stacks/notes/: new stack with CouchDB 3 for obsidian-livesync sync backend. Vault data at /config/couchdb/data; CORS must be configured post-deploy via Fauxton (/_utils). Claude integration via CouchDB REST API documented in compose comments. Caddyfile: obsidian.ginnoir.com → couchdb:5984 (public for mobile sync). --- Caddyfile | 7 ++++++ stacks/notes/docker-compose.yml | 43 +++++++++++++++++++++++++++++++++ stacks/notes/stack.env | 6 +++++ 3 files changed, 56 insertions(+) create mode 100644 stacks/notes/docker-compose.yml create mode 100644 stacks/notes/stack.env diff --git a/Caddyfile b/Caddyfile index a95bc80..a7fbf4c 100644 --- a/Caddyfile +++ b/Caddyfile @@ -271,4 +271,11 @@ plane.ginnoir.com { handle { reverse_proxy plane_web:3000 } +} + +# ============================================================= +# NOTES / PKM — public (obsidian-livesync syncs from any device) +# ============================================================= +obsidian.ginnoir.com { + reverse_proxy couchdb:5984 } \ No newline at end of file diff --git a/stacks/notes/docker-compose.yml b/stacks/notes/docker-compose.yml new file mode 100644 index 0000000..7f106ec --- /dev/null +++ b/stacks/notes/docker-compose.yml @@ -0,0 +1,43 @@ +# notes stack — personal knowledge base / PKM backbone. +# +# CouchDB powers obsidian-livesync for real-time Obsidian vault sync +# across all devices. Vault data lives at /config/couchdb/data on SSD. +# +# POST-DEPLOY (one-time setup): +# 1. Open https://obsidian.ginnoir.com/_utils and sign in as admin. +# 2. Settings → CORS → Enable CORS, add origins: +# app://obsidian.md +# capacitor://localhost +# http://localhost +# 3. In Obsidian: install the "Self-hosted LiveSync" plugin, +# point it at https://obsidian.ginnoir.com with your creds. +# 4. Let the setup wizard create the 'obsidian' database. +# +# Claude integration: +# The CouchDB REST API is the read/write surface for the vault. +# All notes are docs in the 'obsidian' database. +# GET https://obsidian.ginnoir.com/obsidian/_all_docs?include_docs=true +# returns all notes; each doc has a 'data' field with the markdown content. + +services: + couchdb: + container_name: couchdb + image: couchdb:3 + restart: unless-stopped + networks: [notes, edge] + environment: + COUCHDB_USER: ${COUCHDB_USER} + COUCHDB_PASSWORD: ${COUCHDB_PASSWORD} + volumes: + - /config/couchdb/data:/opt/couchdb/data + - /config/couchdb/etc:/opt/couchdb/etc/local.d + ports: + - "5984:5984" + +networks: + notes: + name: notes + driver: bridge + edge: + name: edge + external: true diff --git a/stacks/notes/stack.env b/stacks/notes/stack.env new file mode 100644 index 0000000..047ec73 --- /dev/null +++ b/stacks/notes/stack.env @@ -0,0 +1,6 @@ +# notes stack secrets — CouchDB for Obsidian livesync + +# CouchDB admin credentials. +# Used by: obsidian-livesync plugin, CouchDB Fauxton admin UI at /_utils. +COUCHDB_USER=admin +COUCHDB_PASSWORD=couchdb_obs_p4ss_7x9k