Skip to content

Commit

Permalink
refactor(stremio): update scripts to latest ver
Browse files Browse the repository at this point in the history
  • Loading branch information
n0bodysec committed Dec 30, 2023
1 parent e5ff345 commit 8634102
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
7 changes: 4 additions & 3 deletions stremio/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ FROM node:alpine AS builder

# build args
ARG SERVER_VERSION=master
ARG DOWNLOAD_URL=https://dl.strem.io/four/${SERVER_VERSION}
ARG SERVER_BUILD=desktop
ARG DOWNLOAD_URL=https://dl.strem.io/server/${SERVER_VERSION}/${SERVER_BUILD}

WORKDIR /srv/stremio
RUN apk add --no-cache git wget dos2unix
Expand All @@ -22,15 +23,15 @@ WORKDIR /srv/stremio/stremio-web
RUN npm ci && npm run build && cp -r build ../dist/web

WORKDIR /srv/stremio/dist/server
RUN wget $DOWNLOAD_URL/server.js $DOWNLOAD_URL/stremio.asar && cp server.js server.js.bak
RUN wget $DOWNLOAD_URL/server.js && cp server.js server.js.bak

##########################################################################

# main image
FROM node:alpine

WORKDIR /srv/stremio
RUN apk add --no-cache ffmpeg
RUN apk add --no-cache ffmpeg dos2unix
COPY --from=builder /srv/stremio/dist ./
RUN npm install -g http-server

Expand Down
7 changes: 5 additions & 2 deletions stremio/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ version: '3.9'
services:
stremio:
image: n0bodysec/stremio
# build: .
# build:
# context: .
# args:
# SERVER_VERSION: v4.20.3
ports:
- '11470:11470'
- '12470:12470'
Expand All @@ -17,5 +20,5 @@ services:
environment:
WORKDIR: /srv/stremio # important! used for patches
APPLY_PATCHES: 1
FIX_UNSUPPORTED_MEDIA: 1
FIX_UNSUPPORTED_MEDIA: 0
NO_CORS: 1
1 change: 1 addition & 0 deletions stremio/files/patches/FIX_UNSUPPORTED_MEDIA.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh

# deprecated!
if [ ${FIX_UNSUPPORTED_MEDIA:-0} -eq 1 ]; then
echo "Applying patch for HTTP 415 Unsupported Media Type..."
sed -i -E "s|(var first = req\.params\.first)|if (req.params.first === 'hlsv2') { req.params.first = req.query.mediaURL.split('/')[3]; req.params.second = req.query.mediaURL.split('/')[4]; }\n \1|" $WORKDIR/server/server.js
Expand Down
2 changes: 1 addition & 1 deletion stremio/files/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [[ ${APPLY_PATCHES:-0} -eq 1 ]]; then
echo "Applying patches..."
for file in patches/*.sh; do
echo "Executing patch $file"
sh $file
cat $file | dos2unix | sh
done
fi
else
Expand Down

0 comments on commit 8634102

Please sign in to comment.