Backend configuration¶
Service configuration is performed via environment variables.
Environment variables¶
The environment variables of the backend service can be grouped by configuration areas.
Common¶
| Variable | Valid values | Description | |
|---|---|---|---|
LISTEN |
localhost:8085 |
host:port |
Backend service address |
STATE_DIRECTORY |
Service working directory | Directory path | Directory containing the current state of the service |
GRACEFUL_TIMEOUT |
15s |
Any numbers with associated time units s, m, h |
Defines the duration after which the backend service process is forcibly terminated when a graceful shutdown has been initiated |
INSTANCE_NAME |
Generated automatically | String | A unique ID used to deploy multiple backend services within a single installation. If not set manually, it is generated automatically each time the service starts |
Logging¶
| Variable | Valid values | Description | |
|---|---|---|---|
LOG_LEVEL |
debug |
debug, info, warn, error |
Log level of the backend service |
GORM_LOG_LEVEL |
warn |
silent, info, warn, error |
Log level of the database |
GORM_LOG_PARAM_QUERIES |
1 |
0 — included, 1 — not included |
Controls the inclusion of SQL parameters in logs |
LOG_FILE |
not specified | File in JSON format | Log output file |
Important
The LOG_LEVEL variable has priority over GORM_LOG_LEVEL.
Detailed information about the available logging levels is presented in the table below.
| Level | Description |
|---|---|
debug |
Logs all information, including debug messages and internal service details. Only available for LOG_LEVEL |
info |
Logs general information about service operation: launch, shutdown, request handling. |
warn |
Logs warnings about potentially problematic situations that are not critical but deserve attention |
error |
Logs errors only |
silent |
Completely disables database logging. Only available for GORM_LOG_LEVEL |
Audit¶
| Variable | Valid values | Description | |
|---|---|---|---|
AUDIT_LOG |
1 |
1 — used, 0 — not used |
Controls the use of the audit log for backend events |
APP_AUDIT_LOG |
0 |
1 — used, 0 — not used |
Controls the use of the audit log for scanned application events |
AUDIT_LOG_FILE |
not specified | File in JSONL format | Audit log file |
Databases¶
| Variable | Default | Valid values | Description |
|---|---|---|---|
DATABASE_URI |
postgresql://solidpoint:solidpoint@127.0.0.1:5432/solidpoint |
URI in postgresql://user:password@host:port/db format |
Database URI |
DATABASE_URI_FILE |
not specified | Text file | File containing the database URI |
DB_MAX_OPEN_CONNECTIONS |
80 |
Positive integer | Maximum number of concurrent open connections to the database |
DB_MAX_IDLE_CONNECTIONS |
50 |
Positive integer | Maximum number of idle connections |
DB_MAX_CONN_LIFETIME |
5m |
Any numbers with associated time units s, m, h |
Maximum time interval during which a connection can be reused. If the specified time is exceeded, the connection is terminated |
BATCH_SIZE |
100 |
Positive integer | Maximum size of a data set for bulk insertion into a table |
Migrations and state¶
| Variable | Valid values | Description | |
|---|---|---|---|
MIGRATIONS_UP |
1 |
1 — in progress, 0 — not in progress |
Indicates whether a migration (or rollback) is currently in progress |
DATABASE_DIRTY |
0 |
1 — error, 0 — OK |
Indicates that the last migration failed or the database is inconsistent |
FORCE_VERSION |
0 |
Positive integer | Force setting the migration version. After manually applying a failed migration, set DATABASE_DIRTY=1, FORCE_VERSION=[migration number] |
Scan synchronization¶
| Variable | Valid values | Description | |
|---|---|---|---|
SYNC_SCANS |
1 |
1 — used, 0 — not used |
Controls the synchronization of scans created through different methods when the backend starts |
RESYNC_SCANS |
0 |
1 — used, 0 — not used |
Controls the synchronization of scans created on different scan nodes when the backend starts |
SMTP client¶
Detailed information about the SMTP client is available in the “Notifications” section.
Interaction with the scanner¶
| Variable | Valid values | Description | |
|---|---|---|---|
SCANNER_MAX_CALL_RECV_MSG_SIZE_MB |
100 |
Positive integer | Maximum size of a message received from the scanner (in MB) |
SCANNER_SELECTION_STRATEGY |
RoundRobin |
RoundRobin, LeastLoaded |
Specifies the algorithm for selecting a scan node |
Report generator¶
| Variable | Default | Valid values | Description |
|---|---|---|---|
REPORTER_ADDRESS |
localhost:9090 |
host:port |
Address of the report generator for scans |
Detailed information about the report generator is available in the “PDF Report Generator” section.
Concurrent backend services¶
In order to run backend services concurrently, simply configure a unique LISTEN address for each instance in its configuration file (e.g. localhost:8085 and localhost:8086). An INSTANCE_NAME identifier is generated automatically for each service when it starts.
Note
It is also possible to manually set the INSTANCE_NAME identifier in the configuration file of each backend service. In this case, the specified identifiers will be preserved and will not be generated automatically.
Load balancing configuration¶
To ensure proper operation of multiple concurrently running backend services, traffic must be balanced across them. This requires configuring Nginx as a load balancer.
The example below uses the Round-robin algorithm for load balancing. For each server, an optional weight parameter is specified, which determines the priority for receiving requests (the higher the number, the more requests are sent to that server). When equal load balancing is required, the weight parameter may be left unspecified.