From 707fff4ed951fd5b44bfba716496dd0f46c981d0 Mon Sep 17 00:00:00 2001 From: claude Date: Fri, 2 Oct 2026 09:06:22 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20image=20SVG=20du=20sch=C3=A9ma=20d'arch?= =?UTF-8?q?itecture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/architecture.svg | 103 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 docs/architecture.svg diff --git a/docs/architecture.svg b/docs/architecture.svg new file mode 100644 index 0000000..73bbeb6 --- /dev/null +++ b/docs/architecture.svg @@ -0,0 +1,103 @@ + + + +Searchgit : architecture logique + + +Sandbox : serveur de Cédric (hôte Docker 192.168.200.158) + + +Gitea vLab-BZH/searchgit +git pulldocker compose up -d --build + + + + + +Navigateur +UI embarquée (go:embed web/)servie par GET /index.html · app.js · style.cssOnglets Recherche · Veille · Revuethème clair / sombreinterface FR / ENlocalStorage : préférences(searchgit.*) + +Conteneur Docker « searchgit » (alpine 3.24, port 8080 publié en 8686) + + +Middleware basicAuth +AUTH_USER / AUTH_PASS (sauf /healthz) + + +Serveur Go : routes HTTP (api.go, saved_api.go) +GET / fichiers statiquesGET /healthz sonde de santéGET /api/search recherche directeGET /api/status jeton, quota, fuseauGET|POST /api/savedGET|PUT|DELETE /api/saved/{id}POST /api/saved/{id}/runGET /api/saved/{id}/runs[/{run}] + + +Critères (query.go) +ParseCriteria → requête GitHub « q= » + + +Stockage (store.go) +fichiers JSON, écriture atomique(fichier .tmp puis rename)marque nouveaux / en hausse + + +Isolation du conteneur +binaire Go statique (CGO=0)utilisateur non-root 10001seul /data est inscriptibleHEALTHCHECK → /healthz + + +Planificateur (scheduler.go) +tic toutes les 30 s (heure TZ)une exécution à la fois (mutex)heures / jour / semainequota épuisé → nouvel essai 3 min + + +Client GitHub (github.go) +cache mémoire CACHE_TTL (5 min)quota RateLimit mémoriséAuthorization: Bearer GITHUB_TOKEN + + +API GitHub Search +api.github.com/search/repositories10 req/min sans jeton, 30 avec + + +Configuration (env) +GITHUB_TOKENCACHE_TTL = 5mAUTH_USER / AUTH_PASSTZ = Europe/ParisHISTORY_KEEP = 100DATA_DIR = /dataHTTP_PORT = 8686 → 8080 + + +Volume Docker « searchgit-data » monté sur /data +searches.json recherches programméesruns/<id>/index.json résumés des passagesruns/<id>/seen.json première apparitionruns/<id>/<run>.json instantané (HISTORY_KEEP) + + + +HTTP :8686JSONfichiers + + + + + + +/api/search + + + + + + +Run() + + + +CRUDhistorique + + + +Search() + + + +AddRunUpdate + + + +REST HTTPS + + + +lecture / écriture JSON + + + +variables +