System_Architecture.md
📱 How to Add to Obsidian:
- Open Obsidian on your Android
- Create folder: 00_Meta/DevLogs/
- Create new note: System_Architecture
- Tap "Copy Content" button below
- Paste into your note
- Save - it will auto-sync! ✅
# System Architecture - Obsidian Hybrid Stack
**Created:** 2026-02-12
**Last Updated:** 2026-02-12
**Status:** ✅ Production
---
## 🏗️ Infrastructure Overview
This is a self-hosted Obsidian hybrid stack designed for cross-device note synchronization and web-based access.
### Technology Stack
| Component | Technology | Purpose |
|-----------|-----------|---------|
| **Sync Backend** | CouchDB 3 | Real-time synchronization across devices |
| **Web Interface** | LinuxServer Obsidian | Browser-based vault access (REMOVED) |
| **Reverse Proxy** | Nginx + Let's Encrypt | HTTPS termination and routing |
| **Orchestration** | Docker Compose | Service management |
---
## 🔌 Service Endpoints
| Service | Internal Port | External Port | Public URL |
|---------|--------------|---------------|------------|
| **CouchDB Sync** | 5984 | 8092 | https://couchdb.nocturnefox.com |
---
## 🔐 Authentication
### CouchDB Admin Credentials
- **Username:** `obsidian_admin`
- **Password:** `ANTIquity9!0*`
- **Admin Panel:** https://couchdb.nocturnefox.com/_utils
### Security Notes
- All traffic encrypted via HTTPS (Let's Encrypt)
- CORS enabled for mobile app connections
- Max upload size: 100MB (configured in Nginx)
---
## 📁 Data Persistence
### Docker Volumes
```
obsidian-stack_couchdb-data → /opt/couchdb/data
obsidian-stack_couchdb-config → /opt/couchdb/etc/local.d
```
### Vault Location
- **Host Path:** `/var/lib/docker/volumes/obsidian-stack_obsidian-vaults/_data`
- **This File:** `00_Meta/DevLogs/System_Architecture.md`
---
## 🚀 Deployment Details
### Docker Compose Location
`/root/services/obsidian-stack/docker-compose.yml`
### Environment Configuration
`/root/services/obsidian-stack/.env`
### Service Management
```bash
cd /root/services/obsidian-stack
docker compose up -d # Start services
docker compose down # Stop services
docker compose logs -f # View logs
docker compose ps # Check status
```
---
## 🔄 Backup Strategy
### Critical Data
1. **CouchDB Database:** `obsidian-stack_couchdb-data` volume
2. **Configuration:** `/root/services/obsidian-stack/.env`
### Backup Commands
```bash
# Backup CouchDB
docker exec obsidian-couchdb couchdb-backup > couchdb-backup-$(date +%Y%m%d).json
# Backup Vaults
tar -czf obsidian-vaults-backup-$(date +%Y%m%d).tar.gz \
/var/lib/docker/volumes/obsidian-stack_obsidian-vaults/_data
```
---
## 🧠 Memory Protocol
This vault includes an automated documentation system for AI agents:
1. **Startup Protocol:** Agents MUST read this file before making changes
2. **Shutdown Protocol:** Agents MUST append summaries to `ChangeLog.md`
3. **Context Preservation:** All architectural decisions documented here
---
## 🛠️ Maintenance
### SSL Certificate Renewal
Certificates managed by Certbot (auto-renewal enabled)
### Health Checks
```bash
# Check service health
curl -f http://localhost:8092/_up # CouchDB
# Check HTTPS endpoints
curl -I https://couchdb.nocturnefox.com
```
---
## 📋 Troubleshooting
### Common Issues
**CouchDB not accessible:**
```bash
docker logs obsidian-couchdb
docker inspect obsidian-couchdb --format='{{.State.Health.Status}}'
```
**Sync issues:**
- Verify CORS is enabled
- Check credentials in Obsidian app
- Ensure internet connection
---
## 🔗 Related Documentation
- `ChangeLog.md` - Development history and changes
- `/root/services/obsidian-stack/README.md` - Setup guide
- `/root/services/obsidian-stack/CLAUDE.md` - AI agent instructions
---
**Last Architecture Review:** 2026-02-12
**Next Review Due:** 2026-03-12
ChangeLog.md
📱 How to Add to Obsidian:
- In the same 00_Meta/DevLogs/ folder
- Create new note: ChangeLog
- Tap "Copy Content" button below
- Paste into your note
- Save - it will auto-sync! ✅
# Development ChangeLog **Purpose:** Track all system changes, deployments, and maintenance activities. **Protocol:** AI agents MUST append a summary before ending each session. --- ## 2026-02-12 - Initial Setup (Claude Sonnet 4.5) ### Summary Established Memory Protocol for automated AI documentation within Obsidian vault. ### Changes Made 1. ✅ Created folder structure: `00_Meta/DevLogs/` 2. ✅ Created `System_Architecture.md` with full infrastructure documentation 3. ✅ Created `ChangeLog.md` (this file) for session tracking 4. ✅ Created `/root/services/obsidian-stack/CLAUDE.md` with agent instructions ### Infrastructure Status - **CouchDB Sync:** ✅ Running (https://couchdb.nocturnefox.com) - **Reverse Proxy:** ✅ Configured (Nginx + Let's Encrypt) - **Memory Protocol:** ✅ Active ### Services Verified - Docker containers: `obsidian-couchdb` (healthy) - Nginx virtual host: couchdb.nocturnefox.com - Data volumes: CouchDB volumes created and mounted ### Next Steps - [x] User configured Obsidian sync plugin with CouchDB credentials - [x] User syncing successfully on Android - [ ] Consider setting up automated backups via cron --- ## 2026-02-12 - Removed Obsidian Web Interface (Claude Sonnet 4.5) ### Summary Successfully removed resource-heavy Obsidian Web container after confirming Android sync works. System now only runs CouchDB for sync functionality. ### Changes Made 1. ✅ Stopped and removed obsidian-web container 2. ✅ Commented out obsidian service in docker-compose.yml 3. ✅ Disabled nginx virtual host for obsidian.nocturnefox.com 4. ✅ Reloaded nginx configuration 5. ✅ Verified CouchDB still healthy and accessible ### Services Status - **CouchDB:** ✅ Running (https://couchdb.nocturnefox.com) - **Obsidian Web:** ❌ Removed (no longer needed) - **Android Sync:** ✅ Working ### Resource Savings - Removed: ~300-500MB RAM usage from Obsidian Web container - Reduced: 1 fewer container to manage - Freed: Ports 8093, 8094 now available ### Fixes Applied - ✅ Enabled CORS on CouchDB (required for mobile app connections) - ✅ Configured: origins=*, credentials=true, methods=GET/PUT/POST/HEAD/DELETE ### Next Steps - [x] User tested Android sync - working perfectly - [ ] Consider automated CouchDB backups - [ ] Add Memory Protocol files to user's Obsidian vault --- ## Template for Future Entries ```markdown ## YYYY-MM-DD - [Brief Title] ([Agent Name]) ### Summary [One-line description of what was changed/fixed/added] ### Changes Made - [List of specific changes] ### Files Modified - [File paths with brief description] ### Testing Performed - [How changes were verified] ### Issues Encountered - [Any problems and their solutions] ### Next Steps - [ ] [Actionable items for future work] ``` --- **Last Updated:** 2026-02-12 11:30 UTC **Total Sessions:** 2