diff --git a/.gitlab/ci/lint.gitlab-ci.yml b/.gitlab/ci/lint.gitlab-ci.yml index 2c2bdcc1d..69e87b6ca 100644 --- a/.gitlab/ci/lint.gitlab-ci.yml +++ b/.gitlab/ci/lint.gitlab-ci.yml @@ -44,5 +44,4 @@ black: - git push -f origin "ci-format-${CI_COMMIT_REF_NAME}":"ci-format-${CI_COMMIT_REF_NAME}" - hub pull-request -m "[CI] Format code with Black" -b Yunohost:$CI_COMMIT_REF_NAME -p || true # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd only: - variables: - - $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH + - tags diff --git a/.gitlab/ci/translation.gitlab-ci.yml b/.gitlab/ci/translation.gitlab-ci.yml index b6c683f57..83db2b5a4 100644 --- a/.gitlab/ci/translation.gitlab-ci.yml +++ b/.gitlab/ci/translation.gitlab-ci.yml @@ -26,7 +26,7 @@ autofix-translated-strings: - git checkout -b "ci-autofix-translated-strings-${CI_COMMIT_REF_NAME}" --no-track - python3 maintenance/missing_i18n_keys.py --fix - python3 maintenance/autofix_locale_format.py - - '[ $(git diff | wc -l) != 0 ] || exit 0' # stop if there is nothing to commit + - '[ $(git diff --ignore-blank-lines --ignore-all-space --ignore-space-at-eol --ignore-cr-at-eol | wc -l) != 0 ] || exit 0' # stop if there is nothing to commit - git commit -am "[CI] Reformat / remove stale translated strings" || true - git push -f origin "ci-autofix-translated-strings-${CI_COMMIT_REF_NAME}":"ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}" - hub pull-request -m "[CI] Reformat / remove stale translated strings" -b Yunohost:$CI_COMMIT_REF_NAME -p || true # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd diff --git a/debian/changelog b/debian/changelog index 0d13b3c92..db74b6d6a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,32 @@ +yunohost (11.1.5.3) stable; urgency=low + + - helpers/appsv2: replacement of __PHPVERSION__ should use the phpversion setting, not YNH_PHP_VERSION (13d4e16e) + - appv2 resources: document the fact that the apt resource may create a phpversion setting when the dependencies contain php packages (2107a848) + + -- Alexandre Aubin Fri, 03 Feb 2023 03:05:11 +0100 + +yunohost (11.1.5.2) stable; urgency=low + + - maintenance: new year, update copyright header (ba4f1925) + - helpers: fix remaining __FINALPATH__ in php template (note that this is backward compatible because ynh_add_config will replace __INSTALL_DIR__ by $finalpath if $finalpath exists... (9b7668da) + + -- Alexandre Aubin Thu, 02 Feb 2023 23:58:29 +0100 + +yunohost (11.1.5.1) stable; urgency=low + + - debian: Bump moulinette/ssowat requirement to 11.1 (0826a541) + - helpers: Fixes $app unbound when running ynh_secure_remove ([#1582](https://github.com/yunohost/yunohost/pull/1582)) + - log/appv2: don't dump all settings in log metadata (a9ac55e4) + - appv2: resource upgrade will tweak settings, we have to re-update the env_dict after upgrading resources (3110460a) + - appv2: safety-backup-before-upgrade should only contain the app (1c95bcff) + - appv2: fix env not including vars for v1->v2 upgrade (2b2d49a5) + - backup: add name of the backup in create/delete message, otherwise that creates some spooky messages with 'Backup created' directly followed by 'Backup deleted' during safety-backup-before-upgrade in v2 apps (8090acb1) + - [i18n] Translations updated for Arabic, French, Galician, Polish + + Thanks to all contributors <3 ! (ButterflyOfFire, Éric Gaspar, Eryk Michalak, Florent, José M, ppr) + + -- Alexandre Aubin Thu, 02 Feb 2023 23:37:46 +0100 + yunohost (11.1.5) stable; urgency=low - Release as stable ! diff --git a/helpers/php b/helpers/php index 6119c4870..0149bc243 100644 --- a/helpers/php +++ b/helpers/php @@ -156,7 +156,7 @@ ynh_add_fpm_config() { user = __APP__ group = __APP__ -chdir = __FINALPATH__ +chdir = __INSTALL_DIR__ listen = /var/run/php/php__PHPVERSION__-fpm-__APP__.sock listen.owner = www-data diff --git a/helpers/utils b/helpers/utils index bc83888e9..a0efa2c45 100644 --- a/helpers/utils +++ b/helpers/utils @@ -348,7 +348,7 @@ ynh_local_curl() { # __NAMETOCHANGE__ by $app # __USER__ by $app # __FINALPATH__ by $final_path -# __PHPVERSION__ by $YNH_PHP_VERSION +# __PHPVERSION__ by $YNH_PHP_VERSION (packaging v1 only, packaging v2 uses phpversion setting implicitly set by apt resource) # __YNH_NODE_LOAD_PATH__ by $ynh_node_load_PATH # ``` # And any dynamic variables that should be defined before calling this helper like: @@ -417,7 +417,7 @@ ynh_add_config() { # __NAMETOCHANGE__ by $app # __USER__ by $app # __FINALPATH__ by $final_path -# __PHPVERSION__ by $YNH_PHP_VERSION +# __PHPVERSION__ by $YNH_PHP_VERSION (packaging v1 only, packaging v2 uses phpversion setting implicitly set by apt resource) # __YNH_NODE_LOAD_PATH__ by $ynh_node_load_PATH # # And any dynamic variables that should be defined before calling this helper like: @@ -452,7 +452,8 @@ ynh_replace_vars() { ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$file" ynh_replace_string --match_string="__INSTALL_DIR__" --replace_string="$final_path" --target_file="$file" fi - if test -n "${YNH_PHP_VERSION:-}"; then + # Legacy / Packaging v1 only + if dpkg --compare-versions ${YNH_APP_PACKAGING_FORMAT:-0} lt 2 && test -n "${YNH_PHP_VERSION:-}"; then ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$YNH_PHP_VERSION" --target_file="$file" fi if test -n "${ynh_node_load_PATH:-}"; then @@ -718,7 +719,7 @@ _acceptable_path_to_delete() { local forbidden_paths=$(ls -d / /* /{var,home,usr}/* /etc/{default,sudoers.d,yunohost,cron*}) # Legacy : A couple apps still have data in /home/$app ... - if [[ -n "$app" ]] + if [[ -n "${app:-}" ]] then forbidden_paths=$(echo "$forbidden_paths" | grep -v "/home/$app") fi diff --git a/locales/ar.json b/locales/ar.json index c1d6cbcfb..04fd27001 100644 --- a/locales/ar.json +++ b/locales/ar.json @@ -209,5 +209,10 @@ "unbackup_app": "لن يتم حفظ التطبيق '{app}'", "unrestore_app": "لن يتم استعادة التطبيق '{app}'", "yunohost_already_installed": "إنّ YunoHost مُنصّب مِن قَبل", - "hook_name_unknown": "إسم الإجراء '{name}' غير معروف" + "hook_name_unknown": "إسم الإجراء '{name}' غير معروف", + "app_manifest_install_ask_admin": "اختر مستخدمًا إداريًا لهذا التطبيق", + "domain_config_cert_summary_abouttoexpire": "مدة صلاحية الشهادة الحالية على وشك الإنتهاء ومِن المفتَرض أن يتم تجديدها تلقائيا قريبا.", + "app_manifest_install_ask_path": "اختر مسار URL (بعد النطاق) حيث ينبغي تنصيب هذا التطبيق", + "app_manifest_install_ask_domain": "اختر اسم النطاق الذي ينبغي فيه تنصيب هذا التطبيق", + "app_manifest_install_ask_is_public": "هل يجب أن يكون هذا التطبيق ظاهرًا للزوار المجهولين؟" } diff --git a/locales/en.json b/locales/en.json index 9f56aacd5..b8ca0c229 100644 --- a/locales/en.json +++ b/locales/en.json @@ -102,14 +102,14 @@ "backup_copying_to_organize_the_archive": "Copying {size}MB to organize the archive", "backup_couldnt_bind": "Could not bind {src} to {dest}.", "backup_create_size_estimation": "The archive will contain about {size} of data.", - "backup_created": "Backup created", + "backup_created": "Backup created: {name}", "backup_creation_failed": "Could not create the backup archive", "backup_csv_addition_failed": "Could not add files to backup into the CSV file", "backup_csv_creation_failed": "Could not create the CSV file needed for restoration", "backup_custom_backup_error": "Custom backup method could not get past the 'backup' step", "backup_custom_mount_error": "Custom backup method could not get past the 'mount' step", "backup_delete_error": "Could not delete '{path}'", - "backup_deleted": "Backup deleted", + "backup_deleted": "Backup deleted: {name}", "backup_hook_unknown": "The backup hook '{hook}' is unknown", "backup_method_copy_finished": "Backup copy finalized", "backup_method_custom_finished": "Custom backup method '{method}' finished", @@ -400,12 +400,12 @@ "firewall_reloaded": "Firewall reloaded", "firewall_rules_cmd_failed": "Some firewall rule commands have failed. More info in log.", "global_settings_reset_success": "Reset global settings", - "global_settings_setting_dns_exposure": "IP versions to consider for DNS configuration and diagnosis", - "global_settings_setting_dns_exposure_help": "NB: This only affects the recommended DNS configuration and diagnosis checks. This does not affect system configurations.", "global_settings_setting_admin_strength": "Admin password strength requirements", "global_settings_setting_admin_strength_help": "These requirements are only enforced when initializing or changing the password", "global_settings_setting_backup_compress_tar_archives": "Compress backups", "global_settings_setting_backup_compress_tar_archives_help": "When creating new backups, compress the archives (.tar.gz) instead of uncompressed archives (.tar). N.B. : enabling this option means create lighter backup archives, but the initial backup procedure will be significantly longer and heavy on CPU.", + "global_settings_setting_dns_exposure": "IP versions to consider for DNS configuration and diagnosis", + "global_settings_setting_dns_exposure_help": "NB: This only affects the recommended DNS configuration and diagnosis checks. This does not affect system configurations.", "global_settings_setting_nginx_compatibility": "NGINX Compatibility", "global_settings_setting_nginx_compatibility_help": "Compatibility vs. security tradeoff for the web server NGINX. Affects the ciphers (and other security-related aspects)", "global_settings_setting_nginx_redirect_to_https": "Force HTTPS", @@ -752,4 +752,4 @@ "yunohost_installing": "Installing YunoHost...", "yunohost_not_installed": "YunoHost is not correctly installed. Please run 'yunohost tools postinstall'", "yunohost_postinstall_end_tip": "The post-install completed! To finalize your setup, please consider:\n - diagnose potential issues through the 'Diagnosis' section of the webadmin (or 'yunohost diagnosis run' in command-line);\n - reading the 'Finalizing your setup' and 'Getting to know YunoHost' parts in the admin documentation: https://yunohost.org/admindoc." -} \ No newline at end of file +} diff --git a/locales/fr.json b/locales/fr.json index c1647334a..e8302fb82 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -652,7 +652,7 @@ "tools_upgrade_failed": "Impossible de mettre à jour les paquets : {packages_list}", "migration_0023_not_enough_space": "Prévoyez suffisamment d'espace disponible dans {path} pour exécuter la migration.", "migration_0023_postgresql_11_not_installed": "PostgreSQL n'a pas été installé sur votre système. Il n'y a rien à faire.", - "global_settings_setting_backup_compress_tar_archives_help": "Lors de la création de nouvelles sauvegardes, compresser automatiquement les archives (.tar.gz) au lieu des archives non compressées (.tar). N.B. : activer cette option permet de créer des archives plus légères, mais la procédure de sauvegarde initiale sera significativement plus longues et plus gourmandes en CPU.", + "global_settings_setting_backup_compress_tar_archives_help": "Lors de la création de nouvelles sauvegardes, compresser automatiquement les archives (.tar.gz) au lieu des archives non compressées (.tar).\nN.B. : activer cette option permet de créer des archives plus légères, mais la procédure de sauvegarde initiale sera significativement plus longues et plus gourmandes en CPU.", "global_settings_setting_security_experimental_enabled": "Fonctionnalités de sécurité expérimentales", "global_settings_setting_security_experimental_enabled_help": "Activer les fonctionnalités de sécurité expérimentales (ne l'activez pas si vous ne savez pas ce que vous faites !)", "global_settings_setting_nginx_compatibility_help": "Compromis 'compatibilité versus sécurité' pour le serveur web NGINX. Affecte les cryptogrammes utilisés (et d'autres aspects liés à la sécurité)", diff --git a/locales/gl.json b/locales/gl.json index 7ba5c181f..1b5147ac6 100644 --- a/locales/gl.json +++ b/locales/gl.json @@ -749,4 +749,4 @@ "global_settings_setting_dns_exposure": "Versións de IP a ter en conta para a configuración DNS e diagnóstico", "global_settings_setting_dns_exposure_help": "Nota: Esto só lle afecta á configuración DNS recomendada e diagnóstico do sistema. Non lle afecta aos axustes do sistema.", "diagnosis_ip_no_ipv6_tip_important": "Se está dispoñible, IPv6 debería estar automáticamente configurado polo sistema ou o teu provedor. Se non, pode que teñas que facer algúns axustes manualmente tal como se explica na documentación: https://yunohost.org/#/ipv6." -} +} \ No newline at end of file diff --git a/locales/pl.json b/locales/pl.json index 6734e6558..c73de7314 100644 --- a/locales/pl.json +++ b/locales/pl.json @@ -5,5 +5,67 @@ "already_up_to_date": "Nic do zrobienia. Wszystko jest obecnie aktualne.", "admin_password": "Hasło administratora", "action_invalid": "Nieprawidłowe działanie '{action:s}'", - "aborting": "Przerywanie." -} \ No newline at end of file + "aborting": "Przerywanie.", + "domain_config_auth_consumer_key": "Klucz konsumenta", + "domain_config_cert_validity": "Ważność", + "visitors": "Odwiedzający", + "app_start_install": "Instalowanie {app}...", + "app_unknown": "Nieznana aplikacja", + "ask_main_domain": "Domena główna", + "backup_created": "Utworzono kopię zapasową", + "firewall_reloaded": "Przeładowano zaporę sieciową", + "user_created": "Utworzono użytkownika", + "yunohost_installing": "Instalowanie YunoHost...", + "global_settings_setting_smtp_allow_ipv6": "Zezwól na IPv6", + "user_deleted": "Usunięto użytkownika", + "domain_config_default_app": "Domyślna aplikacja", + "restore_complete": "Przywracanie zakończone", + "domain_deleted": "Usunięto domenę", + "domains_available": "Dostępne domeny:", + "domain_config_api_protocol": "API protokołu", + "domain_config_auth_application_key": "Klucz aplikacji", + "diagnosis_description_systemresources": "Zasoby systemu", + "log_user_import": "Importuj użytkowników", + "system_upgraded": "Zaktualizowano system", + "diagnosis_description_regenconf": "Konfiguracja systemu", + "diagnosis_description_apps": "Aplikacje", + "diagnosis_description_basesystem": "Podstawowy system", + "unlimit": "Brak limitu", + "global_settings_setting_pop3_enabled": "Włącz POP3", + "domain_created": "Utworzono domenę", + "ask_new_admin_password": "Nowe hasło administracyjne", + "ask_new_domain": "Nowa domena", + "ask_new_path": "Nowa ścieżka", + "downloading": "Pobieranie...", + "ask_password": "Hasło", + "backup_deleted": "Usunięto kopię zapasową", + "done": "Gotowe", + "diagnosis_description_dnsrecords": "Rekordy DNS", + "diagnosis_description_ip": "Połączenie z internetem", + "diagnosis_description_mail": "Email", + "diagnosis_mail_ehlo_could_not_diagnose_details": "Błąd: {error}", + "diagnosis_mail_queue_unavailable_details": "Błąd: {error}", + "diagnosis_http_could_not_diagnose_details": "Błąd: {error}", + "installation_complete": "Instalacja zakończona", + "app_start_remove": "Usuwanie {app}...", + "app_start_restore": "Przywracanie {app}...", + "app_upgraded": "Zaktualizowano {app}", + "extracting": "Rozpakowywanie...", + "app_removed": "Odinstalowano {app}", + "upgrade_complete": "Aktualizacja zakończona", + "global_settings_setting_backup_compress_tar_archives": "Kompresuj kopie zapasowe", + "global_settings_setting_nginx_compatibility": "Kompatybilność z NGINX", + "global_settings_setting_nginx_redirect_to_https": "Wymuszaj HTTPS", + "ask_admin_username": "Nazwa użytkownika administratora", + "ask_fullname": "Pełne imię i nazwisko", + "upgrading_packages": "Aktualizowanie paczek...", + "admins": "Administratorzy", + "diagnosis_ports_could_not_diagnose_details": "Błąd: {error}", + "log_settings_set": "Zastosuj ustawienia", + "domain_config_cert_issuer": "Organ certyfikacji", + "domain_config_cert_summary": "Status certyfikatu", + "global_settings_setting_ssh_compatibility": "Kompatybilność z SSH", + "global_settings_setting_ssh_port": "Port SSH", + "log_settings_reset": "Resetuj ustawienia", + "log_tools_migrations_migrate_forward": "Uruchom migracje" +} diff --git a/locales/tr.json b/locales/tr.json index 6768f95e4..c219e997b 100644 --- a/locales/tr.json +++ b/locales/tr.json @@ -16,4 +16,4 @@ "additional_urls_already_removed": "Ek URL '{url}', '{permission}' izni için ek URL'de zaten kaldırıldı", "app_action_cannot_be_ran_because_required_services_down": "Bu eylemi gerçekleştirmek için şu servisler çalışıyor olmalıdır: {services}. Devam etmek için onları yeniden başlatın (ve muhtemelen neden çalışmadığını araştırın).", "app_arch_not_supported": "Bu uygulama yalnızca {', '.join(required)} işlemci mimarisi üzerine kurulabilir ancak sunucunuzun işlemci mimarisi {current}." -} +} \ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py index 4d4026fdf..d13d61089 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1,6 +1,6 @@ #! /usr/bin/python # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/app.py b/src/app.py index 205dec505..6d754ab25 100644 --- a/src/app.py +++ b/src/app.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # @@ -647,7 +647,9 @@ def app_upgrade(app=[], url=None, file=None, force=False, no_safety_backup=False safety_backup_name = f"{app_instance_name}-pre-upgrade2" other_safety_backup_name = f"{app_instance_name}-pre-upgrade1" - backup_create(name=safety_backup_name, apps=[app_instance_name]) + backup_create( + name=safety_backup_name, apps=[app_instance_name], system=None + ) if safety_backup_name in backup_list()["archives"]: # if the backup suceeded, delete old safety backup to save space @@ -677,11 +679,17 @@ def app_upgrade(app=[], url=None, file=None, force=False, no_safety_backup=False env_dict = _make_environment_for_app_script( app_instance_name, workdir=extracted_app_folder, action="upgrade" ) - env_dict["YNH_APP_UPGRADE_TYPE"] = upgrade_type - env_dict["YNH_APP_MANIFEST_VERSION"] = str(app_new_version) - env_dict["YNH_APP_CURRENT_VERSION"] = str(app_current_version) + + env_dict_more = { + "YNH_APP_UPGRADE_TYPE": upgrade_type, + "YNH_APP_MANIFEST_VERSION": str(app_new_version), + "YNH_APP_CURRENT_VERSION": str(app_current_version), + } + if manifest["packaging_format"] < 2: - env_dict["NO_BACKUP_UPGRADE"] = "1" if no_safety_backup else "0" + env_dict_more["NO_BACKUP_UPGRADE"] = "1" if no_safety_backup else "0" + + env_dict.update(env_dict_more) # Start register change on system related_to = [("app", app_instance_name)] @@ -698,6 +706,17 @@ def app_upgrade(app=[], url=None, file=None, force=False, no_safety_backup=False operation_logger=operation_logger, ) + # Boring stuff : the resource upgrade may have added/remove/updated setting + # so we need to reflect this in the env_dict used to call the actual upgrade script x_x + # Or: the old manifest may be in v1 and the new in v2, so force to add the setting in env + env_dict = _make_environment_for_app_script( + app_instance_name, + workdir=extracted_app_folder, + action="upgrade", + include_app_settings=True, + ) + env_dict.update(env_dict_more) + # Execute the app upgrade script upgrade_failed = True try: @@ -2718,7 +2737,12 @@ def _assert_no_conflicting_apps(domain, path, ignore_app=None, full_domain=False def _make_environment_for_app_script( - app, args={}, args_prefix="APP_ARG_", workdir=None, action=None + app, + args={}, + args_prefix="APP_ARG_", + workdir=None, + action=None, + include_app_settings=False, ): app_setting_path = os.path.join(APPS_SETTING_PATH, app) @@ -2745,7 +2769,7 @@ def _make_environment_for_app_script( env_dict[f"YNH_{args_prefix}{arg_name_upper}"] = str(arg_value) # If packaging format v2, load all settings - if manifest["packaging_format"] >= 2: + if manifest["packaging_format"] >= 2 or include_app_settings: env_dict["app"] = app for setting_name, setting_value in _get_app_settings(app).items(): # Ignore special internal settings like checksum__ diff --git a/src/app_catalog.py b/src/app_catalog.py index 59d2ebdc1..9fb662845 100644 --- a/src/app_catalog.py +++ b/src/app_catalog.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/authenticators/ldap_admin.py b/src/authenticators/ldap_admin.py index 8637b3833..b1b550bc0 100644 --- a/src/authenticators/ldap_admin.py +++ b/src/authenticators/ldap_admin.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/backup.py b/src/backup.py index 0783996b9..0727ad295 100644 --- a/src/backup.py +++ b/src/backup.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # @@ -2295,7 +2295,7 @@ def backup_create( ) backup_manager.backup() - logger.success(m18n.n("backup_created")) + logger.success(m18n.n("backup_created", name=name)) operation_logger.success() return { @@ -2622,7 +2622,7 @@ def backup_delete(name): hook_callback("post_backup_delete", args=[name]) - logger.success(m18n.n("backup_deleted")) + logger.success(m18n.n("backup_deleted", name=name)) # diff --git a/src/certificate.py b/src/certificate.py index a0eba212a..52e0d8c1b 100644 --- a/src/certificate.py +++ b/src/certificate.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosers/00-basesystem.py b/src/diagnosers/00-basesystem.py index 8be334406..336271bd1 100644 --- a/src/diagnosers/00-basesystem.py +++ b/src/diagnosers/00-basesystem.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosers/10-ip.py b/src/diagnosers/10-ip.py index ea68fc7bb..4f9cd9708 100644 --- a/src/diagnosers/10-ip.py +++ b/src/diagnosers/10-ip.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosers/12-dnsrecords.py b/src/diagnosers/12-dnsrecords.py index 58bd04d39..2d46f979c 100644 --- a/src/diagnosers/12-dnsrecords.py +++ b/src/diagnosers/12-dnsrecords.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosers/14-ports.py b/src/diagnosers/14-ports.py index 12f2481f7..34c512f14 100644 --- a/src/diagnosers/14-ports.py +++ b/src/diagnosers/14-ports.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosers/21-web.py b/src/diagnosers/21-web.py index a12a83f94..2050cd658 100644 --- a/src/diagnosers/21-web.py +++ b/src/diagnosers/21-web.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosers/24-mail.py b/src/diagnosers/24-mail.py index 9a4cd1fc3..857de687d 100644 --- a/src/diagnosers/24-mail.py +++ b/src/diagnosers/24-mail.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosers/30-services.py b/src/diagnosers/30-services.py index 44bbf1745..42ea9d18f 100644 --- a/src/diagnosers/30-services.py +++ b/src/diagnosers/30-services.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosers/50-systemresources.py b/src/diagnosers/50-systemresources.py index 10a153c61..096c3483f 100644 --- a/src/diagnosers/50-systemresources.py +++ b/src/diagnosers/50-systemresources.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosers/70-regenconf.py b/src/diagnosers/70-regenconf.py index 7d11b9174..65195aac5 100644 --- a/src/diagnosers/70-regenconf.py +++ b/src/diagnosers/70-regenconf.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosers/80-apps.py b/src/diagnosers/80-apps.py index ae89f26d3..44ce86bcc 100644 --- a/src/diagnosers/80-apps.py +++ b/src/diagnosers/80-apps.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosers/__init__.py b/src/diagnosers/__init__.py index 5cad500fa..7c1e7b0cd 100644 --- a/src/diagnosers/__init__.py +++ b/src/diagnosers/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/diagnosis.py b/src/diagnosis.py index 6b9f8fa92..02047c001 100644 --- a/src/diagnosis.py +++ b/src/diagnosis.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/dns.py b/src/dns.py index e697e6324..d4c9b1380 100644 --- a/src/dns.py +++ b/src/dns.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/domain.py b/src/domain.py index 5728c6884..e83b5e3e8 100644 --- a/src/domain.py +++ b/src/domain.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/dyndns.py b/src/dyndns.py index 9cba360ab..2594abe8f 100644 --- a/src/dyndns.py +++ b/src/dyndns.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/firewall.py b/src/firewall.py index f4d7f77fe..073e48c88 100644 --- a/src/firewall.py +++ b/src/firewall.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/hook.py b/src/hook.py index eb5a7c035..42d9d3eac 100644 --- a/src/hook.py +++ b/src/hook.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/log.py b/src/log.py index f8eb65f8f..e7ea18857 100644 --- a/src/log.py +++ b/src/log.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # @@ -16,6 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # +import copy import os import re import yaml @@ -594,6 +595,16 @@ class OperationLogger: Write or rewrite the metadata file with all metadata known """ + metadata = copy.copy(self.metadata) + + # Remove lower-case keys ... this is because with the new v2 app packaging, + # all settings are included in the env but we probably don't want to dump all of these + # which may contain various secret/private data ... + if "env" in metadata: + metadata["env"] = { + k: v for k, v in metadata["env"].items() if k == k.upper() + } + dump = yaml.safe_dump(self.metadata, default_flow_style=False) for data in self.data_to_redact: # N.B. : we need quotes here, otherwise yaml isn't happy about loading the yml later diff --git a/src/permission.py b/src/permission.py index 7f5a65f2e..c7446b7ad 100644 --- a/src/permission.py +++ b/src/permission.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/regenconf.py b/src/regenconf.py index 7acc6f58f..69bedb262 100644 --- a/src/regenconf.py +++ b/src/regenconf.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/service.py b/src/service.py index 935e87339..a3bcc5561 100644 --- a/src/service.py +++ b/src/service.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/settings.py b/src/settings.py index a06377176..fbe4db7d0 100644 --- a/src/settings.py +++ b/src/settings.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/ssh.py b/src/ssh.py index d5951cba5..2ae5ffe46 100644 --- a/src/ssh.py +++ b/src/ssh.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/tools.py b/src/tools.py index 777d8fc8f..dee4c8486 100644 --- a/src/tools.py +++ b/src/tools.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/user.py b/src/user.py index 797c3252f..12f13f75c 100644 --- a/src/user.py +++ b/src/user.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/utils/__init__.py b/src/utils/__init__.py index 5cad500fa..7c1e7b0cd 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/utils/config.py b/src/utils/config.py index 5dce4070d..534cddcb3 100644 --- a/src/utils/config.py +++ b/src/utils/config.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/utils/dns.py b/src/utils/dns.py index 225a0e98f..b3ca4b564 100644 --- a/src/utils/dns.py +++ b/src/utils/dns.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/utils/error.py b/src/utils/error.py index cdf2a3d09..9be48c5df 100644 --- a/src/utils/error.py +++ b/src/utils/error.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/utils/i18n.py b/src/utils/i18n.py index ecbfe36e8..2aafafbdd 100644 --- a/src/utils/i18n.py +++ b/src/utils/i18n.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/utils/ldap.py b/src/utils/ldap.py index 5a0e3ba35..6b41cdb22 100644 --- a/src/utils/ldap.py +++ b/src/utils/ldap.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/utils/legacy.py b/src/utils/legacy.py index fa0b68137..82507d64d 100644 --- a/src/utils/legacy.py +++ b/src/utils/legacy.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/utils/network.py b/src/utils/network.py index e9892333e..2a13f966e 100644 --- a/src/utils/network.py +++ b/src/utils/network.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/utils/password.py b/src/utils/password.py index 569833a7d..833933d33 100644 --- a/src/utils/password.py +++ b/src/utils/password.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/utils/resources.py b/src/utils/resources.py index 569512006..65c8ee8cd 100644 --- a/src/utils/resources.py +++ b/src/utils/resources.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # @@ -703,6 +703,7 @@ class AptDependenciesAppResource(AppResource): ##### Provision/Update: - The code literally calls the bash helpers `ynh_install_app_dependencies` and `ynh_install_extra_app_dependencies`, similar to what happens in v1. + - Note that when `packages` contains some phpX.Y-foobar dependencies, this will automagically define a `phpversion` setting equal to `X.Y` which can therefore be used in app scripts ($phpversion) or templates (`__PHPVERSION__`) ##### Deprovision: - The code literally calls the bash helper `ynh_remove_app_dependencies` diff --git a/src/utils/system.py b/src/utils/system.py index c55023e52..2538f74fb 100644 --- a/src/utils/system.py +++ b/src/utils/system.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) # diff --git a/src/utils/yunopaste.py b/src/utils/yunopaste.py index 806f8a34f..46131846d 100644 --- a/src/utils/yunopaste.py +++ b/src/utils/yunopaste.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 YunoHost Contributors +# Copyright (c) 2023 YunoHost Contributors # # This file is part of YunoHost (see https://yunohost.org) #