Obsidian Sync Server
A secure file sync server for two-way synchronization between Clawdbot and Obsidian.
📦 This skill is part of obsidian-openclaw
An Obsidian plugin that lets you chat with your Clawdbot agent and sync notes between your vault and the agent's workspace.
Quick Start
CODEBLOCK0
Configuration
| Environment Variable | Default | Description |
|---|
| INLINECODE0 | INLINECODE1 | Server port |
| INLINECODE2 |
localhost | Bind address |
|
SYNC_WORKSPACE |
/data/clawdbot | Root workspace path |
|
SYNC_TOKEN | (required) | Auth token (use Gateway token) |
|
SYNC_ALLOWED_PATHS |
notes,memory | Comma-separated allowed subdirectories |
Security
- - Only configured subdirectories are accessible
- Path traversal (
../) is blocked - All requests require INLINECODE10
- Bind to localhost; expose via Tailscale serve for remote access
API Endpoints
| Method | Endpoint | Description |
|---|
| GET | INLINECODE11 | Health check |
| GET |
/sync/list?path=notes | List markdown files |
| GET |
/sync/read?path=notes/x.md | Read file + metadata |
| POST |
/sync/write?path=notes/x.md | Write file (conflict detection) |
Exposing via Tailscale
CODEBLOCK1
Running as a Service
User systemd service
CODEBLOCK2
Obsidian Plugin
This skill provides the backend for the OpenClaw Obsidian plugin:
github.com/AndyBold/obsidian-openclaw
The plugin provides:
- - 💬 Chat sidebar — Talk to your Clawdbot agent from Obsidian
- 📁 File actions — Create, edit, delete notes via conversation
- 🔄 Two-way sync — Keep notes synchronized between vault and agent
- 🔒 Secure storage — OS keychain integration for tokens
- 📋 Audit logging — Track all file operations
Install the plugin via BRAT using: INLINECODE15
Obsidian 同步服务器
一个安全的文件同步服务器,用于 Clawdbot 与 Obsidian 之间的双向同步。
📦 本技能是 obsidian-openclaw 的一部分
一个 Obsidian 插件,可让您与 Clawdbot 代理聊天,并在您的知识库与代理的工作空间之间同步笔记。
快速开始
bash
SYNC_TOKEN=your-gateway-token node scripts/sync-server.mjs
配置
| 环境变量 | 默认值 | 描述 |
|---|
| SYNCPORT | 18790 | 服务器端口 |
| SYNCBIND |
localhost | 绑定地址 |
| SYNC_WORKSPACE | /data/clawdbot | 根工作空间路径 |
| SYNC_TOKEN | (必填) | 认证令牌(使用网关令牌) |
| SYNC
ALLOWEDPATHS | notes,memory | 逗号分隔的允许子目录 |
安全性
- - 仅可访问已配置的子目录
- 路径遍历(../)被阻止
- 所有请求需要 Authorization: Bearer 头
- 绑定到 localhost;通过 Tailscale serve 暴露以实现远程访问
API 端点
| 方法 | 端点 | 描述 |
|---|
| GET | /sync/status | 健康检查 |
| GET |
/sync/list?path=notes | 列出 Markdown 文件 |
| GET | /sync/read?path=notes/x.md | 读取文件 + 元数据 |
| POST | /sync/write?path=notes/x.md | 写入文件(冲突检测) |
通过 Tailscale 暴露
bash
tailscale serve --bg --https=18790 http://localhost:18790
作为服务运行
用户 systemd 服务
bash
mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/openclaw-sync.service << EOF
[Unit]
Description=OpenClaw 同步服务器
After=network.target
[Service]
Type=simple
Environment=SYNC_TOKEN=your-token-here
Environment=SYNC_WORKSPACE=/data/clawdbot
Environment=SYNCALLOWEDPATHS=notes,memory
ExecStart=/usr/bin/node /path/to/skills/obsidian-sync/scripts/sync-server.mjs
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
EOF
systemctl --user daemon-reload
systemctl --user enable --now openclaw-sync
loginctl enable-linger $USER # 开机启动
Obsidian 插件
本技能为 OpenClaw Obsidian 插件 提供后端支持:
github.com/AndyBold/obsidian-openclaw
该插件提供:
- - 💬 聊天侧边栏 — 在 Obsidian 中与您的 Clawdbot 代理对话
- 📁 文件操作 — 通过对话创建、编辑、删除笔记
- 🔄 双向同步 — 保持知识库与代理之间的笔记同步
- 🔒 安全存储 — 集成操作系统钥匙串管理令牌
- 📋 审计日志 — 跟踪所有文件操作
通过 BRAT 使用以下地址安装插件:AndyBold/obsidian-openclaw