Change thresholds, endpoint paths and which checks run.
The package works with only LEDGE_SECRET_KEY set. Almost everything else can be changed with an environment variable. For the few options that can't, publish the config file:
php artisan vendor:publish --tag=ledge-configThis creates config/ledge.php. If you change config in production, run php artisan config:cache again.
off or none to turn that tier off.healthy, degraded or unhealthy. healthy keeps the condition in the check's data without affecting the app's status.true, 1, yes, on and their opposites.LEDGE_DISABLED_CHECKS=failedLogins,packagesOr set checks to false under enabled_checks in config/ledge.php. If enabled_checks has any entries, LEDGE_DISABLED_CHECKS is ignored, so use one or the other.
To keep a check running but stop one known result from affecting the app, ignore it in Ledge instead.
| Environment variable | Default | |
|---|---|---|
LEDGE_SECRET_KEY | none | The shared key. Generate it with php artisan ledge:generate-key. |
LEDGE_KEY_HEADER | X-Ledge-Key | Request header that carries the key. |
LEDGE_ALLOW_QUERY_KEY | false | Also accept the key as a query parameter. Leave this off unless a proxy strips headers: keys in URLs end up in access logs. |
LEDGE_QUERY_KEY_PARAM | key | Name of that query parameter. |
LEDGE_HEALTH_PATH | _ledge/health | Path of the health endpoint. |
LEDGE_DEPENDENCIES_ENABLED | true | Report installed Composer packages, used to match security advisories. |
LEDGE_DEPENDENCIES_PATH | _ledge/dependencies | Path of the package list. |
| Environment variable | Default | |
|---|---|---|
LEDGE_DISK_DEGRADED_AT / LEDGE_DISK_UNHEALTHY_AT | 80 / 90 | Percentage used on the volume holding storage/. |
LEDGE_DISK_MIN_FREE_BYTES | off | Unhealthy below this much free space, whatever the percentage. |
LEDGE_MEMORY_DEGRADED_AT / LEDGE_MEMORY_UNHEALTHY_AT | 75 / 90 | Percentage of PHP's memory_limit used. |
LEDGE_QUEUE_STALE_AFTER | 300 | Seconds a job can wait before it counts as stale. |
LEDGE_QUEUE_FAILED_WINDOW | 86400 | Seconds to look back for failed jobs. |
LEDGE_QUEUE_FAILED_DEGRADED_AT / LEDGE_QUEUE_FAILED_UNHEALTHY_AT | off / 1 | Failed jobs in that window. |
LEDGE_QUEUE_STALE_DEGRADED_AT / LEDGE_QUEUE_STALE_UNHEALTHY_AT | off / 1 | Stale jobs. |
LEDGE_FAILED_LOGINS_WINDOW | 86400 | Seconds to look back for failed logins. |
LEDGE_FAILED_LOGINS_DEGRADED_AT / LEDGE_FAILED_LOGINS_UNHEALTHY_AT | 10 / 50 | Failed login attempts in that window. |
LEDGE_SCHEDULER_STALE_AFTER | 600 | Seconds since the last completed schedule:run. |
| Environment variable | Default | Applies when |
|---|---|---|
LEDGE_SCHEDULER_STALE_STATUS | degraded | The scheduler hasn't run recently. |
LEDGE_DEBUG_MODE_STATUS | degraded | APP_DEBUG is on. |
LEDGE_MISSING_ENV_VARS_STATUS | degraded | A required key from .env.example isn't set. |
LEDGE_STORAGE_UNWRITABLE_STATUS | unhealthy | A storage or cache directory isn't writable. |
LEDGE_CACHE_FAILURE_STATUS | unhealthy | The cache can't store and read a value. |
LEDGE_REDIS_FAILURE_STATUS | unhealthy | Redis doesn't respond. |
LEDGE_HORIZON_STOPPED_STATUS | unhealthy | Horizon isn't running. |
LEDGE_HORIZON_PAUSED_STATUS | degraded | Horizon is paused. |
LEDGE_NOT_OPTIMIZED_STATUS | degraded | Config or routes aren't cached in production. |
LEDGE_PHP_SECURITY_ONLY_STATUS | degraded | Your PHP version only gets security fixes. |
LEDGE_PHP_EOL_STATUS | unhealthy | Your PHP version no longer gets security fixes. |
LEDGE_UPDATE_AVAILABLE_STATUS | healthy | A Composer package has a newer release. |
LEDGE_IGNORED_ENV_VARS (comma-separated) lists keys the environment check shouldn't report as missing. LEDGE_PACKAGES_AUTO_REFRESH=false stops the daily package check from being scheduled.
| Environment variable | Default | |
|---|---|---|
LEDGE_ACQUIRE_ENABLED | false | Let Ledge take encrypted database backups. |
LEDGE_ACQUIRE_MAX_BUNDLE_BYTES | 524288000 | Largest backup the package will send, in bytes (500 MB). |
LEDGE_ACQUIRE_JOB_TIMEOUT | 3600 | Seconds the backup job may run. |
LEDGE_ACQUIRE_QUEUE / LEDGE_ACQUIRE_QUEUE_CONNECTION | app default | Queue and connection for the backup job. |
LEDGE_ACQUIRE_TMP_PATH | storage/framework/ledge | Where temporary files go while the backup is built. |
LEDGE_ACQUIRE_DUMP_BINARY_PATH | none | Folder containing the dump tool, if it isn't on the PATH. |
These are set in config/ledge.php only:
enabled_checks: turn individual checks on or off.checks: class names of your own checks.