Repository navigation
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·43 lines (37 loc) · 2.8 KB
/
Copy pathdocker-entrypoint.sh
File metadata and controls
executable file
·43 lines (37 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -euo pipefail
VENDOR="/var/www/html/vendor"
# Download vendor libraries on first start if not present.
# Files are written to the mounted ./www/vendor/ path so they
# persist on the host and are only downloaded once.
if [ ! -f "$VENDOR/qrcode.min.js" ]; then
echo "[entrypoint] Downloading qrcode-generator 1.4.4..."
mkdir -p "$VENDOR"
curl -fsSL https://cdn.jsdelivr.net/npm/qrcode-generator@1.4.4/qrcode.min.js -o "$VENDOR/qrcode.min.js"
fi
if [ ! -f "$VENDOR/nosleep.min.js" ]; then
echo "[entrypoint] Downloading NoSleep.js 0.12.0..."
curl -fsSL https://cdn.jsdelivr.net/npm/nosleep.js@0.12.0/dist/NoSleep.min.js -o "$VENDOR/nosleep.min.js"
fi
# Self-hosted Google Fonts for the tournament-timer theme system.
# Downloaded from fonts.bunny.net (privacy-friendly Google Fonts mirror).
if [ ! -f "$VENDOR/fonts/fonts.css" ]; then
echo "[entrypoint] Downloading timer fonts..."
mkdir -p "$VENDOR/fonts"
curl -fsSL -o "$VENDOR/fonts/inter-400.woff2" https://fonts.bunny.net/inter/files/inter-latin-400-normal.woff2
curl -fsSL -o "$VENDOR/fonts/inter-700.woff2" https://fonts.bunny.net/inter/files/inter-latin-700-normal.woff2
curl -fsSL -o "$VENDOR/fonts/bebas-neue-400.woff2" https://fonts.bunny.net/bebas-neue/files/bebas-neue-latin-400-normal.woff2
curl -fsSL -o "$VENDOR/fonts/orbitron-400.woff2" https://fonts.bunny.net/orbitron/files/orbitron-latin-400-normal.woff2
curl -fsSL -o "$VENDOR/fonts/orbitron-700.woff2" https://fonts.bunny.net/orbitron/files/orbitron-latin-700-normal.woff2
curl -fsSL -o "$VENDOR/fonts/press-start-2p-400.woff2" https://fonts.bunny.net/press-start-2p/files/press-start-2p-latin-400-normal.woff2
cat > "$VENDOR/fonts/fonts.css" <<'FONTSCSS'
/* Self-hosted Google Fonts (via fonts.bunny.net mirror). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/vendor/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/vendor/fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Bebas Neue"; font-style: normal; font-weight: 400; font-display: swap; src: url("/vendor/fonts/bebas-neue-400.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 400; font-display: swap; src: url("/vendor/fonts/orbitron-400.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 700; font-display: swap; src: url("/vendor/fonts/orbitron-700.woff2") format("woff2"); }
@font-face { font-family: "Press Start 2P"; font-style: normal; font-weight: 400; font-display: swap; src: url("/vendor/fonts/press-start-2p-400.woff2") format("woff2"); }
FONTSCSS
fi
exec docker-php-entrypoint apache2-foreground