Skip to content

Commit

Permalink
feat(stremio-web): add local copy of shell webui
Browse files Browse the repository at this point in the history
  • Loading branch information
n0bodysec committed Oct 4, 2022
1 parent c221d9d commit 7774146
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stremio-web.publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ jobs:
uses: docker/build-push-action@v3
with:
context: stremio-web/
platforms: linux/amd64,linux/arm64,linux/arm/v8,linux/arm/v7,linux/arm/v6
platforms: linux/amd64,linux/arm64,linux/arm/v8,linux/arm/v6
push: true
tags: n0bodysec/stremio:latest
14 changes: 11 additions & 3 deletions stremio-web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ ARG SERVER_VERSION=master
ARG DOWNLOAD_URL=https://dl.strem.io/four/${SERVER_VERSION}

WORKDIR /srv/stremio
RUN apk add --no-cache git
RUN apk add --no-cache git wget dos2unix
RUN git clone https://github.com/Stremio/stremio-web.git

WORKDIR /srv/stremio/scripts
COPY patches.sh run.sh ./
RUN dos2unix *.sh

WORKDIR /srv/stremio/stremio-shell
RUN wget -mkEpnp -nH https://staging.strem.io || true

WORKDIR /srv/stremio/stremio-web
RUN npm ci && npm run build

Expand All @@ -24,13 +31,14 @@ FROM node:alpine

WORKDIR /srv/stremio
RUN apk add --no-cache ffmpeg
COPY --from=builder /srv/stremio/stremio-shell ./shell
COPY --from=builder /srv/stremio/stremio-web/build ./web
COPY --from=builder /srv/stremio/stremio-server ./server
COPY patches.sh run.sh ./
COPY --from=builder /srv/stremio/scripts ./
RUN chmod +x ./patches.sh ./run.sh && \
npm install -g http-server

# Expose default ports
EXPOSE 11470 8080
EXPOSE 11470 8080 8081

CMD ["./run.sh"]
4 changes: 2 additions & 2 deletions stremio-web/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# stremio-web

This docker image contains a built copy of the open source [stremio-web](https://github.com/Stremio/stremio-web/) and a copy of the closed source [stremio-server](http://dl.strem.io/four/master/server.js).
This docker image contains a built copy of the open source [stremio-web](https://github.com/Stremio/stremio-web/), a copy of the stremio-shell web ui and a copy of the closed source [stremio-server](http://dl.strem.io/four/master/server.js).

With this image, you can quickly deploy a ready-to-use stremio-web client and server.

Expand Down Expand Up @@ -50,5 +50,5 @@ docker run -e APPLY_PATCHES=1 n0bodysec/stremio
| NO_CORS | Do no check CORS in the SERVER | server.js |

For more environment variables, please check the `server.js` file.
Undocumented env vars: `APPDATA`, `APP_PATH`, `BLUEBIRD_DEBUG`, `BLUEBIRD_LONG_STACK_TRACES`, `BLUEBIRD_WARNINGS`, `BLUEBIRD_W_FORGOTTEN_RETURN`, `CASTING_DISABLED`, `COLORTERM`, `DEBUG`, `DEBUG_COLORS`, `DEBUG_COLORS`, `DEBUG_DEPTH`, `DEBUG_FD`, `DEBUG_MIME`, `DEBUG_SHOW_HIDDEN`, `DISABLE_CACHING`, `DISABLE_CACHING`, `FFMPEG_BIN`, `FFMPEG_DEBUG`, `FFSPLIT_DEBUG`, `FORCE_COLOR`, `HOME`, `HTTPS_CERT_ENDPOINT`, `NODE_DEBUG`, `NODE_ENV`, `NO_CORS`, `NO_DEPRECATION`, `OPEN`, `OSTYPE`, `PATHEXT`, `PORT`, `READABLE_STREAM`, `SUDO_USER`, `SystemRoot`, `TEMP`, `TERM`, `TMP`, `TMPDIR`, `TRACE_DEPRECATION`, `TV_ENV`, `WEBUI_LOCATION`, `YTDL_NO_UPDATE`, `npm_config_arch`, `npm_config_platform`,
Undocumented env vars: `APPDATA`, `APP_PATH`, `BLUEBIRD_DEBUG`, `BLUEBIRD_LONG_STACK_TRACES`, `BLUEBIRD_WARNINGS`, `BLUEBIRD_W_FORGOTTEN_RETURN`, `CASTING_DISABLED`, `COLORTERM`, `DEBUG`, `DEBUG_COLORS`, `DEBUG_COLORS`, `DEBUG_DEPTH`, `DEBUG_FD`, `DEBUG_MIME`, `DEBUG_SHOW_HIDDEN`, `DISABLE_CACHING`, `DISABLE_CACHING`, `FFMPEG_BIN`, `FFMPEG_DEBUG`, `FFSPLIT_DEBUG`, `FORCE_COLOR`, `HOME`, `HTTPS_CERT_ENDPOINT`, `NODE_DEBUG`, `NODE_ENV`, `NO_DEPRECATION`, `OPEN`, `OSTYPE`, `PATHEXT`, `PORT`, `READABLE_STREAM`, `SUDO_USER`, `SystemRoot`, `TEMP`, `TERM`, `TMP`, `TMPDIR`, `TRACE_DEPRECATION`, `TV_ENV`, `WEBUI_LOCATION`, `YTDL_NO_UPDATE`, `npm_config_arch`, `npm_config_platform`,
`windir`
8 changes: 4 additions & 4 deletions stremio-web/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ version: '3.9'

services:
stremio:
image: stremio
build: .
ports:
- '11470:11470'
- '8080:8080'
- '8081:8081'
volumes:
- ./data/:/root/.stremio-server
environment:
APPLY_PATCHES: 1
FIX_UNSUPPORTED_MEDIA: 1
NO_CORS: 1
APPLY_PATCHES: ${APPLY_PATCHES:-1}
FIX_UNSUPPORTED_MEDIA: ${FIX_UNSUPPORTED_MEDIA:-1}
NO_CORS: ${NO_CORS:-1}
7 changes: 4 additions & 3 deletions stremio-web/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ services:
ports:
- '11470:11470'
- '8080:8080'
- '8081:8081'
volumes:
- ./data/:/root/.stremio-server
environment:
APPLY_PATCHES: 1
FIX_UNSUPPORTED_MEDIA: 1
NO_CORS: 1
APPLY_PATCHES: ${APPLY_PATCHES:-1}
FIX_UNSUPPORTED_MEDIA: ${FIX_UNSUPPORTED_MEDIA:-1}
NO_CORS: ${NO_CORS:-1}
8 changes: 1 addition & 7 deletions stremio-web/patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@
cp server/server.js.bak server/server.js

# Fix for HTTP 415 Unsupported Media Type
if [[ ${FIX_UNSUPPORTED_MEDIA:-0} -eq 1 ]]; then
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|" server/server.js
sed -i -E 's/HLS.masterMultiPlaylistMiddleware\)/HLS.masterPlaylistMiddleware\)/' server/server.js
fi

# Deprecated
if [[ ${FIX_CORS:-0} -eq 1 ]]; then
echo "FIX_CORS is deprecated. Please set the environment variable NO_CORS=1."
export NO_CORS=1
fi
1 change: 1 addition & 0 deletions stremio-web/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ else
fi

http-server web/ -p 8080 -d false &
http-server shell/ -p 8081 -d false &
node server/server.js

0 comments on commit 7774146

Please sign in to comment.