-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvil-server.reference.yaml
More file actions
239 lines (218 loc) · 9.38 KB
/
vil-server.reference.yaml
File metadata and controls
239 lines (218 loc) · 9.38 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# =============================================================================
# vil-server.reference.yaml — Complete VIL Server Configuration Reference
# =============================================================================
#
# All values shown are defaults for the "dev" profile.
# Precedence: Code Default → YAML → Profile → ENV
#
# Profiles: dev, staging, prod
# VIL_PROFILE=prod (env override)
#
# Environment variables override any YAML value:
# VIL_SERVER_PORT=9090
# VIL_LOG_LEVEL=debug
# VIL_SHM_CAPACITY_MB=256
# ... (see each section for VIL_* env var names)
# ── Profile ──────────────────────────────────────────────────────────
# dev: debug logging, 8MB SHM, small buffers, admin enabled
# staging: info+json logging, 64MB SHM, rate limits on
# prod: warn+json logging, 256MB SHM, large buffers, admin disabled
profile: dev # VIL_PROFILE
# ── Server ───────────────────────────────────────────────────────────
server:
name: vil-server
port: 8080 # VIL_SERVER_PORT
host: "0.0.0.0" # VIL_SERVER_HOST
workers: 0 # VIL_WORKERS (0 = num_cpus)
metrics_port: null # VIL_METRICS_PORT (null = same as main)
max_body_size: "10MB"
request_timeout_secs: 30 # VIL_REQUEST_TIMEOUT
graceful_shutdown_timeout_secs: 30
# ── Logging ──────────────────────────────────────────────────────────
logging:
level: info # VIL_LOG_LEVEL
format: text # VIL_LOG_FORMAT (text | json)
modules: {} # Per-module overrides: { "vil_server_core": "debug" }
# ── SHM (Shared Memory) ─────────────────────────────────────────────
# ExchangeHeap pool for zero-copy HTTP I/O.
# P99 tuning: check_interval controls amortized reset frequency.
shm:
enabled: true
pool_size: "64MB" # VIL_SHM_POOL_SIZE
reset_threshold_pct: 85 # VIL_SHM_RESET_PCT (reset when util > N%)
check_interval: 256 # VIL_SHM_CHECK_INTERVAL (check every N allocs)
query_cache:
enabled: true
region_size: "32MB"
default_ttl_secs: 60
max_entries: 10000
# ── Mesh (Tri-Lane) ─────────────────────────────────────────────────
# Trigger/Data/Control lane configuration for inter-service messaging.
mesh:
mode: unified # unified | distributed
channels:
trigger:
buffer_size: 1024
shm_region_size: "4MB"
data:
buffer_size: 1024
shm_region_size: "16MB"
control:
buffer_size: 256
shm_region_size: "1MB"
discovery:
mode: shm # shm | dns | consul
routes: []
# routes:
# - from: order-svc
# to: payment-svc
# lane: data
# ── Pipeline ─────────────────────────────────────────────────────────
# SDK Pipeline runtime settings (ShmToken/GenericToken processing).
pipeline:
queue_capacity: 1024 # VIL_PIPELINE_QUEUE_CAPACITY
session_timeout_secs: 300 # VIL_PIPELINE_SESSION_TIMEOUT
max_concurrent: 64
# ── Database ─────────────────────────────────────────────────────────
database:
postgres:
url: "postgres://vil:vil@localhost:5432/vil" # VIL_DATABASE_URL
max_connections: 10 # VIL_DATABASE_MAX_CONNECTIONS
min_connections: 1
connect_timeout_secs: 5
idle_timeout_secs: 300
max_lifetime_secs: 1800
redis:
url: "redis://localhost:6380" # VIL_REDIS_URL
pool_size: 4
# ── Message Queues ───────────────────────────────────────────────────
mq:
nats:
url: "nats://localhost:4222" # VIL_NATS_URL
max_reconnects: 60
kafka:
brokers: "localhost:9092" # VIL_KAFKA_BROKERS
group_id: vil-default
mqtt:
host: localhost # VIL_MQTT_HOST
port: 1883 # VIL_MQTT_PORT
client_id: vil-client
keep_alive_secs: 30
# ── Services ─────────────────────────────────────────────────────────
services: []
# services:
# - name: order-svc
# visibility: public
# prefix: /api/orders
# ── Middleware ───────────────────────────────────────────────────────
middleware:
request_tracker:
enabled: true
handler_metrics:
enabled: true
sample_rate: 1
tracing:
enabled: true
sample_rate: 1
propagation: w3c
cors:
enabled: true
mode: permissive # permissive | strict
compression:
enabled: false # prod profile enables this
min_body_size: 256
timeout:
enabled: true
duration_secs: 30
security_headers:
enabled: true
hsts:
enabled: false # prod profile enables this
max_age_secs: 31536000
include_subdomains: true
# ── Security ─────────────────────────────────────────────────────────
security:
jwt:
enabled: false
secret: "" # Use env: VIL_JWT_SECRET
algorithm: HS256
optional: false
rate_limit:
enabled: false # staging/prod profiles enable this
max_requests: 1000
window_secs: 60
per: ip # ip | api_key
csrf:
enabled: false
cookie_name: vil-csrf-token
exempt_paths: []
brute_force:
enabled: false
max_attempts: 5
block_duration_secs: 300
# ── Session ──────────────────────────────────────────────────────────
session:
enabled: false
cookie_name: vil-session
ttl_secs: 1800
http_only: true
secure: false # prod profile sets true
same_site: Lax # prod profile sets Strict
# ── Observability ────────────────────────────────────────────────────
observability:
error_tracker:
enabled: true
max_recent: 1000
span_collector:
max_spans: 10000
profiler:
enabled: true
# ── Performance ──────────────────────────────────────────────────────
performance:
metrics_sample_rate: 1 # 1 = every request, 10 = 1 in 10
trace_sample_rate: 1
idempotency:
enabled: false
ttl_secs: 86400
max_entries: 10000
# ── gRPC ─────────────────────────────────────────────────────────────
grpc:
enabled: false
port: 50051
max_message_size: "4MB"
health_check: true
reflection: true
max_concurrent_streams: 200
# ── GraphQL ──────────────────────────────────────────────────────────
graphql:
enabled: false
playground: true
max_depth: 10
max_complexity: 1000
introspection: true
default_page_size: 20
max_page_size: 100
# ── Feature Flags ────────────────────────────────────────────────────
feature_flags:
flags: {}
file: null
# ── Scheduler ────────────────────────────────────────────────────────
scheduler:
jobs: []
# jobs:
# - name: cleanup-expired
# every_secs: 3600
# ── Plugins ──────────────────────────────────────────────────────────
plugins:
directory: "~/.vil/plugins"
encryption_key: "~/.vil/secrets/encryption.key"
active: []
# ── Rolling Restart ──────────────────────────────────────────────────
rolling_restart:
drain_timeout_secs: 30
# ── Admin ────────────────────────────────────────────────────────────
admin:
playground: true # prod profile disables this
diagnostics: true
hot_reload: true
plugin_gui: true