Remove backup_admin_password variable

This commit is contained in:
Orsiris de Jong 2023-12-10 23:11:04 +01:00
parent 658a0327f6
commit f7a8cf9a89
5 changed files with 15 additions and 19 deletions

View file

@ -79,7 +79,6 @@ The output of the above command should be something like `b'\xa1JP\r\xff\x11u>?V
Now copy that string into the file `npbackup/secret_keys.py`, which should look like: Now copy that string into the file `npbackup/secret_keys.py`, which should look like:
``` ```
AES_KEY = b'\xa1JP\r\xff\x11u>?V\x15\xa1\xfd\xaa&tD\xdd\xf9\xde\x07\x93\xd4\xdd\x87R\xd0eb\x10=/' AES_KEY = b'\xa1JP\r\xff\x11u>?V\x15\xa1\xfd\xaa&tD\xdd\xf9\xde\x07\x93\xd4\xdd\x87R\xd0eb\x10=/'
DEFAULT_BACKUP_ADMIN_PASSWORD = "MySuperSecretPassword123"
``` ```
Note that we also changed the default backup admin password, which is used to see unencrypted configurations in the GUI. Note that we also changed the default backup admin password, which is used to see unencrypted configurations in the GUI.

View file

@ -7,7 +7,7 @@ __intname__ = "npbackup.gui.config"
__author__ = "Orsiris de Jong" __author__ = "Orsiris de Jong"
__copyright__ = "Copyright (C) 2022-2023 NetInvent" __copyright__ = "Copyright (C) 2022-2023 NetInvent"
__license__ = "GPL-3.0-only" __license__ = "GPL-3.0-only"
__build__ = "2023042201" __build__ = "2023121001"
import os import os
@ -26,22 +26,20 @@ logger = getLogger(__intname__)
def ask_backup_admin_password(config_dict) -> bool: def ask_backup_admin_password(config_dict) -> bool:
# NPF-SEC-00001 SECURITY-ADMIN-BACKUP-PASSWORD ONLY AVAILABLE ON PRIVATE COMPILED BUILDS
if not IS_COMPILED or not configuration.IS_PRIV_BUILD:
sg.PopupError(_t("config_gui.not_allowed_on_not_compiled"))
return False
try: try:
backup_admin_password = config_dict["options"]["backup_admin_password"] backup_admin_password = config_dict["options"]["backup_admin_password"]
if not backup_admin_password:
backup_admin_password = configuration.DEFAULT_BACKUP_ADMIN_PASSWORD
except KeyError: except KeyError:
backup_admin_password = configuration.DEFAULT_BACKUP_ADMIN_PASSWORD backup_admin_password = None
if backup_admin_password:
if sg.PopupGetText( if sg.PopupGetText(
_t("config_gui.enter_backup_admin_password"), password_char="*" _t("config_gui.enter_backup_admin_password"), password_char="*"
) == str(backup_admin_password): ) == str(backup_admin_password):
return True return True
sg.PopupError(_t("config_gui.wrong_password")) sg.PopupError(_t("config_gui.wrong_password"))
return False return False
else:
sg.PopupError(_t("config_gui.no_backup_admin_password_set"))
return False
def config_gui(config_dict: dict, config_file: str): def config_gui(config_dict: dict, config_file: str):

View file

@ -7,7 +7,7 @@ __intname__ = "npbackup.secret_keys"
__author__ = "Orsiris de Jong" __author__ = "Orsiris de Jong"
__copyright__ = "Copyright (C) 2023 NetInvent" __copyright__ = "Copyright (C) 2023 NetInvent"
__license__ = "GPL-3.0-only" __license__ = "GPL-3.0-only"
__build__ = "2023032601" __build__ = "2023120601"
# Encryption key to keep repo settings safe in plain text yaml config file # Encryption key to keep repo settings safe in plain text yaml config file
@ -19,7 +19,6 @@ __build__ = "2023032601"
# print(generate_key(32)) # print(generate_key(32))
AES_KEY = b"\xc3T\xdci\xe3[s\x87o\x96\x8f\xe5\xee.>\xf1,\x94\x8d\xfe\x0f\xea\x11\x05 \xa0\xe9S\xcf\x82\xad|" AES_KEY = b"\xc3T\xdci\xe3[s\x87o\x96\x8f\xe5\xee.>\xf1,\x94\x8d\xfe\x0f\xea\x11\x05 \xa0\xe9S\xcf\x82\xad|"
DEFAULT_BACKUP_ADMIN_PASSWORD = "NPBackup_00"
""" """
If someday we need to change the AES_KEY, copy it's content to EARLIER_AES_KEY and generate a new one If someday we need to change the AES_KEY, copy it's content to EARLIER_AES_KEY and generate a new one

View file

@ -82,7 +82,7 @@ en:
machine_group: Machine group machine_group: Machine group
show_decrypted: Show decrypted show_decrypted: Show decrypted
not_allowed_on_not_compiled: Using this option is not allowed on non compiled or non private builds no_backup_admin_password_set: No backup admin password set, cannot show unencrypted
# compression # compression
auto: Automatic auto: Automatic

View file

@ -82,7 +82,7 @@ fr:
machine_group: Groupe machine machine_group: Groupe machine
show_decrypted: Voir déchiffré show_decrypted: Voir déchiffré
not_allowed_on_not_compiled: Cette option n'est pas permise sur une version non compilée ou non privée no_backup_admin_password_set: Mot de passe admin backup non initialisé, ne peut montrer la version déchiffrée
# compression # compression
auto: Automatique auto: Automatique