Slack コマンドでホワイトボードを作って共同編集。
/wb: 部屋を作る/wb status: 状態を取得
以下は production 環境にデプロイする前提。
- Cloudflare アカウントを用意、 Workers と Durable Objects を使える状態にする(有料プラン)
- このリポジトリをクローン
- wrangler.toml の
account_idを更新 npm cinpx wrangler loginnpx wrangler publish --env productionnpx wrangler secret put --env production <name>- DEBUG_API:
false - SLACK_APP:
true
- DEBUG_API:
最低限、以下を設定(任意で各種説明やアイコン logo.png などを設定)
- Slack アプリを作る
- Slash コマンドを設定
- Command:
/wb - Request URL:
https://whiteboard.{}.workers.dev/app/slack
- Command:
- Slack アプリをワークスペースにインストール
npx wrangler secret put --env production <name>- SLACK_SIGNING_SECRET:
xxxxx - SLACK_TEAM_DOMAIN:
xxxxx
- SLACK_SIGNING_SECRET:
以下のどちらかを設定する。
- GitHub アプリを作る
- Redirect URL:
https://whiteboard.{}.workers.dev/callback/github
- Redirect URL:
npx wrangler secret put --env production <name>- AUTH_TYPE:
github - COOKIE_SECRET:
xxxxxxx - GITHUB_CLIENT_ID:
xxxxx - GITHUB_CLIENT_SECRET:
xxxxx - GITHUB_ORG:
xxxxx
- AUTH_TYPE:
- Slack アプリの OAuth 設定:
- Redirect URL:
https://whiteboard.{}.workers.dev/callback/slack - Bot Token Scopes:
commands - User Token Scopes:
identity.avatar,identity.basic
- Redirect URL:
- Slack アプリを public distribution する
npx wrangler secret put --env production <name>- AUTH_TYPE:
slack - COOKIE_SECRET:
xxxxxxx - SLACK_CLIENT_ID:
xxxxx - SLACK_CLIENT_SECRET:
xxxxx - SLACK_TEAM_DOMAIN:
xxxxx
- AUTH_TYPE:
.env.production に変数を書く
DEBUG_API=false
SLACK_APP=true
...
以下のコマンドで同期する
npm run sync-env -- production