Overview
The Pope Bot uses environment variables for core configuration. These are set in.env in your project root and control the Event Handler’s behavior (web chat, Telegram, webhooks, and job summaries).
Never commit the actual
.env file with real secrets! Use .env.example as a template.Quick Start
Copy the example file and fill in your values:Required Variables
These variables must be set for the system to function: | Variable | Description | Example | |----------|-------------|---------|| |AUTH_SECRET | Secret for NextAuth session encryption (auto-generated by setup) | openssl rand -base64 32 |
| APP_URL | Public URL for webhooks, Telegram, and Traefik hostname | https://mybot.example.com |
| APP_HOSTNAME | Hostname extracted from APP_URL (used by docker-compose/Traefik) | mybot.example.com |
| GH_TOKEN | GitHub Personal Access Token (needs repo, workflow scopes) | ghp_your_token_here |
| GH_OWNER | GitHub repository owner username | your_github_username |
| GH_REPO | GitHub repository name | your_repo_name |
LLM Provider Configuration
Configure which LLM provider powers your Event Handler (chat, Telegram, webhooks): | Variable | Description | Default | |----------|-------------|---------|| |LLM_PROVIDER | LLM provider: anthropic, openai, google, or custom | anthropic |
| LLM_MODEL | Model name override (provider-specific default if unset) | Provider default |
| LLM_MAX_TOKENS | Max tokens for responses | 4096 |
| ANTHROPIC_API_KEY | API key for Anthropic provider | sk-ant-your_key_here |
| OPENAI_API_KEY | API key for OpenAI provider or Whisper voice transcription | Required for OpenAI |
| GOOGLE_API_KEY | API key for Google provider | Required for Google |
| CUSTOM_API_KEY | API key for custom OpenAI-compatible endpoints | Optional |
| OPENAI_BASE_URL | Custom OpenAI-compatible base URL (for custom provider) | http://localhost:11434/v1 |
Telegram Configuration
Optional variables for Telegram integration: | Variable | Description | How to Get | |----------|-------------|------------|| |TELEGRAM_BOT_TOKEN | Bot token from @BotFather | Message @BotFather on Telegram |
| TELEGRAM_CHAT_ID | Default chat ID for notifications (restricts bot to this chat) | Use @userinfobot or check webhook logs |
| TELEGRAM_WEBHOOK_SECRET | Secret for validating Telegram webhooks | openssl rand -hex 32 |
| TELEGRAM_VERIFICATION | Verification code for getting your chat ID | verify-abc12345 |
Voice Transcription
Optional API keys for voice input:| Variable | Description |
|---|---|
OPENAI_API_KEY | Required for Whisper voice transcription |
ASSEMBLYAI_API_KEY | Required for real-time voice input (alternative to Whisper) |
Webhook Security
| Variable | Description |
|---|---|
GH_WEBHOOK_SECRET | Secret for GitHub Actions webhook auth (must match GitHub secret) |
Docker Deployment
Variables specific to docker-compose deployment: | Variable | Description | Default | |----------|-------------|---------|| |AUTH_TRUST_HOST | Trust host header behind reverse proxy (Traefik, ngrok, etc.) | true |
| LETSENCRYPT_EMAIL | Email for Let’s Encrypt automatic SSL certificates | Optional (self-signed if unset) |
| THEPOPEBOT_VERSION | Package version for Docker image tags (auto-set by postinstall) | Auto-set |
| EVENT_HANDLER_IMAGE_URL | Custom event handler Docker image | stephengpope/thepopebot:event-handler-* |
| JOB_IMAGE_URL | Custom job agent Docker image | stephengpope/thepopebot:pi-coding-agent-job-* |
Advanced Configuration
| Variable | Description | Default | |----------|-------------|---------|| |DATABASE_PATH | Override SQLite database location | data/thepopebot.sqlite |
GitHub Secrets vs Environment Variables
The Pope Bot uses two separate configuration systems:Environment Variables (.env)
Control the Event Handler (your server):
- Web chat interface
- Telegram responses
- Webhook processing
- Job completion summaries
.env file. Restart your server after changes:
GitHub Secrets
Control the Job Agent (Docker containers on GitHub Actions):- Agent credentials (filtered from LLM’s bash output)
- LLM-accessible credentials (for skills, browser logins)
- GitHub Actions workflow authentication
AGENT_ | Protected credentials (filtered from LLM’s bash) | AGENT_GH_TOKEN, AGENT_ANTHROPIC_API_KEY |
| AGENT_LLM_ | LLM-accessible credentials (skills, browser logins) | AGENT_LLM_BRAVE_API_KEY |
GitHub Repository Variables
Configure in Settings → Secrets and variables → Actions → Variables: | Variable | Description | Default | |----------|-------------|---------|| |APP_URL | Public URL for the event handler | Required |
| AUTO_MERGE | Set to false to disable auto-merge of job PRs | Enabled |
| ALLOWED_PATHS | Comma-separated path prefixes for auto-merge | /logs |
| JOB_IMAGE_URL | Docker image path for job agent | stephengpope/thepopebot:pi-coding-agent-job-${THEPOPEBOT_VERSION} |
| EVENT_HANDLER_IMAGE_URL | Docker image path for event handler | stephengpope/thepopebot:event-handler-${THEPOPEBOT_VERSION} |
| RUNS_ON | GitHub Actions runner label | ubuntu-latest |
| LLM_PROVIDER | LLM provider for jobs | anthropic |
| LLM_MODEL | LLM model name for the agent | Provider default |
Set these via CLI:
Job model configuration is independent from Event Handler configuration. You can use different models for chat vs jobs.
Changing APP_URL
If your public URL changes (e.g., after restarting ngrok or changing domains):- Update
APP_URLandAPP_HOSTNAMEin.env - Update the
APP_URLGitHub repository variable: - Restart Docker:
- Re-register Telegram webhook (if configured):