Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -sS 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:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion scripts/index/80-index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down
Loading