From 570184ac1e3f0ddbef1f50f4de2a7ac9ddfec728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 1 Nov 2023 17:02:55 +0100 Subject: [PATCH 01/13] Fix change url --- helpers/nginx | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/helpers/nginx b/helpers/nginx index bb0fe0577..cf58c3f1a 100644 --- a/helpers/nginx +++ b/helpers/nginx @@ -53,19 +53,6 @@ ynh_change_url_nginx_config() { local old_nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf local new_nginx_conf_path=/etc/nginx/conf.d/$new_domain.d/$app.conf - # Change the path in the NGINX config file - if [ $change_path -eq 1 ] - then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$old_nginx_conf_path" - # Set global variables for NGINX helper - domain="$old_domain" - path="$new_path" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config - fi - # Change the domain for NGINX if [ $change_domain -eq 1 ] then @@ -73,6 +60,17 @@ ynh_change_url_nginx_config() { mv "$old_nginx_conf_path" "$new_nginx_conf_path" ynh_store_file_checksum --file="$new_nginx_conf_path" fi + + # Change the path in the NGINX config file + if [ $change_path -eq 1 ] + then + # Make a backup of the original NGINX config file if modified + ynh_backup_if_checksum_is_different --file="$old_nginx_conf_path" + # Set global variables for NGINX helper + path="$new_path" + path_url="$new_path" + # Create a dedicated NGINX config + ynh_add_nginx_config + fi ynh_systemd_action --service_name=nginx --action=reload } - From fe3416aa02139eb8215a4d9a7aae61c963893e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 29 Nov 2023 15:02:47 +0100 Subject: [PATCH 02/13] Set domain with new_domain and path with new_path --- src/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app.py b/src/app.py index 12b3c4233..df6cb606b 100644 --- a/src/app.py +++ b/src/app.py @@ -478,6 +478,8 @@ def app_change_url(operation_logger, app, domain, path): env_dict["old_path"] = old_path env_dict["new_domain"] = domain env_dict["new_path"] = path + env_dict["domain"] = domain + env_dict["path"] = path env_dict["change_path"] = "1" if old_path != path else "0" env_dict["change_domain"] = "1" if old_domain != domain else "0" From 8c475d0a7b3acc7871e65256dd712d3aa953d517 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:01:17 +0100 Subject: [PATCH 03/13] Further simplify ynh_change_url_nginx_config --- helpers/nginx | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/helpers/nginx b/helpers/nginx index cf58c3f1a..600c70a49 100644 --- a/helpers/nginx +++ b/helpers/nginx @@ -44,33 +44,22 @@ ynh_remove_nginx_config() { } -# Move / regen the nginx config in a change url context +# Regen the nginx config in a change url context # # usage: ynh_change_url_nginx_config # # Requires YunoHost version 11.1.9 or higher. ynh_change_url_nginx_config() { + + # Make a backup of the original NGINX config file if manually modified + # (nb: this is possibly different from the same instruction called by + # ynh_add_config inside ynh_add_nginx_config because the path may have + # changed if we're changing the domain too...) local old_nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - local new_nginx_conf_path=/etc/nginx/conf.d/$new_domain.d/$app.conf + ynh_backup_if_checksum_is_different --file="$old_nginx_conf_path" + ynh_delete_file_checksum --file="$old_nginx_conf_path" + ynh_secure_remove --file="$old_nginx_conf_path" - # Change the domain for NGINX - if [ $change_domain -eq 1 ] - then - ynh_delete_file_checksum --file="$old_nginx_conf_path" - mv "$old_nginx_conf_path" "$new_nginx_conf_path" - ynh_store_file_checksum --file="$new_nginx_conf_path" - fi - - # Change the path in the NGINX config file - if [ $change_path -eq 1 ] - then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$old_nginx_conf_path" - # Set global variables for NGINX helper - path="$new_path" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config - fi - ynh_systemd_action --service_name=nginx --action=reload + # Regen the nginx conf + ynh_add_nginx_config } From 38db30cd70026e9a2d5763c192948fdce94b1bd2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 5 Dec 2023 19:22:34 +0100 Subject: [PATCH 04/13] Update changelog for 11.2.8 --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 73cbe440b..d94dc5f70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +yunohost (11.2.8) stable; urgency=low + + - domains: also regen dovecot configuration when adding a domain (59875cae) + - helpers/fail2ban: grep logpath is likely to match comments in the file that contain the word logpath... (26796807) + - helpers: Further simplify the change url helper ([#1746](https://github.com/yunohost/yunohost/pull/1746)) + + Thanks to all contributors <3 ! (Josué Tille) + + -- Alexandre Aubin Tue, 05 Dec 2023 19:21:38 +0100 + yunohost (11.2.7) stable; urgency=low - helpers: fix fail2ban helper when using using --use_template arg ([#1743](https://github.com/yunohost/yunohost/pull/1743)) From f436057d27aca1e632a5243c7d42975c6fc983a1 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 5 Dec 2023 19:51:58 +0000 Subject: [PATCH 05/13] [CI] Format code with Black --- src/domain.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/domain.py b/src/domain.py index 0fb9f577c..1914cabc5 100644 --- a/src/domain.py +++ b/src/domain.py @@ -305,7 +305,15 @@ def domain_add( # should identify the root of this bug... _force_clear_hashes([f"/etc/nginx/conf.d/{domain}.conf"]) regen_conf( - names=["nginx", "metronome", "dnsmasq", "postfix", "rspamd", "mdns", "dovecot"] + names=[ + "nginx", + "metronome", + "dnsmasq", + "postfix", + "rspamd", + "mdns", + "dovecot", + ] ) app_ssowatconf() From 169c921444dde57bd1e79bb352d0f359993873ca Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 9 Dec 2023 15:54:04 +0100 Subject: [PATCH 06/13] Fix change_url again, otherwise the lack of path_url default to the old path and fucks up the nginx regen --- src/app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app.py b/src/app.py index df6cb606b..59a68af57 100644 --- a/src/app.py +++ b/src/app.py @@ -480,6 +480,7 @@ def app_change_url(operation_logger, app, domain, path): env_dict["new_path"] = path env_dict["domain"] = domain env_dict["path"] = path + env_dict["path_url"] = path env_dict["change_path"] = "1" if old_path != path else "0" env_dict["change_domain"] = "1" if old_domain != domain else "0" @@ -500,6 +501,8 @@ def app_change_url(operation_logger, app, domain, path): change_url_script = os.path.join(tmp_workdir_for_app, "scripts/change_url") + import pdb; pdb.set_trace() + # Execute App change_url script change_url_failed = True try: From 2828b7636410fd7acb1394c5065b22534e33b201 Mon Sep 17 00:00:00 2001 From: Christian Wehrli Date: Wed, 6 Dec 2023 18:19:31 +0000 Subject: [PATCH 07/13] Translated using Weblate (German) Currently translated at 100.0% (782 of 782 strings) Translation: YunoHost/core Translate-URL: https://translate.yunohost.org/projects/yunohost/core/de/ --- locales/de.json | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/locales/de.json b/locales/de.json index 634107b1f..34d9c4819 100644 --- a/locales/de.json +++ b/locales/de.json @@ -19,7 +19,7 @@ "ask_password": "Passwort", "backup_app_failed": "Konnte keine Sicherung für {app} erstellen", "backup_archive_app_not_found": "{app} konnte in keiner Datensicherung gefunden werden", - "backup_archive_name_exists": "Datensicherung mit dem selben Namen existiert bereits.", + "backup_archive_name_exists": "Eine Datensicherung mit dem Namen '{name}' existiert bereits.", "backup_archive_name_unknown": "Unbekanntes lokale Datensicherung mit Namen '{name}' gefunden", "backup_archive_open_failed": "Kann Sicherungsarchiv nicht öfnen", "backup_cleaning_failed": "Temporäres Sicherungsverzeichnis konnte nicht geleert werden", @@ -394,8 +394,8 @@ "group_cannot_edit_primary_group": "Die Gruppe '{group}' kann nicht manuell bearbeitet werden. Es ist die primäre Gruppe, welche dazu gedacht ist, nur ein spezifisches Konto zu enthalten.", "diagnosis_processes_killed_by_oom_reaper": "Das System hat ein paar Prozesse abgewürgt, da ihm der Speicher ausgegangen ist. Dies ist typischerweise sympomatisch eines ungenügenden Vorhandenseins des Arbeitsspeichers oder eines einzelnen Prozesses, der zu viel Speicher verbraucht. Zusammenfassung der abgewürgtenProzesse: \n{kills_summary}", "diagnosis_description_ports": "Geöffnete Ports", - "additional_urls_already_added": "Zusätzliche URL '{url}' bereits hinzugefügt in der zusätzlichen URL für Berechtigung '{permission}'", - "additional_urls_already_removed": "Zusätzliche URL '{url}' bereits entfernt in der zusätzlichen URL für Berechtigung '{permission}'", + "additional_urls_already_added": "Die zusätzliche URL '{url}' wurde bereits hinzugefügt für die Berechtigung '{permission}'", + "additional_urls_already_removed": "Die zusätzliche URL '{url}' wurde bereits entfernt für die Berechtigung '{permission}'", "app_label_deprecated": "Dieser Befehl ist veraltet! Bitte nutze den neuen Befehl 'yunohost user permission update' um das Applabel zu verwalten.", "diagnosis_http_hairpinning_issue_details": "Das liegt wahrscheinlich an Ihrem Router. Dadurch können Personen von ausserhalb deines Netzwerkes, aber nicht von innerhalb deines lokalen Netzwerkes (wie wahrscheinlich Sie selbst), auf Ihren Server zugreifen, wenn dazu die Domäne oder öffentliche IP verwendet wird. Sie können das Problem eventuell beheben, indem Sie einen Blick auf https://yunohost.org/dns_local_network werfen", "diagnosis_http_nginx_conf_not_up_to_date": "Die Konfiguration von Nginx scheint für diese Domäne manuell geändert worden zu sein. Dies hindert YunoHost daran festzustellen, ob es über HTTP erreichbar ist.", @@ -766,5 +766,23 @@ "pattern_fullname": "Muss ein gültiger voller Name sein (mindestens 3 Zeichen)", "migration_0021_not_buster2": "Die aktuelle Debian-Distribution ist nicht Buster! Wenn Sie bereits eine Buster->Bullseye-Migration durchgeführt haben, dann ist dieser Fehler symptomatisch für den Umstand, dass das Migrationsprozedere nicht zu 100% erfolgreich war (andernfalls hätte Yunohost es als vollständig gekennzeichnet). Es ist empfehlenswert, sich der Geschehnisse zusammen mit dem Support-Team anzunehmen, das einen Bedarf an einem **vollständigen** Log der Migration haben wird, das in Werkzeuge > Logs im Adminpanel auffindbar ist.", "migration_0024_rebuild_python_venv_disclaimer_base": "Der Aktualisierung zu Debian Bullseye folgend ist es nötig, dass ein paar Python-Applikationen partiell neu gebaut und in die neue, mit Debian mitgelieferte Python-Version konvertiert werden. (in technischen Begrifflichkeiten: das, was wir die 'virtualenv' nennen, muss erneuert werden). In der Zwischenzeit kann es sein, dass diese Python-Applikationen nicht funktionieren. YunoHost kann versuchen die virtualenv für ein paar davon zu erneuern, wie untenstehend detailliert beschrieben wird. Für die anderen Applikationen, oder für den Fall, dass die Erneuerung fehlschlägt, werden eine erzwungene Aktualisierung für diese Applikationen durchführen müssen.", - "migration_0024_rebuild_python_venv_disclaimer_ignored": "Virtualenvs können für diese Applikationen nicht automatisch erneuert werden. Für diejenigen werden Sie eine erzwungene Aktualisierung durchführen müssen, was in der Kommandozeile bewerkstelligt werden kann mit: `yunohost app upgrade --force APP`: {ignored_apps}" + "migration_0024_rebuild_python_venv_disclaimer_ignored": "Virtualenvs können für diese Applikationen nicht automatisch erneuert werden. Für diejenigen werden Sie eine erzwungene Aktualisierung durchführen müssen, was in der Kommandozeile bewerkstelligt werden kann mit: `yunohost app upgrade --force APP`: {ignored_apps}", + "ask_dyndns_recovery_password_explain_unavailable": "Diese DynDNS-Domäne ist bereits registriert. Wenn Sie die Person sind, die diese Domäne ursprünglich registriert hat, können Sie das Wiederherstellungspasswort eingeben, um diese Domäne wiederherzustellen.", + "ask_dyndns_recovery_password": "DynDNS Wiederherstellungspasswort", + "ask_dyndns_recovery_password_explain_during_unsubscribe": "Bitte geben Sie das Wiederherstellungspasswort für Ihre DynDNS-Domäne ein.", + "dyndns_no_recovery_password": "Es wurde kein Wiederherstellungspasswort spezifiziert! Wenn Sie die Kontrolle über diese Domäne verlieren, werden Sie einen Administrator des YunoHost-Teams kontaktieren müssen!", + "dyndns_too_many_requests": "Der DynDNS-Service von YunoHost hat zu viele Anfragen von Ihnen erhalten, warten Sie ungefähr 1 Stunde bevor Sie erneut versuchen.", + "dyndns_set_recovery_password_invalid_password": "Konnte Wiederherstellungspasswort nicht einstellen: Passwort ist nicht stark genug", + "log_dyndns_unsubscribe": "Von einer YunoHost-Subdomain abmelden '{}'", + "ask_dyndns_recovery_password_explain": "Bitte wählen Sie ein Passwort zur Wiederherstellung ihrer DynDNS, für den Fall, dass Sie sie später zurücksetzen müssen.", + "dyndns_subscribed": "DynDNS-Domäne registriert", + "dyndns_subscribe_failed": "Konnte DynDNS-Domäne nicht registrieren: {error}", + "dyndns_unsubscribe_failed": "Konnte die DynDNS-Domäne nicht abmelden: {error}", + "dyndns_unsubscribed": "DynDNS-Domäne abgemeldet", + "dyndns_unsubscribe_denied": "Konnte Domäne nicht abmelden: ungültige Anmeldedaten", + "dyndns_unsubscribe_already_unsubscribed": "Domäne ist bereits abgemeldet", + "dyndns_set_recovery_password_denied": "Konnte Wiederherstellungspasswort nicht einstellen: ungültiges Passwort", + "dyndns_set_recovery_password_unknown_domain": "Konnte Wiederherstellungspasswort nicht einstellen: Domäne nicht registriert", + "dyndns_set_recovery_password_failed": "Konnte Wiederherstellungspasswort nicht einstellen: {error}", + "dyndns_set_recovery_password_success": "Wiederherstellungspasswort eingestellt!" } From 457289d6cac0072941f28ebd99fcefe9469a965a Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 9 Dec 2023 15:57:03 +0100 Subject: [PATCH 08/13] Update changelog for 11.2.8.1 --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index d94dc5f70..89e2231ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +yunohost (11.2.8.1) stable; urgency=low + + - apps: fix change_url again, otherwise the lack of path_url default to the old path and fucks up the nginx regen (169c9214) + - i18n: Translations updated for German + + Thanks to all contributors <3 ! (Christian Wehrli) + + -- Alexandre Aubin Sat, 09 Dec 2023 15:56:20 +0100 + yunohost (11.2.8) stable; urgency=low - domains: also regen dovecot configuration when adding a domain (59875cae) From 0a7b5fb0ba956d4f19673036352b7382969ee2f5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 9 Dec 2023 15:12:51 +0000 Subject: [PATCH 09/13] [CI] Format code with Black --- src/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app.py b/src/app.py index 59a68af57..4dd76532c 100644 --- a/src/app.py +++ b/src/app.py @@ -501,7 +501,9 @@ def app_change_url(operation_logger, app, domain, path): change_url_script = os.path.join(tmp_workdir_for_app, "scripts/change_url") - import pdb; pdb.set_trace() + import pdb + + pdb.set_trace() # Execute App change_url script change_url_failed = True From 54a6a1b3d246c68e99271c17ba7893aab95859b1 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 9 Dec 2023 18:26:02 +0100 Subject: [PATCH 10/13] Aleks forgot to remove pdb.set_trace ... --- src/app.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/app.py b/src/app.py index 4dd76532c..ad20b3552 100644 --- a/src/app.py +++ b/src/app.py @@ -501,10 +501,6 @@ def app_change_url(operation_logger, app, domain, path): change_url_script = os.path.join(tmp_workdir_for_app, "scripts/change_url") - import pdb - - pdb.set_trace() - # Execute App change_url script change_url_failed = True try: From 9489d200b2c663d1fbe5d437565f2ae4311e01b5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 9 Dec 2023 18:26:43 +0100 Subject: [PATCH 11/13] Update changelog for 11.2.8.2 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 89e2231ea..97812a78f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +yunohost (11.2.8.2) stable; urgency=low + + - Aleks forgot to remove pdb.set_trace ... (54a6a1b3) + + -- Alexandre Aubin Sat, 09 Dec 2023 18:26:10 +0100 + yunohost (11.2.8.1) stable; urgency=low - apps: fix change_url again, otherwise the lack of path_url default to the old path and fucks up the nginx regen (169c9214) From 8e3e78884282e211a4ea55002e30115baee2fb93 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 10 Dec 2023 12:07:39 +0100 Subject: [PATCH 12/13] ynh_setup_source: properly handle --keep for directories when the dir already exists in the new setup --- helpers/utils | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/helpers/utils b/helpers/utils index 8b28000d6..edbdbdc3a 100644 --- a/helpers/utils +++ b/helpers/utils @@ -374,7 +374,13 @@ ynh_setup_source() { for stuff_to_keep in $keep; do if [ -e "$keep_dir/$stuff_to_keep" ]; then mkdir --parents "$(dirname "$dest_dir/$stuff_to_keep")" - cp --archive "$keep_dir/$stuff_to_keep" "$dest_dir/$stuff_to_keep" + + # We add "--no-target-directory" (short option is -T) to handle the special case + # when we "keep" a folder, but then the new setup already contains the same dir (but possibly empty) + # in which case a regular "cp" will create a copy of the directory inside the directory ... + # resulting in something like /var/www/$app/data/data instead of /var/www/$app/data + # cf https://unix.stackexchange.com/q/94831 for a more elaborate explanation on the option + cp --archive --no-target-directory "$keep_dir/$stuff_to_keep" "$dest_dir/$stuff_to_keep" fi done fi From 64c616076fd2180b7832e275019439a08bf782c4 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 11 Dec 2023 11:48:55 +0100 Subject: [PATCH 13/13] i18n: fix fucked up tags --- locales/it.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locales/it.json b/locales/it.json index 98512df40..43a442621 100644 --- a/locales/it.json +++ b/locales/it.json @@ -300,8 +300,8 @@ "diagnosis_domain_expiration_not_found": "Non riesco a controllare la data di scadenza di alcuni domini", "diagnosis_dns_try_dyndns_update_force": "La configurazione DNS di questo dominio dovrebbe essere gestita automaticamente da YunoHost. Se non avviene, puoi provare a forzare un aggiornamento usando il comando yunohost dyndns update --force.", "diagnosis_dns_point_to_doc": "Controlla la documentazione a https://yunohost.org/dns_config se hai bisogno di aiuto nel configurare i record DNS.", - "diagnosis_dns_discrepancy": "Il record DNS non sembra seguire la configurazione DNS raccomandata:
Type: {type}
Name: {name}
Current value: {current}
Expected value: {value}", - "diagnosis_dns_missing_record": "Stando alla configurazione DNS raccomandata, dovresti aggiungere un record DNS con le seguenti informazioni.
Type: {type}
Name: {name}
Value: {value}", + "diagnosis_dns_discrepancy": "Il record DNS non sembra seguire la configurazione DNS raccomandata:
Type: {type}
Name: {name}
Current value: {current}
Expected value: {value}", + "diagnosis_dns_missing_record": "Stando alla configurazione DNS raccomandata, dovresti aggiungere un record DNS con le seguenti informazioni.
Type: {type}
Name: {name}
Value: {value}", "diagnosis_dns_bad_conf": "Alcuni record DNS sono mancanti o incorretti per il dominio {domain} (categoria {category})", "diagnosis_dns_good_conf": "I recordDNS sono configurati correttamente per il dominio {domain} (categoria {category})", "diagnosis_ip_weird_resolvconf_details": "Il file /etc/resolv.conf dovrebbe essere un symlink a /etc/resolvconf/run/resolv.conf che punta a 127.0.0.1 (dnsmasq). Se vuoi configurare manualmente i DNS, modifica /etc/resolv.dnsmasq.conf.",