From f4955341bb5ad71969eb765915509708ebb70d0f Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Tue, 5 Sep 2017 21:09:24 +0200 Subject: [PATCH 1/8] Complete ynh_replace_string helper comments to mention the possible use of regexp --- data/helpers.d/string | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/data/helpers.d/string b/data/helpers.d/string index 772681fb9..b77b42ef7 100644 --- a/data/helpers.d/string +++ b/data/helpers.d/string @@ -10,12 +10,16 @@ ynh_string_random() { | sed -n 's/\(.\{'"${1:-24}"'\}\).*/\1/p' } -# Substitute/replace a string by another in a file +# Substitute/replace a string (or expression) by another in a file # # usage: ynh_replace_string match_string replace_string target_file # | arg: match_string - String to be searched and replaced in the file # | arg: replace_string - String that will replace matches # | arg: target_file - File in which the string will be replaced. +# +# As this helper is based on sed command, regular expressions and +# references to sub-expressions can be used +# (see sed manual page for more information) ynh_replace_string () { delimit=@ match_string=${1//${delimit}/"\\${delimit}"} # Escape the delimiter if it's in the string. From 0dbec4fa62beebdb173f58aec5dee6a40ffa967d Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 6 Sep 2017 22:00:17 +0200 Subject: [PATCH 2/8] [enh] add debugging in ldap init (#365) --- src/yunohost/tools.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index e172fa8e5..22ac7894f 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -78,14 +78,14 @@ def tools_ldapinit(): for rdn, attr_dict in ldap_map['parents'].items(): try: auth.add(rdn, attr_dict) - except: - pass + except Exception as e: + logger.warn("Error when trying to inject '%s' -> '%s' into ldap: %s" % (rdn, attr_dict, e)) for rdn, attr_dict in ldap_map['children'].items(): try: auth.add(rdn, attr_dict) - except: - pass + except Exception as e: + logger.warn("Error when trying to inject '%s' -> '%s' into ldap: %s" % (rdn, attr_dict, e)) admin_dict = { 'cn': 'admin', From 85f0b02f1fe87cc6794d4f299329299a26ed877e Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 7 Sep 2017 15:06:12 +0200 Subject: [PATCH 3/8] [fix] '/' was resulting in '//' --- src/yunohost/app.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 84092580f..fe71cfd85 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -445,8 +445,9 @@ def app_change_url(auth, app, domain, path): # Normalize path and domain format domain = domain.strip().lower() - old_path = '/' + old_path.strip("/").strip() + '/' - path = '/' + path.strip("/").strip() + '/' + + old_path = normalize_url_path(old_path) + path = normalize_url_path(path) if (domain, path) == (old_domain, old_path): raise MoulinetteError(errno.EINVAL, m18n.n("app_change_url_identical_domains", domain=domain, path=path)) @@ -2105,3 +2106,10 @@ def random_password(length=8): char_set = string.ascii_uppercase + string.digits + string.ascii_lowercase return ''.join([random.SystemRandom().choice(char_set) for x in range(length)]) + + +def normalize_url_path(url_path): + if url_path.strip("/").strip(): + return '/' + url_path.strip("/").strip() + '/' + + return "/" From 1086a50eb2d8c9400f3da347862916eeee746291 Mon Sep 17 00:00:00 2001 From: JimboJoe Date: Wed, 13 Sep 2017 19:35:29 +0200 Subject: [PATCH 4/8] Fix #1005 (add missing 'ask_path' key) (#369) --- locales/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/en.json b/locales/en.json index 80ff22655..9ef41a3f2 100644 --- a/locales/en.json +++ b/locales/en.json @@ -55,6 +55,7 @@ "ask_main_domain": "Main domain", "ask_new_admin_password": "New administration password", "ask_password": "Password", + "ask_path": "Path", "backup_abstract_method": "This backup method hasn't yet been implemented", "backup_action_required": "You must specify something to save", "backup_app_failed": "Unable to back up the app '{app:s}'", From d42cc00a8765b77339ca089fd134684a8a50890b Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Tue, 19 Sep 2017 01:34:23 +0200 Subject: [PATCH 5/8] [enh] Remove date from sql dump --- data/helpers.d/mysql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/helpers.d/mysql b/data/helpers.d/mysql index 1c0ece114..5bc598cbc 100644 --- a/data/helpers.d/mysql +++ b/data/helpers.d/mysql @@ -73,7 +73,7 @@ ynh_mysql_drop_db() { # | arg: db - the database name to dump # | ret: the mysqldump output ynh_mysql_dump_db() { - mysqldump -u "root" -p"$(sudo cat $MYSQL_ROOT_PWD_FILE)" "$1" + mysqldump -u "root" -p"$(sudo cat $MYSQL_ROOT_PWD_FILE)" --skip-dump-date "$1" } # Create a user From f4b95ca5ff5dccbc96e18d34f0b3f8995e8e0a14 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 26 Sep 2017 01:01:00 +0200 Subject: [PATCH 6/8] [fix] fix this UnicodeDecodingError on backup-restore --- src/yunohost/backup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index d794a2fca..def7fb27b 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -166,11 +166,11 @@ class BackupRestoreTargetsManager(object): or (exclude and isinstance(exclude, list) and not include) if include: - return [target for target in self.targets[category] + return [target.encode("Utf-8") for target in self.targets[category] if self.results[category][target] in include] if exclude: - return [target for target in self.targets[category] + return [target.encode("Utf-8") for target in self.targets[category] if self.results[category][target] not in exclude] From 220c447074534fc2c283559ab255fd86a54ebb9c Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sat, 30 Sep 2017 13:01:15 +0200 Subject: [PATCH 7/8] [enh] Handle root path in nginx conf (#361) Avoid to put a double slash when the path is /. That can induce some errors in a nginx config. --- data/helpers.d/backend | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/helpers.d/backend b/data/helpers.d/backend index c54e82754..c0cbc616c 100644 --- a/data/helpers.d/backend +++ b/data/helpers.d/backend @@ -123,6 +123,9 @@ ynh_add_nginx_config () { # To avoid a break by set -u, use a void substitution ${var:-}. If the variable is not set, it's simply set with an empty variable. # Substitute in a nginx config file only if the variable is not empty if test -n "${path_url:-}"; then + # path_url_slash_less if path_url or a blank value if path_url is only '/' + path_url_slash_less=${path_url%/} + ynh_replace_string "__PATH__/" "$path_url_slash_less/" "$finalnginxconf" ynh_replace_string "__PATH__" "$path_url" "$finalnginxconf" fi if test -n "${domain:-}"; then From 2a49613e59117811b0da09f2d212ba4046429de0 Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Mon, 2 Oct 2017 19:56:31 +0200 Subject: [PATCH 8/8] Update from Weblate. (#355) * [i18n] Translated using Weblate (French) Currently translated at 100.0% (351 of 351 strings) * [i18n] Translated using Weblate (French) Currently translated at 100.0% (351 of 351 strings) --- locales/fr.json | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/locales/fr.json b/locales/fr.json index 86df7b10d..f4afdceb3 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -14,7 +14,7 @@ "app_install_files_invalid": "Fichiers d'installation incorrects", "app_location_already_used": "Une application est déjà installée à cet emplacement", "app_location_install_failed": "Impossible d'installer l'application à cet emplacement", - "app_manifest_invalid": "Manifeste d'application incorrect", + "app_manifest_invalid": "Manifeste d'application incorrect : {error}", "app_no_upgrade": "Aucune application à mettre à jour", "app_not_correctly_installed": "{app:s} semble être mal installé", "app_not_installed": "{app:s} n'est pas installé", @@ -320,7 +320,7 @@ "backup_archive_system_part_not_available": "La partie « {part:s} » du système n’est pas disponible dans cette sauvegarde", "backup_archive_mount_failed": "Le montage de l’archive de sauvegarde a échoué", "backup_archive_writing_error": "Impossible d’ajouter les fichiers à la sauvegarde dans l’archive compressée", - "backup_ask_for_copying_if_needed": "Votre système ne prend pas complètement en charge la méthode rapide d’organisation des fichiers dans l’archive, voulez-vous les organiser en copiant {size:s} Mio ?", + "backup_ask_for_copying_if_needed": "Certains fichiers n’ont pas pu être préparés pour être sauvegardée en utilisant la méthode qui évite de temporairement gaspiller de l’espace sur le système. Pour mener la sauvegarde, {size:s} Mio doivent être temporairement utilisés. Acceptez-vous ?", "backup_borg_not_implemented": "La méthode de sauvegarde Bord n’est pas encore implémentée", "backup_cant_mount_uncompress_archive": "Impossible de monter en lecture seule le dossier de l’archive décompressée", "backup_copying_to_organize_the_archive": "Copie de {size:s} Mio pour organiser l’archive", @@ -344,5 +344,24 @@ "restore_mounting_archive": "Montage de l’archive dans « {path:s} »", "restore_may_be_not_enough_disk_space": "Votre système semble ne pas avoir suffisamment d’espace disponible (libre : {free_space:d} octets, nécessaire : {needed_space:d} octets, marge de sécurité : {margin:d} octets)", "restore_not_enough_disk_space": "Espace disponible insuffisant (libre : {free_space:d} octets, nécessaire : {needed_space:d} octets, marge de sécurité : {margin:d} octets)", - "restore_system_part_failed": "Impossible de restaurer la partie « {part:s} » du système" + "restore_system_part_failed": "Impossible de restaurer la partie « {part:s} » du système", + "backup_couldnt_bind": "Impossible de lier {src:s} avec {dest:s}.", + "domain_dns_conf_is_just_a_recommendation": "Cette page montre la configuration *recommandée*. Elle ne configure *pas* le DNS pour vous. Il est de votre responsabilité que de configurer votre zone DNS chez votre registrar DNS avec cette recommandation.", + "domain_dyndns_dynette_is_unreachable": "Impossible de contacter la dynette YunoHost, soit YunoHost n’est pas correctement connecté à internet ou alors le serveur de dynette est arrêté. Erreur : {error}", + "migrations_backward": "Migration en arrière.", + "migrations_bad_value_for_target": "Nombre invalide pour le paramètre « target », les numéros de migration sont ou {}", + "migrations_cant_reach_migration_file": "Impossible d’accéder aux fichiers de migrations avec le chemin %s", + "migrations_current_target": "La cible de migration est {}", + "migrations_error_failed_to_load_migration": "ERREUR : échec du chargement de migration {number} {name}", + "migrations_forward": "Migration en avant", + "migrations_loading_migration": "Chargement de la migration {number} {name}…", + "migrations_migration_has_failed": "La migration {number} {name} a échoué avec l’exception {exception}, annulation", + "migrations_no_migrations_to_run": "Aucune migration à lancer", + "migrations_show_currently_running_migration": "Application de la migration {number} {name}…", + "migrations_show_last_migration": "La dernière migration appliquée est {}", + "migrations_skip_migration": "Omission de la migration {number} {name}…", + "server_shutdown": "Le serveur sera éteint", + "server_shutdown_confirm": "Le serveur immédiatement être éteint, le voulez-vous vraiment ? [{answers:s}]", + "server_reboot": "Le serveur va redémarrer", + "server_reboot_confirm": "Le serveur va redémarrer immédiatement, le voulez-vous vraiment ? [{answers:s}]" }