diff --git a/locales/en.json b/locales/en.json index f5f706d69..49376a1e6 100644 --- a/locales/en.json +++ b/locales/en.json @@ -222,6 +222,8 @@ "migrate_tsig_wait_3": "1min...", "migrate_tsig_wait_4": "30 secondes...", "migrate_tsig_not_needed": "You do not appear to use a dyndns domain, so no migration is needed !", + "migration_description_0001_change_cert_group_to_sslcert": "Change certificates group permissions from 'metronome' to 'ssl-cert'", + "migration_description_0002_migrate_to_tsig_sha256": "Improve security of dyndns TSIG by using SHA512 instead of MD5", "migrations_backward": "Migrating backward.", "migrations_bad_value_for_target": "Invalide number for target argument, available migrations numbers are 0 or {}", "migrations_cant_reach_migration_file": "Can't access migrations files at path %s", diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index fcea5ffb3..f0e0315ca 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -950,10 +950,9 @@ def _load_migration(migration_file): class Migration(object): - # forward() and backward() are to be implemented by daughter classes + # Those are to be implemented by daughter classes - def migrate(self): - self.forward() + mode = "auto" def forward(self): raise NotImplementedError() @@ -961,15 +960,27 @@ class Migration(object): def backward(self): pass + def disclaimer(self): + return None + # The followings shouldn't be overriden + def migrate(self): + self.forward() + def __init__(self, id_): self.id = id_ + def description(self): + return m18n.n("migration_description_%s" % self.id) + def infos(self): return { "id": self.id, "number": int(self.id.split("_", 1)[0]), "name": self.id.split("_", 1)[1], + "mode": self.mode, + "description": self.description(), + "disclaimer": self.disclaimer() }