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:
Executable
+58
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST AND GENERATE SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression "Récupération des paramètres de veille-ia..."
|
||||
|
||||
# Token protégeant POST /api/alerts (webhook Node-RED) — secret généré à l'install.
|
||||
alerts_token="$(ynh_string_random 48)"
|
||||
ynh_app_setting_set --key=alerts_token --value="$alerts_token"
|
||||
|
||||
#=================================================
|
||||
# DEPLOY APP FILES
|
||||
#=================================================
|
||||
ynh_script_progression "Déploiement des fichiers de veille-ia..."
|
||||
|
||||
# Archive du tag de la forge (ressource sources.main du manifest), pré-téléchargée.
|
||||
ynh_setup_source --dest_dir="$install_dir"
|
||||
|
||||
# L'app SvelteKit vit dans le sous-dossier app/ du dépôt.
|
||||
chown -R "$app:$app" "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# BUILD THE APP
|
||||
#=================================================
|
||||
ynh_script_progression "Installation des dépendances et build de veille-ia..."
|
||||
|
||||
veille_ia_build_app
|
||||
|
||||
#=================================================
|
||||
# APP CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression "Ajout de la configuration de veille-ia..."
|
||||
|
||||
veille_ia_write_env
|
||||
|
||||
#=================================================
|
||||
# SYSTEM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression "Ajout de la configuration système pour veille-ia..."
|
||||
|
||||
ynh_config_add_nginx
|
||||
|
||||
ynh_config_add_systemd
|
||||
|
||||
yunohost service add "$app" --description="Observatoire de veille sur les modèles IA"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression "Démarrage du service systemd de veille-ia..."
|
||||
|
||||
ynh_systemctl --service="$app" --action="start"
|
||||
|
||||
ynh_script_progression "Installation de veille-ia terminée"
|
||||
Reference in New Issue
Block a user