mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
dyndns: add postinstall recovery password handling
This commit is contained in:
parent
67e28567ff
commit
65843bda6d
1 changed files with 9 additions and 2 deletions
|
@ -157,7 +157,7 @@ def tools_postinstall(
|
||||||
overwrite_root_password=True,
|
overwrite_root_password=True,
|
||||||
):
|
):
|
||||||
from yunohost.dyndns import _dyndns_available
|
from yunohost.dyndns import _dyndns_available
|
||||||
from yunohost.utils.dns import is_yunohost_dyndns_domain
|
from yunohost.utils.dns import is_yunohost_dyndns_domain, dyndns_unsubscribe
|
||||||
from yunohost.utils.password import (
|
from yunohost.utils.password import (
|
||||||
assert_password_is_strong_enough,
|
assert_password_is_strong_enough,
|
||||||
assert_password_is_compatible,
|
assert_password_is_compatible,
|
||||||
|
@ -218,6 +218,13 @@ def tools_postinstall(
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if not available:
|
if not available:
|
||||||
|
if dyndns_recovery_password:
|
||||||
|
# Try to unsubscribe the domain so it can be subscribed again
|
||||||
|
# If successful, it will be resubscribed with the same recovery password
|
||||||
|
dyndns_unsubscribe(
|
||||||
|
domain=domain, recovery_password=dyndns_recovery_password
|
||||||
|
)
|
||||||
|
else:
|
||||||
raise YunohostValidationError("dyndns_unavailable", domain=domain)
|
raise YunohostValidationError("dyndns_unavailable", domain=domain)
|
||||||
|
|
||||||
if os.system("iptables -V >/dev/null 2>/dev/null") != 0:
|
if os.system("iptables -V >/dev/null 2>/dev/null") != 0:
|
||||||
|
|
Loading…
Add table
Reference in a new issue