Skip to content

Commit

Permalink
Load config from default data dir and configure ord env using conf…
Browse files Browse the repository at this point in the history
…ig (#3240)
  • Loading branch information
casey authored Mar 8, 2024
1 parent 5595982 commit 4747a28
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 110 deletions.
13 changes: 9 additions & 4 deletions docs/src/guides/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ The command line takes precedence over environment variables, which take
precedence over the configuration file, which takes precedence over defaults.

The path to the configuration file can be given with `--config <CONFIG_PATH>`.
`ord` will error if `<CONFIG_PATH>` doesn't exist. The path to a configuration
directory can be given with `--config-dir <CONFIG_DIR_PATH>`, in which case the
config path is `<CONFIG_DIR_PATH>/ord.yaml`. It is not an error if
`<CONFIG_DIR_PATH>/ord.yaml` does not exist.
`ord` will error if `<CONFIG_PATH>` doesn't exist.

The path to a directory containing a configuration file name named `ord.yaml`
can be given with `--config-dir <CONFIG_DIR_PATH>` or `--data-dir
<DATA_DIR_PATH>` in which case the config path is `<CONFIG_DIR_PATH>/ord.yaml`
or `<DATA_DIR_PATH>/ord.yaml`. It is not an error if it does not exist.

If none of `--config`, `--config-dir`, or `--data-dir` are given, and a file
named `ord.yaml` exists in the default data directory, it will be loaded.

For a setting named `--setting-name` on the command line, the environment
variable will be named `ORD_SETTING_NAME`, and the config file field will be
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ pub fn parse_ord_server_args(args: &str) -> (Settings, subcommand::server::Serve
vec![("INTEGRATION_TEST".into(), "1".into())]
.into_iter()
.collect(),
Default::default(),
)
.unwrap(),
server,
Expand Down
Loading

0 comments on commit 4747a28

Please sign in to comment.