# UCE WORKING DIRECTORIES
BIN_DIRECTORY=/var/cache/uce/work
TMP_UPLOAD_PATH=/var/lib/uce/uploads
SESSION_PATH=/var/lib/uce/sessions

# LISTEN ON SOCKETS
FCGI_SOCKET_PATH=/run/uce/fastcgi.sock
# FastCGI is normally consumed by the local web server user/group.
FCGI_SOCKET_MODE=0666
FCGI_PORT=9993

# HTTP-over-Unix command socket for local CLI/control tooling.
# Example: curl --unix-socket /run/uce/cli.sock http://localhost/ping
CLI_SOCKET_PATH=/run/uce/cli.sock
# Keep the CLI/admin socket private by default; set 0660 only for a trusted group.
CLI_SOCKET_MODE=0600

# Built-in HTTP/WebSocket listener used for WebSocket Upgrade requests.
# Keep this behind nginx/Apache on localhost or firewall it from public access.
HTTP_PORT=8080

# After this many seconds, an in-flight WS broker render-forward that is still
# not completed (including stalled writes/reads) is dropped.
WS_BROKER_OUTBOUND_TIMEOUT_SECONDS=30

# OPTIONAL PROACTIVE COMPILE ROOT
# Leave empty to scan SITE_DIRECTORY relative to the runtime root.
PRECOMPILE_FILES_IN=

# PUBLIC SITE DIRECTORY USED FOR STARTUP SCAN WHEN PRECOMPILE_FILES_IN IS EMPTY
SITE_DIRECTORY=site

# ENABLE JIT COMPILATION WHEN A PAGE REQUEST HITS A STALE OR MISSING UNIT
JIT_COMPILE_ON_REQUEST=1

# WASM SIDE-MODULE COMPILER USED FOR .uce UNITS
WASM_COMPILE_SCRIPT=scripts/compile_wasm_unit

# WASM RUNTIME SETTINGS. Unit execution is always routed through wasm.
WASM_BACKEND_VERBOSE=0
WASM_CORE_PATH=bin/wasm/core.wasm
WASM_MEMORY_LIMIT_BYTES=536870912
WASM_EPOCH_DEADLINE_TICKS=200
WASM_EPOCH_PERIOD_MS=50

# ENABLE THE BACKGROUND PROACTIVE COMPILER LOOP
PROACTIVE_COMPILE_ENABLED=1

# AFTER A FAILED COMPILE, UCE NOW REUSES THE PERSISTED COMPILER OUTPUT UNTIL
# THE SOURCE OR COMPILER INPUTS CHANGE. THIS SETTING IS KEPT FOR COMPATIBILITY.
COMPILE_FAILURE_RETRY_SECONDS=10

# PERIODIC KNOWN-.uce RECHECK INTERVAL IN SECONDS
PROACTIVE_COMPILE_CHECK_INTERVAL=60

# SPAWN WORKERS
WORKER_COUNT=4

# MAX MEMORY PER REQUEST
MAX_MEMORY=16777216

# TRANSPORT / DOS LIMITS
TRANSPORT_MAX_CLIENT_CONNECTIONS=256
TRANSPORT_MAX_HTTP_HEADER_BYTES=16384
TRANSPORT_MAX_HTTP_BODY_BYTES=1048576
TRANSPORT_MAX_WEBSOCKET_FRAME_BYTES=1048576
TRANSPORT_MAX_WEBSOCKET_MESSAGE_BYTES=1048576
TRANSPORT_MAX_WEBSOCKET_OUTPUT_BYTES=4194304
TRANSPORT_MAX_RESPONSE_BYTES=8388608
TRANSPORT_HTTP_REQUEST_TIMEOUT_SECONDS=15
TRANSPORT_CONNECTION_IDLE_TIMEOUT_SECONDS=120
# Empty means COMPILER_SYS_PATH for the built-in direct HTTP listener.
HTTP_DOCUMENT_ROOT=

# CUSTOM SERVER LIMITS
CUSTOM_SERVER_MAX_SERVERS=16
CUSTOM_SERVER_MIN_PORT=1024
CUSTOM_SERVER_MAX_PORT=65535
CUSTOM_SERVER_ALLOW_PUBLIC_BIND=0
CUSTOM_SERVER_UNIX_SOCKET_PREFIX=/tmp/uce/custom-servers/
CUSTOM_SERVER_HANDLER_TIMEOUT_SECONDS=30
# Empty means COMPILER_SYS_PATH/SITE_DIRECTORY.
CUSTOM_SERVER_UCE_ROOT=

# ARCHIVE HELPER LIMITS
ARCHIVE_MAX_INPUT_BYTES=67108864
ARCHIVE_MAX_OUTPUT_BYTES=67108864
ARCHIVE_MAX_ZIP_ENTRIES=4096

# LIFETIME OF SESSION COOKIES IN SECONDS
SESSION_TIME=2592000
# Set to 1 behind HTTPS-only frontends to add Secure to session cookies.
SESSION_COOKIE_SECURE=0

# DEVELOPER-DEFINED ERROR PAGES (see /doc/index.uce?p=error_pages and
# /doc/index.uce?p=3_blocked_functions). The unit receives the error details in
# context.call["error"]; comment out for the plain-text fallback instead.
page_runtime_error=site/errors/runtime-error.uce

# Comma-separated uce_host_* names to disable per server policy (empty = none).
# A unit calling a blocked hostcall fails into the error page above.
UCE_HOSTCALL_BLOCKLIST=
