mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
autodns: Improve handling of the subdomain case
This commit is contained in:
parent
5812c8f1ae
commit
fa31d49bf9
2 changed files with 13 additions and 3 deletions
|
@ -318,7 +318,8 @@
|
|||
"domain_remove_confirm_apps_removal": "Removing this domain will remove those applications:\n{apps}\n\nAre you sure you want to do that? [{answers}]",
|
||||
"domain_uninstall_app_first": "Those applications are still installed on your domain:\n{apps}\n\nPlease uninstall them using 'yunohost app remove the_app_id' or move them to another domain using 'yunohost app change-url the_app_id' before proceeding to domain removal",
|
||||
"domain_registrar_is_not_configured": "The registrar is not yet configured for domain {domain}.",
|
||||
"domain_dns_push_not_applicable": "The DNS push feature is not applicable to domain {domain}",
|
||||
"domain_dns_push_not_applicable": "The DNS push feature is not applicable to domain {domain}. You should manually configure your DNS records following the documentation at https://yunohost.org/dns_config.",
|
||||
"domain_dns_push_managed_in_parent_domain": "The DNS push feature is managed in the parent domain {parent_domain}.",
|
||||
"domain_dns_push_failed_to_authenticate": "Failed to authenticate on registrar's API. Most probably the credentials are incorrect? (Error: {error})",
|
||||
"domain_config_mail_in": "Incoming emails",
|
||||
"domain_config_mail_out": "Outgoing emails",
|
||||
|
|
|
@ -470,11 +470,17 @@ def _get_registrar_config_section(domain):
|
|||
# If parent domain exists in yunohost
|
||||
parent_domain = domain.split(".", 1)[1]
|
||||
if parent_domain in domain_list()["domains"]:
|
||||
|
||||
if Moulinette.interface.type = "api":
|
||||
parent_domain_link = "[{parent_domain}](#/domains/{parent_domain}/config)"
|
||||
else:
|
||||
parent_domain_link = parent_domain
|
||||
|
||||
registrar_infos["registrar"] = OrderedDict({
|
||||
"type": "alert",
|
||||
"style": "info",
|
||||
"ask": f"This domain is a subdomain of {parent_domain}. DNS registrar configuration should be managed in {parent_domain}'s configuration panel.", # FIXME: i18n
|
||||
"value": None
|
||||
"ask": f"This domain is a subdomain of {parent_domain_link}. DNS registrar configuration should be managed in {parent_domain}'s configuration panel.", # FIXME: i18n
|
||||
"value": "parent_domain"
|
||||
})
|
||||
return OrderedDict(registrar_infos)
|
||||
|
||||
|
@ -544,6 +550,9 @@ def domain_dns_push(operation_logger, domain, dry_run=False, force=False, purge=
|
|||
if not registrar or registrar in ["None", "yunohost"]:
|
||||
raise YunohostValidationError("domain_dns_push_not_applicable", domain=domain)
|
||||
|
||||
if registrar == "parent_domain":
|
||||
raise YunohostValidationError("domain_dns_push_managed_in_parent_domain", domain=domain, parent_domain=registrar)
|
||||
|
||||
base_dns_zone = _get_dns_zone_for_domain(domain)
|
||||
|
||||
registrar_credentials = settings
|
||||
|
|
Loading…
Add table
Reference in a new issue