Skip to content

tako0614/yurucommu

Yurucommu

Yurucommu はセルフホスト型・一人用の ActivityPub プロダクトです。

自分のドメイン、自分のデータ、小さなコミュニティ単位のつながりを前提に設計されています。

この repo 単体で、runtime model、ローカル開発、deploy の大枠が追える状態を保つことを目指します。

特徴

  • セルフホスト前提で、Cloudflare ベースの低コスト運用を目指す
  • ActivityPub 互換で、Mastodon や Misskey 系との相互接続を意識する
  • アルゴリズムよりも小さなコミュニティや趣味単位のつながりを重視する

目指す方向

  • recommendation feed より human-scale な関係性
  • mass-audience timeline より community-sized な場
  • identity、domain、data を自分で持てる self-hosted 性
  • ActivityPub による standards-based federation

技術スタック

  • Runtime: Cloudflare Workers
  • Database: Cloudflare D1
  • Storage: Cloudflare R2
  • Backend: Hono
  • Web UI: SolidJS + Vite
  • Protocol: ActivityPub

Repository Map

  • src/backend: Hono route、middleware、runtime code、backend test
  • src/db: schema と database 関連コード
  • src/plugin: 再利用可能な plugin surface
  • src/runtime: runtime helper
  • web/: Vite ベースの web UI
  • site/: プロジェクトサイト用の静的ファイル
  • migrations/: database migration
  • wrangler.tomlwrangler.tenant2.tomlwrangler.local.tomlwrangler.site.toml: deploy / environment 別設定

Quickstart

cd yurucommu
deno task dev

これは wrangler.local.toml を使った Cloudflare Worker 前提のローカル開発フローを起動します。

web UI の開発:

cd yurucommu
deno task dev:web

テスト・lint:

cd yurucommu
deno task test
deno task lint

database helper:

cd yurucommu
deno task db:generate
deno task db:push
deno task db:studio

Deploy

アプリ本体:

cd yurucommu
deno task deploy

現在 commit されている wrangler.tomltest.yurucommu.com 向けの本体 Worker 設定です。別の production hostname で運用する場合は、APP_URL[[routes]].pattern をその canonical hostname に合わせてから deploy します。 wrangler.tenant2.tomltest2.yurucommu.com 向けの別 tenant/test 設定です。 .env.exampleAPP_URL=https://app.yurucommu.com は self-host 用の例であり、 checked-in wrangler*.toml の実デプロイ先とは別です。

Takos 向け experimental bundle:

cd yurucommu
deno task build:takos-worker

.takos/app.ymldist/takos-worker.js を deploy artifact として扱います。 この bundle は web UI を worker に内包するため、Takos 側で ASSETS が無くても 画面は配信できます。/healthz は bootstrap 用の liveness probe で、binding 欠落がある場合も degraded を 200 で返します。Takos manifest readiness は初回 resource bootstrap が詰まらないよう /healthz を使います。runtime binding の strict 確認には /readyz を使います。 YURUCOMMU_STRICT_READINESS=1 を設定すると /healthz も binding 欠落時に 503 を返します。

ただし canonical ActivityPub identity を固定する production では APP_URL を deploy env / manifest override で明示してください。runtime binding は .takos/app.ymlresourcesDB / MEDIA / KV / DELIVERY_QUEUE / DELIVERY_DLQ として宣言済みです。queue consumer は .takos/app.ymlcompute.web.triggers.queuesDELIVERY_QUEUE を primary consumer、DELIVERY_DLQ を dead-letter queue かつ DLQ reconciliation consumer として宣言します。manifest は DELIVERY_QUEUE_NAME=yurucommu-deliveryDELIVERY_DLQ_NAME=yurucommu-delivery-dlq も明示し、Takos resource 名と runtime dispatch 名を一致させます。

Takos deploy の目安:

cd yurucommu

# 1. manifest resources / bindings / queue consumers を含めて deploy する
takos deploy --group yurucommu

# 2. D1 migration を適用する
deno task takos:migrate

# 3. migration 後の strict readiness を確認し、必要なら再 deploy する
takos deploy --group yurucommu

queue 名を変えた環境では DELIVERY_QUEUE_NAME / DELIVERY_DLQ_NAME を worker env に設定してください。未設定時は yurucommu-delivery / yurucommu-delivery-dlq を consumer queue 名として扱います。

静的サイト:

cd yurucommu
deno run -A npm:wrangler deploy --config wrangler.site.toml

設定メモ

  • ローカル設定は .env.example を起点にする
  • tracked config は OSS に安全な値だけを置き、secret や本番専用 ID は commit しない
  • public behavior を変えたら、コードと一緒に README.md や example も更新する

ドキュメント方針

現状の Yurucommu は、README と in-repo config example を public entrypoint の中心にしています。 今後 docs を増やしても、この README は短い overview と navigation の役割を維持します。

ライセンスと貢献

ライセンスは GNU AGPL v3 です。詳細は LICENSE を参照してください。

貢献方針は CONTRIBUTING.md、脆弱性報告は SECURITY.md を参照してください。

About

web自主用分散型SNS「yurucommu」

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors