mirror of
https://github.com/romanz/electrs.git
synced 2024-11-19 09:54:09 +01:00
Use configure_me to skip default config files
This removes the feature for skipping default config files and replaces it with a configure_me implementation. Closes #217
This commit is contained in:
parent
a73866297f
commit
081f70323c
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -235,9 +235,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "configure_me_codegen"
|
name = "configure_me_codegen"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a7ddbd860cbff075ceadf4714922a73afbe8bf53d9ed9add6c6b733feeb6f3c7"
|
checksum = "9aa65df44cc55922b4e22f49939727156a8de25492bf6bd2462a75afc5e155d6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cargo_toml",
|
"cargo_toml",
|
||||||
"fmt2io",
|
"fmt2io",
|
||||||
|
@ -16,7 +16,6 @@ build = "build.rs"
|
|||||||
default = ["metrics"]
|
default = ["metrics"]
|
||||||
metrics = ["prometheus", "tiny_http"]
|
metrics = ["prometheus", "tiny_http"]
|
||||||
metrics_process = ["prometheus/process"]
|
metrics_process = ["prometheus/process"]
|
||||||
ignore_default_config_files = []
|
|
||||||
|
|
||||||
[package.metadata.configure_me]
|
[package.metadata.configure_me]
|
||||||
spec = "internal/config_specification.toml"
|
spec = "internal/config_specification.toml"
|
||||||
@ -51,7 +50,7 @@ default-features = false
|
|||||||
features = ["zstd", "snappy"]
|
features = ["zstd", "snappy"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
configure_me_codegen = "0.4"
|
configure_me_codegen = "0.4.2"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempfile = "3.2"
|
tempfile = "3.2"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
env_prefix = "ELECTRS"
|
env_prefix = "ELECTRS"
|
||||||
conf_file_param = "conf"
|
conf_file_param = "conf"
|
||||||
conf_dir_param = "conf_dir"
|
conf_dir_param = "conf_dir"
|
||||||
|
skip_default_conf_files_switch = "skip_default_conf_files"
|
||||||
doc = """
|
doc = """
|
||||||
An efficient re-implementation of Electrum Server, inspired by ElectrumX, Electrum Personal Server and bitcoincore-indexd.
|
An efficient re-implementation of Electrum Server, inspired by ElectrumX, Electrum Personal Server and bitcoincore-indexd.
|
||||||
|
|
||||||
|
@ -178,8 +178,6 @@ fn default_daemon_dir() -> PathBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn default_config_files() -> Vec<OsString> {
|
fn default_config_files() -> Vec<OsString> {
|
||||||
#[cfg(not(feature = "ignore_default_config_files"))]
|
|
||||||
{
|
|
||||||
let mut files = vec![OsString::from("electrs.toml")]; // cwd
|
let mut files = vec![OsString::from("electrs.toml")]; // cwd
|
||||||
if let Some(mut path) = home_dir() {
|
if let Some(mut path) = home_dir() {
|
||||||
path.extend(&[".electrs", "config.toml"]);
|
path.extend(&[".electrs", "config.toml"]);
|
||||||
@ -187,12 +185,6 @@ fn default_config_files() -> Vec<OsString> {
|
|||||||
}
|
}
|
||||||
files.push(OsString::from("/etc/electrs/config.toml")); // system-wide
|
files.push(OsString::from("/etc/electrs/config.toml")); // system-wide
|
||||||
files
|
files
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "ignore_default_config_files")]
|
|
||||||
{
|
|
||||||
vec![]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
|
Loading…
Reference in New Issue
Block a user