Version: 1.0.0 Status: Design Phase Project: Aoi-factory Knowledge Management System Repository: https://github.com/0xshugo/Knowledge-Curator
Syncthing-based Knowledge Sync System は、iPhone、Mac、VPS間でObsidian vaultをリアルタイム同期し、VPS上でAIエージェント(knowledge-curator)による自動処理を実現するシステムです。
- ✅ 3デバイス間同期: iPhone、Mac、VPSで双方向リアルタイム同期(< 5秒)
- ✅ AI自動処理: VPS上でファイル変更を検知し、knowledge-curatorが自動実行
- ✅ Git履歴管理: 1時間ごとに自動commitで完全な監査証跡を確保
- ✅ 暗号化バックアップ: Cloudflare R2へ日次バックアップ(GPG暗号化、365日保持)
- ✅ セキュリティ・バイ・デザイン: STRIDE脅威モデル、TLS 1.3、デバイス認証
| ドキュメント | 担当エージェント | 内容 |
|---|---|---|
| 01-requirements.md | product-strategist | 要件定義、ユースケース、KPI、ROI分析 |
| 02-security-design.md | security-architect | STRIDE脅威モデル、セキュリティ要件、緩和策 |
| 03-technical-architecture.md | tech-architect | システムアーキテクチャ、実装詳細、デプロイ計画 |
┌─────────────┐
│ iPhone │ ← Möbius Sync / Syncthing iOS
│ (Obsidian) │
└──────┬──────┘
│ TLS 1.3
▼
┌─────────────┐ ┌──────────────────────┐
│ Mac │ ←──→ │ VPS │
│ (Obsidian) │ │ - Syncthing Server │
└─────────────┘ │ - inotify-tools │
│ - knowledge-curator │
│ - Git (hourly) │
│ - Prometheus/Grafana│
└──────────────────────┘
│
▼
┌──────────────────────┐
│ External Services │
│ - GitHub (Git) │
│ - Cloudflare R2 │
│ - Claude API │
└──────────────────────┘
目標: 3デバイス間でSyncthing同期確立
- VPS Syncthing設定
- iPhone Syncthing設定
- Mac Syncthing設定
- 同期動作確認(< 5秒遅延)
ドキュメント: implementation/phase-1-basic-sync.md
目標: knowledge-curatorとファイル監視の統合
- inotify-tools導入
- file-monitor.sh + systemdサービス
- trigger-curator.sh(Docker実行)
- 動作確認(編集 → 30秒後にcurator起動)
ドキュメント: implementation/phase-2-ai-integration.md
目標: Git自動化、バックアップ、監視
- Git Repository初期化(GPG署名)
- auto-commit.sh + systemd timer(hourly)
- backup-daily.sh + Cloudflare R2
- Prometheus + Grafana導入
- ダッシュボード作成
ドキュメント: implementation/phase-3-monitoring.md
| コンポーネント | 技術 | バージョン |
|---|---|---|
| 同期エンジン | Syncthing | 1.27+ |
| OS(VPS) | Ubuntu Server | 22.04 LTS |
| ファイル監視 | inotify-tools | 3.22+ |
| AIエージェント | knowledge-curator | 1.0.0 |
| LLM | Claude API | Sonnet 4.5 |
| バージョン管理 | Git | 2.40+ |
| 監視 | Prometheus + Grafana | Latest |
| バックアップ | Cloudflare R2 | - |
| 暗号化 | GPG | 2.2+ |
| カテゴリ | 対策 |
|---|---|
| 通信暗号化 | TLS 1.3(Syncthing P2P通信) |
| デバイス認証 | Device whitelist(3デバイスのみ) |
| データ暗号化 | GPG暗号化(バックアップ) |
| 完全性保証 | Git commit署名(GPG) |
| 入力検証 | Path traversal防止(knowledge-curator) |
| 監査証跡 | Git履歴 + Prometheus logs |
セキュリティリスク評価: 🔴 HIGH (7.2/10) → 緩和策実装後 🟡 MEDIUM (4.5/10)
- 実装工数: 16時間
- コスト: ¥40,000
- 削減時間: 215分/月
- 削減コスト: ¥8,900/月
- 投資対効果: 167%
- 投資回収期間: 4.5ヶ月
- Ubuntu 22.04 LTS VPS(2 vCPU、4GB RAM、50GB SSD)
- iPhone(iOS 17+)
- Mac(macOS 14+)
- Claude API key
- Cloudflare R2アカウント
# 1. VPS Syncthing インストール
sudo apt update
sudo apt install syncthing
# 2. Syncthing起動
systemctl --user enable syncthing
systemctl --user start syncthing
# 3. Web UI アクセス
# http://VPS_IP:8384
# 4. デバイス追加
# iPhone、Macの Device ID を追加(config.xml)詳細: implementation/phase-1-basic-sync.md
すべての設定ファイルサンプルは config/ ディレクトリに格納されています:
config/syncthing-config.xml- Syncthing設定例config/docker-compose.yml- 監視スタック(Prometheus + Grafana)config/prometheus.yml- Prometheusメトリクス収集設定config/.env.example- 環境変数テンプレート
すべての実装用スクリプトは scripts/ ディレクトリに格納されています:
scripts/file-monitor.sh- ファイル変更監視(inotify)scripts/trigger-curator.sh- knowledge-curator起動スクリプトscripts/auto-commit.sh- Git hourly auto-commitscripts/backup-daily.sh- Cloudflare R2日次バックアップscripts/restore-from-r2.sh- R2からの復元スクリプト
- Syncthing Web UIで接続状態を確認:
http://VPS_IP:8384 - Relay Server経由の場合は遅延が増加(直接接続を推奨)
- ネットワーク帯域を確認
- ログ確認:
tail -f /var/log/sync-system/curator-execution.log - Docker実行確認:
docker ps -a | grep curator - Claude API key確認:
echo $ANTHROPIC_API_KEY
- SSH key確認:
ssh -T git@github.com - GPG key確認:
git config --global user.signingkey - リモートリポジトリ確認:
git remote -v
- GitHub Repository: https://github.com/0xshugo/Knowledge-Curator
- Aoi-factory Project: CLAUDE.md
- knowledge-curator Agent: .claude/agents/00-meta-governance/knowledge-curator.md
MIT License
- product-strategist - 要件定義
- security-architect - セキュリティ設計
- tech-architect - 技術アーキテクチャ
- governance-controller - 最終承認(予定)
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2025-12-10 | 初回設計完了(product-strategist, security-architect, tech-architect) |
Generated by: Aoi-factory Multi-Agent System Last Updated: 2025-12-10