feat: v0.2.0, add harden support
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -1,5 +1,5 @@
|
||||
use clap::{App, AppSettings, ArgMatches};
|
||||
use rust_util::{failure_and_exit, information};
|
||||
use rust_util::{failure_and_exit, information, success, warning};
|
||||
use rust_util::util_clap::{Command, CommandError};
|
||||
|
||||
mod db;
|
||||
@@ -20,6 +20,16 @@ impl DefaultCommandImpl {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let ignore_harden_process_error = std::env::var("IGNORE_HARDEN_PROCESS_ERROR")
|
||||
.map(|v| &v == "true").unwrap_or_else(|_| false);
|
||||
match secmem_proc::harden_process() {
|
||||
Err(e) => if ignore_harden_process_error {
|
||||
warning!("Harden local-mini-kms failed: {}", e);
|
||||
} else {
|
||||
failure_and_exit!("Harden local-mini-kms failed: {}", e);
|
||||
}
|
||||
Ok(_) => success!("Harden local-mini-kms success"),
|
||||
}
|
||||
if let Err(e) = inner_main() {
|
||||
failure_and_exit!("Run local-mini-kms error: {}", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user