Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggregator: Look for config files in similiar places like the other tools. #440

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cmd/csaf_aggregator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ type config struct {

// configPaths are the potential file locations of the config file.
var configPaths = []string{
// TODO: Make symmetric to checker and downloader.
"aggregator.toml",
"~/.config/csaf/aggregator.toml",
"~/.csaf_aggregator.toml",
"csaf_aggregator.toml",
}

// parseArgsConfig parse the command arguments and loads configuration
Expand Down
9 changes: 9 additions & 0 deletions docs/csaf_aggregator.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ Help Options:
-h, --help Show this help message
```

If no config file is explictly given the follwing places are searched for a config file:
```
~/.config/csaf/aggregator.toml
~/.csaf_aggregator.toml
csaf_aggregator.toml
```

with `~` expanding to `$HOME` on unixoid systems and `%HOMEPATH` on Windows systems.

Usage example for a single run, to test if the config is good:
```bash
./csaf_aggregator -c docs/examples/aggregator.toml
Expand Down
Loading