-
Notifications
You must be signed in to change notification settings - Fork 347
Expand file tree
/
Copy pathconfig.example.yml
More file actions
152 lines (139 loc) · 8.88 KB
/
config.example.yml
File metadata and controls
152 lines (139 loc) · 8.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# yaml-language-server: $schema=https://github.com/looplj/axonhub/releases/latest/download/config.schema.json
# AxonHub Configuration Example
# Copy this file to config.yml and modify as needed
# Server configuration
server:
host: "0.0.0.0" # Server host (env: AXONHUB_SERVER_HOST)
port: 8090 # Server port (env: AXONHUB_SERVER_PORT)
name: "AxonHub" # Server name (env: AXONHUB_SERVER_NAME)
base_path: "" # Base path for API routes (env: AXONHUB_SERVER_BASE_PATH)
request_timeout: "30s" # Request timeout duration (env: AXONHUB_SERVER_REQUEST_TIMEOUT)
llm_request_timeout: "600s" # LLM request timeout duration (env: AXONHUB_SERVER_LLM_REQUEST_TIMEOUT)
trace:
thread_header: "AH-Thread-Id" # Thread ID header name (env: AXONHUB_SERVER_TRACE_THREAD_HEADER)
trace_header: "AH-Trace-Id" # Trace ID header name (env: AXONHUB_SERVER_TRACE_TRACE_HEADER)
extra_trace_headers: [] # Extra trace headers (env: AXONHUB_SERVER_TRACE_EXTRA_TRACE_HEADERS)
extra_trace_body_fields: [] # Extra trace body fields (env: AXONHUB_SERVER_TRACE_EXTRA_TRACE_BODY_FIELDS)
claude_code_trace_enabled: false # Enable extracting trace IDs from Claude Code request metadata (env: AXONHUB_SERVER_TRACE_CLAUDE_CODE_TRACE_ENABLED)
codex_trace_enabled: false # Enable extracting trace IDs from Codex Session_id header (env: AXONHUB_SERVER_TRACE_CODEX_TRACE_ENABLED)
debug: false # Enable debug mode (env: AXONHUB_SERVER_DEBUG)
disable_ssl_verify: false # Disable SSL certificate verification for self-signed certificates (env: AXONHUB_SERVER_DISABLE_SSL_VERIFY)
cors:
enabled: true # Enable CORS middleware (env: AXONHUB_SERVER_CORS_ENABLED)
debug: false # Enable CORS debug logging (env: AXONHUB_SERVER_CORS_DEBUG)
allowed_origins: # Allowed origins for CORS (env: AXONHUB_SERVER_CORS_ALLOWED_ORIGINS)
- "http://localhost:3000"
- "http://localhost:5173"
allowed_methods: # Allowed HTTP methods (env: AXONHUB_SERVER_CORS_ALLOWED_METHODS)
- "GET"
- "POST"
- "DELETE"
- "PATCH"
- "PUT"
- "OPTIONS"
- "HEAD"
allowed_headers: # Allowed headers (env: AXONHUB_SERVER_CORS_ALLOWED_HEADERS)
- "Content-Type"
- "Authorization"
- "X-API-Key"
- "X-Goog-Api-Key"
- "X-Project-ID"
- "AH-Thread-Id"
- "AH-Trace-Id"
# Add any other headers your frontend sends
exposed_headers: [] # Exposed headers (env: AXONHUB_SERVER_CORS_EXPOSED_HEADERS)
allow_credentials: true # Allow credentials (env: AXONHUB_SERVER_CORS_ALLOW_CREDENTIALS)
max_age: 1m # Max age for preflight cache in seconds (env: AXONHUB_SERVER_CORS_MAX_AGE)
# Database configuration
db:
dialect: "sqlite3" # Database dialect: sqlite3, postgres, mysql (env: AXONHUB_DB_DIALECT)
dsn: "file:axonhub.db?cache=shared&_fk=1" # Database connection string (env: AXONHUB_DB_DSN)
debug: false # Enable database debug logging (env: AXONHUB_DB_DEBUG)
# Cache configuration
cache:
# One of: memory, redis, two-level (memory + redis)
mode: "memory" # (env: AXONHUB_CACHE_MODE)
# Memory cache configuration
memory:
expiration: "5s" # Memory cache TTL (env: AXONHUB_CACHE_MEMORY_EXPIRATION)
cleanup_interval: "10m" # Memory cache cleanup interval (env: AXONHUB_CACHE_MEMORY_CLEANUP_INTERVAL)
# Redis cache configuration
redis:
# Simple mode: Use addr for plain host:port
addr: "" # Redis address (host:port) (env: AXONHUB_CACHE_REDIS_ADDR)
# URL mode: Use url for full redis:// or rediss:// URLs (takes priority over addr)
# Supported formats:
# - "redis://127.0.0.1:6379"
# - "rediss://127.0.0.1:6380" (auto-enables TLS)
# - "redis://user:[email protected]:6379/0"
url: "" # Redis URL (env: AXONHUB_CACHE_REDIS_URL)
# Optional overrides (apply to both addr and url modes)
username: "" # Overrides URL username (env: AXONHUB_CACHE_REDIS_USERNAME)
password: "" # Overrides URL password (env: AXONHUB_CACHE_REDIS_PASSWORD)
db: 0 # Overrides URL /db (env: AXONHUB_CACHE_REDIS_DB)
tls: false # Enable TLS for addr mode (env: AXONHUB_CACHE_REDIS_TLS)
tls_insecure_skip_verify: false # Skip TLS cert verification (env: AXONHUB_CACHE_REDIS_TLS_INSECURE_SKIP_VERIFY)
expiration: "30m" # Redis cache TTL (env: AXONHUB_CACHE_REDIS_EXPIRATION)
# Logging configuration
log:
name: "axonhub" # Logger name (env: AXONHUB_LOG_NAME)
debug: false # Enable debug logging (env: AXONHUB_LOG_DEBUG)
level: "info" # Log level: debug, info, warn, error, panic, fatal (env: AXONHUB_LOG_LEVEL)
level_key: "level" # Key name for log level field (env: AXONHUB_LOG_LEVEL_KEY)
time_key: "time" # Key name for timestamp field (env: AXONHUB_LOG_TIME_KEY)
caller_key: "label" # Key name for caller info field (env: AXONHUB_LOG_CALLER_KEY)
function_key: "" # Key name for function field (env: AXONHUB_LOG_FUNCTION_KEY)
name_key: "logger" # Key name for logger name field (env: AXONHUB_LOG_NAME_KEY)
encoding: "json" # Log encoding: json, console, console_json (env: AXONHUB_LOG_ENCODING)
includes: [] # Logger names to include (env: AXONHUB_LOG_INCLUDES)
excludes: [] # Logger names to exclude (env: AXONHUB_LOG_EXCLUDES)
output: "stdio" # Output target: file or stdio (env: AXONHUB_LOG_OUTPUT)
file: # File-based logging configuration (env prefix: AXONHUB_LOG_FILE_*)
path: "logs/axonhub.log" # Log file path (env: AXONHUB_LOG_FILE_PATH)
max_size: 100 # Max size in MB before rotation (env: AXONHUB_LOG_FILE_MAX_SIZE)
max_age: 30 # Max age in days to retain (env: AXONHUB_LOG_FILE_MAX_AGE)
max_backups: 10 # Max number of old log files to retain (env: AXONHUB_LOG_FILE_MAX_BACKUPS)
local_time: true # Use local time for rotated files (env: AXONHUB_LOG_FILE_LOCAL_TIME)
# Metrics configuration
metrics:
enabled: false # Enable metrics collection (env: AXONHUB_METRICS_ENABLED)
exporter:
type: "oltphttp" # Metrics exporter type: prometheus, console (env: AXONHUB_METRICS_EXPORTER_TYPE)
endpoint: "localhost:8080" # Metrics exporter endpoint (env: AXONHUB_METRICS_EXPORTER_ENDPOINT)
insecure: true # Enable insecure connection (env: AXONHUB_METRICS_EXPORTER_INSECURE)
# Garbage Collection configuration
gc:
cron: "0 2 * * *" # Cron expression for GC execution (env: AXONHUB_GC_CRON)
# This example runs daily at 2:00 AM
# Format: minute hour day month day_of_week
# Examples:
# "0 2 * * *" - Daily at 2:00 AM
# "0 3 * * 0" - Weekly on Sunday at 3:00 AM
# "0 4 1 * *" - Monthly on 1st day at 4:00 AM
vacuum_enabled: false # Enable VACUUM after cleanup (env: AXONHUB_GC_VACUUM_ENABLED)
# Supported for SQLite and PostgreSQL
# SQLite: Rebuilds database file to reclaim space
# PostgreSQL: Reclaims space from dead tuples
vacuum_full: false # Use VACUUM FULL for PostgreSQL (env: AXONHUB_GC_VACUUM_FULL)
# true = VACUUM FULL (reclaims more space but locks tables)
# false = VACUUM (allows concurrent operations)
# Note: SQLite always uses plain VACUUM
# Provider Quota configuration
provider_quota:
check_interval: "20m" # Interval for checking provider quota status (env: AXONHUB_PROVIDER_QUOTA_CHECK_INTERVAL)
# Supported values: 1m, 2m, 3m, 4m, 5m, 6m, 10m, 12m, 15m, 20m, 30m, 1h, 2h, etc.
# Default: 20m
# Longer intervals reduce API calls but show less fresh quota data
# Environment Variable Examples:
# export AXONHUB_SERVER_PORT=8080
# export AXONHUB_DB_DSN="postgres://user:pass@localhost/axonhub?sslmode=disable"
# export AXONHUB_LOG_LEVEL="debug"
# export AXONHUB_LOG_ENCODING="console"
# export AXONHUB_LOG_OUTPUT="stdio" # or "file"
# export AXONHUB_LOG_FILE_PATH="/var/log/axonhub/axonhub.log"
# export AXONHUB_LOG_FILE_MAX_SIZE=200
# export AXONHUB_LOG_FILE_MAX_AGE=14
# export AXONHUB_LOG_FILE_MAX_BACKUPS=7
# export AXONHUB_SERVER_TRACE_HEADER="X-Trace-ID"
# export AXONHUB_METRICS_ENABLED=false
# export AXONHUB_GC_CRON="0 3 * * 0" # Run weekly on Sunday at 3:00 AM