Configuration
There are four ways of setting configuration values. In the order of priority, with the lower one overriding or replacing values of the ones above it:
- Default settings
- Configuration files, as provided by the
--configor-coptions - You can include multiple configuration files by including multiple
--configoptions - Environment variables, which start with
LEICMIN_ - Command-line options, such as
--port - Every command has a
--helpwhich identifies tehse varibales
Database
The databse connection URL has no default and must be set:
LEICMIN_DATABASE_URLenvironment variable--database-urlconfiguration value- From the YAML file, see below
For the YAML file, setting it would look like:
database:
url: postgres://leicmin:leicmin@localhost/leicmin?sslmode=disable
Configuration Files
At the moment, the only supported configuration file is YAML format. This works with the nested set of structures that matches the command used. For example, For example, leicmin http serve --port=9000 can also be set using the -c or --config with the path to the file that looks like:
http:
serve:
port: 9000
There are two examples in the //.config folder:
//.config/leicmin-dev.yamlare defaults for testing locallyIt assumes there is a local Postgres database
The command
just rebuild-databasewill drop and rebuildleicmin- User name and password are also
leicmin
- User name and password are also
//.config/leicmin-test.yamlis used by thejust test-scriptsThis is rebuilt every time to test behavioral functionality
Environment Variables
Enviroment variables that start with LEICMIN_ are used to configure settings, as if they were provided from the command line. Almost any option in the configuration file can be set in this manner:
- Start the environment variable with
LEICMIN_ - Sections are separated by two underscores (
__) - Understores and dashes are changed to a single underscore (
_)
For example, leicmin http serve --port=9000 can also be set by LEICMIN_HTTP__SERVE__PORT=9000.
Metadata
Project
- Project Home
- Documentation
- Project ID: 019d129e-8934-7aa9-b665-8518469763ea