# Deploying NoteGraph ## VPS Setup (First Time) ### 1. SSH into VPS and set up ```bash ssh root@217.160.174.2 cd /opt git clone https://github.com/DoctoDre/NoteGraph.git cd NoteGraph # Configure cp .env.example .env nano .env # Set: SB_USER=admin:yourpassword ``` ### 2. Add Caddy reverse proxy entry Add to `/etc/caddy/Caddyfile`: ``` notes.andreknie.de { reverse_proxy localhost:3000 } ``` Then reload: ```bash systemctl reload caddy ``` ### 3. Start ```bash docker compose up -d ``` ### 4. DNS Add an A record: `notes.andreknie.de` → `217.160.174.2` ### 5. Access Open `https://notes.andreknie.de` — log in with the credentials from `.env`. ## Subsequent Deploys Push to `main` → GitHub Actions deploys automatically (pulls + restarts containers). ## Git-Backed Notes The `git-sync` container auto-commits note changes every 5 minutes. To push these to GitHub, set up a deploy key or token on the VPS: ```bash cd /opt/NoteGraph/notes git remote add origin https://github.com/DoctoDre/NoteGraph.git # Or use SSH key for push access ``` ## Architecture - **SilverBullet** runs on port 3000 (Docker) - **Caddy** handles HTTPS + reverse proxy - **Notes** stored as markdown in `./notes/` (mounted volume) - **Git-sync** container auto-commits changes