Skip to main content
Version: 0.2.x

Introduction​

Configuration management is one of the runtime entry points for lina-core. When the core framework starts, it reads config.yaml and distributes the settings to the HTTP server, logging, database, authentication, sessions, scheduling, public admin workspace frontend configuration, internationalization, cluster coordination, file uploads, and plugin governance subsystems.

The default configuration file lives in the main repository:

apps/lina-core/manifest/config/config.yaml

This file serves as both the default development template and an index for understanding how the core framework operates. Business projects can override sensitive settings per environment at delivery time — database connections, JWT secrets, log output, and cluster coordination addresses.

Configuration Groups​

GroupPurpose
serverHTTP listen address, route map dump, and API documentation path
loggerLog directory, filename pattern, level, stdout, structured logging, and TraceID output
databaseDefault database connection and SQL debug logging
jwtAuthentication token signing secret and expiry
sessionOnline session timeout and expired session cleanup interval
monitorService metrics collection interval for monitoring plugins
healthHealth probe timeout when checking database connectivity
shutdownMaximum wait time for graceful process shutdown
schedulerDefault timezone for scheduled tasks
workspaceDefault admin workspace frontend route base, returned to lina-vben through public frontend configuration
i18nDefault language, multi-language toggle, and locale list
clusterSingle-node or cluster mode, Redis coordinator, and leader election lease
uploadUpload file directory and single-file size limit
pluginForce-uninstall policy, dynamic plugin artifact directory, and auto-enable plugin list

Server and API Documentation​

server.address sets the core framework listen address, defaulting to :9120. server.dumpRouterMap outputs the route table at startup — useful during development but not recommended for production.

server.extensions.apiDocPath is a LinaPro extension field on the GoFrame server configuration, defaulting to /api.json:

server:
address: ":9120"
dumpRouterMap: false
extensions:
apiDocPath: "/api.json"

After startup, the core framework publishes the aggregated OpenAPI document at this path. See API Reference for more on API documentation design.

Logging​

Logging reuses GoFrame log capabilities with LinaPro-specific extensions:

logger:
path: ""
file: "{Y-m-d}.log"
level: "all"
stdout: true
extensions:
structured: false
traceIDEnabled: false
SettingDescription
pathLog file directory; when empty, output goes to the terminal only
fileLog filename pattern
levelLog level — all, debug, info, error, or off
stdoutWhether to also output to standard output
structuredEnable JSON structured logging
traceIDEnabledInclude TraceID in log output

Production environments should enable structured logging and set a stable log directory to integrate with ELK, Loki, or cloud logging services.

Database​

The default database configuration points to PostgreSQL:

database:
default:
link: "pgsql:postgres:postgres@tcp(127.0.0.1:5432)/linapro?sslmode=disable"
debug: false

PostgreSQL 14+ is the recommended production database. SQLite can be used for single-node local demos or smoke testing:

database:
default:
link: "sqlite::@file(./temp/sqlite/linapro.db)"

SQLite is not suitable for production and does not support cluster deployment. In cluster mode, all lina-core nodes must connect to the same shared PostgreSQL database.

Authentication and Sessions​

Authentication configuration includes the JWT signing secret and token expiry:

jwt:
secret: "lina-jwt-secret-key-change-in-production"
expire: 24h

You must replace jwt.secret in production. Use a random strong secret and never commit real secrets to the source repository.

Online sessions are controlled by the session group:

session:
timeout: 24h
cleanupInterval: 5m

session.timeout determines how long an inactive session lives. session.cleanupInterval controls how often the built-in session cleanup task runs. This cleanup task is projected into the core framework's persistent task system — see Scheduled Tasks for details.

Monitoring, Health, and Shutdown​

monitor.interval provides the collection interval for service monitoring plugins. health.timeout controls the timeout when the /health probe checks database connectivity — exceeding this returns an error status. shutdown.timeout controls the maximum wait time for graceful process shutdown.

monitor:
interval: 1m

health:
timeout: 5s

shutdown:
timeout: 30s

These settings directly affect runtime observability and orchestration system decisions. In containerized deployments, the health probe timeout should not be too long, or failed nodes will be removed later.

Scheduling​

scheduler.defaultTimezone defines the default timezone for persistent tasks:

scheduler:
defaultTimezone: "UTC"

If your users are primarily in mainland China, change this to Asia/Shanghai based on your deployment strategy. Tasks that have explicitly saved their own timezone take precedence.

Admin Workspace Frontend Configuration​

workspace.basePath defines the frontend route base for the default admin workspace. The default is /admin:

workspace:
basePath: "/admin"

During local development, the default workspace address is http://localhost:5666/admin, and the core framework API address is http://localhost:9120. workspace.basePath is returned to lina-vben through public frontend configuration and is used by Vue Router, asset URL resolution, and login redirects. It is not the core framework control-plane API prefix, and it does not mean the default workspace is served under the core framework API address.

For ordinary deployments, keep /admin so /, portal pages, and source-plugin custom public routes remain available. Only use / when the admin workspace has its own dedicated domain. This value must not use core framework reserved paths such as /api, /x, or /x-assets.

Internationalization​

I18N configuration determines the runtime default language, whether multi-language is enabled, and the frontend language switch list:

i18n:
default: zh-CN
enabled: true
locales:
- locale: en-US
nativeName: English
- locale: zh-CN
nativeName: įŽ€äŊ“中文

The main repository ships zh-CN and en-US runtime language resources by default. When adding a new language, you need to provide core framework and plugin language packs and add the language to i18n.locales. See I18N Internationalization for resource organization details.

Cluster Coordination​

The default single-node mode:

cluster:
enabled: false

Single-node mode does not connect to Redis. When cluster mode is enabled, the current coordination backend only supports Redis:

cluster:
enabled: true
coordination: redis
election:
lease: 30s
renewInterval: 10s
redis:
address: "127.0.0.1:6379"
db: 0
password: ""
connectTimeout: 3s
readTimeout: 2s
writeTimeout: 2s

Redis handles leader election, distributed locks, cache revision, and cross-node events. PostgreSQL continues to handle business data, governance data, and plugin state persistence. See Native Distributed Architecture for topology details.

File Uploads​

Upload configuration controls where the core framework saves files and the single-file size limit:

upload:
path: "temp/upload"
maxSize: 100

Plugins that need file storage should use their own namespace, for example temp/upload/content-notice/, to avoid mixing with core framework or other plugin resources.

Plugin Configuration​

Plugin configuration bridges core framework governance and the plugin runtime:

plugin:
allowForceUninstall: true
dynamic:
storagePath: "temp/output"
autoEnable:
# - id: "demo-control"
# withMockData: false
SettingDescription
allowForceUninstallWhether platform administrators can perform an audited force-uninstall after a lifecycle guard vetoes
dynamic.storagePathStorage directory for WASM dynamic plugin build artifacts and uploads
autoEnablePlugin list to automatically install and enable when the core framework starts

Each entry in autoEnable uses the {id, withMockData} structure. withMockData: true loads demo data from the plugin's manifest/sql/mock-data during auto-installation — not recommended for production.

autoEnable no longer accepts bare string entries. The following form is invalid:

plugin:
autoEnable:
- "linapro-demo-source"

withMockData defaults to false and only applies during startup auto-installation. Already-installed plugins do not import demo data again just because the setting changes to true. Duplicate plugin IDs keep the first configuration entry.

Plugin-Owned Business Configuration​

The core framework config.yaml stores core framework runtime configuration only. It should not carry a plugin's own business configuration. Plugins should read their configuration through the plugin-scoped configuration service, in this priority order:

PriorityPathDescription
1plugins/<plugin-id>/config.yamlOperations-side override under the production configuration root; the root is determined by GF_GCFG_PATH or the default configuration path
2apps/lina-plugins/<plugin-id>/manifest/config/config.yamlDevelopment-time plugin default configuration
3manifest/config/config.yaml inside a dynamic plugin artifactDynamic plugin default configuration carried with the release

manifest/config/config.example.yaml is only a template and is not used as a runtime default. Source plugins read their own configuration through HostServices().Config(). Dynamic plugins read it after declaring service: config with methods: [get] in hostServices. When a plugin genuinely needs public host configuration, use HostConfig() or hostConfig.get to read allowlisted keys. The current allowlist includes workspace.basePath, i18n.default, and i18n.enabled.

Production Checklist​

Before going live, review at least these settings:

ItemRecommendation
jwt.secretReplace the default with a random strong secret
database.default.linkPoint to production PostgreSQL; do not use demo connection strings
database.default.debugKeep false to avoid leaking SQL details
logger.extensions.structuredEnable structured logging in production
workspace.basePathKeep /admin or use / only on a dedicated admin domain; do not occupy /api, /x, or /x-assets. The local default workspace address is http://localhost:5666/admin
scheduler.defaultTimezoneSet to your business timezone
cluster.redisUse a dedicated, reliable, authenticated Redis instance in cluster mode
plugin.allowForceUninstallDecide based on organizational governance requirements
plugin.autoEnableUse caution with demo data in production