General Configuration#
BaSyx Go components use a shared configuration model from internal/common. Configuration can be provided through a YAML file and overridden with environment variables.
Configuration Source Precedence#
The shared configuration loader applies the following precedence:
Environment variables
YAML configuration file
Built-in defaults
Environment variables override YAML values. Nested keys use underscore notation, for example server.port becomes SERVER_PORT.
Common Configuration Sections#
These sections are part of the shared configuration model. Components ignore settings that are not relevant to their feature set.
server#
Key |
Default |
Purpose |
|---|---|---|
|
|
Host used for the HTTP server and generated Swagger server URL. |
|
|
HTTP server port. |
|
|
Base path for API, Swagger, and health endpoints. |
|
|
Enables descriptor persistence caches where supported. |
|
|
Semantic verification mode: |
|
|
Enables the |
postgres#
Key |
Default |
Purpose |
|---|---|---|
|
|
PostgreSQL host. |
|
|
PostgreSQL port. |
|
|
Database user. |
|
|
Database password. |
|
|
Database name. |
|
|
Maximum number of open DB connections. |
|
|
Maximum number of idle DB connections. |
|
|
Maximum DB connection lifetime in minutes. |
cors#
Key |
Default |
Purpose |
|---|---|---|
|
|
Allowed CORS origins. |
|
|
Allowed HTTP methods. |
|
|
Allowed request headers. |
|
|
Enables credentialed CORS requests. |
oidc and abac#
Key |
Default |
Purpose |
|---|---|---|
|
|
JSON trustlist of accepted OIDC providers. |
|
|
Enables OIDC authentication and ABAC authorization middleware. |
|
|
ABAC access-rules model. |
If abac.enabled is false, the shared security setup is skipped. If it is true, the trustlist is required and the ABAC model is loaded when abac.modelPath is set.
general#
Key |
Default |
Purpose |
|---|---|---|
|
|
Allows implicit casts in ABAC/query expression evaluation. |
|
|
Enables descriptor query debug output. |
|
|
Enables discovery-specific descriptor behavior; some services set this internally. |
|
|
Enables custom claim/header middleware where supported. |
|
|
Accepts singular |
|
|
Enables AAS repository to AAS registry synchronization. |
|
|
Enables Submodel repository to Submodel registry synchronization. |
|
|
Public base URL used to generate synchronized registry endpoint descriptors. Multiple URLs can be comma-separated. |
|
|
Maximum upload size for repository/environment upload endpoints. |
|
|
AAS Environment startup import sources. Supports files or folders with |
When registry synchronization is enabled, general.externalUrl must be set to at least one absolute URL with scheme and host.
jws and swagger#
Key |
Default |
Purpose |
|---|---|---|
|
|
RSA private key used by Submodel Repository and AAS Environment signing use cases. |
|
|
Contact name injected into OpenAPI/Swagger docs. |
|
|
Contact email injected into OpenAPI/Swagger docs. |
|
|
Contact URL injected into OpenAPI/Swagger docs. |
Example YAML#
server:
host: 0.0.0.0
port: 5004
contextPath: ""
cacheEnabled: false
strictVerification: permissive
verificationEndpointAvailable: true
postgres:
host: db
port: 5432
dbname: basyxTestDB
user: admin
password: admin123
maxOpenConnections: 50
maxIdleConnections: 50
connMaxLifetimeMinutes: 5
cors:
allowedOrigins: []
allowedMethods: [GET, POST, PUT, PATCH, DELETE, OPTIONS]
allowedHeaders: []
allowCredentials: false
oidc:
trustlistPath: "config/trustlist.json"
abac:
enabled: false
modelPath: "config/access_rules/access-rules.json"
general:
enableImplicitCasts: true
enableDescriptorDebug: false
discoveryIntegration: false
enableCustomMiddlewareHeaderInjection: false
supportsSingularSupplementalSemanticId: false
aasRegistryIntegration: false
submodelRegistryIntegration: false
externalUrl: ""
uploadMaxSizeBytes: 134217728
aasPreconfigPaths: []
jws:
privateKeyPath: ""
swagger:
contactName: "Eclipse BaSyx"
contactEmail: "basyx-dev@eclipse.org"
contactUrl: "https://basyx.org"
Environment Variables#
Use uppercase names with underscores:
SERVER_PORT=5004
SERVER_CONTEXTPATH=/api
SERVER_STRICTVERIFICATION=permissive
POSTGRES_HOST=db
POSTGRES_PORT=5432
POSTGRES_USER=admin
POSTGRES_PASSWORD=admin123
POSTGRES_DBNAME=basyxTestDB
ABAC_ENABLED=false
OIDC_TRUSTLISTPATH=config/trustlist.json
GENERAL_EXTERNALURL=https://example.org/aas
GENERAL_UPLOADMAXSIZEBYTES=134217728
GENERAL_AAS_PRECONFIG_PATHS is parsed as a comma-separated list and overrides general.aasPreconfigPaths:
GENERAL_AAS_PRECONFIG_PATHS=file:/data/example.aasx,/data/preconfigured-aas
Security Files#
Components that use shared OIDC/ABAC security may rely on these paths:
oidc.trustlistPathabac.modelPath
In containers, paths are resolved inside the container filesystem. Mount the files or their parent directory and point the YAML value or environment variable to the mounted path.
Notes#
The BaSyx Configuration Service mainly uses the
postgressection.Repository and environment services use
general.uploadMaxSizeBytesfor upload limits.AAS Environment additionally supports
general.aasPreconfigPaths.AAS Repository, Submodel Repository, and AAS Environment use the registry synchronization settings when enabled.