Skip to content
Snippets Groups Projects
Commit 482b23bf authored by achill (fossdd)'s avatar achill (fossdd) :gay_pride_flag: Committed by Johannes Marbach
Browse files

Load config from /usr/share aswell

parent d82dd905
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ If a change only affects particular applications, they are listed in parentheses
## Unreleased
- feat: Load config from /usr/share aswell (!26, thanks @fossdd)
- feat(buffyboard): Add man pages (!23, thanks @Jarrah)
- misc: Unify build system (!23, thanks @Jarrah)
- misc: Ensure stable file order during builds (!24, thanks @devrtz)
......
......@@ -44,6 +44,8 @@ Mandatory arguments to long options are mandatory for short options too.
-C, --config-override Path to a config override file. Can be supplied
multiple times. Config files are merged in the
following order:
* /usr/share/buffyboard.conf
* /usr/share/buffyboard.conf.d/* (alphabetically)
* /etc/buffyboard.conf
* /etc/buffyboard.conf.d/* (alphabetically)
* Override files (in supplied order)
......
......@@ -57,6 +57,8 @@ static void print_usage() {
" -C, --config-override Path to a config override file. Can be supplied\n"
" multiple times. Config files are merged in the\n"
" following order:\n"
" * /usr/share/buffyboard.conf\n"
" * /usr/share/buffyboard.conf.d/* (alphabetically)\n"
" * /etc/buffyboard.conf\n"
" * /etc/buffyboard.conf.d/* (alphabetically)\n"
" * Override files (in supplied order)\n"
......
......@@ -27,6 +27,8 @@ result.
*-C, --config-override*
Path to a config override file. Can be supplied multiple times. Config
files are merged in the following order:
- /usr/share/buffyboard.conf
- /usr/share/buffyboard.conf.d/\* (alphabetically)
- /etc/buffyboard.conf
- /etc/buffyboard.conf.d/\* (alphabetically)
- Override files (in supplied order)
......
......@@ -14,10 +14,11 @@ one option/value pair per line:
<option>=<value>
```
The default configuration file is at /etc/buffyboard.conf, BUFFYBOARD will use this
configuration file if present along with overrides placed in
/etc/buffyboard.conf.d/ and those specified with the -C option. All config files
will be merged in the following order:
On launch, BUFFYBOARD searches for configuration files in various locations and
successively merges all files together into a single configuration. Files are searched
for and, if found, merged in the following order:
- /usr/share/buffyboard.conf
- /usr/share/buffyboard.conf.d/ (alphabetically)
- /etc/buffyboard.conf
- /etc/buffyboard.conf.d/ (alphabetically)
- Override files (in supplied order)
......
......@@ -188,6 +188,8 @@ int main(int argc, char *argv[]) {
/* Parse config files */
bb_config_init_opts(&conf_opts);
bb_config_parse_file("/usr/share/buffyboard.conf", &conf_opts);
bb_config_parse_directory("/usr/share/buffyboard.conf.d", &conf_opts);
bb_config_parse_file("/etc/buffyboard.conf", &conf_opts);
bb_config_parse_directory("/etc/buffyboard.conf.d", &conf_opts);
bb_config_parse_files(cli_opts.config_files, cli_opts.num_config_files, &conf_opts);
......
......@@ -52,6 +52,8 @@ Mandatory arguments to long options are mandatory for short options too.
-C, --config-override Path to a config override file. Can be supplied
multiple times. Config files are merged in the
following order:
* /usr/share/unl0kr.conf
* /usr/share/unl0kr.conf.d/* (alphabetically)
* /etc/unl0kr.conf
* /etc/unl0kr.conf.d/* (alphabetically)
* Override files (in supplied order)
......
......@@ -59,6 +59,8 @@ static void print_usage() {
" -C, --config-override Path to a config override file. Can be supplied\n"
" multiple times. Config files are merged in the\n"
" following order:\n"
" * /usr/share/unl0kr.conf\n"
" * /usr/share/unl0kr.conf.d/* (alphabetically)\n"
" * /etc/unl0kr.conf\n"
" * /etc/unl0kr.conf.d/* (alphabetically)\n"
" * Override files (in supplied order)\n"
......
......@@ -24,6 +24,8 @@ password is printed to STDOUT. All other output happens on STDERR.
*-C, --config-override*
Path to a config override file. Can be supplied multiple times. Config
files are merged in the following order:
- /usr/share/unl0kr.conf
- /usr/share/unl0kr.conf.d/\* (alphabetically)
- /etc/unl0kr.conf
- /etc/unl0kr.conf.d/\* (alphabetically)
- Override files (in supplied order)
......
......@@ -14,11 +14,12 @@ one option/value pair per line:
<option>=<value>
```
The default configuration file is at /etc/unl0kr.conf, UNL0KR will use this
configuration file if present along with overrides placed in
/etc/unl0kr.conf.d/ and those specified with the -C option. All config files
will be merged in the following order:
- /etc/unl0kr.conf
On launch, UNL0KR searches for configuration files in various locations and
successively merges all files together into a single configuration. Files are searched
for and, if found, merged in the following order:
- /usr/share/unl0kr.conf
- /usr/share/unl0kr.conf.d/ (alphabetically)
- /etc/unl0kr.conf
- /etc/unl0kr.conf.d/ (alphabetically)
- Override files (in supplied order)
......
......@@ -381,6 +381,8 @@ int main(int argc, char *argv[]) {
/* Parse config files */
ul_config_init_opts(&conf_opts);
ul_config_parse_file("/usr/share/unl0kr.conf", &conf_opts);
ul_config_parse_directory("/usr/share/unl0kr.conf.d", &conf_opts);
ul_config_parse_file("/etc/unl0kr.conf", &conf_opts);
ul_config_parse_directory("/etc/unl0kr.conf.d", &conf_opts);
ul_config_parse_files(cli_opts.config_files, cli_opts.num_config_files, &conf_opts);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment