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,86 @@
|
||||
# veille-ia
|
||||
|
||||
Observatoire personnel de veille sur les modèles IA génératifs (sorties, licences, classements), avec moteur de recommandation par profils de projets. Application privée, self-hosted, packagée pour YunoHost. Licence AGPL-3.0.
|
||||
|
||||
- **Spécification fonctionnelle** : [`plan_prd_veille_ia.md`](plan_prd_veille_ia.md)
|
||||
- **Conventions frontend (prioritaires)** : [`SPECS_SVELTE.md`](SPECS_SVELTE.md)
|
||||
|
||||
## Structure du dépôt
|
||||
|
||||
| Chemin | Contenu |
|
||||
|---|---|
|
||||
| `app/` | Application SvelteKit (Svelte 5 runes, TypeScript strict, adapter-node) |
|
||||
| `veille-ia_ynh/` | Package YunoHost (packaging v2, helpers 2.1) |
|
||||
| `nodered-flows/` | Flows Node-RED exportés (phase 2 — à venir) |
|
||||
|
||||
## Développement local (hors YunoHost)
|
||||
|
||||
Prérequis : Node 24 LTS, npm.
|
||||
|
||||
```bash
|
||||
cd app
|
||||
cp .env.example .env # DEV_USER=dev simule un utilisateur SSO connecté
|
||||
npm ci
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Sans `DEV_USER`, l'accueil public minimal est affiché et toute autre route renvoie 401 — comme en production sans header SSO.
|
||||
|
||||
### Variables d'environnement
|
||||
|
||||
| Variable | Défaut | Rôle |
|
||||
|---|---|---|
|
||||
| `DATA_DIR` | `./data` (relatif à `app/`) | Dossier persistant : YAML + git interne. En prod : `/home/yunohost.app/veille-ia` |
|
||||
| `OLLAMA_URL` | `http://127.0.0.1:11434` | Endpoint Ollama. Optionnel : dégradation gracieuse si injoignable |
|
||||
| `ALERTS_TOKEN` | *(aucun)* | Token Bearer de `POST /api/alerts`. Généré à l'install YNH, jamais commité |
|
||||
| `SSO_HEADER` | `ynh-user` | Header HTTP injecté par SSOwat portant l'utilisateur authentifié |
|
||||
| `DEV_USER` | *(aucun)* | Dev uniquement : simule un utilisateur SSO. Ignoré en production |
|
||||
| `BASE_PATH` | *(aucun)* | Build uniquement : sous-chemin de montage (ex. `/veille`) pour `paths.base` |
|
||||
|
||||
### Qualité (à faire passer avant chaque commit)
|
||||
|
||||
```bash
|
||||
npm run check # svelte-check : 0 erreur, 0 warning
|
||||
npm run lint # prettier + eslint
|
||||
npm run test # vitest
|
||||
npm run build # build adapter-node
|
||||
```
|
||||
|
||||
## Packaging YunoHost (`veille-ia_ynh/`)
|
||||
|
||||
Packaging v2 vérifié contre la documentation officielle (août 2026) et le schéma
|
||||
`manifest.v2.schema.json`. Helpers 2.1 (`ynh_config_add_nginx`, `ynh_config_add_systemd`…).
|
||||
Ressources : `ports`, `nodejs` (24), `system_user`, `install_dir` (`/var/www/veille-ia`),
|
||||
`data_dir` (`/home/yunohost.app/veille-ia`). App privée : permission `all_users`,
|
||||
identité transmise via le header `Ynh-User` (`proxy_params_with_auth`).
|
||||
|
||||
### Procédure de release (à suivre avant toute installation)
|
||||
|
||||
Le package consomme une **archive de tag** publiée sur la forge :
|
||||
|
||||
1. Pousser le dépôt sur `https://labola.o-k-i.net/cyber-mawonaj/veille-ia` (procédure : `doc2sveltekit-transition/GITEA.md` — dépôt créé **sans** initialisation).
|
||||
2. Taguer : `git tag v0.1.0 && git push gitea v0.1.0`.
|
||||
3. Télécharger `https://labola.o-k-i.net/cyber-mawonaj/veille-ia/archive/v0.1.0.tar.gz` et calculer son sha256.
|
||||
4. Mettre à jour `veille-ia_ynh/manifest.toml` : `version = "0.1.0~ynh1"`, `resources.sources.main.url` et `sha256` (le placeholder `TODO_…` actuel bloque volontairement toute installation).
|
||||
5. Vérifier avec `package_check` (sur une machine YunoHost de test) : viser niveau ≥ 7.
|
||||
|
||||
### Installation (sur le serveur)
|
||||
|
||||
```bash
|
||||
yunohost app install /chemin/vers/veille-ia_ynh
|
||||
# ou une fois publié : yunohost app install https://labola.o-k-i.net/cyber-mawonaj/veille-ia_ynh
|
||||
```
|
||||
|
||||
L'install : déploie l'archive, `npm ci` + build (avec `BASE_PATH` = chemin d'install), génère `ALERTS_TOKEN`, écrit `/var/www/veille-ia/app/.env` (chmod 400), configure nginx + systemd (logs journald).
|
||||
|
||||
### Ollama
|
||||
|
||||
Optionnel. Si le paquet `ollama_ynh` est indisponible : Ollama sur la machine locale du porteur, exposé au serveur via wireguard/LAN — renseigner `OLLAMA_URL` à l'install (question du manifest) ou dans `/var/www/veille-ia/app/.env`. L'app démarre et fonctionne sans (dégradation gracieuse).
|
||||
|
||||
## État d'avancement
|
||||
|
||||
- [x] **Phase 0** — socle SvelteKit (SSO, thème OKI, CSP) + packaging YNH + dev local
|
||||
- [ ] **Phase 1** — registre + profils + moteur de recommandation + export markdown
|
||||
- [ ] **Phase 2** — inbox alertes + flows Node-RED
|
||||
- [ ] **Phase 3** — templates ComfyUI + smoke tests
|
||||
- [ ] **Phase 4** — durcissement (i18n gcf/en, niveau 8 package_check)
|
||||
Reference in New Issue
Block a user