fix(ja4ebpf): split bpf2go generate into Ja4Tc + Ja4Ssl, fix RPM systemd-rpm-macros
- Use two separate //go:generate directives (Ja4Tc for tc_capture.c, Ja4Ssl
for uprobe_ssl.c) to avoid duplicate LICENSE symbol and multi-file clang issue
- Update loader.go to hold tcObjs/sslObjs separately with correct field names:
UprobeSslSetFd, UprobeSslReadEntry, UretprobeSslReadExit,
KprobeAccept4Entry, KretprobeAccept4Exit
- Add systemd-rpm-macros to all three RPM build stages (el8/el9/el10)
so that %{_unitdir} macro resolves correctly
- RPMs now build successfully for el8, el9, el10
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
54
tests/integration/hitch-varnish/platform/Dockerfile
Normal file
54
tests/integration/hitch-varnish/platform/Dockerfile
Normal file
@ -0,0 +1,54 @@
|
||||
# =============================================================================
|
||||
# Platform hitch + varnish — Rocky Linux 9
|
||||
# hitch (TLS, PROXY protocol) → Varnish (HTTP cache) → backend HTTP
|
||||
# =============================================================================
|
||||
|
||||
FROM golang:1.24-bookworm AS go-builder
|
||||
|
||||
RUN apt-get update && apt-get install -y clang llvm libbpf-dev && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /build
|
||||
COPY go.work go.work.sum* ./
|
||||
COPY shared/go/ja4common/go.mod shared/go/ja4common/go.sum* ./shared/go/ja4common/
|
||||
COPY services/ja4ebpf/go.mod services/ja4ebpf/go.sum* ./services/ja4ebpf/
|
||||
RUN cd services/ja4ebpf && go mod download 2>/dev/null; true
|
||||
|
||||
COPY shared/go/ja4common/ ./shared/go/ja4common/
|
||||
COPY services/ja4ebpf/ ./services/ja4ebpf/
|
||||
|
||||
WORKDIR /build/services/ja4ebpf
|
||||
RUN GOWORK=off go generate ./internal/loader/ && \
|
||||
GOWORK=off CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
||||
go build -ldflags="-s -w" -o /out/ja4ebpf ./cmd/ja4ebpf/
|
||||
|
||||
# ── Runtime : hitch + varnish + backend + ja4ebpf ────────────────────────────
|
||||
ARG BASE_IMAGE=rockylinux:9
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
# hitch est dans EPEL ; varnish dans le dépôt officiel Rocky
|
||||
RUN dnf install -y epel-release && \
|
||||
dnf install -y hitch varnish openssl curl python3 && \
|
||||
dnf clean all
|
||||
|
||||
COPY --from=go-builder /out/ja4ebpf /usr/local/bin/ja4ebpf
|
||||
|
||||
# Certificat TLS auto-signé pour hitch
|
||||
RUN openssl req -x509 -nodes -days 365 \
|
||||
-subj "/CN=platform.test" \
|
||||
-newkey rsa:2048 \
|
||||
-keyout /tmp/hitch.key \
|
||||
-out /tmp/hitch.crt && \
|
||||
# hitch attend un fichier PEM concaténé (clé + certificat)
|
||||
cat /tmp/hitch.key /tmp/hitch.crt > /etc/hitch/hitch.pem && \
|
||||
chmod 600 /etc/hitch/hitch.pem && \
|
||||
mkdir -p /var/www/html /run/varnish && \
|
||||
echo '{"status":"ok","stack":"hitch-varnish"}' > /var/www/html/health
|
||||
|
||||
COPY tests/integration/hitch-varnish/platform/hitch.conf /etc/hitch/hitch.conf
|
||||
COPY tests/integration/hitch-varnish/platform/varnish.vcl /etc/varnish/default.vcl
|
||||
COPY tests/integration/hitch-varnish/platform/ja4ebpf.yml /etc/ja4ebpf/config.yml
|
||||
COPY tests/integration/hitch-varnish/platform/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
EXPOSE 80 443
|
||||
CMD ["/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user