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:
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
# Variables et fonctions communes aux scripts du package veille-ia_ynh.
|
||||
|
||||
# Normalise le chemin YNH pour paths.base de SvelteKit ("/" -> "" ; sinon "/veille").
|
||||
veille_ia_base_path() {
|
||||
if [ "$path" = "/" ]; then
|
||||
echo ""
|
||||
else
|
||||
echo "$path"
|
||||
fi
|
||||
}
|
||||
|
||||
# Installe les dépendances, build l'app (avec le bon sous-chemin), puis élague
|
||||
# les devDependencies pour ne garder que le runtime.
|
||||
veille_ia_build_app() {
|
||||
pushd "$install_dir/app"
|
||||
ynh_hide_warnings ynh_exec_as_app npm ci
|
||||
ynh_hide_warnings ynh_exec_as_app env BASE_PATH="$(veille_ia_base_path)" npm run build
|
||||
ynh_hide_warnings ynh_exec_as_app npm prune --omit=dev
|
||||
popd
|
||||
}
|
||||
|
||||
# (Re)génère le fichier d'environnement applicatif et verrouille ses droits.
|
||||
veille_ia_write_env() {
|
||||
ynh_config_add --template="env" --destination="$install_dir/app/.env"
|
||||
chmod 400 "$install_dir/app/.env"
|
||||
chown "$app:$app" "$install_dir/app/.env"
|
||||
}
|
||||
Reference in New Issue
Block a user