feat(packaging) : package YunoHost veille-ia_ynh (packaging v2, helpers 2.1)

- manifest.toml validé contre le schéma officiel manifest.v2.schema.json
  (sources par tag forge avec placeholder sha256 assumé, nodejs 24, ports,
  system_user, install_dir, data_dir, permission privée all_users, SSO)
- Scripts install/remove/upgrade/backup/restore/change_url (bash -n OK) :
  build au fil de l'eau avec BASE_PATH, ALERTS_TOKEN généré à l'install,
  .env chmod 400, logs journald
- conf/nginx.conf : proxy_params_with_auth (header Ynh-User), conf/systemd.service :
  node via __NODEJS_DIR__, sandboxing modéré, conf/env : DATA_DIR/OLLAMA_URL/ALERTS_TOKEN
- tests.toml minimal, doc DESCRIPTION/ADMIN fr+en
- README racine : dev local, variables d'env, procédure de release, Ollama
This commit is contained in:
cyber-mawonaj
2026-08-01 09:25:39 -04:00
parent ff26136dfb
commit b3ff529cfa
17 changed files with 559 additions and 39 deletions
+42
View File
@@ -0,0 +1,42 @@
#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression "Arrêt du service systemd de veille-ia..."
ynh_systemctl --service="$app" --action="stop"
#=================================================
# UPDATE NGINX CONFIGURATION
#=================================================
ynh_script_progression "Mise à jour de la configuration nginx de veille-ia..."
# $domain/$path pointent déjà vers les nouvelles valeurs ($old_domain/$old_path
# et $change_domain/$change_path sont disponibles si besoin).
ynh_config_change_url_nginx
#=================================================
# RE-BUILD THE APP WITH THE NEW BASE PATH
#=================================================
ynh_script_progression "Re-build de veille-ia pour le nouveau chemin..."
# paths.base est figé au build (SvelteKit) : le changement de chemin impose
# un re-build avec le nouveau BASE_PATH.
veille_ia_build_app
# .env : régénéré pour rester cohérent (ORIGIN systemd suit __DOMAIN____PATH__
# via ynh_config_change_url_nginx ; le .env ne contient pas le domaine).
veille_ia_write_env
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Démarrage du service systemd de veille-ia..."
ynh_systemctl --service="$app" --action="start"
ynh_script_progression "Changement d'URL de veille-ia terminé"