changement de nom
This commit is contained in:
1 parent
54dba44ebf
commit
a1c53892f0
7 files changed
+24
-24
No files matched your search
+6
-6
@@ -4,16 +4,16 @@ WORKDIR /src
|
|||||||
COPY go.mod ./
|
COPY go.mod ./
|
||||||
COPY *.go ./
|
COPY *.go ./
|
||||||
COPY web ./web
|
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) ----
|
# ---- Image finale (~15 Mo) ----
|
||||||
FROM alpine:3.20
|
FROM alpine:3.20
|
||||||
RUN adduser -D -H -u 10001 logwell \
|
RUN adduser -D -H -u 10001 logstream \
|
||||||
&& mkdir /data && chown logwell /data
|
&& mkdir /data && chown logstream /data
|
||||||
COPY --from=build /out/logwell /usr/local/bin/logwell
|
COPY --from=build /out/logstream /usr/local/bin/logstream
|
||||||
USER logwell
|
USER logstream
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
# 5514 en interne (port non privilégié), publié sur 514 par docker-compose
|
# 5514 en interne (port non privilégié), publié sur 514 par docker-compose
|
||||||
EXPOSE 5514/udp 5514/tcp 8080/tcp
|
EXPOSE 5514/udp 5514/tcp 8080/tcp
|
||||||
HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://127.0.0.1:8080/healthz || exit 1
|
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"]
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
# Logwell
|
# Logstream
|
||||||
|
|
||||||
Un puits de logs syslog simple : réception UDP/TCP sur le port 514, stockage dans
|
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
|
[VictoriaLogs](https://docs.victoriametrics.com/victorialogs/), et une interface web
|
||||||
claire (thème clair/sombre, recherche dynamique, direct, tags de couleur).
|
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
|
▲ └── SSE (direct) ──▶ navigateur
|
||||||
└──── API / interface ◀──┘
|
└──── API / interface ◀──┘
|
||||||
```
|
```
|
||||||
@@ -23,7 +23,7 @@ Puis ouvrez <http://localhost:8080>.
|
|||||||
## Envoyer ses logs
|
## Envoyer ses logs
|
||||||
|
|
||||||
- **rsyslog** (Linux) : ajoutez `*.* @IP_DU_SERVEUR:514` (UDP) ou `*.* @@IP_DU_SERVEUR:514` (TCP)
|
- **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
|
- **Équipements réseau, NAS, pare-feu** : renseignez l'IP du serveur et le port 514 dans la
|
||||||
configuration « syslog distant ».
|
configuration « syslog distant ».
|
||||||
- **Test manuel** : `logger -n 127.0.0.1 -P 514 -d "hello error"` (util-linux) ou
|
- **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
|
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,
|
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
|
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).
|
`error` (rouge), `ok` (vert).
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
@@ -71,7 +71,7 @@ respect de la casse, expression régulière, actif. Les tags sont enregistrés d
|
|||||||
|
|
||||||
## Débogage
|
## 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.
|
- La barre du bas affiche les compteurs reçus / stockés / perdus et la dernière erreur de stockage.
|
||||||
- <http://localhost:9428/select/vmui> : interface native de VictoriaLogs pour tester des requêtes LogsQL.
|
- <http://localhost:9428/select/vmui> : interface native de VictoriaLogs pour tester des requêtes LogsQL.
|
||||||
- API :
|
- API :
|
||||||
|
|||||||
+5
-5
@@ -1,7 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
logwell:
|
logstream:
|
||||||
build: .
|
build: .
|
||||||
container_name: logwell
|
container_name: logstream
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- victorialogs
|
- victorialogs
|
||||||
@@ -15,12 +15,12 @@ services:
|
|||||||
AUTH_USER: ${AUTH_USER:-} # laisser vide pour désactiver l'authentification
|
AUTH_USER: ${AUTH_USER:-} # laisser vide pour désactiver l'authentification
|
||||||
AUTH_PASS: ${AUTH_PASS:-}
|
AUTH_PASS: ${AUTH_PASS:-}
|
||||||
volumes:
|
volumes:
|
||||||
- logwell-data:/data # tags.json
|
- logstream-data:/data # tags.json
|
||||||
|
|
||||||
victorialogs:
|
victorialogs:
|
||||||
# Épinglez une version précise en production (voir hub.docker.com/r/victoriametrics/victoria-logs/tags)
|
# Épinglez une version précise en production (voir hub.docker.com/r/victoriametrics/victoria-logs/tags)
|
||||||
image: victoriametrics/victoria-logs:latest
|
image: victoriametrics/victoria-logs:latest
|
||||||
container_name: logwell-victorialogs
|
container_name: logstream-victorialogs
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
command:
|
command:
|
||||||
- -storageDataPath=/vlogs
|
- -storageDataPath=/vlogs
|
||||||
@@ -33,5 +33,5 @@ services:
|
|||||||
- "127.0.0.1:9428:9428"
|
- "127.0.0.1:9428:9428"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
logwell-data:
|
logstream-data:
|
||||||
vlogs-data:
|
vlogs-data:
|
||||||
@@ -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.
|
// avec une interface web de consultation.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ func basicAuth(user, pass string, next http.Handler) http.Handler {
|
|||||||
if !ok ||
|
if !ok ||
|
||||||
subtle.ConstantTimeCompare([]byte(u), []byte(user)) != 1 ||
|
subtle.ConstantTimeCompare([]byte(u), []byte(user)) != 1 ||
|
||||||
subtle.ConstantTimeCompare([]byte(p), []byte(pass)) != 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)
|
http.Error(w, "authentification requise", http.StatusUnauthorized)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -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 RANGE_MS = { '5m': 3e5, '15m': 9e5, '1h': 36e5, '6h': 216e5, '24h': 864e5, '7d': 6048e5, '30d': 2592e6 };
|
||||||
|
|
||||||
const store = {
|
const store = {
|
||||||
get(k, def) { try { const v = localStorage.getItem('logwell.' + k); return v === null ? def : v; } catch { return def; } },
|
get(k, def) { try { const v = localStorage.getItem('logstream.' + k); return v === null ? def : v; } catch { return def; } },
|
||||||
set(k, v) { try { localStorage.setItem('logwell.' + k, v); } catch { /* stockage indisponible */ } },
|
set(k, v) { try { localStorage.setItem('logstream.' + k, v); } catch { /* stockage indisponible */ } },
|
||||||
};
|
};
|
||||||
|
|
||||||
const ESC = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' };
|
const ESC = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' };
|
||||||
|
|||||||
+3
-3
@@ -3,19 +3,19 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Logwell</title>
|
<title>Logstream</title>
|
||||||
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%236366f1'/%3E%3Cpath d='M8 10h16M8 16h11M8 22h14' stroke='white' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E">
|
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%236366f1'/%3E%3Cpath d='M8 10h16M8 16h11M8 22h14' stroke='white' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<script>
|
<script>
|
||||||
// Applique le thème mémorisé avant l'affichage, pour éviter un flash.
|
// Applique le thème mémorisé avant l'affichage, pour éviter un flash.
|
||||||
try { var t = localStorage.getItem('logwell.theme'); if (t) document.documentElement.dataset.theme = t; } catch (e) {}
|
try { var t = localStorage.getItem('logstream.theme'); if (t) document.documentElement.dataset.theme = t; } catch (e) {}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header class="topbar">
|
<header class="topbar">
|
||||||
<div class="brand">
|
<div class="brand">
|
||||||
<svg viewBox="0 0 32 32" aria-hidden="true"><rect width="32" height="32" rx="8"/><path d="M8 10h16M8 16h11M8 22h14"/></svg>
|
<svg viewBox="0 0 32 32" aria-hidden="true"><rect width="32" height="32" rx="8"/><path d="M8 10h16M8 16h11M8 22h14"/></svg>
|
||||||
<span>Logwell</span>
|
<span>Logstream</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="search">
|
<div class="search">
|
||||||
|
|||||||
Reference in new issue
Block a user