Skip to content

Configuration Reference

This document lists all environment variables and configuration options for the Signal Bot, including candidates for future externalization.

Currently Configurable Environment Variables

Section titled “Currently Configurable Environment Variables”
VariableDescriptionExample
SIGNAL_PHONE_NUMBERSignal phone number for the bot+1234567890
BOT_NUMBERAlias for bot phone number (used by !rm)+1234567890
BOT_UUIDBot’s Signal UUID (used by !rm)xxxxxxxx-xxxx-...
SIGNAL_CLI_CONFIG_DIRPath to signal-cli config directory/app/signal-data
SIGNAL_CLI_PORTJSON-RPC port for signal-cli daemon7583
VariableDescriptionExample
ADMIN_PHONE_NUMBERSComma-separated admin phone numbers+1234567890,+0987654321
ADMIN_UUIDSComma-separated admin Signal UUIDsuuid1,uuid2
ADMIN_FALLBACK_NUMBERFallback phone number for credential DMs+1234567890
VariableDefaultDescription
DB_HOST-Database hostname (use signal-bot-postgres, not postgres)
DB_PORT5432Database port
DB_NAMEsignal_botDatabase name
DB_USERsignal_botDatabase user
DB_PASSWORD-Database password
VariableDefaultDescription
REDIS_HOSTredisRedis hostname
REDIS_PORT6379Redis port
REDIS_URL-Full Redis URL (overrides host/port if set)
VariableDefaultDescription
OPENAI_API_KEY-OpenAI API key
OPENAI_ACTIVEtrueEnable/disable OpenAI integration
VariableDefaultDescription
LOCAL_AI_URL-Local AI endpoint (e.g., https://ai.irregularchat.com)
LOCAL_AI_API_KEY-Local AI API key
LOCAL_AI_MODEL-Model name for !lai (e.g., irregularbot)
LOCAL_AI_UNCENSORED_MODEL-Model name for !uai
VariableDefaultDescription
DISCOURSE_URL-Discourse instance URL
DISCOURSE_API_KEY-Discourse API key
DISCOURSE_USERNAME-Bot username on Discourse
DISCOURSE_QA_CATEGORY-Category ID for Q&A/news auto-posts
DISCOURSE_BREAKOUT_CATEGORY-Category ID for breakout room summaries
VariableDefaultDescription
OUTLINE_URL-Outline instance URL
OUTLINE_API_KEY-Outline API key (starts with ol_api_)
OUTLINE_DEFAULT_COLLECTION-UUID of default collection for new docs
VariableDefaultDescription
AUTHENTIK_BASE_URL-Authentik instance URL
AUTHENTIK_API_TOKEN-Authentik API token
AUTHENTIK_INVITE_FLOW_ID-Flow UUID for invite enrollment
AUTHENTIK_INVITE_FLOW_SLUG-Flow slug (e.g., invite-enrollment-flow)
VariableDefaultDescription
PEERTUBE_URL-Internal PeerTube URL (e.g., http://peertube:9000)
PEERTUBE_PUBLIC_URL-Public PeerTube URL (e.g., https://videos.irregularchat.com)
PEERTUBE_ACCESS_TOKEN-PeerTube long-lived access token
PEERTUBE_CHANNEL_ID1PeerTube channel ID for uploads
PEERTUBE_IDP_URL-PeerTube SSO login URL
VariableDefaultDescription
R2_ACCOUNT_ID-Cloudflare account ID
R2_ACCESS_KEY_ID-R2 access key
R2_SECRET_ACCESS_KEY-R2 secret key
R2_BUCKET_NAME-R2 bucket name
R2_PUBLIC_URL-Public R2 URL
VariableDefaultDescription
GITEA_API_URL-Gitea API endpoint (e.g., https://git.irregularchat.com/api/v1)
GITEA_TOKEN-Gitea API token
GITEA_DEFAULT_OWNER-Default repo owner (e.g., irregulars)
GITEA_DEFAULT_REPO-Default repo name (e.g., 3d-files)
VariableDefaultDescription
EVENT_SERVICE_URL-Event service Worker URL
EVENT_SERVICE_API_KEY-Event service API key
VariableDefaultDescription
BOT_DEV_GROUP_ID-Bot development/testing group ID
ENTRY_INDOC_GROUP_ID-Entry/indoctrination group ID
ACTIONS_GROUP_ID-Actions/notifications group ID
VariableDefaultDescription
VERBOSE_LOGGINGfalseEnable verbose debug logging
LOG_LEVELinfoLog level (debug, info, warn, error)
VariableDefaultDescription
QA_WEB_URL-Q&A web form URL (e.g., https://qa.irregulars.io)
SUMMARIZE_ALLOWED_DOMAINS-Comma-separated domains allowed for !summarize
GOOGLE_KG_API_KEY-Google Knowledge Graph API key (optional)
GITHUB_TOKEN-GitHub token for repo operations
IDENTITY_POLL_INTERVAL_MS300000Interval for identity fingerprint polling (5 min)
VariableDefaultDescription
MINIO_ENDPOINT-Internal MinIO API endpoint (e.g., http://minio-irregularchat:9000)
MINIO_ACCESS_KEY-MinIO access key (S3 compatible)
MINIO_SECRET_KEY-MinIO secret key (S3 compatible)
MINIO_BUCKETirregularchatMinIO bucket name
MINIO_REGIONus-east-1MinIO region (required for S3 API)
MINIO_PUBLIC_URL-Public URL for presigned links (e.g., https://s3.irregular.chat)
VariableDefaultDescription
SHLINK_API_URL-Shlink API endpoint (e.g., http://shlink-api:8080)
SHLINK_API_KEY-Shlink API key
SHLINK_PUBLIC_URL-Public base URL for shortened links
VariableDefaultDescription
IRREGULARCHAT_PATH/app/irregularchatBase path for file archive
MEMES_PATH/app/memesPath to meme images directory
VariableDefaultDescription
COMMUNITY_DOMAINSirregularpedia.org,irregularchat.com,irregular.chat,forum.irregularchat.comComma-separated list of community domains to skip in auto-scraper
VariableDefaultDescription
PCLOUD_PUBLIC_URL(configured)pCloud public folder URL
PCLOUD_API_HOSTapi.pcloud.compCloud API endpoint
VariableDefaultDescription
WIKI_REPO_PATH/app/wiki-repoPath to wiki repository clone
VariableDefaultDescription
GITLAB_WIKI_URL-GitLab repo URL for wiki push (e.g., http://gitlab:8929/irregulars/IrregularChatWiki.git)
GITLAB_WIKI_TOKEN-GitLab personal access token with write_repository scope
WIKI_WORKDIR_PATH/app/wiki-workdirLocal path for wiki git clone (must be writable by container user)
WIKI_GIT_USERIrregularBotGit author name for wiki commits
WIKI_GIT_EMAILbot@irregularchat.comGit author email for wiki commits

Notes:

  • The GITLAB_WIKI_URL uses the Docker internal hostname (gitlab:8929) since the bot and GitLab share a Docker network
  • The bot user needs Maintainer access on the GitLab project to push to the protected main branch
  • The token is embedded in the git remote URL at runtime (never logged)
  • WIKI_WORKDIR_PATH must be mounted as a Docker volume for persistence across container restarts
VariableDefaultDescription
WHISPER_ENABLEDtrueEnable/disable Whisper audio transcription for !tldr
WHISPER_MODEL_SIZEbaseWhisper model size: tiny, base, small, medium, large

Notes:

  • Whisper is used as a fallback for YouTube (when no captions exist) and as the primary method for Instagram/TikTok/Facebook videos
  • The base model offers the best speed/accuracy tradeoff for CPU transcription
  • Larger models (small, medium) improve accuracy but are significantly slower on CPU
  • Model files are cached in data/whisper-models/ (mounted as a Docker volume)
  • Requires faster-whisper Python package (pre-installed in Docker image)

The following hardcoded values could be externalized to environment variables in future updates.

File: src/src/utils/news-detector.ts:270-283

Currently hardcoded list of 13 bypass/archive services to skip:

12ft.io, 12footer.com, archive.org, web.archive.org, archive.is,
archive.ph, archive.today, archive.li, archive.vn, archive.md,
webcache.googleusercontent.com, outline.com, printfriendly.com

Suggested env var: BYPASS_ARCHIVE_DOMAINS Format: Comma-separated list Rationale: Some deployments may want to allow or block different bypass services.

File: src/src/utils/wiki-search.ts:65

Currently hardcoded:

const WIKI_BASE_URL = 'https://irregularpedia.org';

Suggested env var: WIKI_BASE_URL Rationale: Self-hosters will have their own wiki instance.


File: src/src/utils/minio-client.ts:31

Currently hardcoded:

const DEFAULT_EXPIRY_SECONDS = 86400; // 24 hours

Suggested env var: MINIO_PRESIGNED_URL_EXPIRY_SECONDS Default: 86400 Rationale: Some deployments may want shorter or longer expiry times.

File: src/src/utils/shlink-client.ts:21

Currently hardcoded:

const DEFAULT_EXPIRY_MINUTES = 1440; // 24 hours (matches MinIO presigned URL expiry)

Suggested env var: SHLINK_DEFAULT_EXPIRY_MINUTES Default: 1440 (24 hours) Rationale: Control how long shortened URLs remain valid. Should match MinIO presigned URL expiry.

File: src/src/utils/discourse-poster.ts:157

Currently hardcoded:

model: 'gpt-4o-mini',
temperature: 0.7,
max_tokens: 150

Suggested env vars:

  • DISCOURSE_SUMMARY_MODEL (default: gpt-4o-mini)
  • DISCOURSE_SUMMARY_TEMPERATURE (default: 0.7)
  • DISCOURSE_SUMMARY_MAX_TOKENS (default: 150)

Rationale: Allow using different models or tuning summary behavior.

File: src/src/utils/pdf-scraper.ts:24-25

Currently hardcoded:

const MAX_PAGES_FOR_FULL_EXTRACTION = 20;
const MAX_CHARS_FOR_LLM = 15000;

Suggested env vars:

  • PDF_MAX_PAGES (default: 20)
  • PDF_MAX_CHARS (default: 15000)

Rationale: Tune PDF processing for different LLM context windows or performance.

File: src/src/utils/file-search.ts:52-53

Currently hardcoded:

const INDEX_REFRESH_INTERVAL = 60 * 60 * 1000; // 1 hour
const INDEX_MAX_FILES = 50000;

Suggested env vars:

  • FILE_INDEX_REFRESH_INTERVAL_MS (default: 3600000)
  • FILE_INDEX_MAX_FILES (default: 50000)

Rationale: Tune indexing frequency and limits based on archive size.

File: src/src/utils/file-search.ts:797

Currently hardcoded:

const PCLOUD_INDEX_TTL = 30 * 60 * 1000; // 30 minutes

Suggested env var: PCLOUD_INDEX_TTL_MS Default: 1800000

File: src/src/utils/file-search.ts:984

Currently hardcoded:

const SESSION_TTL = 10 * 60 * 1000; // 10 minutes

Suggested env var: SEARCH_SESSION_TTL_MS Default: 600000


File: src/src/utils/rps-game.ts:65-68

Currently hardcoded:

const CHOICE_TIMEOUT_MS = 120000; // 2 minutes
const SPAM_WINDOW_MS = 30 * 60 * 1000; // 30 minutes
const SPAM_DELAY_MS = 10 * 60 * 1000; // 10 minutes
const SPAM_QUIT_THRESHOLD = 2;

Suggested env vars:

  • RPS_CHOICE_TIMEOUT_MS (default: 120000)
  • RPS_SPAM_WINDOW_MS (default: 1800000)
  • RPS_SPAM_DELAY_MS (default: 600000)
  • RPS_SPAM_QUIT_THRESHOLD (default: 2)

File: src/src/utils/dice-game.ts:91-96

Currently hardcoded:

const STARTING_POINTS = 100;
const DEFAULT_MIN_BET = 10;
const DEFAULT_MAX_BET = 50;
const DEFAULT_TIMEOUT_MS = 60000;
const INACTIVITY_TIMEOUT_MS = 180000;

Suggested env vars:

  • DICE_STARTING_POINTS (default: 100)
  • DICE_MIN_BET (default: 10)
  • DICE_MAX_BET (default: 50)
  • DICE_TIMEOUT_MS (default: 60000)
  • DICE_INACTIVITY_TIMEOUT_MS (default: 180000)

File: src/src/utils/wiki-embeddings.ts:15-18

Currently hardcoded:

const EMBEDDING_MODEL = 'text-embedding-3-small';
const EMBEDDING_DIMENSIONS = 1536;
const MAX_TOKENS_PER_CHUNK = 8000;
const CHUNK_OVERLAP_CHARS = 200;

Suggested env vars:

  • EMBEDDING_MODEL (default: text-embedding-3-small)
  • EMBEDDING_CHUNK_SIZE (default: 8000)
  • EMBEDDING_CHUNK_OVERLAP (default: 200)

File: src/src/utils/breakout-manager.ts

VariableDefaultDescription
BREAKOUT_ARCHIVE_DELAY_SECONDS120Delay before removing members after session ends (gives time to save info)
BREAKOUT_BROADCAST_GROUPS-Comma-separated group IDs for --broadcast announcements

Currently hardcoded (candidates for future configuration):

const MIN_MESSAGES_FOR_AI = 3;
const MIN_MESSAGES_FOR_AI_CATCHUP = 5;

Suggested env vars:

  • BREAKOUT_MIN_MESSAGES_FOR_AI (default: 3)
  • BREAKOUT_MIN_MESSAGES_CATCHUP (default: 5)

These lists are kept in code as they are extensive and rarely need per-deployment customization:

  • SOCIAL_MEDIA_DOMAINS - 23 social media platforms (news-detector.ts:26-48)
  • FILE_HOSTING_DOMAINS - 20 file hosting services (news-detector.ts:51-71)
  • NEWS_DOMAINS - 200+ news domains for legacy whitelist (news-detector.ts:74-211)
  • SUSPICIOUS_TLDS - Geopolitical TLD mapping (url-security.ts:25-53)
  • TRACKING_PARAMS - URL tracking parameters to strip (url-security.ts:58-132)

When adding new configurable values, follow this pattern:

// At top of file
const DEFAULT_VALUE = 'default';
const CONFIG_VALUE = process.env.CONFIG_NAME
? process.env.CONFIG_NAME
: DEFAULT_VALUE;
// For comma-separated lists
const DEFAULT_LIST = ['item1', 'item2'];
const CONFIG_LIST: string[] = process.env.CONFIG_LIST
? process.env.CONFIG_LIST.split(',').map(s => s.trim()).filter(s => s.length > 0)
: DEFAULT_LIST;
// For numbers
const DEFAULT_NUM = 100;
const CONFIG_NUM = process.env.CONFIG_NUM
? parseInt(process.env.CONFIG_NUM, 10)
: DEFAULT_NUM;