Skip to main content

Configuration

SolidPing is configured primarily through environment variables. All environment variables use the SP_ prefix.

Configuration Methods

  1. Environment Variables - Recommended for Docker and production
  2. Configuration File - config.yml in the working directory
  3. Command Line - Some options can be passed via CLI flags

Environment variables take precedence over configuration file values.

Quick Reference

Essential Variables

VariableDefaultDescription
SP_DB_TYPEsqliteDatabase type: postgres, sqlite, sqlite-memory
SP_DB_URL-PostgreSQL connection string
SP_DB_DIR.SQLite database directory
SP_SERVER_LISTEN:4000Server address and port

Server Configuration

VariableDefaultDescription
SP_SERVER_LISTEN:4000Listen address (e.g., :4000, 0.0.0.0:8080)
SP_SERVER_JOB_WORKER_NB2Number of job runner goroutines
SP_SERVER_CHECK_WORKER_NB3Number of check runner goroutines
SP_SHUTDOWN_TIMEOUT30sGraceful shutdown timeout
PORT-Alternative to SP_SERVER_LISTEN (for PaaS compatibility)

Logging

VariableDefaultDescription
LOG_LEVELinfoLog 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

Security Recommendations

Production Security

Always change these in production:

  • Database passwords - Use strong, unique passwords
  • Email credentials - Store securely, never commit to version control