- Add packages/smart-ide-upstreams (versioned dist) for resolveUpstream + listUpstreamKeys - Wire smart-ide-global-api and smart-ide-sso-gateway via file: dependency - Add systemd user unit templates and install-smart-ide-gateway-systemd-user.sh (SSO After/Requires global API) - Update docs and VERSION 0.0.3
68 lines
2.8 KiB
Markdown
68 lines
2.8 KiB
Markdown
# Unités systemd (smart_ide)
|
||
|
||
## Ollama
|
||
|
||
Installé par l’[installateur officiel Ollama Linux](https://ollama.com/download/linux). Unité : `ollama.service`.
|
||
|
||
Exposer l’API à Docker sur le même hôte (AnythingLLM) avec un drop-in :
|
||
|
||
```ini
|
||
# /etc/systemd/system/ollama.service.d/override.conf
|
||
[Service]
|
||
Environment="OLLAMA_HOST=0.0.0.0:11434"
|
||
```
|
||
|
||
Puis : `sudo systemctl daemon-reload && sudo systemctl restart ollama`
|
||
|
||
Script d’aide dans le dépôt : `setup/configure-ollama-for-docker.sh` (écrit ce drop-in).
|
||
|
||
## AnythingLLM
|
||
|
||
- `anythingllm.service` — image Docker officielle au premier plan sous systemd (`Type=simple`).
|
||
- Défauts : `/etc/default/anythingllm` (copier depuis `systemd/anythingllm.default` si absent).
|
||
- Helper : `/usr/local/sbin/anythingllm-docker-exec.sh` (installé depuis `scripts/anythingllm-docker-exec.sh`).
|
||
|
||
Installation / rafraîchissement :
|
||
|
||
```bash
|
||
sudo ./scripts/install-systemd-services.sh
|
||
```
|
||
|
||
Commandes :
|
||
|
||
```bash
|
||
sudo systemctl status anythingllm
|
||
sudo systemctl restart anythingllm
|
||
journalctl -u anythingllm -f
|
||
```
|
||
|
||
Nécessite `docker.service`, utilisateur autorisé à utiliser Docker, et chemins dans `/etc/default/anythingllm` si stockage non standard.
|
||
|
||
## Git pull des clones projet (utilisateur, pas root)
|
||
|
||
Tirage **périodique** des dépôts listés dans `projects/*/conf.json` (voir [cron-git-pull.md](./cron-git-pull.md)) :
|
||
|
||
- Unités : `systemd/user/git-pull-project-clones.service.in` + `systemd/user/git-pull-project-clones.timer`
|
||
- Installation : `scripts/install-git-pull-systemd-user.sh` (écrit dans `~/.config/systemd/user/`, **sans** `sudo`)
|
||
- Configuration : `cron/config.env`
|
||
|
||
## smart-ide-global-api et smart-ide-sso-gateway (utilisateur)
|
||
|
||
Unités **user** pour l’agrégateur HTTP interne puis la passerelle OIDC. L’unité SSO déclare **`Requires=smart-ide-global-api.service`** et **`After=smart-ide-global-api.service`** pour garantir l’ordre de démarrage.
|
||
|
||
- Gabarits : `systemd/user/smart-ide-global-api.service.in`, `systemd/user/smart-ide-sso-gateway.service.in`
|
||
- Variables : `config/services.local.env` (copie de `config/services.local.env.example`, gitignoré) — `GLOBAL_API_INTERNAL_TOKEN`, `OIDC_ISSUER`, jetons micro-services, etc.
|
||
- Prérequis : `npm ci && npm run build` dans `packages/smart-ide-upstreams`, `services/smart-ide-global-api`, `services/smart-ide-sso-gateway`
|
||
|
||
Installation :
|
||
|
||
```bash
|
||
./scripts/install-smart-ide-gateway-systemd-user.sh
|
||
systemctl --user start smart-ide-global-api smart-ide-sso-gateway
|
||
systemctl --user status smart-ide-global-api smart-ide-sso-gateway
|
||
```
|
||
|
||
## Linger (session fermée)
|
||
|
||
Les timers **user** ne tournent en général que lorsqu’une session utilisateur systemd est active. Pour exécuter les timers après déconnexion graphique complète, activer le **linger** pour l’utilisateur : `loginctl enable-linger <user>` (décision d’administration machine).
|