From a1c53892f0d41338ba3adfa59aaf10bcf6ed9d32 Mon Sep 17 00:00:00 2001 From: Cedric Date: Mon, 28 Sep 2026 12:43:56 +0200 Subject: [PATCH] changement de nom --- Dockerfile | 12 ++++++------ README.md | 10 +++++----- docker-compose.yml | 10 +++++----- go.mod | 2 +- main.go | 4 ++-- web/app.js | 4 ++-- web/index.html | 6 +++--- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0cd9d66..5457418 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,16 +4,16 @@ WORKDIR /src COPY go.mod ./ COPY *.go ./ COPY web ./web -RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/logwell . +RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/logstream . # ---- Image finale (~15 Mo) ---- FROM alpine:3.20 -RUN adduser -D -H -u 10001 logwell \ - && mkdir /data && chown logwell /data -COPY --from=build /out/logwell /usr/local/bin/logwell -USER logwell +RUN adduser -D -H -u 10001 logstream \ + && mkdir /data && chown logstream /data +COPY --from=build /out/logstream /usr/local/bin/logstream +USER logstream VOLUME /data # 5514 en interne (port non privilégié), publié sur 514 par docker-compose EXPOSE 5514/udp 5514/tcp 8080/tcp HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://127.0.0.1:8080/healthz || exit 1 -ENTRYPOINT ["/usr/local/bin/logwell"] +ENTRYPOINT ["/usr/local/bin/logstream"] diff --git a/README.md b/README.md index 85156f8..7980662 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# Logwell +# Logstream Un puits de logs syslog simple : réception UDP/TCP sur le port 514, stockage dans [VictoriaLogs](https://docs.victoriametrics.com/victorialogs/), et une interface web claire (thème clair/sombre, recherche dynamique, direct, tags de couleur). ``` -équipements ──514 udp/tcp──▶ logwell (Go) ──lots HTTP──▶ VictoriaLogs +équipements ──514 udp/tcp──▶ logstream (Go) ──lots HTTP──▶ VictoriaLogs ▲ └── SSE (direct) ──▶ navigateur └──── API / interface ◀──┘ ``` @@ -23,7 +23,7 @@ Puis ouvrez . ## Envoyer ses logs - **rsyslog** (Linux) : ajoutez `*.* @IP_DU_SERVEUR:514` (UDP) ou `*.* @@IP_DU_SERVEUR:514` (TCP) - dans `/etc/rsyslog.d/90-logwell.conf`, puis exécutez `systemctl restart rsyslog`. + dans `/etc/rsyslog.d/90-logstream.conf`, puis exécutez `systemctl restart rsyslog`. - **Équipements réseau, NAS, pare-feu** : renseignez l'IP du serveur et le port 514 dans la configuration « syslog distant ». - **Test manuel** : `logger -n 127.0.0.1 -P 514 -d "hello error"` (util-linux) ou @@ -55,7 +55,7 @@ affiche tous ses champs. L'icône d'étiquette ouvre l'éditeur. Chaque tag a un mot-clé, une couleur de fond (le texte passe automatiquement en noir ou en blanc pour rester lisible) et des options : mot entier, respect de la casse, expression régulière, actif. Les tags sont enregistrés dans -`/data/tags.json` (volume `logwell-data`). Tags par défaut : `warning` (orange), +`/data/tags.json` (volume `logstream-data`). Tags par défaut : `warning` (orange), `error` (rouge), `ok` (vert). ## Configuration @@ -71,7 +71,7 @@ respect de la casse, expression régulière, actif. Les tags sont enregistrés d ## Débogage -- `docker compose logs -f logwell` : erreurs de réception et d'envoi vers VictoriaLogs. +- `docker compose logs -f logstream` : erreurs de réception et d'envoi vers VictoriaLogs. - La barre du bas affiche les compteurs reçus / stockés / perdus et la dernière erreur de stockage. - : interface native de VictoriaLogs pour tester des requêtes LogsQL. - API : diff --git a/docker-compose.yml b/docker-compose.yml index 5cbae23..c93ac4a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: - logwell: + logstream: build: . - container_name: logwell + container_name: logstream restart: unless-stopped depends_on: - victorialogs @@ -15,12 +15,12 @@ services: AUTH_USER: ${AUTH_USER:-} # laisser vide pour désactiver l'authentification AUTH_PASS: ${AUTH_PASS:-} volumes: - - logwell-data:/data # tags.json + - logstream-data:/data # tags.json victorialogs: # Épinglez une version précise en production (voir hub.docker.com/r/victoriametrics/victoria-logs/tags) image: victoriametrics/victoria-logs:latest - container_name: logwell-victorialogs + container_name: logstream-victorialogs restart: unless-stopped command: - -storageDataPath=/vlogs @@ -33,5 +33,5 @@ services: - "127.0.0.1:9428:9428" volumes: - logwell-data: + logstream-data: vlogs-data: diff --git a/go.mod b/go.mod index 7403f0c..7bdfaab 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module logwell +module logstream go 1.23 diff --git a/main.go b/main.go index ba861ff..789a166 100644 --- a/main.go +++ b/main.go @@ -1,4 +1,4 @@ -// Logwell : puits de logs syslog (UDP/TCP) stocké dans VictoriaLogs, +// Logstream : puits de logs syslog (UDP/TCP) stocké dans VictoriaLogs, // avec une interface web de consultation. package main @@ -131,7 +131,7 @@ func basicAuth(user, pass string, next http.Handler) http.Handler { if !ok || subtle.ConstantTimeCompare([]byte(u), []byte(user)) != 1 || subtle.ConstantTimeCompare([]byte(p), []byte(pass)) != 1 { - w.Header().Set("WWW-Authenticate", `Basic realm="logwell"`) + w.Header().Set("WWW-Authenticate", `Basic realm="logstream"`) http.Error(w, "authentification requise", http.StatusUnauthorized) return } diff --git a/web/app.js b/web/app.js index 92a5f9a..5dddfd8 100644 --- a/web/app.js +++ b/web/app.js @@ -8,8 +8,8 @@ const MAX_ROWS = 2000; // lignes gardées à l'écran en mode direct const RANGE_MS = { '5m': 3e5, '15m': 9e5, '1h': 36e5, '6h': 216e5, '24h': 864e5, '7d': 6048e5, '30d': 2592e6 }; const store = { - get(k, def) { try { const v = localStorage.getItem('logwell.' + k); return v === null ? def : v; } catch { return def; } }, - set(k, v) { try { localStorage.setItem('logwell.' + k, v); } catch { /* stockage indisponible */ } }, + get(k, def) { try { const v = localStorage.getItem('logstream.' + k); return v === null ? def : v; } catch { return def; } }, + set(k, v) { try { localStorage.setItem('logstream.' + k, v); } catch { /* stockage indisponible */ } }, }; const ESC = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; diff --git a/web/index.html b/web/index.html index 79383ef..462c355 100644 --- a/web/index.html +++ b/web/index.html @@ -3,19 +3,19 @@ - Logwell + Logstream
- Logwell + Logstream