From 3bc4945ccf12c1bbc0c47a5c609f8ab1baf161c4 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 11 Sep 2019 04:29:04 +0200 Subject: [PATCH 1/9] [ux] 'new-domain' argument of maindomain command was confusing --- data/actionsmap/yunohost.yml | 2 +- src/yunohost/tools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index 22037f05f..e18a45276 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -1547,7 +1547,7 @@ tools: - PUT /domains/main arguments: -n: - full: --new-domain + full: --new-main-domain help: Change the current main domain extra: pattern: *pattern_domain diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index 64689fe0c..e4d4c4274 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -165,7 +165,7 @@ def tools_adminpw(new_password, check_strength=True): @is_unit_operation() -def tools_maindomain(operation_logger, new_domain=None): +def tools_maindomain(operation_logger, new_main_domain=None): """ Check the current main domain, or change it From 877cfc1fe550a305a624ba258bf0d30469afab10 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 11 Sep 2019 04:31:22 +0200 Subject: [PATCH 2/9] [ux] move 'maindomain' command from 'tools' to 'domain' section --- data/actionsmap/yunohost.yml | 14 +++++++++ src/yunohost/domain.py | 58 ++++++++++++++++++++++++++++++++++++ src/yunohost/tools.py | 56 ++-------------------------------- 3 files changed, 75 insertions(+), 53 deletions(-) diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index e18a45276..b7b4eaf88 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -441,6 +441,19 @@ domain: - !!str ^[0-9]+$ - "pattern_positive_number" + ### domain_maindomain() + maindomain: + action_help: Check the current main domain, or change it + api: + - GET /domains/main + - PUT /domains/main + arguments: + -n: + full: --new-main-domain + help: Change the current main domain + extra: + pattern: *pattern_domain + ### certificate_status() cert-status: action_help: List status of current certificates (all by default). @@ -1542,6 +1555,7 @@ tools: ### tools_maindomain() maindomain: action_help: Check the current main domain, or change it + deprecated: true api: - GET /domains/main - PUT /domains/main diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index 3f906748b..8529433ee 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -34,10 +34,12 @@ from moulinette.utils.log import getActionLogger import yunohost.certificate +from yunohost.app import app_ssowatconf from yunohost.regenconf import regen_conf from yunohost.utils.network import get_public_ip from yunohost.log import is_unit_operation from yunohost.hook import hook_callback +from yunohost.tools import _set_hostname logger = getActionLogger('yunohost.domain') @@ -233,6 +235,62 @@ def domain_dns_conf(domain, ttl=None): return result +@is_unit_operation() +def domain_maindomain(operation_logger, new_main_domain=None): + """ + Check the current main domain, or change it + + Keyword argument: + new_main_domain -- The new domain to be set as the main domain + + """ + + # If no new domain specified, we return the current main domain + if not new_main_domain: + return {'current_main_domain': _get_maindomain()} + + # Check domain exists + if new_main_domain not in domain_list()['domains']: + raise YunohostError('domain_unknown') + + operation_logger.related_to.append(('domain', new_main_domain)) + operation_logger.start() + + # Apply changes to ssl certs + ssl_key = "/etc/ssl/private/yunohost_key.pem" + ssl_crt = "/etc/ssl/private/yunohost_crt.pem" + new_ssl_key = "/etc/yunohost/certs/%s/key.pem" % new_main_domain + new_ssl_crt = "/etc/yunohost/certs/%s/crt.pem" % new_main_domain + + try: + if os.path.exists(ssl_key) or os.path.lexists(ssl_key): + os.remove(ssl_key) + if os.path.exists(ssl_crt) or os.path.lexists(ssl_crt): + os.remove(ssl_crt) + + os.symlink(new_ssl_key, ssl_key) + os.symlink(new_ssl_crt, ssl_crt) + + _set_maindomain(new_main_domain) + except Exception as e: + logger.warning("%s" % e, exc_info=1) + raise YunohostError('maindomain_change_failed') + + _set_hostname(new_main_domain) + + # Generate SSOwat configuration file + app_ssowatconf() + + # Regen configurations + try: + with open('/etc/yunohost/installed', 'r'): + regen_conf() + except IOError: + pass + + logger.success(m18n.n('maindomain_changed')) + + def domain_cert_status(domain_list, full=False): return yunohost.certificate.certificate_status(domain_list, full) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index e4d4c4274..5feb04dec 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -39,7 +39,7 @@ from moulinette.utils.log import getActionLogger from moulinette.utils.process import check_output, call_async_output from moulinette.utils.filesystem import read_json, write_to_json, read_yaml, write_to_yaml from yunohost.app import app_fetchlist, app_info, app_upgrade, app_ssowatconf, app_list, _install_appslist_fetch_cron -from yunohost.domain import domain_add, domain_list, _get_maindomain, _set_maindomain +from yunohost.domain import domain_add, domain_list from yunohost.dyndns import _dyndns_available, _dyndns_provides from yunohost.firewall import firewall_upnp from yunohost.service import service_status, service_start, service_enable @@ -166,58 +166,8 @@ def tools_adminpw(new_password, check_strength=True): @is_unit_operation() def tools_maindomain(operation_logger, new_main_domain=None): - """ - Check the current main domain, or change it - - Keyword argument: - new_domain -- The new domain to be set as the main domain - - """ - - # If no new domain specified, we return the current main domain - if not new_domain: - return {'current_main_domain': _get_maindomain()} - - # Check domain exists - if new_domain not in domain_list()['domains']: - raise YunohostError('domain_unknown') - - operation_logger.related_to.append(('domain', new_domain)) - operation_logger.start() - - # Apply changes to ssl certs - ssl_key = "/etc/ssl/private/yunohost_key.pem" - ssl_crt = "/etc/ssl/private/yunohost_crt.pem" - new_ssl_key = "/etc/yunohost/certs/%s/key.pem" % new_domain - new_ssl_crt = "/etc/yunohost/certs/%s/crt.pem" % new_domain - - try: - if os.path.exists(ssl_key) or os.path.lexists(ssl_key): - os.remove(ssl_key) - if os.path.exists(ssl_crt) or os.path.lexists(ssl_crt): - os.remove(ssl_crt) - - os.symlink(new_ssl_key, ssl_key) - os.symlink(new_ssl_crt, ssl_crt) - - _set_maindomain(new_domain) - except Exception as e: - logger.warning("%s" % e, exc_info=1) - raise YunohostError('maindomain_change_failed') - - _set_hostname(new_domain) - - # Generate SSOwat configuration file - app_ssowatconf() - - # Regen configurations - try: - with open('/etc/yunohost/installed', 'r'): - regen_conf() - except IOError: - pass - - logger.success(m18n.n('maindomain_changed')) + from yunohost.domain import domain_maindomain + return domain_main_domain(new_main_domain=new_main_domain) def _set_hostname(hostname, pretty_hostname=None): From f732085d3fb0ada7bc628a034dc5ed5a30774e1d Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 11 Sep 2019 04:48:53 +0200 Subject: [PATCH 3/9] [ux] rename 'yunohost domain maindomain' to 'yunohost domain main-domain' --- data/actionsmap/yunohost.yml | 4 +++- src/yunohost/domain.py | 2 +- src/yunohost/tools.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index b7b4eaf88..76500ac13 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -442,8 +442,10 @@ domain: - "pattern_positive_number" ### domain_maindomain() - maindomain: + main-domain: action_help: Check the current main domain, or change it + deprecated_alias: + - maindomain api: - GET /domains/main - PUT /domains/main diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index 8529433ee..bed8e6883 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -236,7 +236,7 @@ def domain_dns_conf(domain, ttl=None): @is_unit_operation() -def domain_maindomain(operation_logger, new_main_domain=None): +def domain_main_domain(operation_logger, new_main_domain=None): """ Check the current main domain, or change it diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index 5feb04dec..e33ef8e82 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -166,7 +166,8 @@ def tools_adminpw(new_password, check_strength=True): @is_unit_operation() def tools_maindomain(operation_logger, new_main_domain=None): - from yunohost.domain import domain_maindomain + from yunohost.domain import domain_main_domain + logger.warning(m18n.g("deprecated_command_alias", prog="yunohost", old="tools maindomain", new="domain main-domain")) return domain_main_domain(new_main_domain=new_main_domain) From 1584c907005332405c9f92811297efa658360d61 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 11 Sep 2019 04:50:50 +0200 Subject: [PATCH 4/9] [ux] more useful deprecated warning that mention the new command --- data/actionsmap/yunohost.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index 76500ac13..0fbca6efc 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -1557,7 +1557,6 @@ tools: ### tools_maindomain() maindomain: action_help: Check the current main domain, or change it - deprecated: true api: - GET /domains/main - PUT /domains/main From 94ba47d171784a4ff755015cfc48c8a5343533c7 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 11 Sep 2019 05:11:33 +0200 Subject: [PATCH 5/9] [ux] better error messages when trying to remove the main domain --- locales/en.json | 7 ++++--- src/yunohost/domain.py | 9 ++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/locales/en.json b/locales/en.json index 98cbf22e9..3964c17af 100644 --- a/locales/en.json +++ b/locales/en.json @@ -154,12 +154,13 @@ "diagnosis_no_apps": "No installed application", "dpkg_is_broken": "You cannot do this right now because dpkg/APT (the system package managers) seems to be in a broken state… You can try to solve this issue by connecting through SSH and running `sudo dpkg --configure -a`.", "dpkg_lock_not_available": "This command can't be ran right now because another program seems to be using the lock of dpkg (the system package manager)", - "domain_cannot_remove_main": "Cannot remove main domain. Set one first", + "domain_cannot_remove_main": "You cannot remove '{domain:s}' since it's the main domain, you need first to set another domain as the main domain using 'yunohost domain main-domain -n ', here is the list of candidate domains: {other_domains:s}", + "domain_cannot_remove_main_add_new_one": "You cannot remove '{domain:s}' since it's the main domain and your only domain, you need to first add another domain using 'yunohost domain add ', then set is as the main domain using 'yunohost domain main-domain -n ' and then you can remove the domain '{domain:s}' using 'yunohost domain remove {domain:s}'.'", "domain_cert_gen_failed": "Could not generate certificate", "domain_created": "Domain created", - "domain_creation_failed": "Could not create domain {domain}: {error}", + "domain_creation_failed": "Unable to create domain {domain}: {error}", "domain_deleted": "Domain deleted", - "domain_deletion_failed": "Could not delete domain {domain}: {error}", + "domain_deletion_failed": "Unable to delete domain {domain}: {error}", "domain_dns_conf_is_just_a_recommendation": "This command shows you the *recommended* configuration. It does not actually set up the DNS configuration for you. It is your responsability to configure your DNS zone in your registrar according to this recommendation.", "domain_dyndns_already_subscribed": "You have already subscribed to a DynDNS domain", "domain_dyndns_root_unknown": "Unknown DynDNS root domain", diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index bed8e6883..f26a19e8d 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -156,7 +156,14 @@ def domain_remove(operation_logger, domain, force=False): # Check domain is not the main domain if domain == _get_maindomain(): - raise YunohostError('domain_cannot_remove_main') + other_domains = domain_list()["domains"] + other_domains.remove(domain) + + if other_domains: + raise YunohostError('domain_cannot_remove_main', + domain=domain, other_domains="\n * " + ("\n * ".join(other_domains))) + else: + raise YunohostError('domain_cannot_remove_main_add_new_one', domain=domain) # Check if apps are installed on the domain for app in os.listdir('/etc/yunohost/apps/'): From 01ad8ec9643220fd835b3c20e39d14176f2c1770 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sat, 14 Sep 2019 17:06:20 +0200 Subject: [PATCH 6/9] [mod] remove now useless decorator --- src/yunohost/tools.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index e33ef8e82..bae17e15a 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -164,8 +164,7 @@ def tools_adminpw(new_password, check_strength=True): logger.success(m18n.n('admin_password_changed')) -@is_unit_operation() -def tools_maindomain(operation_logger, new_main_domain=None): +def tools_maindomain(new_main_domain=None): from yunohost.domain import domain_main_domain logger.warning(m18n.g("deprecated_command_alias", prog="yunohost", old="tools maindomain", new="domain main-domain")) return domain_main_domain(new_main_domain=new_main_domain) From 1cfe32f6f31918f92c095c2d6b400a82b9a16133 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sat, 14 Sep 2019 17:19:09 +0200 Subject: [PATCH 7/9] [fix] circular import --- src/yunohost/domain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index f26a19e8d..64c2d9927 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -39,7 +39,6 @@ from yunohost.regenconf import regen_conf from yunohost.utils.network import get_public_ip from yunohost.log import is_unit_operation from yunohost.hook import hook_callback -from yunohost.tools import _set_hostname logger = getActionLogger('yunohost.domain') @@ -251,6 +250,7 @@ def domain_main_domain(operation_logger, new_main_domain=None): new_main_domain -- The new domain to be set as the main domain """ + from yunohost.tools import _set_hostname # If no new domain specified, we return the current main domain if not new_main_domain: From 6eb4b3f89e76223241491019e55fd7a68b53d40a Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sun, 15 Sep 2019 03:11:52 +0200 Subject: [PATCH 8/9] [mod] use renamed domain_main_domain function in postinstall --- src/yunohost/tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index bae17e15a..fe75bcf61 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -231,6 +231,7 @@ def tools_postinstall(operation_logger, domain, password, ignore_dyndns=False, """ from yunohost.utils.password import assert_password_is_strong_enough + from yunohost.domain import domain_main_domain dyndns_provider = "dyndns.yunohost.org" @@ -353,7 +354,7 @@ def tools_postinstall(operation_logger, domain, password, ignore_dyndns=False, # New domain config regen_conf(['nsswitch'], force=True) domain_add(domain, dyndns) - tools_maindomain(domain) + domain_main_domain(domain) # Change LDAP admin password tools_adminpw(password, check_strength=not force_password) From f18252d82e6a932dc4d86494d6048668152a5cf5 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sun, 15 Sep 2019 03:39:04 +0200 Subject: [PATCH 9/9] [i18n] change translation key to match new function name --- locales/ar.json | 6 +++--- locales/ca.json | 6 +++--- locales/de.json | 4 ++-- locales/en.json | 6 +++--- locales/es.json | 4 ++-- locales/fr.json | 6 +++--- locales/it.json | 6 +++--- locales/oc.json | 6 +++--- locales/pt.json | 4 ++-- src/yunohost/domain.py | 4 ++-- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/locales/ar.json b/locales/ar.json index 46f9315af..fba086bc4 100644 --- a/locales/ar.json +++ b/locales/ar.json @@ -211,8 +211,8 @@ "mail_domain_unknown": "Unknown mail address domain '{domain:s}'", "mail_forward_remove_failed": "Unable to remove mail forward '{mail:s}'", "mailbox_used_space_dovecot_down": "Dovecot mailbox service need to be up, if you want to get mailbox used space", - "maindomain_change_failed": "Unable to change the main domain", - "maindomain_changed": "The main domain has been changed", + "main_domain_change_failed": "Unable to change the main domain", + "main_domain_changed": "The main domain has been changed", "migrate_tsig_end": "Migration to hmac-sha512 finished", "migrate_tsig_failed": "Migrating the dyndns domain {domain} to hmac-sha512 failed, rolling back. Error: {error_code} - {error}", "migrate_tsig_start": "Not secure enough key algorithm detected for TSIG signature of domain '{domain}', initiating migration to the more secure one hmac-sha512", @@ -404,7 +404,7 @@ "log_user_create": "إضافة المستخدم '{}'", "log_user_delete": "حذف المستخدم '{}'", "log_user_update": "تحديث معلومات المستخدم '{}'", - "log_tools_maindomain": "جعل '{}' كنطاق أساسي", + "log_domain_main_domain": "جعل '{}' كنطاق أساسي", "log_tools_upgrade": "تحديث حُزم ديبيان", "log_tools_shutdown": "إطفاء الخادم", "log_tools_reboot": "إعادة تشغيل الخادم", diff --git a/locales/ca.json b/locales/ca.json index f5c040670..6ec3c0890 100644 --- a/locales/ca.json +++ b/locales/ca.json @@ -271,7 +271,7 @@ "log_user_create": "Afegeix l'usuari « {} »", "log_user_delete": "Elimina l'usuari « {} »", "log_user_update": "Actualitza la informació de l'usuari « {} »", - "log_tools_maindomain": "Fes de « {} » el domini principal", + "log_domain_main_domain": "Fes de « {} » el domini principal", "log_tools_migrations_migrate_forward": "Migrar", "log_tools_migrations_migrate_backward": "Migrar endarrera", "log_tools_postinstall": "Fer la post instal·lació del servidor YunoHost", @@ -289,8 +289,8 @@ "mail_forward_remove_failed": "No s'han pogut eliminar el reenviament de correu «{mail:s}»", "mailbox_used_space_dovecot_down": "S'ha d'engegar el servei de correu Dovecot per poder obtenir l'espai utilitzat per la bústia de correu", "mail_unavailable": "Aquesta adreça de correu esta reservada i ha de ser atribuïda automàticament el primer usuari", - "maindomain_change_failed": "No s'ha pogut canviar el domini principal", - "maindomain_changed": "S'ha canviat el domini principal", + "main_domain_change_failed": "No s'ha pogut canviar el domini principal", + "main_domain_changed": "S'ha canviat el domini principal", "migrate_tsig_end": "La migració cap a hmac-sha512 s'ha acabat", "migrate_tsig_failed": "Ha fallat la migració del domini dyndns {domain} cap a hmac-sha512, anul·lant les modificacions. Error: {error_code} - {error}", "migrate_tsig_start": "L'algoritme de generació de claus no es prou segur per a la signatura TSIG del domini «{domain}», començant la migració cap a un de més segur hmac-sha512", diff --git a/locales/de.json b/locales/de.json index d03226187..dc9ea70f1 100644 --- a/locales/de.json +++ b/locales/de.json @@ -104,8 +104,8 @@ "mail_alias_remove_failed": "E-Mail Alias '{mail:s}' konnte nicht entfernt werden", "mail_domain_unknown": "Unbekannte Mail Domain '{domain:s}'", "mail_forward_remove_failed": "Mailweiterleitung '{mail:s}' konnte nicht entfernt werden", - "maindomain_change_failed": "Die Hauptdomain konnte nicht geändert werden", - "maindomain_changed": "Die Hauptdomain wurde geändert", + "main_domain_change_failed": "Die Hauptdomain konnte nicht geändert werden", + "main_domain_changed": "Die Hauptdomain wurde geändert", "monitor_disabled": "Das Servermonitoring wurde erfolgreich deaktiviert", "monitor_enabled": "Das Servermonitoring wurde aktiviert", "monitor_glances_con_failed": "Verbindung mit Glances nicht möglich", diff --git a/locales/en.json b/locales/en.json index 3964c17af..c5c468703 100644 --- a/locales/en.json +++ b/locales/en.json @@ -277,7 +277,7 @@ "log_user_update": "Update user info of '{}'", "log_user_permission_update": "Update accesses for permission '{}'", "log_user_permission_reset": "Reset permission '{}'", - "log_tools_maindomain": "Make '{}' the main domain", + "log_domain_main_domain": "Make '{}' as main domain", "log_tools_migrations_migrate_forward": "Migrate forward", "log_tools_postinstall": "Postinstall your YunoHost server", "log_tools_upgrade": "Upgrade system packages", @@ -292,8 +292,8 @@ "mailbox_disabled": "E-mail turned off for user {user:s}", "mailbox_used_space_dovecot_down": "The Dovecot mailbox service needs to be up, if you want to fetch used mailbox space", "mail_unavailable": "This e-mail address is reserved and shall be automatically allocated to the very first user", - "maindomain_change_failed": "Could not change the main domain", - "maindomain_changed": "The main domain now changed", + "main_domain_change_failed": "Unable to change the main domain", + "main_domain_changed": "The main domain has been changed", "migrate_tsig_end": "Migration to HMAC-SHA-512 finished", "migrate_tsig_failed": "Could not migrate the DynDNS domain '{domain}' to HMAC-SHA-512, rolling back. Error: {error_code}, {error}", "migrate_tsig_start": "Insufficiently secure key algorithm detected for TSIG signature of the domain '{domain}', initiating migration to the more secure HMAC-SHA-512", diff --git a/locales/es.json b/locales/es.json index 02f46652b..a2dadc31c 100644 --- a/locales/es.json +++ b/locales/es.json @@ -121,8 +121,8 @@ "mail_alias_remove_failed": "No se pudo eliminar el alias de correo «{mail:s}»", "mail_domain_unknown": "Dirección de correo desconocida para el dominio «{domain:s}»", "mail_forward_remove_failed": "No se pudo eliminar el reenvío de correo «{mail:s}»", - "maindomain_change_failed": "No se pudo cambiar el dominio principal", - "maindomain_changed": "El dominio principal ha cambiado", + "main_domain_change_failed": "No se pudo cambiar el dominio principal", + "main_domain_changed": "El dominio principal ha cambiado", "monitor_disabled": "Desactivada la monitorización del servidor", "monitor_enabled": "Activada la monitorización del servidor", "monitor_glances_con_failed": "No se pudo conectar al servidor de Glances", diff --git a/locales/fr.json b/locales/fr.json index 8bffec8b2..b09dd54b7 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -122,8 +122,8 @@ "mail_alias_remove_failed": "Impossible de supprimer l’alias de courriel '{mail:s}'", "mail_domain_unknown": "Le domaine '{domain:s}' pour l'adresse de courriel est inconnu", "mail_forward_remove_failed": "Impossible de supprimer le courriel de transfert '{mail:s}'", - "maindomain_change_failed": "Impossible de modifier le domaine principal", - "maindomain_changed": "Le domaine principal modifié", + "main_domain_change_failed": "Impossible de modifier le domaine principal", + "main_domain_changed": "Le domaine principal a été modifié", "monitor_disabled": "La supervision du serveur a été désactivé", "monitor_enabled": "La supervision du serveur a été activé", "monitor_glances_con_failed": "Impossible de se connecter au serveur Glances", @@ -454,7 +454,7 @@ "log_user_create": "Ajouter l’utilisateur '{}'", "log_user_delete": "Supprimer l’utilisateur '{}'", "log_user_update": "Mettre à jour les informations de l’utilisateur '{}'", - "log_tools_maindomain": "Faire de '{}' le domaine principal", + "log_domain_main_domain": "Faire de '{}' le domaine principal", "log_tools_migrations_migrate_forward": "Migrer vers", "log_tools_migrations_migrate_backward": "Revenir en arrière", "log_tools_postinstall": "Faire la post-installation de votre serveur YunoHost", diff --git a/locales/it.json b/locales/it.json index 2c194d5a6..22cf9e2b0 100644 --- a/locales/it.json +++ b/locales/it.json @@ -136,8 +136,8 @@ "mail_domain_unknown": "Dominio d'indirizzo mail '{domain:s}' sconosciuto", "mail_forward_remove_failed": "Impossibile rimuovere la mail inoltrata '{mail:s}'", "mailbox_used_space_dovecot_down": "Il servizio di posta elettronica Dovecot deve essere attivato se vuoi riportare lo spazio usato dalla posta elettronica", - "maindomain_change_failed": "Impossibile cambiare il dominio principale", - "maindomain_changed": "Il dominio principale è stato cambiato", + "main_domain_change_failed": "Impossibile cambiare il dominio principale", + "main_domain_changed": "Il dominio principale è stato cambiato", "monitor_disabled": "Il monitoraggio del sistema è stato disattivato", "monitor_enabled": "Il monitoraggio del sistema è stato attivato", "monitor_glances_con_failed": "Impossibile collegarsi al server Glances", @@ -402,7 +402,7 @@ "log_user_create": "Aggiungi l'utente '{}'", "log_user_delete": "Elimina l'utente '{}'", "log_user_update": "Aggiornate le informazioni dell'utente '{}'", - "log_tools_maindomain": "Rendi '{}' dominio principale", + "log_domain_main_domain": "Rendi '{}' dominio principale", "log_tools_migrations_migrate_forward": "Migra avanti", "log_tools_migrations_migrate_backward": "Migra indietro", "log_tools_postinstall": "Postinstallazione del tuo server YunoHost", diff --git a/locales/oc.json b/locales/oc.json index 320a18341..49063e829 100644 --- a/locales/oc.json +++ b/locales/oc.json @@ -180,8 +180,8 @@ "invalid_url_format": "Format d’URL pas valid", "ldap_initialized": "L’annuari LDAP es inicializat", "license_undefined": "indefinida", - "maindomain_change_failed": "Modificacion impossibla del domeni màger", - "maindomain_changed": "Lo domeni màger es estat modificat", + "main_domain_change_failed": "Modificacion impossibla del domeni màger", + "main_domain_changed": "Lo domeni màger es estat modificat", "migrate_tsig_end": "La migracion cap a hmac-sha512 es acabada", "migrate_tsig_wait_2": "2 minutas…", "migrate_tsig_wait_3": "1 minuta…", @@ -440,7 +440,7 @@ "log_user_create": "Ajustar l’utilizaire « {} »", "log_user_delete": "Levar l’utilizaire « {} »", "log_user_update": "Actualizar las informacions a l’utilizaire « {} »", - "log_tools_maindomain": "Far venir « {} » lo domeni màger", + "log_domain_main_domain": "Far venir « {} » lo domeni màger", "log_tools_migrations_migrate_forward": "Migrar", "log_tools_migrations_migrate_backward": "Tornar en arrièr", "log_tools_postinstall": "Realizar la post installacion del servidor YunoHost", diff --git a/locales/pt.json b/locales/pt.json index 80a0d5ddd..c0ff0284e 100644 --- a/locales/pt.json +++ b/locales/pt.json @@ -74,8 +74,8 @@ "mail_alias_remove_failed": "Não foi possível remover a etiqueta de correio '{mail:s}'", "mail_domain_unknown": "Domínio de endereço de correio desconhecido '{domain:s}'", "mail_forward_remove_failed": "Não foi possível remover o reencaminhamento de correio '{mail:s}'", - "maindomain_change_failed": "Incapaz alterar o domínio raiz", - "maindomain_changed": "Domínio raiz alterado com êxito", + "main_domain_change_failed": "Incapaz alterar o domínio raiz", + "main_domain_changed": "Domínio raiz alterado com êxito", "monitor_disabled": "Monitorização do servidor parada com êxito", "monitor_enabled": "Monitorização do servidor ativada com êxito", "monitor_glances_con_failed": "Não foi possível ligar ao servidor Glances", diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index 64c2d9927..8f8a68812 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -281,7 +281,7 @@ def domain_main_domain(operation_logger, new_main_domain=None): _set_maindomain(new_main_domain) except Exception as e: logger.warning("%s" % e, exc_info=1) - raise YunohostError('maindomain_change_failed') + raise YunohostError('main_domain_change_failed') _set_hostname(new_main_domain) @@ -295,7 +295,7 @@ def domain_main_domain(operation_logger, new_main_domain=None): except IOError: pass - logger.success(m18n.n('maindomain_changed')) + logger.success(m18n.n('main_domain_changed')) def domain_cert_status(domain_list, full=False):