Nouveaux workflows GitHub Actions: - .github/workflows/build-deb.yml : Build et release DEB sur Ubuntu - .github/workflows/build-rpm.yml : Build et release RPM sur Fedora - Déclenchement sur tags v*, push main/master, workflow_dispatch - Upload des artifacts et création automatique de release Système de build de packages: - packaging/build-deb.sh : Script de build .deb avec sanitization version - packaging/build-rpm.sh : Script de build .rpm (via Docker) - packaging/Dockerfile.deb : Container Ubuntu 22.04 pour build DEB - packaging/Dockerfile.rpm : Container Go 1.24 + rpm pour build RPM Fichiers de configuration systemd: - packaging/systemd/ja4sentinel.service : Unit avec security hardening * NoNewPrivileges, ProtectSystem, ProtectHome * CAP_NET_RAW, CAP_NET_ADMIN pour packet capture - packaging/systemd/config.yml : Configuration par défaut Scripts mainteneur DEB: - packaging/deb/postinst : Création user/group, dirs, config - packaging/deb/prerm : Stop service avant upgrade/remove - packaging/deb/postrm : Cleanup complet en purge Spec file RPM: - packaging/rpm/ja4sentinel.spec : Spec complet avec dependencies * Requires: systemd, libpcap * %pre/%post/%preun/%postun scripts Tests d'installation dans containers: - packaging/test/test-deb.sh : Build + test Docker Ubuntu - packaging/test/test-rpm.sh : Build + test Docker Fedora - packaging/test/test-install-deb.sh : 11 tests automatisés - packaging/test/test-install-rpm.sh : 11 tests automatisés - Dockerfile.deb/rpm : Containers de test dédiés Makefile: - package-deb : Build .deb - package-rpm : Build .rpm via Docker (no-cache) - package : Build les deux - test-package-deb : Build + test installation DEB - test-package-rpm : Build + test installation RPM - test-package : Test les deux packages Tests: - ✅ DEB: 11/11 tests passés (binaire, config, service, user, dirs) - ✅ RPM: Build réussi (3.3 MB) - Version sanitization pour git tags (ex: efd4481-dirty → 0.0.0+efd4481-dirty) Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
32 lines
823 B
Docker
32 lines
823 B
Docker
# Dockerfile for testing DEB package installation
|
|
FROM ubuntu:22.04
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Install dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
libpcap0.8 \
|
|
systemd \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create systemd directory (needed for service installation)
|
|
RUN mkdir -p /etc/systemd/system
|
|
|
|
# Copy DEB package
|
|
COPY *.deb /tmp/ja4sentinel.deb
|
|
|
|
# Install the package
|
|
RUN dpkg -i /tmp/ja4sentinel.deb || apt-get install -f -y
|
|
|
|
# Verify installation
|
|
RUN echo "=== Verifying installation ===" && \
|
|
which ja4sentinel && \
|
|
ja4sentinel --version && \
|
|
ls -la /etc/ja4sentinel/ && \
|
|
ls -la /var/lib/ja4sentinel/ && \
|
|
ls -la /usr/lib/systemd/system/ja4sentinel.service && \
|
|
echo "=== Installation successful ==="
|
|
|
|
# Default command: run tests
|
|
CMD ["/test-install.sh"]
|