56 lines
2.0 KiB
Markdown
56 lines
2.0 KiB
Markdown
# Obsidian Sync Server
|
|
|
|
A headless Docker container that uses `obsidian-headless` to keep a local vault directory synchronized with Obsidian Sync.
|
|
|
|
## Quick Start
|
|
|
|
1. **Clone the repo:**
|
|
```bash
|
|
git clone https://gitea-wc4w40kskg0c4g400s0wcgsg.coolify-7dou.ja7z.net/hermes/obsidian-sync-server.git
|
|
cd obsidian-sync-server
|
|
```
|
|
|
|
2. **Configure the environment:**
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
Open `.env` and fill in:
|
|
- `VAULT_HOST_PATH` — **Absolute path** on your host where notes will be stored (e.g. `/home/user/my-vault`)
|
|
- `OBSIDIAN_VAULT_NAME` — Name of your remote Obsidian Sync vault
|
|
- `OBSIDIAN_SYNC_PASSWORD` — Your end-to-end encryption password
|
|
- `OBSIDIAN_DEVICE_NAME` — How this device appears in your Sync history
|
|
|
|
3. **Log in (one-time setup):**
|
|
```bash
|
|
./login.sh
|
|
```
|
|
This spins up a temporary container just for authentication. Your session is saved to the `./config` folder and will be reused by the main container automatically. You only need to do this once.
|
|
|
|
4. **Start the sync server:**
|
|
```bash
|
|
docker-compose up -d
|
|
```
|
|
The container will now run continuously, syncing your vault in both directions.
|
|
|
|
## How it Works
|
|
|
|
The container runs `ob sync --continuous` which:
|
|
- **Cloud → Host:** Pulls changes from Obsidian Sync down to your `VAULT_HOST_PATH`
|
|
- **Host → Cloud:** Pushes any local file changes back up to the cloud
|
|
|
|
If the container starts and is not logged in, it will print instructions and sleep (instead of crash-looping) so you can run `./login.sh`.
|
|
|
|
## Environment Variables
|
|
|
|
| Variable | Description |
|
|
|----------|-------------|
|
|
| `VAULT_HOST_PATH` | **Absolute path** to the vault folder on your host machine (e.g. `/home/user/my-vault`) |
|
|
| `OBSIDIAN_VAULT_NAME` | The name of the remote vault to sync |
|
|
| `OBSIDIAN_SYNC_PASSWORD` | Your end-to-end encryption password |
|
|
| `OBSIDIAN_DEVICE_NAME` | Device name shown in Sync version history |
|
|
|
|
## Requirements
|
|
|
|
- Docker & Docker Compose
|
|
- An active [Obsidian Sync](https://obsidian.md/sync) subscription
|