From d8a1c5332b32c4044dd694833d13925ad98c6724 Mon Sep 17 00:00:00 2001 From: Cory Forsstrom Date: Wed, 26 Feb 2020 15:03:11 -0800 Subject: [PATCH 1/3] add cert to gnutls known_host file --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f368562..ad0d2e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,9 +30,10 @@ RUN apk add vlc RUN sed -i 's/geteuid/getppid/' /usr/bin/vlc # Add SSL certs for lazystream -RUN openssl s_client -showcerts -connect freegamez.ga:443 /dev/null|openssl x509 -outform PEM > /etc/ssl/certs/mf.svc.nhl.com.pem -RUN openssl s_client -showcerts -connect freegamez.ga:443 /dev/null|openssl x509 -outform PEM > /etc/ssl/certs/playback.svcs.mlb.com.pem -RUN openssl s_client -showcerts -connect freegamez.ga:443 /dev/null|openssl x509 -outform PEM > /etc/ssl/certs/mlb-ws-mf.media.mlb.com.pem +RUN apk add --no-cache gnutls-utils +RUN printf 'y\n' | gnutls-cli --tofu playback.svcs.mlb.com:443 +RUN printf 'y\n' | gnutls-cli --tofu mf.svc.nhl.com:443 +RUN printf 'y\n' | gnutls-cli --tofu mlb-ws-mf.media.mlb.com:443 # Add xTeve and guide2go RUN wget https://github.com/xteve-project/xTeVe-Downloads/raw/master/xteve_linux_amd64.zip -O temp.zip; unzip temp.zip -d /usr/bin/; rm temp.zip @@ -56,4 +57,4 @@ RUN chmod +x /usr/bin/guide2go EXPOSE 34400 # Entrypoint -ENTRYPOINT ["./entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["./entrypoint.sh"] From cb4cdee360d3345547d260b0966fa3914ac639f4 Mon Sep 17 00:00:00 2001 From: Cory Forsstrom Date: Wed, 26 Feb 2020 16:28:14 -0800 Subject: [PATCH 2/3] ensure hosts are set when building otherwise when we try to add the certs to .gnutls/known_hosts, it wont get the correct cert --- Dockerfile | 3 +++ build.sh | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100755 build.sh diff --git a/Dockerfile b/Dockerfile index ad0d2e7..4898cb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ FROM alpine:latest + +RUN cat /etc/hosts + RUN apk update RUN apk upgrade RUN apk add --no-cache ca-certificates diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..1a5e08f --- /dev/null +++ b/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +export IP=$(getent ahostsv4 freegamez.ga | awk '{ print $1 }' | head -1) + +docker build -t taylorbourne/xteve_lazystream \ + --add-host="mf.svc.nhl.com:$IP" \ + --add-host="playback.svcs.mlb.com:$IP" \ + --add-host="mlb-ws-mf.media.mlb.com:$IP" \ + . From 2d5b7ab7d28a612d70ad2d1a0e94cebaa94a1e51 Mon Sep 17 00:00:00 2001 From: Cory Forsstrom Date: Wed, 26 Feb 2020 17:34:44 -0800 Subject: [PATCH 3/3] move hosts and cert update to run --- Dockerfile | 7 +------ build.sh | 5 ----- entrypoint.sh | 10 +++++++++- run.sh | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 12 deletions(-) create mode 100755 run.sh diff --git a/Dockerfile b/Dockerfile index 4898cb0..9e7a15f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM alpine:latest -RUN cat /etc/hosts - RUN apk update RUN apk upgrade RUN apk add --no-cache ca-certificates @@ -32,11 +30,8 @@ RUN apk add ffmpeg RUN apk add vlc RUN sed -i 's/geteuid/getppid/' /usr/bin/vlc -# Add SSL certs for lazystream +# Add GNUtls so we can update certs RUN apk add --no-cache gnutls-utils -RUN printf 'y\n' | gnutls-cli --tofu playback.svcs.mlb.com:443 -RUN printf 'y\n' | gnutls-cli --tofu mf.svc.nhl.com:443 -RUN printf 'y\n' | gnutls-cli --tofu mlb-ws-mf.media.mlb.com:443 # Add xTeve and guide2go RUN wget https://github.com/xteve-project/xTeVe-Downloads/raw/master/xteve_linux_amd64.zip -O temp.zip; unzip temp.zip -d /usr/bin/; rm temp.zip diff --git a/build.sh b/build.sh index 1a5e08f..7c43b52 100755 --- a/build.sh +++ b/build.sh @@ -1,9 +1,4 @@ #!/bin/bash -export IP=$(getent ahostsv4 freegamez.ga | awk '{ print $1 }' | head -1) - docker build -t taylorbourne/xteve_lazystream \ - --add-host="mf.svc.nhl.com:$IP" \ - --add-host="playback.svcs.mlb.com:$IP" \ - --add-host="mlb-ws-mf.media.mlb.com:$IP" \ . diff --git a/entrypoint.sh b/entrypoint.sh index eb1e86f..cc23ad4 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,14 @@ crond -l 2 + +# Update certs +rm /root/.gnutls/known_hosts +printf 'y\n' | gnutls-cli --tofu playback.svcs.mlb.com:443 +printf 'y\n' | gnutls-cli --tofu mf.svc.nhl.com:443 +printf 'y\n' | gnutls-cli --tofu mlb-ws-mf.media.mlb.com:443 +cat /root/.gnutls/known_hosts + CRONJOB_FILE=/config/cronjob.sh if [ -f "$CRONJOB_FILE" ]; then @@ -33,4 +41,4 @@ else xteve -port=34400 -config=/root/.xteve/ fi -exit \ No newline at end of file +exit diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..86d4c29 --- /dev/null +++ b/run.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +export IP=$(getent ahostsv4 freegamez.ga | awk '{ print $1 }' | head -1) + +docker run -d \ + --name=xteve_lazystream \ + --log-opt max-size=10m \ + --log-opt max-file=3 \ + -e TZ="America/Los_Angeles" \ + -v /mnt/user/appdata/xteve/:/root/.xteve:rw \ + -v /mnt/user/appdata/xteve/_config/:/config:rw \ + -v /mnt/user/appdata/xteve/_guide2go/:/guide2go:rw \ + -v /mnt/user/appdata/xteve/playlists/:/playlists:rw \ + -v /tmp/xteve/:/tmp/xteve:rw \ + --add-host="mf.svc.nhl.com:$IP" \ + --add-host="playback.svcs.mlb.com:$IP" \ + --add-host="mlb-ws-mf.media.mlb.com:$IP" \ + taylorbourne/xteve_lazystream