System configuration
System Configuration
Section titled “System Configuration”The system configuration is available for all tasks and is used to store all .env
(environment) variables on the initial backend run. on later runs the configuration is always synced between
the environment variables and the database without overriding any existing DB values, so any subsequent changes to the configuration is done ONLY via the API or the UI.
Configuration Attributes
Section titled “Configuration Attributes”The following table details all available configuration attributes, their descriptions, default values, and whether they are encrypted when stored in the database.
Attribute Path | Description | Default Value | Environment Variable | Sensitive (encrypted at rest) |
---|---|---|---|---|
env | The application environment. | development | NODE_ENV | No |
appName | The application name. | scheduler_backend | APP_NAME | No |
swaggerServer | Whether to enable swagger server or not. | true | ENABLE_SWAGGER_SERVER | No |
server.ip | The server ip. | 0.0.0.0 | IP | No |
server.port | The server port. | 8080 | PORT | No |
server.logToConsole | Whether to log to console. | true | LOG_TO_CONSOLE | No |
jobs.targetFolderForJobs | The target directory for jobs inside the jobs/ folder | "" | JOBS_SUB_DIRECTORY | No |
jobs.jobsFileExtensions | The extension of files to be considered as jobs: only accepts .ts and .js files | ts,js | JOBS_FILES_EXTENSIONS | No |
exportOutputFiles | Whether to export output files. | false | EXPORT_OUTPUT_FILE | No |
files.exportOutputFiles | Whether to export output files. | false | EXPORT_OUTPUT_FILE | No |
files.exportCacheFiles | Whether to export cache files. | false | EXPORT_CACHE_FILE | No |
files.exportJobLogsToFiles | Whether to export job logs to files. | false | EXPORT_JOB_LOGS_TO_FILES | No |
files.cacheFilesRootPath | The root path for cache files. | caches | CACHE_FILES_ROOT_PATH | No |
files.outputFilesRootPath | The root path for output files. | exported | OUTPUT_FILES_ROOT_PATH | No |
files.databaseBackupRootPath | The root path for database backup files. | db | DB_BACKUP_FILES_ROOT_PATH | No |
DB.host | The database host. | 127.0.0.1 | DB_HOST | No |
DB.port | The database port. | 3306 | DB_PORT | No |
DB.username | The database username. | root | DB_USERNAME | No |
DB.password | The database password. | root | DB_PASSWORD | Yes |
DB.schedulerDatabaseName | The database name for the scheduler. | scheduler | SCHEDULER_DB_NAME | No |
baseDB.host | The base database host. | 127.0.0.1 | BASE_DB_HOST | No |
baseDB.port | The base database port. | 3306 | BASE_DB_PORT | No |
baseDB.username | The base database username. | root | BASE_DB_USERNAME | No |
baseDB.password | The base database password. | root | BASE_DB_PASSWORD | Yes |
baseDB.databaseName | The base database name. | scheduler | BASE_DB_NAME | No |
baseDB.passwordSaltRounds | The salt rounds used to hash passwords | 12 | BASE_DB_PASSWORD_SALT_ROUNDS | No |
gotify.url | The gotify url. | null | GOTIFY_URL | No |
gotify.token | The gotify token. | token | GOTIFY_TOKEN | Yes |
gotify.appToken | The gotify app token. | null | GOTIFY_APP_TOKEN | Yes |
gotify.appErrorChannelToken | The gotify app error channel token. | null | GOTIFY_ERROR_APP_TOKEN | Yes |
grafana.lokiUrl | The grafana loki url. | null | GRAFANA_LOKI_URL | No |
grafana.username | The grafana loki username. | null | GRAFANA_LOKI_USERNAME | Yes |
grafana.password | The grafana loki password. | null | GRAFANA_LOKI_PASSWORD | Yes |
browserless.url | The browserless url. | null | BROWSERLESS_URL | No |
browserless.token | The browserless token. | token | BROWSERLESS_TOKEN | Yes |
browserless.timeout | The browserless Timeout | 360000 | BROWSERLESS_TIMEOUT | No |
encryption.masterKey | The master key used to encrypt and decrypt config values, it’s expected to be in base64 | "" | MASTER_ENCRYPTION_KEY | Yes |
Managing Configuration
Section titled “Managing Configuration”System configuration can be managed through two primary interfaces:
Via API
Section titled “Via API”You can programmatically update system configuration using the API. For detailed information on the available endpoints and request formats, please refer to the API Reference.
Via UI
Section titled “Via UI”We provides a user-friendly interface for managing configuration settings. You can create 2 types of configurations :
- Single item configuration: a key value pair (ala
.env
file) - An object like configuration: a more general key name and a value that is an object of key-value pairs, a JSON like structure
The UI will let you choose between the two types of configuration clearly :
Configuration-Task interactions
Section titled “Configuration-Task interactions”Once the configuration is updated, any new task executed afterward will see the updated values. any already running tasks will not. To use the config values in your task you can find all the UNENCRYPTED values from the options object
(...)
const run(.....){ this.options?.config?.["appEnv"] // will return the current environment : development or production}