[pbs-devel] [RFC proxmox-backup 5/5] mark signed manifests as such
Fabian Grünbichler
f.gruenbichler at proxmox.com
Mon Aug 10 13:25:09 CEST 2020
for less-confusing display in the web interface
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
Notes:
I am not so sure about this one - I think I'd rather move the index.json and
client.log out of the backup content and into some new backup metadata struct,
and split the display/add an info button to the GUI view..
src/api2/admin/datastore.rs | 5 ++++-
src/backup/manifest.rs | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index 81ca02eb..fe72ea32 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -67,7 +67,10 @@ fn read_backup_index(
result.push(BackupContent {
filename: MANIFEST_BLOB_NAME.to_string(),
- crypt_mode: Some(CryptMode::None),
+ crypt_mode: match manifest.signature {
+ Some(_) => Some(CryptMode::SignOnly),
+ None => Some(CryptMode::None),
+ },
size: Some(index_size),
});
diff --git a/src/backup/manifest.rs b/src/backup/manifest.rs
index 6af110d1..56f6cf42 100644
--- a/src/backup/manifest.rs
+++ b/src/backup/manifest.rs
@@ -72,6 +72,7 @@ pub struct BackupManifest {
files: Vec<FileInfo>,
#[serde(default="empty_value")] // to be compatible with < 0.8.0 backups
pub unprotected: Value,
+ pub signature: Option<String>,
}
#[derive(PartialEq)]
@@ -105,6 +106,7 @@ impl BackupManifest {
backup_time: snapshot.backup_time().timestamp(),
files: Vec::new(),
unprotected: json!({}),
+ signature: None,
}
}
--
2.20.1
More information about the pbs-devel
mailing list