script feed from stdin via json

Squashed commit of the following:

commit ad482533fa
Author: AR2000 <ar2000@ar2000.me>
Date:   Thu Jan 16 15:33:16 2025 +0100

    add jq to container

commit 79352ec046
Author: AR2000 <ar2000@ar2000.me>
Date:   Thu Jan 16 14:55:37 2025 +0100

    stdin

commit 3100810052
Author: AR2000 <ar2000@ar2000.me>
Date:   Thu Jan 16 14:33:05 2025 +0100

    test
This commit is contained in:
2025-01-16 15:44:56 +01:00
parent 9fbd21f958
commit 09186aedac
3 changed files with 51 additions and 30 deletions

View File

@@ -1,20 +1,20 @@
ARG IPTABLES_MODE=nft
#install iptables
FROM ubuntu:noble AS iptables
FROM ubuntu:noble AS apt
RUN --mount=type=cache,target=/var/lib/apt/lists,sharing=locked --mount=type=cache,target=/var/cache/apt,sharing=locked <<EOF
apt update
apt upgrade -y
apt install iptables -y
apt install iptables jq -y
EOF
#set alternative to use iptables-legacy
FROM iptables AS iptables-legacy
FROM apt AS iptables-legacy
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy
RUN update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
#set alternative to use iptables-nft
FROM iptables AS iptables-nft
FROM apt AS iptables-nft
RUN update-alternatives --set iptables /usr/sbin/iptables-nft
RUN update-alternatives --set ip6tables /usr/sbin/ip6tables-nft
@@ -33,6 +33,7 @@ COPY --from=build-stage /app/cs-custom-bouncer/crowdsec-custom-bouncer \
/usr/bin/crowdsec-custom-bouncer
COPY --from=build-stage /app/cs-custom-bouncer/config/crowdsec-custom-bouncer.yaml \
/crowdsec-custom-bouncer.yaml
RUN sed -i "s/total_retries: .*/total_retries: 1/g" /crowdsec-custom-bouncer.yaml
ADD --chmod=770 bouncer.sh /bouncer.sh
ENV BINARY_PATH=/bouncer.sh
LABEL me.ar2000.gitea.buildargs.iptablesmode="${IPTABLES_MODE}"