fix: add entrypoint script - wait for auth before starting RTSP server

This commit is contained in:
Nox
2026-03-25 11:46:51 +01:00
parent 189e5e6a1b
commit 36ea55f02d
2 changed files with 21 additions and 2 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ FROM alpine:3.19
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=builder /app/tuya-ipc-terminal .
COPY entrypoint.sh .
VOLUME ["/app/.tuya-data"]
EXPOSE 8554
ENTRYPOINT ["./tuya-ipc-terminal"]
CMD ["rtsp", "start", "--port", "8554"]
ENTRYPOINT ["/bin/sh", "entrypoint.sh"]
Executable
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
set -e
echo "=== tuya-ipc-terminal RTSP Bridge ==="
# Vérifier si des users sont authentifiés
if ./tuya-ipc-terminal auth list 2>/dev/null | grep -q '@'; then
echo "Auth trouvée, démarrage du serveur RTSP..."
exec ./tuya-ipc-terminal rtsp start --port 8554
else
echo ""
echo "⚠️ Aucun compte authentifié."
echo ""
echo "Pour configurer, lance depuis le QNAP :"
echo " docker exec -it tuya-ipc ./tuya-ipc-terminal auth add eu-central TON_EMAIL --password"
echo ""
echo "Container en attente (sleep infini)..."
exec sleep infinity
fi