S.I.M.P LogoS.I.M.P

Configuration

Breakdown of config.yaml and how configuration works in the backend.

The S.I.M.P backend is configured using a YAML file (config.yaml). This file controls all aspects of the backend, including server settings, authentication, storage, logging, CORS, and rate limiting.

Structure

The configuration file is loaded at startup and used throughout the backend (see config package).

Enable IP Tracking & Analytics

To enable IP-based analytics and geolocation, get a free IPinfo token from ipinfo.io and set it in your configuration using the ipinfo_token field.

Example

app:
  environment: development
  port: 3000
  domain: "localhost:3000"
  jwt_secret: "your-secret-key-here"
  max_file_size: "1MB"
  uuid_format: "^[A-Za-z0-9]{10}$"
  upload_key: "your-upload-key-here"
  ipinfo_token: ""
  enable_ip_tracking: true
user:
  username: "[email protected]"
  password: "admin"
database:
  file: "sharex.db"
storage:
  base_path: "./storage"
  max_storage: "10MB"
  allowed_extensions:
    - "jpg"
    - "jpeg"
    - "png"
    - "gif"
logging:
  enabled: true
  log_dir: "./logs"
  debug:
    enabled: true
    console_output: true
    file: "debug.log"
  info:
    enabled: true
    console_output: true
    file: "info.log"
  warn:
    enabled: true
    console_output: true
    file: "warn.log"
  error:
    enabled: true
    console_output: true
    file: "error.log"
  max_log_size: "10MB"
  max_log_age: 1
  compress_logs: true
  cleanup_schedule: 2
cors:
  enabled: true
  allowed_origins:
    - "http://localhost:3000"
    - "http://localhost:5173"
  allowed_methods:
    - "GET"
    - "POST"
    - "DELETE"
  allowed_headers:
    - "Authorization"
    - "Content-Type"
rate_limit:
  enabled: true
  redis_url: "redis://simp-redis:6379"
  default_rate:
    requests: 100
    period: 60
  routes:
    "/api/login":
      requests: 5
      period: 60
    "/api/upload":
      requests: 10
      period: 60
    "/api/delete":
      requests: 10
      period: 60

Configuration Sections

app

KeyTypeExampleDescription
environmentstringdevelopmentdevelopment or production. Controls logging and error output.
portnumber3000Port the backend listens on.
domainstringlocalhost:3000Used for generating full URLs in API responses.
jwt_secretstringyour-secret-key-hereSecret for signing JWT tokens. Change in production!
max_file_sizestring1MBMaximum upload size per file (e.g., 1B, 1KB, 1MB, 1GB, 1TB).
uuid_formatstring^[A-Za-z0-9]{10}$Regex for allowed image UUIDs.
upload_keystringyour-upload-key-hereKey required for uploading images. Change in production!
ipinfo_tokenstringapi_token_from_ipinfoIP Info token, get here used for IP Geolocation
enable_ip_trackingbooleantrueEnables/disables IP analytics.

user

KeyTypeExampleDescription
usernamestring[email protected]Admin username for login.
passwordstringadminAdmin password. Change in production!

database

KeyTypeExampleDescription
filestringsharex.dbPath to SQLite database file.

storage

KeyTypeExampleDescription
base_pathstring./storageDirectory for storing uploaded images.
max_storagestring10MBMaximum total storage allowed (e.g., (e.g., 10B, 10KB, 10MB, 10GB, 10TB).
allowed_extensionsstring[][jpg, png, ...]List of allowed file extensions for uploads.

logging

KeyTypeExampleDescription
enabledbooleantrueEnable/disable logging.
log_dirstring./logsDirectory for log files.
debug/info/warn/errorobject{...}Per-level logging config (enable, output, file).
max_log_sizestring10MBMax size per log file.
max_log_agenumber1Days to keep logs.
compress_logsbooleantrueWhether to compress old logs.
cleanup_schedulenumber2Minutes between log cleanup runs.

cors

KeyTypeExampleDescription
enabledbooleantrueEnable/disable CORS.
allowed_originsstring[][http://localhost:3000]List of allowed origins.
allowed_methodsstring[][GET, POST, DELETE]List of allowed HTTP methods.
allowed_headersstring[][Authorization, Content-Type]List of allowed headers.

rate_limit

KeyTypeExampleDescription
enabledbooleantrueEnable/disable rate limiting.
redis_urlstringredis://localhost:6379Redis connection string for rate limiting.
default_rateobject{ requests: 100, period: 60 }Default rate limit (requests per period in seconds).
routesobject{ "/api/login": ... }Per-route overrides (e.g., /api/proxy/, /api/upload).

On this page