feat!: Urutau 2.0.0, ultralight probes and a single analysis hub
Each server runs an ultralight probe (scratch image, ~7 MiB RSS) that tails the logs, ships raw lines to the hub over HTTPS with an on-disk spool, and applies enforce decisions locally. The hub keeps one node per probe (primary node = the 1.x data dir, unchanged), does all analysis and serves the UI. Peer federation is removed. 'urutau import' brings 1.x data dirs in with hash and count verification. UI: probes page, host qualified incidents, IPs never wrap, egress heatmap labels, live and replay globes no longer auto-rotate, replay repeat, live traffic metrics. BREAKING CHANGE: URUTAU_PEERS, URUTAU_PEER_* and /api/v1/peer/* are gone; log path variables move from the hub to the probe. See docs/migration-2.0.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
23a7a5963a
commit
8546d14cef
130 files changed
+9396
-3311
No files matched your search
+41
-12
@@ -1,6 +1,9 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
#
|
||||
# Urutau image: one static binary (no CGO, standard library only) on Alpine.
|
||||
# Urutau 2: one static binary (no CGO, standard library only), two images.
|
||||
# --target hub the hub: dashboard, API, probe ingestion (Alpine)
|
||||
# --target probe the probe: `urutau probe` only (FROM scratch, a few MB)
|
||||
# The default (last) stage is the hub, so a plain `docker build .` is the hub.
|
||||
|
||||
# Build stage.
|
||||
FROM golang:1.26.11-alpine3.24 AS build
|
||||
@@ -10,16 +13,45 @@ COPY cmd cmd
|
||||
COPY internal internal
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/urutau ./cmd/urutau
|
||||
|
||||
# Runtime stage: CA certificates (peers over HTTPS, geo database download) and
|
||||
# tzdata so TZ can match the host's fail2ban log. The HEALTHCHECK is the binary
|
||||
# itself (`urutau healthcheck`): no curl in the image.
|
||||
# Runs unprivileged (uid 10001). To read /var/log/auth.log (group adm) the
|
||||
# compose file adds the host group with `group_add: ["4"]`.
|
||||
FROM alpine:3.24
|
||||
# Files the scratch image needs: CA certificates (HTTPS to the hub), zoneinfo
|
||||
# (TZ must match the host's fail2ban log) and an owned empty /state.
|
||||
FROM alpine:3.24 AS probe-files
|
||||
RUN apk add --no-cache ca-certificates tzdata \
|
||||
&& mkdir -p /rootfs/state \
|
||||
&& chown 10001:10001 /rootfs/state
|
||||
|
||||
# Probe image: no shell, no package manager, no listening port. It reads the
|
||||
# host logs (read-only mounts), sends them to the hub over HTTPS and appends the
|
||||
# hub's ban decisions to a file. The HEALTHCHECK is the binary itself
|
||||
# (`urutau probe --check` reads the liveness mark in the state volume).
|
||||
# Runs unprivileged (uid 10001); the compose file adds the host group adm
|
||||
# (`group_add: ["4"]`) to read /var/log.
|
||||
FROM scratch AS probe
|
||||
COPY --from=probe-files /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY --from=probe-files /usr/share/zoneinfo /usr/share/zoneinfo
|
||||
COPY --from=probe-files --chown=10001:10001 /rootfs/state /state
|
||||
COPY --from=build /out/urutau /urutau
|
||||
LABEL org.opencontainers.image.title="Urutau probe" \
|
||||
org.opencontainers.image.description="Ultra-light Urutau probe: ships host logs to an Urutau hub" \
|
||||
org.opencontainers.image.source="https://git.lucasrguerra.dev.br/ciberfauna/urutau" \
|
||||
org.opencontainers.image.licenses="MIT OR Apache-2.0"
|
||||
ENV URUTAU_STATE_DIR=/state \
|
||||
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
|
||||
ZONEINFO=/usr/share/zoneinfo
|
||||
USER 10001:10001
|
||||
VOLUME /state
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
||||
CMD ["/urutau", "probe", "--check"]
|
||||
ENTRYPOINT ["/urutau", "probe"]
|
||||
|
||||
# Hub image: CA certificates (hub-to-hub downloads: geo database, Tor lists) and
|
||||
# tzdata. The HEALTHCHECK is the binary itself (`urutau healthcheck`): no curl in
|
||||
# the image. The hub reads no log file: the probes bring the lines.
|
||||
FROM alpine:3.24 AS hub
|
||||
RUN apk add --no-cache ca-certificates tzdata \
|
||||
&& addgroup -S -g 10001 urutau \
|
||||
&& adduser -S -u 10001 -G urutau -h /data -s /sbin/nologin urutau \
|
||||
&& mkdir -p /data /logs \
|
||||
&& mkdir -p /data \
|
||||
&& chown urutau:urutau /data
|
||||
COPY --from=build /out/urutau /usr/local/bin/urutau
|
||||
LABEL org.opencontainers.image.title="Urutau" \
|
||||
@@ -27,10 +59,7 @@ LABEL org.opencontainers.image.title="Urutau" \
|
||||
org.opencontainers.image.source="https://git.lucasrguerra.dev.br/ciberfauna/urutau" \
|
||||
org.opencontainers.image.licenses="MIT OR Apache-2.0"
|
||||
ENV URUTAU_BIND=0.0.0.0:8790 \
|
||||
URUTAU_DATA_DIR=/data \
|
||||
URUTAU_TRAEFIK_LOG=/logs/traefik/access.log \
|
||||
URUTAU_AUTH_LOG=/logs/host/auth.log \
|
||||
URUTAU_FAIL2BAN_LOG=/logs/host/fail2ban.log
|
||||
URUTAU_DATA_DIR=/data
|
||||
USER urutau
|
||||
WORKDIR /data
|
||||
VOLUME /data
|
||||
|
||||
Reference in new issue
Block a user