+ added rist2rist and updates

This commit is contained in:
moo
2026-04-18 10:49:19 +02:00
parent 3446b2621f
commit 2d6257f4a1
6 changed files with 92 additions and 5 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
#REPOSITORY=registry.dissertori.lan
REPOSITORY=registry.dissertori.lan
#REPOSITORY=10.0.1.52:5000
REPOSITORY=moothecow
#REPOSITORY=moothecow
#REPOSITORY=172.105.85.44
VERSION=0.0.14
VERSION=0.0.16
+2 -1
View File
@@ -6,7 +6,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
#RUN pip3 install --break-system-packages meson ninja
RUN git clone https://github.com/moo-the-cow/librist && \
#RUN git clone https://github.com/moo-the-cow/librist && \
RUN git clone https://code.videolan.org/rist/librist.git && \
cd librist && \
mkdir build && \
cd build && \
+2 -1
View File
@@ -6,7 +6,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
#RUN pip3 install --break-system-packages meson ninja
RUN git clone https://github.com/moo-the-cow/librist && \
#RUN git clone https://github.com/moo-the-cow/librist && \
RUN git clone https://code.videolan.org/rist/librist.git && \
cd librist && \
mkdir build && \
cd build && \
+43
View File
@@ -0,0 +1,43 @@
FROM debian:bookworm-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
meson ninja-build git build-essential ca-certificates \
cmake \
&& rm -rf /var/lib/apt/lists/*
#RUN pip3 install --break-system-packages meson ninja
#RUN git clone https://github.com/moo-the-cow/librist && \
RUN git clone https://code.videolan.org/rist/librist.git && \
cd librist && \
mkdir build && \
cd build && \
meson .. --default-library=static --buildtype=release -Db_lto=true -Duse_mbedtls=true && \
ninja
FROM busybox:glibc
COPY --from=builder /librist/build/tools/rist2rist /usr/bin/
#COPY --from=builder /librist/build/tools/ristreceiver /usr/bin/
#COPY --from=builder /librist/build/tools/ristsender /usr/bin/
COPY --from=builder /librist/build/tools/ristsrppasswd /usr/bin/
COPY banner.txt /
# Create entrypoint script that generates SRP file
RUN echo '#!/bin/sh' > /entrypoint.sh \
&& echo 'cat /banner.txt' >> /entrypoint.sh \
&& echo 'if [ ! -z "$SRP_USER" ] && [ ! -z "$SRP_PASS" ]; then' >> /entrypoint.sh \
&& echo ' echo "Generating SRP file for user $SRP_USER..."' >> /entrypoint.sh \
&& echo ' ristsrppasswd "$SRP_USER" "$SRP_PASS" 2>/dev/null > /tmp/auth.srp' >> /entrypoint.sh \
&& echo ' if [ $? -eq 0 ] && [ -s /tmp/auth.srp ]; then' >> /entrypoint.sh \
&& echo ' echo "SRP file created successfully"' >> /entrypoint.sh \
&& echo ' export RIST_SRP_FILE="/tmp/auth.srp"' >> /entrypoint.sh \
&& echo ' echo "--- SRP file contents: ---"' >> /entrypoint.sh \
&& echo ' while IFS= read -r line; do echo "$line"; done < /tmp/auth.srp' >> /entrypoint.sh \
&& echo ' echo "--------------------------"' >> /entrypoint.sh \
&& echo ' else' >> /entrypoint.sh \
&& echo ' echo "ERROR: Failed to create SRP file"' >> /entrypoint.sh \
&& echo ' exit 1' >> /entrypoint.sh \
&& echo ' fi' >> /entrypoint.sh \
&& echo 'fi' >> /entrypoint.sh \
&& echo 'exec "$@"' >> /entrypoint.sh \
&& chmod +x /entrypoint.sh
# Set the entrypoint to the created script
ENTRYPOINT ["/entrypoint.sh"]
+34
View File
@@ -0,0 +1,34 @@
import socket
import os
LISTEN_PORT = int(os.environ.get("STATS_FILTER_LISTEN", "5006"))
FORWARD_PORT = int(os.environ.get("STATS_FILTER_FORWARD", "5005"))
FORWARD_ADDR = os.environ.get("STATS_FILTER_ADDR", "127.0.0.1")
BUF_SIZE = 65535
# Byte patterns to match (avoids decode overhead on spam lines)
PASS_PATTERNS = (
b"receiver-stats",
b"[CLEANUP]",
b"has timed out",
b"flow_cumulative_stats",
)
def main():
sock_in = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock_out = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock_in.bind(("0.0.0.0", LISTEN_PORT))
print(f"stats_filter: listening on UDP :{LISTEN_PORT}, forwarding to {FORWARD_ADDR}:{FORWARD_PORT}")
while True:
data, _ = sock_in.recvfrom(BUF_SIZE)
# Fast byte-level check — no decode unless it matches
for pattern in PASS_PATTERNS:
if pattern in data:
sock_out.sendto(data, (FORWARD_ADDR, FORWARD_PORT))
break
if __name__ == "__main__":
main()
+8
View File
@@ -15,6 +15,14 @@ services:
- linux/amd64
- linux/arm64
image: ${REPOSITORY}/moo-rist-forwarder:${VERSION}
moo-rist-to-rist:
build:
context: .
dockerfile: ./DockerfileRist2Rist
platforms:
- linux/amd64
- linux/arm64
image: ${REPOSITORY}/moo-rist-to-rist:${VERSION}
#moo-rist-relay:
# build:
# context: .