From 419cd152fb732f7bdedbf66eda2605470e3c4b72 Mon Sep 17 00:00:00 2001 From: modem7 Date: Sat, 19 Sep 2026 23:01:42 +0100 Subject: [PATCH 1/2] Leave full URLs in VIDEO_FILE untouched --- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ README.md | 2 +- scripts/index/80-index.sh | 5 ++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e9f2c13..217fa0d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -172,6 +172,30 @@ jobs: - name: Stop custom container run: docker rm -f rickroll-custom + - name: Start container with a full URL as VIDEO_FILE + run: | + docker run -d --name rickroll-url -p 8080:8080 \ + -e VIDEO_FILE=https://example.com/v.mp4 \ + rickroll:test + + - name: Wait for URL container to be healthy + run: | + for i in $(seq 1 30); do + docker exec rickroll-url curl -fsS http://localhost:9090/healthz && exit 0 + sleep 1 + done + docker logs rickroll-url + exit 1 + + - name: Check a full URL is left untouched + run: | + set -eu + html=$(curl -fsS http://localhost:8080/some/random/path) + echo "$html" | grep -q 'source src="https://example.com/v.mp4"' + + - name: Stop URL container + run: docker rm -f rickroll-url + - name: Set up Node uses: actions/setup-node@v7 with: diff --git a/README.md b/README.md index 8f6ea17..6825ff2 100755 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ All tags are built from the same image - only the baked-in video resolution diff | WIDTH | CSS width of the video element. | 100% | | OBJECT_FIT | CSS `object-fit` value for the video (`cover`, `contain`, etc). | cover | | LOOP | Whether the video loops (`true`/`false`). | true | -| VIDEO_FILE | Filename of the video to serve, relative to the web root. | video.mp4 | +| VIDEO_FILE | Filename of the video to serve, relative to the web root. A full URL (`https://...`) is also accepted and used as-is. | video.mp4 | # Configuration example diff --git a/scripts/index/80-index.sh b/scripts/index/80-index.sh index 095904f..0810b32 100644 --- a/scripts/index/80-index.sh +++ b/scripts/index/80-index.sh @@ -10,7 +10,10 @@ WIDTH="${WIDTH:-"100%"}" OBJECT_FIT="${OBJECT_FIT:-"cover"}" LOOP="${LOOP:-"true"}" VIDEO_FILE="${VIDEO_FILE:-"video.mp4"}" -VIDEO_FILE="/${VIDEO_FILE#/}" +case "$VIDEO_FILE" in + *://*) ;; + *) VIDEO_FILE="/${VIDEO_FILE#/}" ;; +esac OVERLAY="${OVERLAY:-"random"}" LOOP_ATTR="" From 8911b2090fd655e8098ff32ce4aee86ce7cf4beb Mon Sep 17 00:00:00 2001 From: modem7 Date: Sat, 19 Sep 2026 23:03:09 +0100 Subject: [PATCH 2/2] Fix URL check: path returns 404 so curl -f aborts --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 217fa0d..77b8abc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -190,7 +190,7 @@ jobs: - name: Check a full URL is left untouched run: | set -eu - html=$(curl -fsS http://localhost:8080/some/random/path) + html=$(curl -sS http://localhost:8080/some/random/path) echo "$html" | grep -q 'source src="https://example.com/v.mp4"' - name: Stop URL container