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,11 @@
|
||||
# Environnement applicatif de veille-ia (chargé par systemd via EnvironmentFile).
|
||||
# Régénéré par les scripts du package (ynh_config_add) — ne pas éditer à la main.
|
||||
|
||||
# Dossier de données persistant : registre/profils YAML + dépôt git interne.
|
||||
DATA_DIR=__DATA_DIR__
|
||||
|
||||
# Endpoint Ollama (optionnel : dégradation gracieuse si injoignable).
|
||||
OLLAMA_URL=__OLLAMA_URL__
|
||||
|
||||
# Token Bearer protégeant POST /api/alerts (généré à l'install — secret).
|
||||
ALERTS_TOKEN=__ALERTS_TOKEN__
|
||||
@@ -0,0 +1,14 @@
|
||||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||
location __PATH__/ {
|
||||
|
||||
# Reverse proxy vers le serveur Node (adapter-node).
|
||||
# Pas de '/' final à proxy_pass : l'URI complète (avec le sous-chemin) est
|
||||
# transmise, ce qui correspond au paths.base configuré au build de l'app.
|
||||
proxy_pass http://127.0.0.1:__PORT__;
|
||||
|
||||
# Transmet l'identité SSO (Ynh-User…) après authentification SSOwat, et vide
|
||||
# ces headers pour les requêtes client (non spoofable).
|
||||
include proxy_params_with_auth;
|
||||
|
||||
client_max_body_size 10M;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
[Unit]
|
||||
Description=Veille IA — observatoire de veille sur les modèles IA (SvelteKit)
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
WorkingDirectory=__INSTALL_DIR__/app
|
||||
|
||||
Environment="PATH=__PATH_WITH_NODEJS__"
|
||||
Environment="NODE_ENV=production"
|
||||
Environment="HOST=127.0.0.1"
|
||||
Environment="PORT=__PORT__"
|
||||
Environment="ORIGIN=https://__DOMAIN____PATH__"
|
||||
# DATA_DIR, OLLAMA_URL, ALERTS_TOKEN (fichier posé à l'install, chmod 400)
|
||||
EnvironmentFile=__INSTALL_DIR__/app/.env
|
||||
|
||||
ExecStart=__NODEJS_DIR__/node build/index.js
|
||||
|
||||
# Logs vers journald : yunohost service log __APP__
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=__APP__
|
||||
|
||||
# Sandboxing (niveau modéré : le service doit pouvoir lancer git dans le data_dir,
|
||||
# phase 1 — simple-git — et joindre Ollama en HTTP sortant).
|
||||
NoNewPrivileges=yes
|
||||
PrivateTmp=yes
|
||||
ProtectSystem=full
|
||||
ProtectKernelModules=yes
|
||||
ProtectKernelTunables=yes
|
||||
ProtectControlGroups=yes
|
||||
RestrictRealtime=yes
|
||||
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
|
||||
LockPersonality=yes
|
||||
SystemCallArchitectures=native
|
||||
CapabilityBoundingSet=
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user