spb/trouve-ka Public
Trouve-KA — moteur de recherche web indépendant, Québec-first. Crawler distribué, index OpenSearch, ranking bilingue, galerie d'images. En prod : www.trouve-ka.com
Python 76.8%
TypeScript 15.7%
SQL 3.9%
Shell 1.4%
CSS 1.3%
Dockerfile 0.7%
1#!/usr/bin/env bash2# Trouve-KA — déploiement sur le node m2m32 (cluster MacLustr) + tunnel ngrok3# Author: Simon-Pierre Boucher4# Contact: contact@spboucher.ai5#6# Prérequis sur m2m32 : Docker (ou colima) + docker compose, ngrok authentifié.7# Le domaine www.trouve-ka.com doit être réservé dans le compte ngrok.8set -euo pipefail910NODE="${NODE:-M2M32}"11REMOTE_DIR="~/trouve-ka"12NGROK_DOMAIN="${NGROK_DOMAIN:-www.trouve-ka.com}"1314cd "$(dirname "$0")/../.."1516echo "→ Synchronisation du code vers $NODE:$REMOTE_DIR"17rsync -az --delete \18 --exclude node_modules --exclude .next --exclude .venv --exclude __pycache__ \19 --exclude .git --exclude data --exclude '*.egg-info' \20 ./ "$NODE:$REMOTE_DIR/"2122echo "→ Build et démarrage du stack sur $NODE"23ssh "$NODE" "cd $REMOTE_DIR && docker compose up -d --build"2425echo "→ Chargement des seeds (idempotent)"26ssh "$NODE" "cd $REMOTE_DIR && docker compose run --rm migrate && \27 docker compose run --rm --entrypoint python crawler-worker -m trouveka.crawler.seed scripts/bootstrap-seeds/seeds.txt"2829echo "→ Tunnel ngrok ($NGROK_DOMAIN → :3000)"30ssh "$NODE" "pgrep -f 'ngrok http.*$NGROK_DOMAIN' > /dev/null || \31 nohup ngrok http --url=$NGROK_DOMAIN 3000 > ~/trouve-ka-ngrok.log 2>&1 &"3233echo "→ Vérification de santé"34sleep 535ssh "$NODE" "cd $REMOTE_DIR && bash scripts/health-check/check.sh" || true3637echo "✓ Déploiement terminé : https://$NGROK_DOMAIN"38echo " N'oublie pas de mettre à jour ~/Desktop/cluster-skill/cluster-deployments.json"39