[edge] Listeners, tests first: an overall header deadline (slowloris), pipelined requests answered in order on both listeners, a proxy socket whose X-Forwarded-For is believed (red: the deadline is a pass-through)
This commit is contained in:
+13
-2
@@ -3,7 +3,7 @@
|
||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
//! `ianitor-edge --config <edge.json> [--check] [--admin-socket <path>] [--trial-config <path>]
|
||||
//! [--share-revocations <path>] [--acme-root <ca.pem>]`
|
||||
//! [--share-revocations <path>] [--acme-root <ca.pem>] [--header-timeout <secs>]`
|
||||
//!
|
||||
//! Secrets come from `$CREDENTIALS_DIRECTORY`; the log level from `$IANITOR_LOG`
|
||||
//! (error, warn, info, debug, trace; libraries are capped at info).
|
||||
@@ -25,11 +25,22 @@ fn parse_args() -> Result<(Options, bool), EdgeError> {
|
||||
Some("--admin-socket") => opts.admin_socket = args.next().map(PathBuf::from),
|
||||
Some("--trial-config") => opts.trial_config = args.next().map(PathBuf::from),
|
||||
Some("--share-revocations") => opts.share_revocations = args.next().map(PathBuf::from),
|
||||
Some("--header-timeout") => {
|
||||
let secs = args
|
||||
.next()
|
||||
.and_then(|s| s.to_str().and_then(|s| s.parse::<u64>().ok()))
|
||||
.filter(|s| (1..=3600).contains(s))
|
||||
.ok_or_else(|| {
|
||||
EdgeError::Usage("--header-timeout takes 1 to 3600 seconds".into())
|
||||
})?;
|
||||
opts.header_timeout = Some(std::time::Duration::from_secs(secs));
|
||||
}
|
||||
Some("--check") => check = true,
|
||||
Some("--help" | "-h") => {
|
||||
println!(
|
||||
"usage: ianitor-edge --config <edge.json> [--check] [--admin-socket <path>] \
|
||||
[--trial-config <path>] [--share-revocations <path>] [--acme-root <ca.pem>]"
|
||||
[--trial-config <path>] [--share-revocations <path>] [--acme-root <ca.pem>] \
|
||||
[--header-timeout <secs>]"
|
||||
);
|
||||
std::process::exit(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user