Environment Variables
Safe Settings is configured through environment variables. This page provides a complete reference of all available variables.Required Variables
These variables are required for Safe Settings to function:The unique identifier for your GitHub App. You can find this in your GitHub App settings page.Example:
123456The webhook secret used to verify that webhook payloads are coming from GitHub. Generate this when creating your GitHub App.Example:
development or generate with openssl rand -base64 32The contents of your GitHub App’s private key, base64-encoded. This is the preferred method for providing the private key.Example:
PRIVATE_KEY takes precedence over PRIVATE_KEY_PATH.LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0t...Path to your GitHub App’s private key file. Use this if you prefer to store the key as a file rather than encoding it.Default:
.data/private-key.pem (in some deployment scenarios)Example: /path/to/private-key.pemConfiguration Variables
These variables control how Safe Settings locates and processes configuration files:The name of the repository where Safe Settings configuration files are stored. This repository should contain
settings.yml and repository-specific configuration files.Default: adminExample: safe-settings-config or .githubThe directory path within the admin repository where configuration files are located.Default:
.githubExample: .config or configThe filename for the global settings configuration file within the admin repository.Default:
settings.ymlExample: safe-settings.yml or global-settings.ymlThe filename for deployment-specific configuration that is loaded from the filesystem (not from the repository). This file is loaded once at startup and cached.Default:
deployment-settings.ymlExample: safe-settings-deployment.ymlNote: If this file doesn’t exist, Safe Settings uses a default configuration with restricted repos: ['admin', '.github', 'safe-settings']Feature Toggles
These variables enable or disable specific features:Controls whether Safe Settings posts comments on pull requests in the admin repository with validation results and NOP (no-operation) output.Default:
trueAccepted values: true or falseExample: Set to false to disable PR commentsAlternative name for
CREATE_PR_COMMENT. Use this to enable PR comments if not set by default.Accepted values: true or falseExample: trueControls whether Safe Settings creates issues in the admin repository when synchronization errors occur.Default:
trueAccepted values: true or falseExample: Set to false to disable error issue creationWhen set to
true, Safe Settings will prevent repository renames by humans and revert them back to the original name. Bot renames are still allowed.Default: falseAccepted values: true or falseExample: Set to true to enforce repository naming through Safe Settings configuration onlyWhen set to
true, enables a “no-operation” mode for full synchronization that shows what would be changed without actually making changes.Default: falseAccepted values: true or falseExample: Set to true for testing configuration changesScheduling
A cron expression that defines when Safe Settings should run a full synchronization of all repositories. Uses standard cron syntax.Format:
* * * * * (minute hour day month weekday)Examples:0 * * * *- Every hour at minute 00 0 * * *- Every day at midnight*/15 * * * *- Every 15 minutes
Logging
Controls the verbosity of application logs. Higher levels include all lower level logs.Default:
infoAccepted values:fatal- Only fatal errorserror- Errors and fatalwarn- Warnings, errors, and fatalinfo- General info plus all abovedebug- Debug info plus all abovetrace- Detailed trace logs plus all above
trace for maximum verbosity during troubleshootingGitHub Enterprise Server
These variables are required for GitHub Enterprise Server deployments:The hostname of your GitHub Enterprise Server instance (without protocol).Example:
github.company.com or github.mycompany.comWhen
GHE_HOST is set, Safe Settings automatically uses it as the API base URL.The protocol to use when connecting to GitHub Enterprise Server.Default:
httpsAccepted values: http or httpsExample: httpsDevelopment & Testing
The organization name where you want to register the app using the GitHub App manifest flow. Used during initial app setup.Example:
my-organizationIf set, the app is registered for an organization (
https://github.com/organizations/ORGANIZATION/settings/apps/new). If not set, it’s registered for your user account (https://github.com/settings/apps/new).A webhook proxy URL (like smee.io) for local development. This forwards GitHub webhooks to your local development environment.Example:
https://smee.io/abc123def456The Node.js environment mode.Default:
developmentAccepted values: development, production, testExample: Set to production for production deploymentsControls SSL certificate validation. Setting to
0 disables SSL validation (not recommended for production).Default: 1 (enabled)Accepted values: 0 (disabled) or 1 (enabled)Proxy Configuration
These standard environment variables are automatically detected for proxy support:HTTP proxy URL for outbound HTTP requests.Example:
http://proxy.company.com:8080HTTPS proxy URL for outbound HTTPS requests.Example:
https://proxy.company.com:8443Configuration Priority
Safe Settings loads configuration from multiple sources with the following priority (highest to lowest):- Runtime configuration: Settings from the
settings.ymlfile in the admin repository - Deployment configuration: Settings from the
DEPLOYMENT_CONFIG_FILEon the filesystem - Environment variables: Individual settings from environment variables
- Default values: Built-in defaults