mirror of
https://github.com/netinvent/npbackup.git
synced 2025-12-17 13:41:02 +08:00
Add restore_only permission
This commit is contained in:
parent
7f798b02c1
commit
825269eb39
6 changed files with 13 additions and 7 deletions
|
|
@ -63,6 +63,7 @@ Please check https://github.com/netinvent/npbackup/releases
|
||||||
- Repository permissions allowing to limit clients
|
- Repository permissions allowing to limit clients
|
||||||
- Backup only permission
|
- Backup only permission
|
||||||
- Backup, list and restore permissions
|
- Backup, list and restore permissions
|
||||||
|
- Restore only permissions
|
||||||
- Full permissions including destructive operations
|
- Full permissions including destructive operations
|
||||||
- Encrypted data viewing requires additional password
|
- Encrypted data viewing requires additional password
|
||||||
- AES-256 keys can't be guessed in executables thanks to Nuitka Commercial compiler
|
- AES-256 keys can't be guessed in executables thanks to Nuitka Commercial compiler
|
||||||
|
|
@ -245,6 +246,7 @@ In that case, you can set permissions via the GUI or directly in the configurati
|
||||||
Permissions are:
|
Permissions are:
|
||||||
- full: Set by default, allows all including destructive operations
|
- full: Set by default, allows all including destructive operations
|
||||||
- restore: Allows everything backup does plus restore, check and dump operations
|
- restore: Allows everything backup does plus restore, check and dump operations
|
||||||
|
- restore_noly: Allows only restoring backups, but not creating ones
|
||||||
- backup: Allows, backup, snapshot/object listing operations and repo unlocking
|
- backup: Allows, backup, snapshot/object listing operations and repo unlocking
|
||||||
|
|
||||||
## Logs
|
## Logs
|
||||||
|
|
|
||||||
|
|
@ -520,6 +520,7 @@ class NPBackupRunner:
|
||||||
Possible permissions are:
|
Possible permissions are:
|
||||||
- backup: Init, Backup, list backups and unlock
|
- backup: Init, Backup, list backups and unlock
|
||||||
- restore: Init, Backup, restore, recover and list snapshots
|
- restore: Init, Backup, restore, recover and list snapshots
|
||||||
|
- restore_only: Restore only
|
||||||
- full: Full permissions
|
- full: Full permissions
|
||||||
|
|
||||||
Only one permission can be set per repo
|
Only one permission can be set per repo
|
||||||
|
|
@ -531,13 +532,13 @@ class NPBackupRunner:
|
||||||
required_permissions = {
|
required_permissions = {
|
||||||
"init": ["backup", "restore", "full"],
|
"init": ["backup", "restore", "full"],
|
||||||
"backup": ["backup", "restore", "full"],
|
"backup": ["backup", "restore", "full"],
|
||||||
"has_recent_snapshot": ["backup", "restore", "full"],
|
"has_recent_snapshot": ["backup", "restore", "restore_only", "full"],
|
||||||
"snapshots": ["backup", "restore", "full"],
|
"snapshots": ["backup", "restore", "restore_only", "full"],
|
||||||
"stats": ["backup", "restore", "full"],
|
"stats": ["backup", "restore", "full"],
|
||||||
"ls": ["backup", "restore", "full"],
|
"ls": ["backup", "restore", "restore_only", "full"],
|
||||||
"find": ["backup", "restore", "full"],
|
"find": ["backup", "restore", "restore_only", "full"],
|
||||||
"restore": ["restore", "full"],
|
"restore": ["restore", "restore_only", "full"],
|
||||||
"dump": ["restore", "full"],
|
"dump": ["restore", "retore_only", "full"],
|
||||||
"check": ["restore", "full"],
|
"check": ["restore", "full"],
|
||||||
"recover": ["restore", "full"],
|
"recover": ["restore", "full"],
|
||||||
"list": ["full"],
|
"list": ["full"],
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ def viewer_create_repo(viewer_repo_uri: str, viewer_repo_password: str) -> dict:
|
||||||
# Let's set default backup age to 24h
|
# Let's set default backup age to 24h
|
||||||
repo_config.s("repo_opts.minimum_backup_age", 1440)
|
repo_config.s("repo_opts.minimum_backup_age", 1440)
|
||||||
# NPF-SEC-00005 Add restore permission
|
# NPF-SEC-00005 Add restore permission
|
||||||
repo_config.s("permissions", "restore")
|
repo_config.s("permissions", "restore_only")
|
||||||
|
|
||||||
return repo_config
|
return repo_config
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,7 @@ def config_gui(full_config: dict, config_file: str):
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"backup": _t("config_gui.backup_perms"),
|
"backup": _t("config_gui.backup_perms"),
|
||||||
"restore": _t("config_gui.restore_perms"),
|
"restore": _t("config_gui.restore_perms"),
|
||||||
|
"restore_only": _t("config_gui.restore_only_perms"),
|
||||||
"full": _t("config_gui.full_perms"),
|
"full": _t("config_gui.full_perms"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ en:
|
||||||
permissions: Permissions
|
permissions: Permissions
|
||||||
backup_perms: Backup only
|
backup_perms: Backup only
|
||||||
restore_perms: Backup, verify, recover and restore
|
restore_perms: Backup, verify, recover and restore
|
||||||
|
restore_only_perms: Restore only
|
||||||
full_perms: Full permissions
|
full_perms: Full permissions
|
||||||
setting_permissions_requires_manager_password: Setting permissions requires manager password
|
setting_permissions_requires_manager_password: Setting permissions requires manager password
|
||||||
manager_password_too_simple: Manager password needs at least 8 uppercase, lowercase and digits characters
|
manager_password_too_simple: Manager password needs at least 8 uppercase, lowercase and digits characters
|
||||||
|
|
|
||||||
|
|
@ -146,6 +146,7 @@ fr:
|
||||||
permissions: Permissions
|
permissions: Permissions
|
||||||
backup_perms: Sauvegardes uniquement
|
backup_perms: Sauvegardes uniquement
|
||||||
restore_perms: Sauvegarde, vérification, récupération et restauration
|
restore_perms: Sauvegarde, vérification, récupération et restauration
|
||||||
|
restore_only_perms: Restauration uniquement
|
||||||
full_perms: Accès total
|
full_perms: Accès total
|
||||||
setting_permissions_requires_manager_password: Un mot de passe gestionnaire est requis pour définir des permissions
|
setting_permissions_requires_manager_password: Un mot de passe gestionnaire est requis pour définir des permissions
|
||||||
manager_password_too_simple: Le mot de passe gestionnaire nécessite au moins 8 caractères majuscules, minuscules et chiffres
|
manager_password_too_simple: Le mot de passe gestionnaire nécessite au moins 8 caractères majuscules, minuscules et chiffres
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue