This document details the configuration file format and all available options in FuckRun.
- Configuration File Format
- Global Configuration
- Process Configuration
- Log Configuration
- File System Configuration
- State Management Configuration
- Example Configuration
FuckRun supports both YAML and JSON configuration file formats. YAML is used by default.
Configuration file search order:
config.yaml
in the process directory- Process configuration in
.fuckrun
directory config.yaml
in the project root directory
Global configuration applies to all processes and can be overridden by specific process configurations.
global:
# Global working directory
working_dir: /app
# Global environment variables
env:
RUST_LOG: info
# Global log configuration
log:
file: app.log
level: info
max_size: 100 # MB
max_files: 5
# File system configuration
fs:
max_retries: 3
retry_delay_ms: 100
default_mode: 644
exit_wait_ms: 500
default_file_mode: 644
default_dir_mode: 755
# State management configuration
state:
state_dir: .fuckrun
state_filename: state.json
default_working_dir: .
# Process management configuration
process:
default_port: 5000
init_wait_secs: 5
health_check_timeout_secs: 5
health_check_retries: 10
retry_interval_secs: 2
graceful_shutdown_timeout_secs: 3
exit_wait_ms: 500
default_python_interpreter: python
default_script_path: examples/simple_web.py
Each process can have its own independent configuration.
processes:
web: # Process name
# Required fields
program: python # Executable path
args: [app.py] # Command line arguments
# Optional fields (with defaults)
working_dir: . # Working directory
auto_restart: false # Auto restart on crash
start_delay: 0 # Start delay (seconds)
max_restarts: 3 # Maximum restart attempts
# Optional fields (no defaults)
depends_on: [] # Process dependencies
health_check_url: ~ # Health check URL
env: {} # Environment variables
# Log configuration
log:
file: ~ # Log file path
level: info # Log level
max_size: 100 # Maximum file size (MB)
max_files: 5 # Number of files to keep
Log configuration can be set at both global and process levels.
log:
# Log file path (optional)
file: app.log
# Log level (default: info)
# Available values: trace, debug, info, warn, error
level: info
# Maximum single log file size (MB) (default: 100)
max_size: 100
# Number of log files to keep (default: 5)
max_files: 5
File system related configuration options.
fs:
# Maximum retry attempts for file operations (default: 3)
max_retries: 3
# Retry delay in milliseconds (default: 100)
retry_delay_ms: 100
# Default file permissions (default: 644)
default_mode: 644
# Process exit wait time in milliseconds (default: 500)
exit_wait_ms: 500
# Default file permission mask (default: 644)
default_file_mode: 644
# Default directory permission mask (default: 755)
default_dir_mode: 755
Process state management related configuration.
state:
# State file directory (default: .fuckrun)
state_dir: .fuckrun
# State filename (default: state.json)
state_filename: state.json
# Default working directory (default: .)
default_working_dir: .
Process management related configuration options.
process:
# Default port number (default: 5000)
default_port: 5000
# Process initialization wait time in seconds (default: 5)
init_wait_secs: 5
# Health check timeout in seconds (default: 5)
health_check_timeout_secs: 5
# Health check retry attempts (default: 10)
health_check_retries: 10
# Retry interval in seconds (default: 2)
retry_interval_secs: 2
# Graceful shutdown timeout in seconds (default: 3)
graceful_shutdown_timeout_secs: 3
# Process exit wait time in milliseconds (default: 500)
exit_wait_ms: 500
# Default Python interpreter (default: python)
default_python_interpreter: python
# Default Python script path
default_script_path: examples/simple_web.py
Here's a complete configuration file example with multiple process configurations:
# Global configuration
global:
working_dir: /app
env:
RUST_LOG: info
log:
level: info
max_size: 200
max_files: 10
# Process configurations
processes:
# Web service
web:
program: python
args: [app.py]
working_dir: ./web
auto_restart: true
health_check_url: http://localhost:8000/health
env:
PORT: 8000
DEBUG: true
log:
level: debug
# API service
api:
program: node
args: [server.js]
working_dir: ./api
auto_restart: true
start_delay: 5
depends_on: [web]
health_check_url: http://localhost:3000/health
env:
PORT: 3000
NODE_ENV: production
# Background worker
worker:
program: python
args: [worker.py]
working_dir: ./worker
auto_restart: true
env:
QUEUE_URL: redis://localhost:6379
log:
level: info
max_size: 500
max_files: 7