You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support multiple Slack/GitHub project integrations with TUI (#38)
* feat: support multiple Slack/GitHub project integrations with TUI configuration
Add multi-project support allowing multiple Slack workspaces to be paired
with different GitHub repositories. Projects are managed via an interactive
TUI (tty-prompt) and stored in an AES-256-GCM encrypted config file.
Incoming requests are routed by Slack team_id with env var fallback for
full backward compatibility.
Closes#34
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address PR review feedback
- Log warning when config file exists but CONFIG_PASSPHRASE is unset
- Rescue ArgumentError in decrypt for corrupted/non-Base64 data
- Add blob length validation before attempting decryption
- Enforce unique slack_team_id in add_project and validate on update
- Require non-empty passphrases in TUI prompts
- Replace send() with explicit lambda dispatch table in menu loop
- Add required: true to team_id field in edit flow
- Show restart reminder when exiting TUI with configured projects
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DEBUG=false # Optional: set to 'true' for debug logging
105
+
CONFIG_PASSPHRASE= # Optional: passphrase to decrypt multi-project config (see Multi-Project Setup)
104
106
```
105
107
106
108
### Getting Tokens
@@ -155,6 +157,80 @@ You have two options for setting up your Slack app:
155
157
-`repo` (for private repositories) or `public_repo` (for public repositories only)
156
158
3. Copy the generated token
157
159
160
+
## Multi-Project Setup
161
+
162
+
The app supports connecting multiple Slack workspaces to different GitHub repositories. Each workspace-repository pair is stored as a "project" in an encrypted configuration file.
163
+
164
+
### How It Works
165
+
166
+
When the app receives a request from Slack, it extracts the workspace's `team_id` from the payload and looks up the matching project configuration to find the correct Slack bot token and GitHub token. If no match is found, it falls back to the `SLACK_BOT_TOKEN` and `GITHUB_TOKEN` environment variables.
167
+
168
+
This means existing single-project deployments require **no changes** -- they continue to work with just environment variables.
169
+
170
+
### Managing Projects
171
+
172
+
Use the interactive TUI (terminal user interface) to add, edit, remove, and list project integrations:
173
+
174
+
```bash
175
+
bundle exec rake config
176
+
# or directly:
177
+
bundle exec ruby bin/slack-gh-config
178
+
```
179
+
180
+
The TUI will guide you through:
181
+
182
+
1.**Setting a passphrase** (first run) or **entering your passphrase** (subsequent runs)
183
+
2.**Main menu** with options to:
184
+
-**Add project** -- provide a name, Slack team ID, Slack bot token, GitHub token, and optional default GitHub org
185
+
-**Edit project** -- update any field of an existing project
186
+
-**Remove project** -- delete a project configuration
187
+
-**List projects** -- display all configured projects in a table (tokens are masked)
188
+
189
+
### Finding Your Slack Team ID
190
+
191
+
Your Slack team ID (e.g., `T12345ABC`) can be found in:
192
+
- The URL when viewing your workspace in a browser: `https://app.slack.com/client/T12345ABC/...`
193
+
- Slack Admin Settings > About this workspace
194
+
195
+
### Running the App in Multi-Project Mode
196
+
197
+
Set the `CONFIG_PASSPHRASE` environment variable so the app can decrypt the configuration on startup:
0 commit comments