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
{{ message }}
Repository navigation
Add GitHub intake mode and whitelist helpers for setup #1606
Setup must guide users through GitHub event ingestion choices and user whitelisting. The request specifically asks for the default ProPR App mode, polling, or direct webhooks, with brief explanations and links to documentation. It also asks to configure a GitHub user whitelist.
Requirements
Add a dedicated helper for intake mode .env updates.
Default to the ProPR App/shared relay path where available.
Support polling by disabling webhooks.
Support direct webhooks by requiring a secret.
Add whitelist configuration through the settings API when the backend is running.
Keep docs links in user-facing detail text.
Implementation Specification
Create packages/cli/src/commands/setup/github.ts and replace inline intake/whitelist logic in the engine with these helpers.
GitHub setup is factored out because it mixes local .env writes with backend settings updates. Keeping these operations in one helper makes the security-sensitive defaults easy to inspect. Polling remains the safest default for hardened deployments; direct webhooks are explicit and require a secret so setup cannot create an unsigned public endpoint.
File: packages/cli/src/commands/setup/github.ts (new file)
Why this file: This file owns setup choices around GitHub event intake and authorized users. It connects local env configuration to backend settings while keeping security rationale close to the code.
import{spawnSync}from'node:child_process';importtype{ApiClient}from'../../api/client.js';import{updateSettings}from'../../api/settings.js';import{writeSetupEnv}from'./state.js';importtype{SetupPrompts}from'./engine.js';exporttypeIntakeMode='app'|'polling'|'webhooks';exportasyncfunctionconfigureGithubIntake(rootDir: string,prompts: SetupPrompts): Promise<IntakeMode>{constmode=awaitprompts.choose<IntakeMode>('Choose GitHub event ingestion mode.',[{value: 'app',label: 'ProPR App',detail: 'Recommended default. Uses the ProPR App/relay flow where available. Docs: https://docs.propr.dev/operations/github-auth',},{value: 'polling',label: 'Polling',detail: 'No public webhook endpoint required. ProPR checks GitHub periodically. Docs: https://docs.propr.dev/architecture/daemon-runtime',},{value: 'webhooks',label: 'Direct webhooks',detail: 'Lowest latency, but requires public HTTPS routing and a webhook secret. Docs: https://docs.propr.dev/tutorials/setup-server#configure-github-webhooks-optional',},],'app');if(mode==='polling'){// Disable webhooks explicitly so re-running setup after a webhook experiment// returns the instance to the safer no-public-endpoint intake mode.writeSetupEnv(rootDir,{ENABLE_GITHUB_WEBHOOKS: 'false'});}if(mode==='webhooks'){constsecret=awaitprompts.input('GitHub webhook secret','');if(!secret.trim()){// The API refuses unsigned webhook mode at startup; fail here so the user// fixes the security prerequisite before continuing.thrownewError('Direct webhook mode requires GH_WEBHOOK_SECRET. Generate one with `openssl rand -hex 32`.');}writeSetupEnv(rootDir,{ENABLE_GITHUB_WEBHOOKS: 'true',GH_WEBHOOK_SECRET: secret.trim()});}returnmode;}exportasyncfunctionconfigureGithubWhitelist(client: ApiClient,prompts: SetupPrompts): Promise<string[]>{constdetectedUser=spawnSync('gh',['api','user','--jq','.login'],{encoding: 'utf8'}).stdout.trim();constanswer=awaitprompts.input('Comma-separated GitHub usernames allowed to trigger ProPR work',detectedUser);constusers=answer.split(',').map((name)=>name.trim()).filter(Boolean);if(users.length===0)return[];// Use partial settings update because the settings endpoint merges values and// this avoids clobbering unrelated model/concurrency settings during setup.awaitupdateSettings({github_user_whitelist: users},client);returnusers;}
File: packages/cli/src/commands/setup/engine.ts
Why this file: The engine should delegate GitHub-specific decisions to the helper so the main setup flow stays readable.
Activity
propr-dev commentedon Jun 22, 2026
Suggested Implementation:
Implementation Approach
GitHub setup is factored out because it mixes local
.envwrites with backend settings updates. Keeping these operations in one helper makes the security-sensitive defaults easy to inspect. Polling remains the safest default for hardened deployments; direct webhooks are explicit and require a secret so setup cannot create an unsigned public endpoint.File:
packages/cli/src/commands/setup/github.ts(new file)Why this file: This file owns setup choices around GitHub event intake and authorized users. It connects local env configuration to backend settings while keeping security rationale close to the code.
File:
packages/cli/src/commands/setup/engine.tsWhy this file: The engine should delegate GitHub-specific decisions to the helper so the main setup flow stays readable.
propr-dev commentedon Jun 22, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-4-8 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-4-81606/claude-opus-4-8-add-github-intake-mode-an-20260622-1100-cnj1599-epic-build-comprehensive-b5cissue-1606-20260622-1100-claude-opus-4-8-cnj🔍 Track Task Execution
No custom slugs, so the default URLs (`/docs/architecture/daemon`, `/…
No custom slugs, so the default URLs (`/docs/architecture/daemon`, `/…