mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
fix: remove unsupported letsencrypt_dns plugin and clean up related data handling
This commit is contained in:
parent
23b7ef6ee1
commit
826631291f
2 changed files with 12 additions and 0 deletions
|
|
@ -625,6 +625,10 @@ class Database:
|
|||
del old_data["bw_plugins"][i]
|
||||
break
|
||||
|
||||
if plugin["id"] == "letsencrypt_dns":
|
||||
self.logger.warning(f"Plugin {plugin['id']} is no longer supported in 1.6.X versions, skipping it")
|
||||
continue
|
||||
|
||||
if old_data and plugin["id"] not in found_plugins:
|
||||
self.logger.warning(f'{plugin.get("type", "core").title()} Plugin "{plugin["id"]}" does not exist, creating it')
|
||||
|
||||
|
|
@ -1220,6 +1224,12 @@ class Database:
|
|||
external_column = getattr(row, "external", None)
|
||||
row = {column: getattr(row, column) for column in Base.metadata.tables[table_name].columns.keys() if hasattr(row, column)}
|
||||
|
||||
# ? As the letsencrypt_dns plugin is no longer supported, we need to remove the data
|
||||
if (table_name == "bw_plugins" and row["id"] == "letsencrypt_dns") or (
|
||||
table_name in ("bw_settings", "bw_jobs", "bw_plugin_pages", "bw_cli_commands") and row["plugin_id"] == "letsencrypt_dns"
|
||||
):
|
||||
continue
|
||||
|
||||
# ? As the external column has been replaced by the type column, we need to update the data if the column exists
|
||||
if table_name == "bw_plugins" and external_column is not None:
|
||||
row["type"] = "external" if external_column else "core"
|
||||
|
|
|
|||
|
|
@ -578,6 +578,8 @@ if __name__ == "__main__":
|
|||
stop(1)
|
||||
LOGGER.info("Backup completed successfully, if you want to restore the backup, you can find it in /var/lib/bunkerweb/upgrade_backups")
|
||||
|
||||
rmtree(join(sep, "etc", "bunkerweb", "pro", "plugins", "letsencrypt_dns"), ignore_errors=True)
|
||||
|
||||
if SCHEDULER.db.readonly:
|
||||
LOGGER.warning("The database is read-only, no need to save the changes in the configuration as they will not be saved")
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue