- base_connaissances/ → snippets/ (corpus/ → textes/, instructions.md → consignes_redaction.md, decoupage.py → fichiers.py, importer.py → envoyer.py) ; python3 -m snippets.envoyer. - instance-de-test/ : 1_demarrer.sh, 2_creer_boite_et_cle.py, 3_brancher_ia.py, 4_essayer_brouillons.py, voir_empreintes.sh, connexion_admin.py. - ollama/verifier.py → ollama/verifier_ollama.py ; tests, tâches VS Code et docs alignés. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
1.1 KiB
Bash
27 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
# Lance l'instance de test (LibreDesk v2.9.0, Postgres, Redis, Mailpit). Rien ne sort : le SMTP est Mailpit.
|
|
# bash instance-de-test/1_demarrer.sh <mot de passe System>
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
MDP="${1:?usage : 1_demarrer.sh <mot de passe System>}"
|
|
|
|
if [ ! -f config.toml ]; then
|
|
curl -fsS -o config.toml https://raw.githubusercontent.com/abhinavxd/libredesk/v2.9.0/config.sample.toml
|
|
CLE=$(python3 -c 'import secrets; print(secrets.token_hex(16))')
|
|
sed -i "s/^encryption_key = .*/encryption_key = \"$CLE\"/" config.toml
|
|
echo "config.toml créé"
|
|
fi
|
|
|
|
LIBREDESK_SYSTEM_USER_PASSWORD="$MDP" docker compose -p ldtest up -d
|
|
|
|
for _ in $(seq 60); do
|
|
# une réponse HTTP, quelle qu'elle soit (401 sans connexion), suffit : le serveur écoute
|
|
if [ "$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:9100/api/v1/settings/general)" != "000" ]; then
|
|
echo "instance prête : http://127.0.0.1:9100 (Mailpit : http://127.0.0.1:9125)"
|
|
exit 0
|
|
fi
|
|
sleep 1
|
|
done
|
|
echo "LibreDesk ne répond pas après 60 s : docker logs ldtest_app" >&2
|
|
exit 1
|