Add telemetry-ingest service and Docker updates

Introduce a new telemetry ingestion service (misc/data/service.go) that implements an HTTP server to accept telemetry payloads, validate and sanitize inputs, apply rate limiting, compute dedupe hashes, and forward records to PocketBase with token-based auth. Add module file (misc/data/go.mod) setting module telemetry-ingest and Go version 1.25.5. Update Dockerfile to use golang:1.25-alpine and remove baked-in environment defaults (so runtime envs are required), keeping the build stage and final CMD. These changes add the core ingestion logic, dependency module, and align the build image/version.
This commit is contained in:
CanbiZ (MickLesk)
2026-02-09 15:53:11 +01:00
parent 6fea133392
commit 7bd2ba7b54
3 changed files with 570 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
# build stage
FROM golang:1.23-alpine AS build
FROM golang:1.25-alpine AS build
WORKDIR /src
COPY . .
RUN go build -trimpath -ldflags "-s -w" -o /out/telemetry-ingest ./main.go
@@ -11,11 +11,4 @@ USER app
WORKDIR /app
COPY --from=build /out/telemetry-ingest /app/telemetry-ingest
EXPOSE 8080
ENV LISTEN_ADDR=":8080" \
MAX_BODY_BYTES="1024" \
RATE_LIMIT_RPM="60" \
RATE_BURST="20" \
RATE_KEY_MODE="ip" \
ENABLE_REQUEST_LOGGING="false" \
UPSTREAM_TIMEOUT_MS="4000"
CMD ["/app/telemetry-ingest"]