Skip to main content

Module config

Module config 

Source
Expand description

Configuration for the objectstore server.

This module provides the configuration system for the objectstore HTTP server. Configuration can be loaded from multiple sources with the following precedence (highest to lowest):

  1. Environment variables (prefixed with OS__)
  2. YAML configuration file (specified via -c or --config flag)
  3. Defaults

See Config for a description of all configuration fields and their defaults.

§Environment Variables

Environment variables use OS__ as a prefix and double underscores (__) to denote nested configuration structures. For example:

  • OS__HTTP_ADDR=0.0.0.0:8888 sets the HTTP server address
  • OS__STORAGE__TYPE=filesystem sets the storage type
  • OS__STORAGE__PATH=/data sets the directory path

§YAML Configuration File

Configuration can also be provided via a YAML file. The above configuration in YAML format would look like this:

http_addr: 0.0.0.0:8888

storage:
  type: filesystem
  path: /data

§Variable References

Any configuration value may be written as a reference, which is resolved after all sources have been merged. ${file:PATH} is replaced by that file’s contents and ${VAR_NAME} by that environment variable:

storage_cogs:
  type: kafka
  override_params:
    sasl.password: ${file:/var/secrets/kafka-password}

A reference must be the entire value: ${A} works, prefix-${A} does not. Referencing a file that cannot be read, or an environment variable that is not set, is an error at startup.

§Relationship to OS__ environment variables

These are different mechanisms and neither replaces the other. They can even be used together: OS__SENTRY__DSN=${SENTRY_DSN} will set the sentry.dsn YAML key to the value of the SENTRY_DSN environment variable.

Structs§

AuthZ
Configuration for content-based authorization.
AuthZVerificationKey
A key that may be used to verify a request’s auth token and its associated permissions. May contain multiple key versions to facilitate rotation.
Config
Main configuration struct for the objectstore server.
ConfigSecret
Newtype around String that may protect against accidental logging of secrets in our configuration struct. Use with [secrecy::SecretBox].
Http
Configuration for the HTTP layer.
LevelFilter
A filter comparable to a verbosity [Level].
LoggingConfig
Logging configuration.
Runtime
Runtime configuration for the Tokio async runtime.
Sentry
Sentry error tracking and performance monitoring configuration.
Service
Configuration for the StorageService.

Enums§

LogFormat
Log output format.
MultipartUploadStorageConfig
Configuration for the long-term backend in a tiered::TieredStorageConfig.
StorageConfig
Storage backend configuration.

Constants§

DEFAULT_MAX_HTTP_REQUESTS
Default maximum number of concurrent in-flight HTTP requests.