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 --config or -c options
  • You can include multiple configuration files by including multiple --config options
  • Environment variables, which start with LEICMIN_
  • Command-line options, such as --port
  • Every command has a --help which identifies tehse varibales

Database

The databse connection URL has no default and must be set:

  • LEICMIN_DATABASE_URL environment variable
  • --database-url configuration 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.yaml are defaults for testing locally

  • It assumes there is a local Postgres database

  • The command just rebuild-database will drop and rebuild leicmin

    • User name and password are also leicmin
  • //.config/leicmin-test.yaml is used by the just test-scripts

  • This 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