跳转到内容

Configuration

Server CLI Flags

FlagPurposeDefault
--portServer listen port3000
--log-dirLog directoryempty
--versionPrint version and exitfalse
--helpPrint help and exitfalse

Server Environment Variables

VariablePurposeDefault
PORTServer listen port3000
GIN_MODEGin moderelease unless debug
LOG_LEVELLog levelinfo
SESSION_SECRETSession signing secretrandom on startup
SQLITE_PATHSQLite database pathopenflare.db
DSNPostgreSQL DSN, preferred over SQLiteempty
SQL_DSNLegacy PostgreSQL DSN, lower priority than DSNempty
REDIS_CONN_STRINGRedis connection stringempty
UPLOAD_PATHUpload directoryupload
AGENT_TOKENLegacy global Agent tokenempty

When DSN and SQL_DSN both exist, DSN wins. PostgreSQL is preferred when configured. If PostgreSQL is empty and a local SQLite file exists, Server migrates SQLite data at startup.

Frontend Build Variables

VariablePurposeDefault
NEXT_PUBLIC_API_BASE_URLFrontend API base path/api
NEXT_PUBLIC_APP_VERSIONDisplayed frontend versiondev
NEXT_DEV_BACKEND_URLLocal dev backend proxy targethttp://127.0.0.1:3000

Runtime Options

The settings page maintains these hot-updatable options:

OptionPurposeDefault
AgentHeartbeatIntervalAgent heartbeat interval in milliseconds10000
NodeOfflineThresholdNode offline threshold in milliseconds120000
AgentUpdateRepoAgent update repositoryRain-kl/OpenFlare
GeoIPProviderNode/IP region provideripinfo
RegisterEnabledAllow new user registrationfalse
PasswordRegisterEnabledAllow password registrationtrue
DatabaseAutoCleanupEnabledEnable daily observability cleanupfalse
DatabaseAutoCleanupRetentionDaysRetention days30

OpenResty performance and cache options are also stored in the Option table, including OpenRestyWorkerProcesses, OpenRestyWorkerConnections, OpenRestyProxyConnectTimeout, OpenRestyProxyReadTimeout, OpenRestyCacheEnabled, OpenRestyCachePath, and OpenRestyCacheMaxSize.

Agent Configuration

Agent supports the -config CLI flag, an agent.json file, and the LOG_LEVEL environment variable.

FieldPurposeRequiredDefault / behavior
server_urlControl plane URLyesnone
agent_tokenNode-specific auth tokenone of agent_token / discovery_tokenempty
discovery_tokenGlobal token for first registrationone of agent_token / discovery_tokenempty
node_nameNode namenohost name
node_ipNode IPnoauto-detected
openresty_pathLocal OpenResty pathnoempty; Docker mode
openresty_container_nameDocker container namenoopenflare-openresty
openresty_docker_imageDocker imagenoopenresty/openresty:alpine
openresty_observability_portLocal observability portno18081
docker_binaryDocker binary name or pathnodocker
data_dirAgent data directorynodata under config directory
heartbeat_intervalHeartbeat intervalno10000 ms
request_timeoutHTTP timeoutno10000 ms

heartbeat_interval and request_timeout accept milliseconds or Go duration strings.

Released under the Apache License 2.0.