Merge branch 'unstable' into testing

This commit is contained in:
Alexandre Aubin 2017-11-28 19:01:19 -05:00
commit 8a922ca640
5 changed files with 18 additions and 13 deletions

View file

@ -123,7 +123,7 @@ 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 is path_url, or a blank value if path_url is only '/'
path_url_slash_less=${path_url%/} path_url_slash_less=${path_url%/}
ynh_replace_string "__PATH__/" "$path_url_slash_less/" "$finalnginxconf" ynh_replace_string "__PATH__/" "$path_url_slash_less/" "$finalnginxconf"
ynh_replace_string "__PATH__" "$path_url" "$finalnginxconf" ynh_replace_string "__PATH__" "$path_url" "$finalnginxconf"

View file

@ -59,6 +59,11 @@ ynh_restore_upgradebackup () {
# ynh_abort_if_errors # ynh_abort_if_errors
# #
ynh_backup_before_upgrade () { ynh_backup_before_upgrade () {
if [ ! -e "/etc/yunohost/apps/$app/scripts/backup" ]
then
echo "This app doesn't have any backup script." >&2
return
fi
backup_number=1 backup_number=1
old_backup_number=2 old_backup_number=2
app_bck=${app//_/-} # Replace all '_' by '-' app_bck=${app//_/-} # Replace all '_' by '-'

View file

@ -1,7 +1,7 @@
uPnP: uPnP:
enabled: false enabled: false
TCP: [22, 25, 53, 80, 443, 465, 587, 993, 5222, 5269] TCP: [22, 25, 80, 443, 465, 587, 993, 5222, 5269]
UDP: [53] UDP: []
ipv4: ipv4:
TCP: [22, 25, 53, 80, 443, 465, 587, 993, 5222, 5269] TCP: [22, 25, 53, 80, 443, 465, 587, 993, 5222, 5269]
UDP: [53, 5353] UDP: [53, 5353]

View file

@ -1,7 +1,7 @@
{ {
"action_invalid": "Action « {action:s} » incorrecte", "action_invalid": "Action « {action:s} » incorrecte",
"admin_password": "Mot de passe d'administration", "admin_password": "Mot de passe d'administration",
"admin_password_change_failed": "Impossible de modifier le mot de passe d'administration", "admin_password_change_failed": "Impossible de changer le mot de passe",
"admin_password_changed": "Le mot de passe d'administration a été modifié", "admin_password_changed": "Le mot de passe d'administration a été modifié",
"app_already_installed": "{app:s} est déjà installé", "app_already_installed": "{app:s} est déjà installé",
"app_argument_choice_invalid": "Choix invalide pour le paramètre « {name:s} », il doit être l'un de {choices:s}", "app_argument_choice_invalid": "Choix invalide pour le paramètre « {name:s} », il doit être l'un de {choices:s}",

View file

@ -39,7 +39,7 @@ def get_crt(account_key, csr, acme_dir, log=LOGGER, CA=DEFAULT_CA):
raise IOError("OpenSSL Error: {0}".format(err)) raise IOError("OpenSSL Error: {0}".format(err))
pub_hex, pub_exp = re.search( pub_hex, pub_exp = re.search(
r"modulus:\n\s+00:([a-f0-9\:\s]+?)\npublicExponent: ([0-9]+)", r"modulus:\n\s+00:([a-f0-9\:\s]+?)\npublicExponent: ([0-9]+)",
out.decode('utf8'), re.MULTILINE | re.DOTALL).groups() out.decode('utf8'), re.MULTILINE|re.DOTALL).groups()
pub_exp = "{0:x}".format(int(pub_exp)) pub_exp = "{0:x}".format(int(pub_exp))
pub_exp = "0{0}".format(pub_exp) if len(pub_exp) % 2 else pub_exp pub_exp = "0{0}".format(pub_exp) if len(pub_exp) % 2 else pub_exp
header = { header = {
@ -82,10 +82,10 @@ def get_crt(account_key, csr, acme_dir, log=LOGGER, CA=DEFAULT_CA):
if proc.returncode != 0: if proc.returncode != 0:
raise IOError("Error loading {0}: {1}".format(csr, err)) raise IOError("Error loading {0}: {1}".format(csr, err))
domains = set([]) domains = set([])
common_name = re.search(r"Subject:.*? CN=([^\s,;/]+)", out.decode('utf8')) common_name = re.search(r"Subject:.*? CN\s?=\s?([^\s,;/]+)", out.decode('utf8'))
if common_name is not None: if common_name is not None:
domains.add(common_name.group(1)) domains.add(common_name.group(1))
subject_alt_names = re.search(r"X509v3 Subject Alternative Name: \n +([^\n]+)\n", out.decode('utf8'), re.MULTILINE | re.DOTALL) subject_alt_names = re.search(r"X509v3 Subject Alternative Name: \n +([^\n]+)\n", out.decode('utf8'), re.MULTILINE|re.DOTALL)
if subject_alt_names is not None: if subject_alt_names is not None:
for san in subject_alt_names.group(1).split(", "): for san in subject_alt_names.group(1).split(", "):
if san.startswith("DNS:"): if san.startswith("DNS:"):
@ -95,7 +95,7 @@ def get_crt(account_key, csr, acme_dir, log=LOGGER, CA=DEFAULT_CA):
log.info("Registering account...") log.info("Registering account...")
code, result = _send_signed_request(CA + "/acme/new-reg", { code, result = _send_signed_request(CA + "/acme/new-reg", {
"resource": "new-reg", "resource": "new-reg",
"agreement": "https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf", "agreement": json.loads(urlopen(CA + "/directory").read().decode('utf8'))['meta']['terms-of-service'],
}) })
if code == 201: if code == 201:
log.info("Registered!") log.info("Registered!")