docs: clarify host path mapping and volume configuration
This commit is contained in:
+11
-2
@@ -1,7 +1,16 @@
|
|||||||
# Obsidian Sync Configuration
|
# Obsidian Sync Configuration
|
||||||
|
|
||||||
|
# 1. Remote Vault Details
|
||||||
OBSIDIAN_VAULT_NAME=MyVault
|
OBSIDIAN_VAULT_NAME=MyVault
|
||||||
OBSIDIAN_SYNC_PASSWORD=your_encryption_password_here
|
OBSIDIAN_SYNC_PASSWORD=your_encryption_password_here
|
||||||
OBSIDIAN_DEVICE_NAME=Docker-Sync-Server
|
OBSIDIAN_DEVICE_NAME=Docker-Sync-Server
|
||||||
|
|
||||||
|
# 2. Local Filesystem Mapping
|
||||||
|
# IMPORTANT: Use an ABSOLUTE PATH here.
|
||||||
|
# This is where your notes will be stored on your actual computer/server.
|
||||||
|
# Example: /home/travis/my-obsidian-vault
|
||||||
|
VAULT_HOST_PATH=/path/to/your/local/vault
|
||||||
|
|
||||||
|
# 3. Authentication
|
||||||
|
# Leave blank if you prefer to run 'docker exec -it obsidian-sync-server ob login'
|
||||||
OBSIDIAN_SYNC_TOKEN=
|
OBSIDIAN_SYNC_TOKEN=
|
||||||
# The path on the host where the vault will be mirrored
|
|
||||||
VAULT_HOST_PATH=./vault
|
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
A headless Docker container that uses `obsidian-headless` to keep a local vault directory synchronized with Obsidian Sync.
|
A headless Docker container that uses `obsidian-headless` to keep a local vault directory synchronized with Obsidian Sync.
|
||||||
|
|
||||||
## Architecture
|
|
||||||
- **Base Image:** Node.js 20 Slim
|
|
||||||
- **Sync Engine:** `obsidian-headless` (Official CLI)
|
|
||||||
- **Mode:** Continuous Sync (Watches for changes and pushes/pulls in real-time)
|
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
1. **Clone the repo:**
|
1. **Clone the repo:**
|
||||||
@@ -15,30 +10,31 @@ A headless Docker container that uses `obsidian-headless` to keep a local vault
|
|||||||
cd obsidian-sync-server
|
cd obsidian-sync-server
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Configure Environment:**
|
2. **Configure the Host Path:**
|
||||||
```bash
|
- Copy the example env: `cp .env.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.
|
||||||
# Edit .env with your vault name, E2EE password, and device name
|
- *Correct:* `/home/user/documents/my-vault`
|
||||||
nano .env
|
- *Incorrect:* `./vault` (relative paths can be unpredictable in docker-compose)
|
||||||
```
|
|
||||||
|
|
||||||
3. **Launch:**
|
3. **Set Sync Credentials:**
|
||||||
|
- Fill in `OBSIDIAN_VAULT_NAME` and `OBSIDIAN_SYNC_PASSWORD` (your E2EE key).
|
||||||
|
|
||||||
|
4. **Launch:**
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
4. **First-Time Login:**
|
5. **First-Time Login:**
|
||||||
The `obsidian-headless` tool requires an initial login to your Obsidian account.
|
Because Obsidian Sync requires a secure login, you must authenticate the container once:
|
||||||
```bash
|
```bash
|
||||||
docker exec -it obsidian-sync-server ob login
|
docker exec -it obsidian-sync-server ob login
|
||||||
```
|
```
|
||||||
Follow the on-screen instructions to authenticate. Once logged in, the container will automatically proceed to `sync-setup` and `sync --continuous`.
|
Follow the instructions to log in. The session will be saved in the `./config` folder, so you won't have to do this again.
|
||||||
|
|
||||||
## Interaction
|
## How it Works
|
||||||
Since this is a headless server, you interact with your vault by:
|
The container runs a continuous sync loop.
|
||||||
- **Filesystem:** Accessing the `./vault` folder on your host machine.
|
- **Cloud $\rightarrow$ Host:** Changes in Obsidian Sync are immediately downloaded to your `VAULT_HOST_PATH`.
|
||||||
- **Local Obsidian:** Opening the `./vault` folder in your local Obsidian app.
|
- **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.
|
||||||
- **CLI:** Running commands via `docker exec obsidian-sync-server ob <command>`.
|
|
||||||
|
|
||||||
## Environment Variables
|
## Environment Variables
|
||||||
| Variable | Description |
|
| Variable | Description |
|
||||||
@@ -46,4 +42,4 @@ Since this is a headless server, you interact with your vault by:
|
|||||||
| `OBSIDIAN_VAULT_NAME` | The name of the remote vault you want to sync |
|
| `OBSIDIAN_VAULT_NAME` | The name of the remote vault you want to sync |
|
||||||
| `OBSIDIAN_SYNC_PASSWORD` | Your end-to-end encryption password |
|
| `OBSIDIAN_SYNC_PASSWORD` | Your end-to-end encryption password |
|
||||||
| `OBSIDIAN_DEVICE_NAME` | The name this device will have in your Sync history |
|
| `OBSIDIAN_DEVICE_NAME` | The name this device will have in your Sync history |
|
||||||
| `OBSIDIAN_SYNC_TOKEN` | (Optional) A session token to bypass interactive login |
|
| `VAULT_HOST_PATH` | **Absolute path** to the vault folder on your host machine |
|
||||||
|
|||||||
+5
-1
@@ -6,7 +6,11 @@ services:
|
|||||||
container_name: obsidian-sync-server
|
container_name: obsidian-sync-server
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./vault:/vault
|
# Map your local host folder to the container's vault folder
|
||||||
|
# Syntax: - /absolute/path/on/your/host:/vault
|
||||||
|
- ${VAULT_HOST_PATH}:/vault
|
||||||
|
|
||||||
|
# Persist the sync session and config so you don't have to 'ob login' on every restart
|
||||||
- ./config:/root/.config/obsidian-headless
|
- ./config:/root/.config/obsidian-headless
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
|||||||
Reference in New Issue
Block a user