added /etc/feroxbuster as a valid config location

updated .deb to install the example config at /etc/feroxbuster
version bumped to 0.2.1
This commit is contained in:
epi
2020-10-03 08:59:28 -05:00
parent d8afb58ddd
commit 9edd414442
3 changed files with 13 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "feroxbuster"
version = "0.2.0"
version = "0.2.1"
authors = ["Ben 'epi' Risher <epibar052@gmail.com>"]
license = "MIT"
edition = "2018"
@@ -46,4 +46,8 @@ panic = 'abort'
[package.metadata.deb]
section = "utility"
license-file = ["LICENSE", "4"]
conf-files = ["~/.config/feroxbuster/ferox-config.toml"]
conf-files = ["/etc/feroxbuster/ferox-config.toml"]
assets = [
["target/release/feroxbuster", "/usr/bin/", "755"],
["ferox-config.toml.example", "/etc/feroxbuster/ferox-config.toml", "644"],
]

View File

@@ -97,6 +97,7 @@ After setting built-in default values, any values defined in a `ferox-config.tom
built-in defaults.
`feroxbuster` searches for `ferox-config.toml` in the following locations (in the order shown):
- `/etc/feroxbuster/`
- `CONFIG_DIR/ferxobuster/`
- The same directory as the `feroxbuster` executable
- The user's current working directory

View File

@@ -233,6 +233,7 @@ impl Configuration {
/// built-in defaults.
///
/// `ferox-config.toml` can be placed in any of the following locations (in the order shown):
/// - `/etc/feroxbuster/`
/// - `CONFIG_DIR/ferxobuster/`
/// - The same directory as the `feroxbuster` executable
/// - The user's current working directory
@@ -255,10 +256,15 @@ impl Configuration {
// actually specified in the config file
//
// search for a config using the following order of precedence
// - /etc/feroxbuster/
// - CONFIG_DIR/ferxobuster/
// - same directory as feroxbuster executable
// - current directory
// merge a config found at /etc/feroxbuster/ferox-config.toml
let config_file = PathBuf::new().join("/etc/feroxbuster").join(DEFAULT_CONFIG_NAME);
Self::parse_and_merge_config(config_file, &mut config);
// merge a config found at ~/.config/feroxbuster/ferox-config.toml
if let Some(config_dir) = dirs::config_dir() {
// config_dir() resolves to one of the following