Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ data/charge_log/*
data/daily_log/*
data/monthly_log/*
data/backup/*.tar.gz
data/backup/*.openwb-backup*
data/restore/*.tar.gz
data/data_migration/*.tar.gz
ramdisk/*
Expand Down
3 changes: 2 additions & 1 deletion packages/helpermodules/setdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,8 @@ def process_system_topic(self, msg: mqtt.MQTTMessage):
"openWB/set/system/usage_terms_acknowledged" in msg.topic or
"openWB/set/system/update_config_completed" in msg.topic):
self._validate_value(msg, bool)
elif "openWB/set/system/version" in msg.topic:
elif ("openWB/set/system/version" in msg.topic or
"openWB/set/system/backup_password" in msg.topic):
self._validate_value(msg, str)
elif "openWB/set/system/time" in msg.topic:
self._validate_value(msg, float)
Expand Down
12 changes: 12 additions & 0 deletions packages/helpermodules/subdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,18 @@ def process_system_topic(self, client: mqtt.Client, var: dict, msg: mqtt.MQTTMes
user = splitted[2] if len(splitted) > 2 else "getsupport"
run_command([str(Path(__file__).resolve().parents[2] / "runs" / "start_remote_support.sh"),
token, port, user], process_exception=True)
elif "openWB/system/backup_password" in msg.topic:
if self.event_subdata_initialized.is_set():
key_file = Path.home() / "backup.key"
payload = decode_payload(msg.payload)
if payload is None or payload == "":
# delete key file
if key_file.exists():
key_file.unlink()
else:
# write key file
with key_file.open("w") as file:
file.write(payload)
elif "openWB/system/backup_cloud/config" in msg.topic:
config_dict = decode_payload(msg.payload)
if config_dict["type"] is None:
Expand Down
2 changes: 2 additions & 0 deletions packages/helpermodules/update_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ class UpdateConfig:
"^openWB/system/boot_done$",
"^openWB/system/configurable/backup_clouds$",
"^openWB/system/backup_cloud/backup_before_update$",
"^openWB/system/backup_password$",
"^openWB/system/configurable/chargepoints$",
"^openWB/system/configurable/chargepoints_internal$",
"^openWB/system/configurable/devices_components$",
Expand Down Expand Up @@ -587,6 +588,7 @@ class UpdateConfig:
("openWB/optional/monitoring/config", NO_MODULE),
("openWB/optional/ocpp/config", dataclass_utils.asdict(Ocpp())),
("openWB/optional/rfid/active", False),
("openWB/system/backup_password", None),
("openWB/system/backup_cloud/config", NO_MODULE),
("openWB/system/backup_cloud/backup_before_update", True),
("openWB/system/current_branch", None),
Expand Down