diff --git a/README.md b/README.md index 1c17342..2e12421 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ le style de [Logstream](https://gitea.vlab.bzh/cedric/logstream). ## Architecture -![Schéma d'architecture logique de Searchgit](docs/architecture.svg) +![Schéma d'architecture logique de Searchgit](docs/architecture.png) Le navigateur charge l'interface embarquée dans le binaire Go, puis appelle l'API `/api/*` du serveur. Le serveur interroge l'API GitHub Search à travers un cache mémoire de 5 minutes ; le diff --git a/docs/architecture.png b/docs/architecture.png new file mode 100644 index 0000000..bd68485 Binary files /dev/null and b/docs/architecture.png differ diff --git a/docs/architecture.svg b/docs/architecture.svg deleted file mode 100644 index 73bbeb6..0000000 --- a/docs/architecture.svg +++ /dev/null @@ -1,103 +0,0 @@ - - - -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 -