mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge branch 'unstable' into enh_mysql_single-transaction
This commit is contained in:
commit
402517d841
8 changed files with 48 additions and 13 deletions
|
@ -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.
|
# 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
|
# Substitute in a nginx config file only if the variable is not empty
|
||||||
if test -n "${path_url:-}"; then
|
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"
|
ynh_replace_string "__PATH__" "$path_url" "$finalnginxconf"
|
||||||
fi
|
fi
|
||||||
if test -n "${domain:-}"; then
|
if test -n "${domain:-}"; then
|
||||||
|
|
|
@ -73,7 +73,7 @@ ynh_mysql_drop_db() {
|
||||||
# | arg: db - the database name to dump
|
# | arg: db - the database name to dump
|
||||||
# | ret: the mysqldump output
|
# | ret: the mysqldump output
|
||||||
ynh_mysql_dump_db() {
|
ynh_mysql_dump_db() {
|
||||||
mysqldump -u "root" -p"$(sudo cat $MYSQL_ROOT_PWD_FILE)" --single-transaction "$1"
|
mysqldump -u "root" -p"$(sudo cat $MYSQL_ROOT_PWD_FILE)" --single-transaction --skip-dump-date "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a user
|
# Create a user
|
||||||
|
|
|
@ -10,12 +10,16 @@ ynh_string_random() {
|
||||||
| sed -n 's/\(.\{'"${1:-24}"'\}\).*/\1/p'
|
| 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
|
# usage: ynh_replace_string match_string replace_string target_file
|
||||||
# | arg: match_string - String to be searched and replaced in the file
|
# | arg: match_string - String to be searched and replaced in the file
|
||||||
# | arg: replace_string - String that will replace matches
|
# | arg: replace_string - String that will replace matches
|
||||||
# | arg: target_file - File in which the string will be replaced.
|
# | 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 () {
|
ynh_replace_string () {
|
||||||
delimit=@
|
delimit=@
|
||||||
match_string=${1//${delimit}/"\\${delimit}"} # Escape the delimiter if it's in the string.
|
match_string=${1//${delimit}/"\\${delimit}"} # Escape the delimiter if it's in the string.
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
"ask_main_domain": "Main domain",
|
"ask_main_domain": "Main domain",
|
||||||
"ask_new_admin_password": "New administration password",
|
"ask_new_admin_password": "New administration password",
|
||||||
"ask_password": "Password",
|
"ask_password": "Password",
|
||||||
|
"ask_path": "Path",
|
||||||
"backup_abstract_method": "This backup method hasn't yet been implemented",
|
"backup_abstract_method": "This backup method hasn't yet been implemented",
|
||||||
"backup_action_required": "You must specify something to save",
|
"backup_action_required": "You must specify something to save",
|
||||||
"backup_app_failed": "Unable to back up the app '{app:s}'",
|
"backup_app_failed": "Unable to back up the app '{app:s}'",
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"app_install_files_invalid": "Fichiers d'installation incorrects",
|
"app_install_files_invalid": "Fichiers d'installation incorrects",
|
||||||
"app_location_already_used": "Une application est déjà installée à cet emplacement",
|
"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_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_no_upgrade": "Aucune application à mettre à jour",
|
||||||
"app_not_correctly_installed": "{app:s} semble être mal installé",
|
"app_not_correctly_installed": "{app:s} semble être mal installé",
|
||||||
"app_not_installed": "{app:s} n'est pas 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_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_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_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_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_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",
|
"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_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_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_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}]"
|
||||||
}
|
}
|
||||||
|
|
|
@ -445,8 +445,9 @@ def app_change_url(auth, app, domain, path):
|
||||||
|
|
||||||
# Normalize path and domain format
|
# Normalize path and domain format
|
||||||
domain = domain.strip().lower()
|
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):
|
if (domain, path) == (old_domain, old_path):
|
||||||
raise MoulinetteError(errno.EINVAL, m18n.n("app_change_url_identical_domains", domain=domain, path=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
|
char_set = string.ascii_uppercase + string.digits + string.ascii_lowercase
|
||||||
return ''.join([random.SystemRandom().choice(char_set) for x in range(length)])
|
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 "/"
|
||||||
|
|
|
@ -166,11 +166,11 @@ class BackupRestoreTargetsManager(object):
|
||||||
or (exclude and isinstance(exclude, list) and not include)
|
or (exclude and isinstance(exclude, list) and not include)
|
||||||
|
|
||||||
if 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 self.results[category][target] in include]
|
||||||
|
|
||||||
if exclude:
|
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]
|
if self.results[category][target] not in exclude]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -78,14 +78,14 @@ def tools_ldapinit():
|
||||||
for rdn, attr_dict in ldap_map['parents'].items():
|
for rdn, attr_dict in ldap_map['parents'].items():
|
||||||
try:
|
try:
|
||||||
auth.add(rdn, attr_dict)
|
auth.add(rdn, attr_dict)
|
||||||
except:
|
except Exception as e:
|
||||||
pass
|
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():
|
for rdn, attr_dict in ldap_map['children'].items():
|
||||||
try:
|
try:
|
||||||
auth.add(rdn, attr_dict)
|
auth.add(rdn, attr_dict)
|
||||||
except:
|
except Exception as e:
|
||||||
pass
|
logger.warn("Error when trying to inject '%s' -> '%s' into ldap: %s" % (rdn, attr_dict, e))
|
||||||
|
|
||||||
admin_dict = {
|
admin_dict = {
|
||||||
'cn': 'admin',
|
'cn': 'admin',
|
||||||
|
|
Loading…
Add table
Reference in a new issue