Merge remote-tracking branch 'origin/dev' into manifestv2

This commit is contained in:
Alexandre Aubin 2022-08-09 18:41:26 +02:00
commit 18f33417ef
11 changed files with 295 additions and 29 deletions

View file

@ -14,7 +14,7 @@ generate-helpers-doc:
- cd doc
- python3 generate_helper_doc.py
- hub clone https://$GITHUB_TOKEN:x-oauth-basic@github.com/YunoHost/doc.git doc_repo
- cp helpers.md doc_repo/pages/04.contribute/04.packaging_apps/11.helpers/packaging_apps_helpers.md
- cp helpers.md doc_repo/pages/06.contribute/10.packaging_apps/11.helpers/packaging_apps_helpers.md
- cd doc_repo
# replace ${CI_COMMIT_REF_NAME} with ${CI_COMMIT_TAG} ?
- hub checkout -b "${CI_COMMIT_REF_NAME}"

32
debian/changelog vendored
View file

@ -1,3 +1,35 @@
yunohost (11.0.9) stable; urgency=low
- [fix] services: Skip php 7.3 which is most likely dead after buster->bullseye migration because users get spooked (51804925)
- [enh] bullseye: add a migration process to automatically attempt to rebuild venvs (3b8e49dc)
- [i18n] Translations updated for French
Thanks to all contributors <3 ! (Éric Gaspar, Kayou, ljf, theo-is-taken)
-- Alexandre Aubin <alex.aubin@mailoo.org> Sun, 07 Aug 2022 23:27:41 +0200
yunohost (11.0.8.1) testing; urgency=low
- Fix tests é_è (7fa67b2b)
-- Alexandre Aubin <alex.aubin@mailoo.org> Sun, 07 Aug 2022 12:41:28 +0200
yunohost (11.0.8) testing; urgency=low
- [fix] helpers: escape username in ynh_user_exists ([#1469](https://github.com/YunoHost/yunohost/pull/1469))
- [fix] helpers: in nginx helpers, do not change the nginx template conf, replace #sub_path_only and #root_path_only after ynh_add_config, otherwise it breaks the change_url script (30e926f9)
- [fix] helpers: fix arg parsing in ynh_install_apps ([#1480](https://github.com/YunoHost/yunohost/pull/1480))
- [fix] postinstall: be able to redo postinstall when the 128+ chars
password error is raised ([#1476](https://github.com/YunoHost/yunohost/pull/1476))
- [fix] regenconf dhclient/resolvconf: fix weird typo, probably meant 'search' (like in our rpi-image tweaking) (9d39a2c0)
- [fix] configpanels: remove debug message because it floods the regenconf logs (f6cd35d9)
- [fix] configpanels: don't restrict choices if there's no choices specified ([#1478](https://github.com/YunoHost/yunohost/pull/1478)
- [i18n] Translations updated for Arabic, German, Slovak, Telugu
Thanks to all contributors <3 ! (Alice Kile, ButterflyOfFire, Éric Gaspar, Gregor, Jose Riha, Kay0u, ljf, Meta Meta, tituspijean, Valentin von Guttenberg, yalh76)
-- Alexandre Aubin <alex.aubin@mailoo.org> Sun, 07 Aug 2022 11:26:54 +0200
yunohost (11.0.7) testing; urgency=low
- [fix] Allow lime2 to upgrade even if kernel is hold ([#1452](https://github.com/YunoHost/yunohost/pull/1452))

View file

@ -15,7 +15,7 @@
"app_requirements_checking": "جار فحص الحزم اللازمة لـ {app}…",
"app_sources_fetch_failed": "تعذرت عملية جلب مصادر الملفات",
"app_unknown": "برنامج مجهول",
"app_upgrade_app_name": "جارٍ تحديث تطبيق {app}…",
"app_upgrade_app_name": "جارٍ تحديث {app}…",
"app_upgrade_failed": "تعذرت عملية ترقية {app}",
"app_upgrade_some_app_failed": "تعذرت عملية ترقية بعض التطبيقات",
"app_upgraded": "تم تحديث التطبيق {app}",
@ -30,9 +30,9 @@
"backup_method_copy_finished": "إنتهت عملية النسخ الإحتياطي",
"backup_nothings_done": "ليس هناك أي شيء للحفظ",
"backup_output_directory_required": "يتوجب عليك تحديد مجلد لتلقي النسخ الإحتياطية",
"certmanager_cert_install_success": "تمت عملية تنصيب شهادة Let's Encrypt بنجاح على النطاق {domain} !",
"certmanager_cert_install_success_selfsigned": "نجحت عملية تثبيت الشهادة الموقعة ذاتيا الخاصة بالنطاق {domain}",
"certmanager_cert_renew_success": "نجحت عملية تجديد شهادة Let's Encrypt الخاصة باسم النطاق {domain} !",
"certmanager_cert_install_success": "تمت عملية تنصيب شهادة Let's Encrypt بنجاح على النطاق {domain}",
"certmanager_cert_install_success_selfsigned": "نجحت عملية تثبيت الشهادة الموقعة ذاتيا الخاصة بالنطاق '{domain}'",
"certmanager_cert_renew_success": "نجحت عملية تجديد شهادة Let's Encrypt الخاصة باسم النطاق '{domain}'",
"certmanager_cert_signing_failed": "فشل إجراء توقيع الشهادة الجديدة",
"certmanager_no_cert_file": "تعذرت عملية قراءة شهادة نطاق {domain} (الملف : {file})",
"domain_created": "تم إنشاء النطاق",
@ -114,9 +114,9 @@
"aborting": "إلغاء.",
"admin_password_too_long": "يرجى اختيار كلمة سرية أقصر مِن 127 حرف",
"app_not_upgraded": "",
"app_start_install": "جارٍ تثبيت التطبيق {app}…",
"app_start_remove": "جارٍ حذف التطبيق {app}…",
"app_start_restore": "جارٍ استرجاع التطبيق {app}…",
"app_start_install": "جارٍ تثبيت {app}…",
"app_start_remove": "جارٍ حذف {app}…",
"app_start_restore": "جارٍ استرجاع {app}…",
"app_upgrade_several_apps": "سوف يتم تحديث التطبيقات التالية: {apps}",
"ask_new_domain": "نطاق جديد",
"ask_new_path": "مسار جديد",
@ -127,7 +127,7 @@
"service_description_slapd": "يخزّن المستخدمين والنطاقات والمعلومات المتعلقة بها",
"service_reloaded": "تم إعادة تشغيل خدمة '{service}'",
"service_restarted": "تم إعادة تشغيل خدمة '{service}'",
"group_unknown": "الفريق {group} مجهول",
"group_unknown": "الفريق '{group}' مجهول",
"group_deletion_failed": "فشلت عملية حذف الفريق '{group}': {error}",
"group_deleted": "تم حذف الفريق '{group}'",
"group_created": "تم إنشاء الفريق '{group}'",
@ -145,7 +145,7 @@
"diagnosis_ip_not_connected_at_all": "يبدو أنّ الخادم غير مُتّصل بتاتا بالإنترنت!؟",
"app_install_failed": "لا يمكن تنصيب {app}: {error}",
"apps_already_up_to_date": "كافة التطبيقات مُحدّثة",
"app_remove_after_failed_install": "جارٍ حذف التطبيق بعدما فشل تنصيبها…",
"app_remove_after_failed_install": "جارٍ حذف التطبيق بعدما فشل تنصيبه…",
"apps_catalog_updating": "جارٍ تحديث فهرس التطبيقات…",
"apps_catalog_update_success": "تم تحديث فهرس التطبيقات!",
"diagnosis_domain_expiration_error": "ستنتهي مدة صلاحية بعض النطاقات في القريب العاجل!",
@ -158,5 +158,6 @@
"diagnosis_description_services": "حالة الخدمات",
"diagnosis_description_dnsrecords": "تسجيلات خدمة DNS",
"diagnosis_description_ip": "الإتصال بالإنترنت",
"diagnosis_description_basesystem": "النظام الأساسي"
"diagnosis_description_basesystem": "النظام الأساسي",
"field_invalid": "الحقل غير صحيح : '{}'"
}

View file

@ -487,6 +487,7 @@
"main_domain_change_failed": "Unable to change the main domain",
"main_domain_changed": "The main domain has been changed",
"migration_0021_cleaning_up": "Cleaning up cache and packages not useful anymore...",
"migration_0021_venv_regen_failed": "The virtual environment '{venv}' failed to regenerate, you probably need to run the command `yunohost app upgrade --force`",
"migration_0021_general_warning": "Please note that this migration is a delicate operation. The YunoHost team did its best to review and test it, but the migration might still break parts of the system or its apps.\n\nTherefore, it is recommended to:\n - Perform a backup of any critical data or app. More info on https://yunohost.org/backup;\n - Be patient after launching the migration: Depending on your Internet connection and hardware, it might take up to a few hours for everything to upgrade.",
"migration_0021_main_upgrade": "Starting main upgrade...",
"migration_0021_modified_files": "Please note that the following files were found to be manually modified and might be overwritten following the upgrade: {manually_modified_files}",
@ -502,9 +503,16 @@
"migration_0023_not_enough_space": "Make sufficient space available in {path} to run the migration.",
"migration_0023_postgresql_11_not_installed": "PostgreSQL was not installed on your system. Nothing to do.",
"migration_0023_postgresql_13_not_installed": "PostgreSQL 11 is installed, but not PostgreSQL 13!? Something weird might have happened on your system :(...",
"migration_0024_rebuild_python_venv_broken_app": "Skipping {app} because virtualenv can't easily be rebuilt for this app. Instead, you should fix the situation by forcing the upgrade of this app using `yunohost app upgrade --force {app}`.",
"migration_0024_rebuild_python_venv_disclaimer_base": "Following the upgrade to Debian Bullseye, some Python applications needs to be partially rebuilt to get converted to the new Python version shipped in Debian (in technical terms: what's called the 'virtualenv' needs to be recreated). In the meantime, those Python applications may not work. YunoHost can attempt to rebuild the virtualenv for some of those, as detailed below. For other apps, or if the rebuild attempt fails, you will need to manually force an upgrade for those apps.",
"migration_0024_rebuild_python_venv_disclaimer_rebuild": "Rebuilding the virtualenv will be attempted for the following apps (NB: the operation may take some time!): {rebuild_apps}",
"migration_0024_rebuild_python_venv_disclaimer_ignored": "Virtualenvs can't be rebuilt automatically for those apps. You need to force an upgrade for those, which can be done from the command line with: `yunohost app upgrade -f APP`: {ignored_apps}",
"migration_0024_rebuild_python_venv_in_progress": "Now attempting to rebuild python virtualenv for `{app}`",
"migration_0024_rebuild_python_venv_failed": "Failed to rebuild the python virtual env for {app}. The app may not work as long as this is not resolved. You should fix the situation by forcing the upgrade of this app using `yunohost app upgrade --force {app}`.",
"migration_description_0021_migrate_to_bullseye": "Upgrade the system to Debian Bullseye and YunoHost 11.x",
"migration_description_0022_php73_to_php74_pools": "Migrate php7.3-fpm 'pool' conf files to php7.4",
"migration_description_0023_postgresql_11_to_13": "Migrate databases from PostgreSQL 11 to 13",
"migration_description_0024_rebuild_python_venv": "Repair python app after bullseye migration",
"migration_ldap_backup_before_migration": "Creating a backup of LDAP database and apps settings prior to the actual migration.",
"migration_ldap_can_not_backup_before_migration": "The backup of the system could not be completed before the migration failed. Error: {error}",
"migration_ldap_migration_failed_trying_to_rollback": "Could not migrate... trying to roll back the system.",
@ -685,4 +693,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 - adding a first user through the 'Users' section of the webadmin (or 'yunohost user create <username>' in command-line);\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."
}
}

View file

@ -151,7 +151,7 @@
"certmanager_attempt_to_renew_nonLE_cert": "Le certificat pour le domaine {domain} n'est pas émis par Let's Encrypt. Impossible de le renouveler automatiquement !",
"certmanager_attempt_to_renew_valid_cert": "Le certificat pour le domaine {domain} n'est pas sur le point d'expirer ! (Vous pouvez utiliser --force si vous savez ce que vous faites)",
"certmanager_domain_http_not_working": "Le domaine {domain} ne semble pas être accessible via HTTP. Merci de vérifier la catégorie 'Web' dans le diagnostic pour plus d'informations. (Ou si vous savez ce que vous faites, utilisez '--no-checks' pour désactiver la vérification.)",
"certmanager_domain_dns_ip_differs_from_public_ip": "Les enregistrements DNS du domaine '{domain}' sont différents de l'adresse IP de ce serveur. Pour plus d'informations, veuillez consulter la catégorie \"Enregistrements DNS\" dans la section diagnostic. Si vous avez récemment modifié votre enregistrement A, veuillez attendre sa propagation (des vérificateurs de propagation DNS sont disponibles en ligne). (Si vous savez ce que vous faites, utilisez '--no-checks' pour désactiver ces contrôles)",
"certmanager_domain_dns_ip_differs_from_public_ip": "Les enregistrements DNS du domaine '{domain}' sont différents de l'adresse IP de ce serveur. Pour plus d'informations, veuillez consulter la catégorie \"Enregistrements DNS\" dans la section Diagnostic. Si vous avez récemment modifié votre enregistrement A, veuillez attendre sa propagation (des vérificateurs de propagation DNS sont disponibles en ligne). (Si vous savez ce que vous faites, utilisez '--no-checks' pour désactiver ces contrôles)",
"certmanager_cannot_read_cert": "Quelque chose s'est mal passé lors de la tentative d'ouverture du certificat actuel pour le domaine {domain} (fichier : {file}), la cause est : {reason}",
"certmanager_cert_install_success_selfsigned": "Le certificat auto-signé est maintenant installé pour le domaine '{domain}'",
"certmanager_cert_install_success": "Le certificat Let's Encrypt est maintenant installé pour le domaine '{domain}'",
@ -546,7 +546,7 @@
"app_manifest_install_ask_domain": "Choisissez le domaine sur lequel vous souhaitez installer cette application",
"global_settings_setting_smtp_relay_user": "Compte utilisateur du relais SMTP",
"global_settings_setting_smtp_relay_port": "Port du relais SMTP",
"global_settings_setting_smtp_relay_host": "Un relais SMTP permet d'envoyer du courrier à la place de cette instance YunoHost. Cela est utile si vous êtes dans l'une de ces situations : le port 25 est bloqué par votre FAI ou par votre fournisseur VPS, vous avez une IP résidentielle répertoriée sur DUHL, vous ne pouvez pas configurer de reverse DNS ou le serveur n'est pas directement accessible depuis Internet et que vous voulez en utiliser un autre pour envoyer des mails.",
"global_settings_setting_smtp_relay_host": "Un relais SMTP permet d'envoyer du courrier à la place de cette instance YunoHost. Cela est utile si vous êtes dans l'une de ces situations : le port 25 est bloqué par votre FAI ou par votre fournisseur VPS ; vous avez une IP résidentielle répertoriée sur DUHL ; vous ne pouvez pas configurer le DNS inversé ; ou le serveur n'est pas directement accessible depuis Internet et vous voulez en utiliser un autre pour envoyer des mails.",
"diagnosis_package_installed_from_sury_details": "Certains paquets ont été installés par inadvertance à partir d'un dépôt tiers appelé Sury. L'équipe YunoHost a amélioré la stratégie de gestion de ces paquets, mais on s'attend à ce que certaines configurations qui ont installé des applications PHP7.3 tout en étant toujours sur Stretch présentent des incohérences. Pour résoudre cette situation, vous devez essayer d'exécuter la commande suivante : <cmd>{cmd_to_fix}</cmd>",
"app_argument_password_no_default": "Erreur lors de l'analyse de l'argument de mot de passe '{name}' : l'argument de mot de passe ne peut pas avoir de valeur par défaut pour des raisons de sécurité",
"pattern_email_forward": "L'adresse électronique doit être valide, le symbole '+' étant accepté (par exemple : johndoe+yunohost@exemple.com)",
@ -571,7 +571,7 @@
"diagnosis_rootfstotalspace_warning": "Le système de fichiers racine n'est que de {space}. Cela peut suffire, mais faites attention car vous risquez de les remplir rapidement... Il est recommandé d'avoir au moins 16 GB pour ce système de fichiers.",
"app_restore_script_failed": "Une erreur s'est produite dans le script de restauration de l'application",
"restore_backup_too_old": "Cette sauvegarde ne peut pas être restaurée car elle provient d'une version de YunoHost trop ancienne.",
"log_backup_create": "Création d'une archive de sauvegarde",
"log_backup_create": "Créer une archive de sauvegarde",
"global_settings_setting_ssowat_panel_overlay_enabled": "Activer la superposition de la vignette SSOwat",
"migration_ldap_rollback_success": "Système rétabli dans son état initial.",
"permission_cant_add_to_all_users": "L'autorisation {permission} ne peut pas être ajoutée à tous les utilisateurs.",

View file

@ -30,6 +30,44 @@ N_CURRENT_YUNOHOST = 4
N_NEXT_DEBAN = 11
N_NEXT_YUNOHOST = 11
VENV_REQUIREMENTS_SUFFIX = ".requirements_backup_for_bullseye_upgrade.txt"
def _get_all_venvs(dir, level=0, maxlevel=3):
"""
Returns the list of all python virtual env directories recursively
Arguments:
dir - the directory to scan in
maxlevel - the depth of the recursion
level - do not edit this, used as an iterator
"""
# Using os functions instead of glob, because glob doesn't support hidden folders, and we need recursion with a fixed depth
result = []
for file in os.listdir(dir):
path = os.path.join(dir, file)
if os.path.isdir(path):
activatepath = os.path.join(path, "bin", "activate")
if os.path.isfile(activatepath):
content = read_file(activatepath)
if ("VIRTUAL_ENV" in content) and ("PYTHONHOME" in content):
result.append(path)
continue
if level < maxlevel:
result += _get_all_venvs(path, level=level + 1)
return result
def _backup_pip_freeze_for_python_app_venvs():
"""
Generate a requirements file for all python virtual env located inside /opt/ and /var/www/
"""
venvs = _get_all_venvs("/opt/") + _get_all_venvs("/var/www/")
for venv in venvs:
# Generate a requirements file from venv
os.system(f"{venv}/bin/pip freeze > {venv}{VENV_REQUIREMENTS_SUFFIX}")
class MyMigration(Migration):
@ -70,6 +108,12 @@ class MyMigration(Migration):
'wget --timeout 900 --quiet "https://packages.sury.org/php/apt.gpg" --output-document=- | gpg --dearmor >"/etc/apt/trusted.gpg.d/extra_php_version.gpg"'
)
#
# Get requirements of the different venvs from python apps
#
_backup_pip_freeze_for_python_app_venvs()
#
# Run apt update
#
@ -299,7 +343,9 @@ class MyMigration(Migration):
# Check system is up to date
# (but we don't if 'bullseye' is already in the sources.list ...
# which means maybe a previous upgrade crashed and we're re-running it)
if " bullseye " not in read_file("/etc/apt/sources.list"):
if os.path.exists("/etc/apt/sources.list") and " bullseye " not in read_file(
"/etc/apt/sources.list"
):
tools_update(target="system")
upgradable_system_packages = list(_list_upgradable_apt_packages())
upgradable_system_packages = [
@ -345,15 +391,10 @@ class MyMigration(Migration):
message = m18n.n("migration_0021_general_warning")
# FIXME: update this message with updated topic link once we release the migration as stable
message = (
"N.B.: **THIS MIGRATION IS STILL IN BETA-STAGE** ! If your server hosts critical services and if you are not too confident with debugging possible issues, we recommend you to wait a little bit more while we gather more feedback and polish things up. If on the other hand you are relatively confident with debugging small issues that may arise, you are encouraged to run this migration ;)! You can read and share feedbacks on this forum thread: https://forum.yunohost.org/t/18531\n\n"
"N.B.: This migration has been tested by the community over the last few months but has only been declared stable recently. If your server hosts critical services and if you are not too confident with debugging possible issues, we recommend you to wait a little bit more while we gather more feedback and polish things up. If on the other hand you are relatively confident with debugging small issues that may arise, you are encouraged to run this migration ;)! You can read about remaining known issues and feedback from the community here: https://forum.yunohost.org/t/20590\n\n"
+ message
)
# message = (
# "N.B.: This migration has been tested by the community over the last few months but has only been declared stable recently. If your server hosts critical services and if you are not too confident with debugging possible issues, we recommend you to wait a little bit more while we gather more feedback and polish things up. If on the other hand you are relatively confident with debugging small issues that may arise, you are encouraged to run this migration ;)! You can read about remaining known issues and feedback from the community here: https://forum.yunohost.org/t/12195\n\n"
# + message
# )
if problematic_apps:
message += "\n\n" + m18n.n(
@ -371,7 +412,8 @@ class MyMigration(Migration):
def patch_apt_sources_list(self):
sources_list = glob.glob("/etc/apt/sources.list.d/*.list")
sources_list.append("/etc/apt/sources.list")
if os.path.exists("/etc/apt/sources.list"):
sources_list.append("/etc/apt/sources.list")
# This :
# - replace single 'buster' occurence by 'bulleye'

View file

@ -0,0 +1,178 @@
import os
from moulinette import m18n
from moulinette.utils.log import getActionLogger
from moulinette.utils.process import call_async_output
from yunohost.tools import Migration, tools_migrations_state
from moulinette.utils.filesystem import rm
logger = getActionLogger("yunohost.migration")
VENV_REQUIREMENTS_SUFFIX = ".requirements_backup_for_bullseye_upgrade.txt"
def extract_app_from_venv_path(venv_path):
venv_path = venv_path.replace("/var/www/", "")
venv_path = venv_path.replace("/opt/yunohost/", "")
venv_path = venv_path.replace("/opt/", "")
return venv_path.split("/")[0]
def _get_all_venvs(dir, level=0, maxlevel=3):
"""
Returns the list of all python virtual env directories recursively
Arguments:
dir - the directory to scan in
maxlevel - the depth of the recursion
level - do not edit this, used as an iterator
"""
# Using os functions instead of glob, because glob doesn't support hidden
# folders, and we need recursion with a fixed depth
result = []
for file in os.listdir(dir):
path = os.path.join(dir, file)
if os.path.isdir(path):
activatepath = os.path.join(path, "bin", "activate")
if os.path.isfile(activatepath) and os.path.isfile(
path + VENV_REQUIREMENTS_SUFFIX
):
result.append(path)
continue
if level < maxlevel:
result += _get_all_venvs(path, level=level + 1)
return result
class MyMigration(Migration):
"""
After the update, recreate a python virtual env based on the previously
generated requirements file
"""
ignored_python_apps = [
"calibreweb",
"django-for-runners",
"ffsync",
"jupiterlab",
"librephotos",
"mautrix",
"mediadrop",
"mopidy",
"pgadmin",
"tracim",
"synapse",
"weblate",
]
dependencies = ["migrate_to_bullseye"]
state = None
def is_pending(self):
if not self.state:
self.state = tools_migrations_state()["migrations"].get(
"0024_rebuild_python_venv", "pending"
)
return self.state == "pending"
@property
def mode(self):
if not self.is_pending():
return "auto"
if _get_all_venvs("/opt/") + _get_all_venvs("/var/www/"):
return "manual"
else:
return "auto"
@property
def disclaimer(self):
# Avoid having a super long disclaimer to generate if migrations has
# been done
if not self.is_pending():
return None
ignored_apps = []
rebuild_apps = []
venvs = _get_all_venvs("/opt/") + _get_all_venvs("/var/www/")
for venv in venvs:
if not os.path.isfile(venv + VENV_REQUIREMENTS_SUFFIX):
continue
app_corresponding_to_venv = extract_app_from_venv_path(venv)
# Search for ignore apps
if any(
app_corresponding_to_venv.startswith(app)
for app in self.ignored_python_apps
):
ignored_apps.append(app_corresponding_to_venv)
else:
rebuild_apps.append(app_corresponding_to_venv)
msg = m18n.n("migration_0024_rebuild_python_venv_disclaimer_base")
if rebuild_apps:
msg += "\n\n" + m18n.n(
"migration_0024_rebuild_python_venv_disclaimer_rebuild",
rebuild_apps="\n - " + "\n - ".join(rebuild_apps),
)
if ignored_apps:
msg += "\n\n" + m18n.n(
"migration_0024_rebuild_python_venv_disclaimer_ignored",
ignored_apps="\n - " + "\n - ".join(ignored_apps),
)
return msg
def run(self):
venvs = _get_all_venvs("/opt/") + _get_all_venvs("/var/www/")
for venv in venvs:
app_corresponding_to_venv = extract_app_from_venv_path(venv)
# Search for ignore apps
if any(
app_corresponding_to_venv.startswith(app)
for app in self.ignored_python_apps
):
rm(venv + VENV_REQUIREMENTS_SUFFIX)
logger.info(
m18n.n(
"migration_0024_rebuild_python_venv_broken_app",
app=app_corresponding_to_venv,
)
)
continue
logger.info(
m18n.n(
"migration_0024_rebuild_python_venv_in_progress",
app=app_corresponding_to_venv,
)
)
# Recreate the venv
rm(venv, recursive=True)
callbacks = (
lambda l: logger.debug("+ " + l.rstrip() + "\r"),
lambda l: logger.warning(l.rstrip()),
)
call_async_output(["python", "-m", "venv", venv], callbacks)
status = call_async_output(
[f"{venv}/bin/pip", "install", "-r", venv + VENV_REQUIREMENTS_SUFFIX],
callbacks,
)
if status != 0:
logger.error(
m18n.n(
"migration_0024_rebuild_python_venv_failed",
app=app_corresponding_to_venv,
)
)
else:
rm(venv + VENV_REQUIREMENTS_SUFFIX)

View file

@ -710,6 +710,10 @@ def _get_services():
)
php_fpm_versions = [v for v in php_fpm_versions.split("\n") if v.strip()]
for version in php_fpm_versions:
# Skip php 7.3 which is most likely dead after buster->bullseye migration
# because users get spooked
if version == "7.3":
continue
services[f"php{version}-fpm"] = {
"log": f"/var/log/php{version}-fpm.log",
"test_conf": f"php-fpm{version} --test", # ofc the service is phpx.y-fpm but the program is php-fpmx.y because why not ...

View file

@ -75,7 +75,7 @@ def tools_adminpw(new_password, check_strength=True):
from yunohost.user import _hash_user_password
from yunohost.utils.password import (
assert_password_is_strong_enough,
assert_password_is_compatible
assert_password_is_compatible,
)
import spwd
@ -191,7 +191,7 @@ def tools_postinstall(
from yunohost.utils.dns import is_yunohost_dyndns_domain
from yunohost.utils.password import (
assert_password_is_strong_enough,
assert_password_is_compatible
assert_password_is_compatible,
)
from yunohost.domain import domain_main_domain
import psutil

View file

@ -146,7 +146,7 @@ def user_create(
from yunohost.hook import hook_callback
from yunohost.utils.password import (
assert_password_is_strong_enough,
assert_password_is_compatible
assert_password_is_compatible,
)
from yunohost.utils.ldap import _get_ldap_interface
@ -372,7 +372,7 @@ def user_update(
from yunohost.app import app_ssowatconf
from yunohost.utils.password import (
assert_password_is_strong_enough,
assert_password_is_compatible
assert_password_is_compatible,
)
from yunohost.utils.ldap import _get_ldap_interface
from yunohost.hook import hook_callback

View file

@ -702,7 +702,8 @@ class Question:
self.default = question.get("default", None)
self.optional = question.get("optional", False)
self.visible = question.get("visible", None)
self.choices = question.get("choices", [])
# Don't restrict choices if there's none specified
self.choices = question.get("choices", None)
self.pattern = question.get("pattern", self.pattern)
self.ask = question.get("ask", {"en": self.name})
self.help = question.get("help")
@ -741,7 +742,7 @@ class Question:
confirm=False,
prefill=prefill,
is_multiline=(self.type == "text"),
autocomplete=self.choices,
autocomplete=self.choices or [],
help=_value_for_locale(self.help),
)