Skip to main content

Configuration

Configuration Concept

This document outlines a configuration concept, detailing the steps involved in the configuration process:

  • Default name of the configuration file is "config.toml"
  • Configuration file should be located at the root folder of the database
  • The application will create a configuration file upon initial startup, if one is not already present.
  • Configuration file uses TOML format
  • Configuration values should be read as follows:
    • <CATEGORY><CONFIGURATION>
    • Ex. "server.host"
  • Database leverages environment variables to dynamically modify settings defined in a configuration file. This process typically involves two steps:
    • Initial Configuration Load: During startup, the application reads the configuration file and sets configuration parameters based on the values from the file.
    • Environment Variable Override: The database then checks relevant environment variables. If an environment variable with a matching name exists, its value is used to override the corresponding value loaded from the configuration file.

Configuration Parameters and Default Values

The database should use a configuration file that will defined following parameters:

ConfigurationDefaultENV NameDescriptionCategoryStatus
host127.0.0.1DARE_HOSTName or IP address of the serverserveradded: v0.0.3
port2605DARE_PORTPort number for the serverserveradded: v0.0.3
admin_useradminDARE_USERUsername for the admin user (future auth)serveradded: v0.0.3
admin_password<GENERATED-ON-START>DARE_PASSWORDPassword for the admin user (future implementation)serveradded: v0.0.3
log_levelINFODARE_LOG_LEVELLog levellogadded: v0.0.3
log_filedaredb.logDARE_LOG_FILEPath to the desired location for log files (optional)logadded: v0.0.3
data_dirdataDARE_DATA_DIRPath to the desired location to persist data (if required)settingsadded: v0.0.3
tls_enabledFalseDARE_TLS_ENABLEDEnables HTTPS to access datasecurityadded: v0.0.3
tls_cert_private<ROOT>/settings/cert_private.pemDARE_TLS_CERT_PRIVATEPrivate certificate for secure connectionsecurityadded: v0.0.3
tls_cert_public<ROOT>/settings/cert_public.pemDARE_TLS_CERT_PUBLICPublic certificate for secure connectionsecurityadded: v0.0.3

Internal Settings and Constants

The current section documents a hardcoded settings and constants used in the DareDB

  • JWT token has an expirationTime of a token set to 5 minutes. After this period, a new JWT token must be requested.