46 lines
1.8 KiB
Markdown
46 lines
1.8 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 Host Path:**
|
|
- Copy the example env: `cp .env.example .env`
|
|
- Open `.env` and set `VAULT_HOST_PATH` to the **absolute path** of the folder on your computer where you want the notes to live.
|
|
- *Correct:* `/home/user/documents/my-vault`
|
|
- *Incorrect:* `./vault` (relative paths can be unpredictable in docker-compose)
|
|
|
|
3. **Set Sync Credentials:**
|
|
- Fill in `OBSIDIAN_VAULT_NAME` and `OBSIDIAN_SYNC_PASSWORD` (your E2EE key).
|
|
|
|
4. **Launch:**
|
|
```bash
|
|
docker-compose up -d
|
|
```
|
|
|
|
5. **First-Time Login:**
|
|
Because Obsidian Sync requires a secure login, you must authenticate the container once:
|
|
```bash
|
|
docker exec -it obsidian-sync-server ob login
|
|
```
|
|
Follow the instructions to log in. The session will be saved in the `./config` folder, so you won't have to do this again.
|
|
|
|
## How it Works
|
|
The container runs a continuous sync loop.
|
|
- **Cloud $\rightarrow$ Host:** Changes in Obsidian Sync are immediately downloaded to your `VAULT_HOST_PATH`.
|
|
- **Host $\rightarrow$ Cloud:** Any changes you make to the files in `VAULT_HOST_PATH` (via a local Obsidian app or text editor) are immediately pushed to the cloud.
|
|
|
|
## Environment Variables
|
|
| Variable | Description |
|
|
|----------|-------------|
|
|
| `OBSIDIAN_VAULT_NAME` | The name of the remote vault you want to sync |
|
|
| `OBSIDIAN_SYNC_PASSWORD` | Your end-to-end encryption password |
|
|
| `OBSIDIAN_DEVICE_NAME` | The name this device will have in your Sync history |
|
|
| `VAULT_HOST_PATH` | **Absolute path** to the vault folder on your host machine |
|