Configuration
SolidPing is configured primarily through environment variables. All environment variables use the SP_ prefix.
Configuration Methods
- Environment Variables - Recommended for Docker and production
- Configuration File -
config.ymlin the working directory - Command Line - Some options can be passed via CLI flags
Environment variables take precedence over configuration file values.
Quick Reference
Essential Variables
| Variable | Default | Description |
|---|---|---|
SP_DB_TYPE | sqlite | Database type: postgres, sqlite, sqlite-memory |
SP_DB_URL | - | PostgreSQL connection string |
SP_DB_DIR | . | SQLite database directory |
SP_SERVER_LISTEN | :4000 | Server address and port |
Server Configuration
| Variable | Default | Description |
|---|---|---|
SP_SERVER_LISTEN | :4000 | Listen address (e.g., :4000, 0.0.0.0:8080) |
SP_SERVER_JOB_WORKER_NB | 2 | Number of job runner goroutines |
SP_SERVER_CHECK_WORKER_NB | 3 | Number of check runner goroutines |
SP_SHUTDOWN_TIMEOUT | 30s | Graceful shutdown timeout |
PORT | - | Alternative to SP_SERVER_LISTEN (for PaaS compatibility) |
Logging
| Variable | Default | Description |
|---|---|---|
LOG_LEVEL | info | Log level: debug, info, warn, error |
Example Configuration
Environment Variables
# Database (PostgreSQL)
SP_DB_TYPE=postgres
SP_DB_URL=postgresql://solidping:password@localhost:5432/solidping?sslmode=disable
# Server
SP_SERVER_LISTEN=:4000
# Workers
SP_SERVER_JOB_WORKER_NB=4
SP_SERVER_CHECK_WORKER_NB=8
# Logging
LOG_LEVEL=info
Configuration File (config.yml)
db:
type: postgres
url: postgresql://solidping:password@localhost:5432/solidping?sslmode=disable
server:
listen: ":4000"
job_worker_nb: 4
check_worker_nb: 8
shutdown_timeout: 30s
email:
enabled: true
host: smtp.example.com
port: 587
username: noreply@example.com
password: smtp-password
from: noreply@example.com
from_name: SolidPing
slack:
app_id: your-slack-app-id
client_id: your-slack-client-id
client_secret: your-slack-client-secret
signing_secret: your-slack-signing-secret
Sections
- Database Configuration - PostgreSQL and SQLite options
- Notifications - Email, Slack, and webhook setup
Security Recommendations
Production Security
Always change these in production:
- Database passwords - Use strong, unique passwords
- Email credentials - Store securely, never commit to version control