Skip to content

Adapt install scripts and Core to Debian 13#3176

Open
TiTidom-RC wants to merge 42 commits intojeedom:trixiefrom
TiTidom-RC:pr-trixie-final
Open

Adapt install scripts and Core to Debian 13#3176
TiTidom-RC wants to merge 42 commits intojeedom:trixiefrom
TiTidom-RC:pr-trixie-final

Conversation

@TiTidom-RC
Copy link
Copy Markdown
Contributor

Description

Adapt the install scripts and some core functions to ensure Jeedom can be installed on Debian 13, while maintaining backward compatibility with Debian 11 and 12.

Updated the Docker installation files and scripts too.

Suggested changelog entry

All changes are detailed in the _trixie_migrationcheck.md and _trixie_retrocheck.md files. These files are located at the root of the repository.

In summary, here are the key changes :

Replaced Debian Packages :

  • ntp → chrony
  • ntpdate → removed (included in chrony)
  • locate → plocate (modern version with alternative)
  • espeak + mbrola → espeak-ng
  • libcurl3-gnutls → libcurl4 (for Debian 13+)

Removed Debian packages :

  • telnet
  • apt-transport-https (inluded by default since Debian 10)
  • cutycapt
  • dos2unix (replaced by "sed")
  • libav-tools (replaced by "ffmpeg")
  • software-properties-common (Ubuntu package, not available in Debian)

Migrate to PHP-FPM :

  • proxy_fcgi
  • setenvif

Update MariaDB parameters :

Removed parameters (deprecated) :

  • query_cache_type, query_cache_size, query_cache_limit, query_cache_min_res_unit (query cache no more available)
  • innodb_large_prefix (active by default)

Support for custom fork repository (for the install script) :

Add "-r" parameter (R like repository) in install's script :

sudo ./install.sh -r owner/repo -v branche

Updated all references from 'apt' to 'apt-get', adding options to handle conflicts and interactions with shell.

Related issues/external references

Fixes #

Types of changes

  • Bug fix (non-breaking change which fixes)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

PR checklist

Copy link
Copy Markdown
Contributor

@zoic21 zoic21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beaucoup de changement que je ne comprends pas vraiment

Comment thread core/ajax/jeedom.ajax.php
if (!file_exists(__DIR__ . '/../../cache.tar.gz')) {
$cmd = 'mkdir ' . $cache_dir . ';';
$cmd .= 'chmod -R 777 ' . $cache_dir . ';';
$cmd = system::getCmdSudo() . 'mkdir -p ' . $cache_dir . ';';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normalement tout le cache est sous www-data avec ce changement il passe en root ce qui n'est pas top

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effectivement, le sudo mkdir va créer le dossier en root, mais aux lignes 402 et 403 (juste en dessous) je gère le owner du dossier en le réattribuant à "www-data" (user et groupe d'ailleurs).

J'ai utilisé le "sudo" par "sécurité", au cas où il y aurait des problèmes de droits existants sur le répertoire parent, et j'ai surtout utilisé le paramètre "-p" pour créer l'arborescence si elle n'existe pas.

Par les lignes d'en dessous, je m'assure que le répertoire appartient bien à "www-data" et ainsi ne pas gêner Jeedom dans son fonctionnement.

echo "ServerName localhost" >> /etc/apache2/apache2.conf

echo 'Start PHP-FPM'
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je veux bien plus de détails la dessus

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oui bien sûr.

J'ai basculé le script d'install pour utiliser le module PHP "FPM" couplé à "mod_proxy_fcgi" côté Apache. A l'install, le paquet linux "fpm" n'a pas d'appellation / alias "générique" sous Linux, mais est du style "php8.3-fpm" (donc contient la version php dans son nom). Pour que le script d'init reste valide pour n'importe quelle version qui sera installée maintenant mais également à l'avenir, je le passe en mode dynamique, en calculant la version PHP qui est installée, et en appelant donc le service "fpm" correspondant (ligne 157).

Si la question était pour le fait de démarrer le service, le module fpm ne démarre pas tout seul après son install, et dans un docker, il n'y a pas systématiquement de "systemd", donc je force le démarrage du service (ligne 157) avec son nom complet (incluant donc la version de PHP).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi basculer vers PHP FPM dans ce PR?
Si le but est d'utiliser FPM au lieu de CGI juste pour raison de perf, indépendamment de trixie, alors il ne faudrait pas inclure ce changement dans cette branche

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je comprend le point de vue.

L'intégration de Debian 13 (et je précise comme dit par ailleurs : le script n'est pas seulement compatible Debian 13, mais également Debian 12 et même Debian 11), nécessitait de toute façon de revoir tout le script d'installation, donc plutôt que de conserver la stack CGI (vieillissante et plus le standard du marché), et que le passage à FPM impliquait de revoir ce script d'install (et comme ici la partie docker), pour aller au bout de l'exercice et pouvoir tester de bout en bout, j'ai intégré la partie passage à FPM dans ce PR.

Un changement d'OS devrait être l'occasion de moderniser l'ensemble et de revoir toute la stack 👍 (c'est dans cette optique que j'ai intégré l'ensemble de ces changements, celui-ci et tous les autres, tout en garantissant la rétrocompatibilité).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, ça m'intéresse ;)

Par contre, non il vaudrait mieux séparer et faire une 2e PR pour la "migration" CGI vers FPM si besoin, il n'y a pas besoin de la faire (les 2 sont supporté par debian 11 / 12 / 13 donc ce n'est pas une nécessité techniquement), et la séparation des 2 permet de mieux isoler les problèmes qu'on ne manquera pas de découvrir... 😄

Mais ça m'intéresse parce que j'utilise l'image Docker officielle php pour l'image Jeedom, et donc celle avec apache, mais j'ai essayé d'utiliser celle avec FPM mais jamais réussi à le configurer. FPM implique d'utiliser nginx au lieu de apache (du moins dans tous les exemples que j'ai trouvé). Si tu fais une image Docker avec Jeedom FPM, il faut bien une autre image avec le serveur http ?

elif [[ "${GITHUB_REF_NAME}" == "beta" ]]; then
JEEDOM_TAGS="${REPO}/jeedom:beta"; # ${REPO}/jeedom:$JEEDOM_SHORT_VERSION";
GITHUB_BRANCH=${GITHUB_REF_NAME};
elif [[ "${GITHUB_REF_NAME}" == "trixie" ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour moi on devrait pas avoir une branche trixie....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dans le principe, je suis tout à fait d'accord avec toi, mais il me fallait bien le moyen de tester le script d'install de bout en bout, et la branche "trixie" était son nom actuel 👍

De la même manière, j'imagine qu'à terme, les lignes 19 et 20 (parlant de la branche alpha) devraient disparaitre également, non ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ce fichier init_workflow.sh est spécifique au workflow github et j'ai proposé de le déplacer dans .github/script dans une autre PR #3172
Il faudra revoir le nom des branches j'attends toujours de savoir comment...
https://community.jeedom.com/t/2026-pr-a-faire-sur-branche-alpha-ou-beta/145747/15

Comment thread install/install.sh
} else {
if ($_foreground) {
echo shell_exec(self::getCmdSudo() . ' apt update;' . self::getCmdSudo() . ' apt-get install -y python3 python3-pip python3-dev python3-venv');
echo shell_exec(self::getCmdSudo() . ' apt-get update;' . self::getCmdSudo() . ' apt-get install -y python3 python3-pip python3-dev python3-venv');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi ne pas retirer l'interactive et garder les anciennes conf aussi ?

echo shell_exec(self::getCmdSudo() . self::getCmdPython3($_plugin) . ' -m pip install --upgrade pip wheel');
} else {
$cmd .= self::getCmdSudo() . " apt update;\n" . self::getCmdSudo() . " apt-get install -y python3 python3-pip python3-dev python3-venv\n";
$cmd .= self::getCmdSudo() . " apt-get update;\n" . self::getCmdSudo() . " apt-get install -y python3 python3-pip python3-dev python3-venv\n";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

setTimeZone() {
[[ ${TZ} == $(</etc/timezone) ]] && return
# Check if timezone is already correctly configured via /etc/localtime
if [[ -L /etc/localtime ]] && [[ $(readlink /etc/localtime) == "/usr/share/zoneinfo/${TZ}" ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactor qui a l'air de venir de l'IA, on est certain que zoneinfo est à cet endroit sur RPI ou debian ou autre ?

JEEDOM_INSTALL=0
rm -rf /root/install.sh
wget https://raw.githubusercontent.com/jeedom/core/${VERSION}/install/install.sh -O /root/install.sh
wget https://raw.githubusercontent.com/${GITHUB_REPO}/${VERSION}/install/install.sh -O /root/install.sh
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utilité ? ca sera toujours jeedom/core non ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants