From 427b8db60391a3da43d1a4a3ba501511c816a2e9 Mon Sep 17 00:00:00 2001 From: Ben Adrian Sarmiento Date: Mon, 28 Aug 2023 12:09:46 +0200 Subject: [PATCH] 2.5.10 (#49) * Update tor image * bump version --- package.json | 2 +- src/services/btdigg.ts | 2 +- tor.Dockerfile | 16 +++++++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 8f995b3..ad30817 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "debrid-media-manager", - "version": "2.5.9", + "version": "2.5.10", "private": false, "scripts": { "dev": "next dev", diff --git a/src/services/btdigg.ts b/src/services/btdigg.ts index 7e79da7..f449bcd 100644 --- a/src/services/btdigg.ts +++ b/src/services/btdigg.ts @@ -110,7 +110,7 @@ export async function fetchSearchResults( } } } catch (e: any) { - console.warn(e); + console.warn(`cache read error:`, e.message); } let pageNum = 1; diff --git a/tor.Dockerfile b/tor.Dockerfile index 1854e31..23d45ab 100644 --- a/tor.Dockerfile +++ b/tor.Dockerfile @@ -1,16 +1,22 @@ FROM alpine:latest -RUN apk --no-cache --update --upgrade add tor curl grep \ +RUN apk --no-cache --update --upgrade add tor curl grep netcat-openbsd \ && mv /etc/tor/torrc.sample /etc/tor/torrc \ && sed -i \ -e 's/#SOCKSPort 192.168.0.1:9100/SOCKSPort 0.0.0.0:9050/g' \ /etc/tor/torrc \ - && chown -R tor /var/lib/tor + && chown -R tor /var/lib/tor \ + && echo "#!/bin/sh" > /usr/local/bin/check-and-renew.sh \ + && echo "while true; do" >> /usr/local/bin/check-and-renew.sh \ + && echo " curl -x socks5h://127.0.0.1:9050 -s http://btdigggink2pdqzqrik3blmqemsbntpzwxottujilcdjfz56jumzfsyd.onion/search?q=Kraftfahrzeughaftpflichtversicherung | grep -qm1 Histats || (echo -e 'AUTHENTICATE \"\"\\nsignal NEWNYM\\nQUIT' | nc 127.0.0.1 9051)" >> /usr/local/bin/check-and-renew.sh \ + && echo " sleep 30" >> /usr/local/bin/check-and-renew.sh \ + && echo "done" >> /usr/local/bin/check-and-renew.sh \ + && chmod +x /usr/local/bin/check-and-renew.sh USER tor -ENTRYPOINT tor +ENTRYPOINT tor & /usr/local/bin/check-and-renew.sh EXPOSE 9050/tcp -HEALTHCHECK --interval=10s --timeout=5s --start-period=5s --retries=1 \ - CMD curl -x socks5h://127.0.0.1:9050 -s http://btdigggink2pdqzqrik3blmqemsbntpzwxottujilcdjfz56jumzfsyd.onion/search?q=Kraftfahrzeughaftpflichtversicherung | grep -qm1 Histats +HEALTHCHECK --interval=60s --timeout=15s --start-period=20s \ + CMD curl -s --socks5 127.0.0.1:9050 'https://check.torproject.org/api/ip' | grep -qm1 -E '"IsTor"\s*:\s*true'