use sha-1/hmac

This commit is contained in:
2020-04-04 23:34:42 +08:00
parent 6e116f7003
commit b1a9e6f8f2
7 changed files with 111 additions and 266 deletions

View File

@@ -1,7 +1,10 @@
use std::{
cmp::{min, max, },
fs,
path::Path,
cmp::{
min,
max,
},
};
use rust_util::{
iff,
@@ -9,9 +12,7 @@ use rust_util::{
new_box_ioerror,
util_msg::*,
};
use chrono::{
Utc,
};
use chrono::Utc;
pub const ETC_OSS_BACKUPD_CONFIG: &str = "/etc/oss-backupd/config.json";
pub const OSS_BACKUPD_CONFIG: &str = "oss-backupd-config.json";
@@ -100,7 +101,10 @@ impl OSSBackupdConfigItem {
pub fn get_safe_backup_count(&self) -> usize {
min(
max(self.backup_count.unwrap_or(10u32) as usize, 1_usize),
max(
self.backup_count.unwrap_or(10u32) as usize,
1_usize
),
1000_usize
)
}