src/client/http_client.rs: try to login
use an environment var to store passphrase (PBS_PASSWORD)
This commit is contained in:
@ -53,7 +53,7 @@ impl BackupRepository {
|
||||
|
||||
fn backup_directory(repo: &BackupRepository, body: Body, archive_name: &str) -> Result<(), Error> {
|
||||
|
||||
let client = HttpClient::new(&repo.host);
|
||||
let client = HttpClient::new(&repo.host, &repo.user);
|
||||
|
||||
let epoch = std::time::SystemTime::now().duration_since(
|
||||
std::time::SystemTime::UNIX_EPOCH)?.as_secs();
|
||||
@ -107,7 +107,7 @@ fn list_backups(
|
||||
let repo_url = tools::required_string_param(¶m, "repository")?;
|
||||
let repo = BackupRepository::parse(repo_url)?;
|
||||
|
||||
let client = HttpClient::new(&repo.host);
|
||||
let client = HttpClient::new(&repo.host, &repo.user);
|
||||
|
||||
let path = format!("api2/json/admin/datastore/{}/backups", repo.store);
|
||||
|
||||
|
Reference in New Issue
Block a user