2026-03-12 12:56:59 +00:00
|
|
|
#!/bin/bash
|
2026-06-12 03:00:15 -04:00
|
|
|
|
|
|
|
|
# Start a dedicated X server for the attached kiosk display.
|
|
|
|
|
/usr/bin/Xorg :0 vt1 -nolisten tcp -keeptty &
|
2026-03-12 12:56:59 +00:00
|
|
|
XPID=$!
|
|
|
|
|
|
2026-06-12 03:00:15 -04:00
|
|
|
export DISPLAY=:0
|
|
|
|
|
export HOME=/home/archipelago
|
|
|
|
|
|
|
|
|
|
X_READY=false
|
|
|
|
|
for _ in $(seq 1 30); do
|
|
|
|
|
if kill -0 "$XPID" 2>/dev/null && xrandr --query >/tmp/archipelago-kiosk-xrandr.txt 2>/dev/null; then
|
|
|
|
|
X_READY=true
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
sleep 0.5
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
if [ "$X_READY" != "true" ]; then
|
|
|
|
|
echo 'ERROR: Xorg failed to become ready'
|
|
|
|
|
kill "$XPID" 2>/dev/null || true
|
2026-03-12 12:56:59 +00:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2026-06-12 03:00:15 -04:00
|
|
|
KIOSK_SAFE_AREA_X_PX=${ARCHIPELAGO_KIOSK_SAFE_AREA_X_PX:-}
|
|
|
|
|
KIOSK_SAFE_AREA_Y_PX=${ARCHIPELAGO_KIOSK_SAFE_AREA_Y_PX:-}
|
|
|
|
|
|
|
|
|
|
configure_display() {
|
|
|
|
|
command -v xrandr >/dev/null 2>&1 || return 0
|
|
|
|
|
|
|
|
|
|
local output mode internal width height
|
|
|
|
|
output=$(awk '/ connected/ && $1 !~ /^eDP|^LVDS/{print $1; exit}' /tmp/archipelago-kiosk-xrandr.txt)
|
|
|
|
|
[ -n "$output" ] || output=$(awk '/ connected/{print $1; exit}' /tmp/archipelago-kiosk-xrandr.txt)
|
|
|
|
|
[ -n "$output" ] || return 0
|
|
|
|
|
|
|
|
|
|
mode=$(awk -v out="$output" '
|
|
|
|
|
$1 == out { active = 1; next }
|
|
|
|
|
active && /^[[:space:]]+[0-9]+x[0-9]+/ {
|
|
|
|
|
if ($0 ~ /\*/) { print $1; exit }
|
|
|
|
|
if (!first) first = $1
|
|
|
|
|
}
|
|
|
|
|
active && /^[^[:space:]]/ { active = 0 }
|
|
|
|
|
END { if (first) print first }
|
|
|
|
|
' /tmp/archipelago-kiosk-xrandr.txt)
|
|
|
|
|
[ -n "$mode" ] || mode=1920x1080
|
|
|
|
|
|
|
|
|
|
# Kiosk should use one native output. A spanning desktop makes Chromium land
|
|
|
|
|
# on the laptop panel or stretch across both outputs.
|
|
|
|
|
for internal in $(awk '/ connected/ && $1 ~ /^eDP|^LVDS/{print $1}' /tmp/archipelago-kiosk-xrandr.txt); do
|
|
|
|
|
[ "$internal" = "$output" ] || xrandr --output "$internal" --off 2>/dev/null || true
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
xrandr --output "$output" \
|
|
|
|
|
--primary \
|
|
|
|
|
--mode "$mode" \
|
|
|
|
|
--pos 0x0 \
|
|
|
|
|
--scale 1x1 \
|
|
|
|
|
--panning 0x0 \
|
|
|
|
|
--transform none 2>/dev/null || true
|
|
|
|
|
|
|
|
|
|
width=${mode%x*}
|
|
|
|
|
height=${mode#*x}
|
|
|
|
|
case "$width:$height" in *[!0-9:]*|:*) width=1920; height=1080 ;; esac
|
2026-03-12 12:56:59 +00:00
|
|
|
|
2026-06-12 03:00:15 -04:00
|
|
|
# Browser safe-area fallback for TVs that crop edges. Driver underscan is
|
|
|
|
|
# preferable, but many Intel HDMI outputs do not expose that property.
|
|
|
|
|
KIOSK_SAFE_AREA_X_PX=${KIOSK_SAFE_AREA_X_PX:-$((width * 3 / 100))}
|
|
|
|
|
KIOSK_SAFE_AREA_Y_PX=${KIOSK_SAFE_AREA_Y_PX:-$((height * 3 / 100))}
|
|
|
|
|
}
|
2026-03-12 12:56:59 +00:00
|
|
|
|
2026-06-12 03:00:15 -04:00
|
|
|
configure_display
|
2026-03-12 12:56:59 +00:00
|
|
|
|
2026-06-12 03:00:15 -04:00
|
|
|
xhost +SI:localuser:archipelago 2>/dev/null || true
|
|
|
|
|
xsetroot -solid black 2>/dev/null || true
|
|
|
|
|
xset s off 2>/dev/null || true
|
|
|
|
|
xset -dpms 2>/dev/null || true
|
|
|
|
|
xset s noblank 2>/dev/null || true
|
2026-03-12 12:56:59 +00:00
|
|
|
|
2026-06-12 03:00:15 -04:00
|
|
|
pkill -u archipelago -f 'chromium.*localhost' 2>/dev/null || true
|
2026-04-02 20:28:53 +01:00
|
|
|
sleep 1
|
|
|
|
|
|
2026-06-16 11:10:26 -04:00
|
|
|
# GPU vs headless (#36). On a real kiosk display with a GPU, GPU rasterization is
|
|
|
|
|
# fast. On a GPU-less / headless server (no /dev/dri), --enable-gpu-rasterization
|
|
|
|
|
# forces GPU paths that fall back to software compositing and SPIN a full core at
|
|
|
|
|
# ~92% CPU, saturating the node. Detect the GPU and pick safe flags accordingly.
|
|
|
|
|
if [ -e /dev/dri/card0 ] || [ -e /dev/dri/renderD128 ]; then
|
|
|
|
|
GPU_FLAGS="--enable-gpu-rasterization --num-raster-threads=2"
|
|
|
|
|
else
|
|
|
|
|
GPU_FLAGS="--disable-gpu --num-raster-threads=1"
|
|
|
|
|
fi
|
|
|
|
|
|
2026-03-12 12:56:59 +00:00
|
|
|
while true; do
|
2026-03-31 02:42:44 +01:00
|
|
|
sudo -u archipelago env DISPLAY=:0 HOME=/home/archipelago chromium --kiosk \
|
2026-06-12 03:00:15 -04:00
|
|
|
--app=http://localhost/kiosk?safe_area_x=${KIOSK_SAFE_AREA_X_PX:-0}\&safe_area_y=${KIOSK_SAFE_AREA_Y_PX:-0} \
|
2026-03-31 02:42:44 +01:00
|
|
|
--noerrdialogs \
|
|
|
|
|
--disable-infobars \
|
|
|
|
|
--disable-translate \
|
|
|
|
|
--no-first-run \
|
|
|
|
|
--check-for-update-interval=31536000 \
|
2026-04-02 11:10:08 +01:00
|
|
|
--disable-features=TranslateUI,MetricsReporting,AutofillServerCommunication,PasswordManagerEnabled \
|
2026-03-31 02:42:44 +01:00
|
|
|
--disable-session-crashed-bubble \
|
|
|
|
|
--disable-save-password-bubble \
|
|
|
|
|
--disable-suggestions-service \
|
|
|
|
|
--disable-component-update \
|
2026-06-16 11:10:26 -04:00
|
|
|
$GPU_FLAGS \
|
fix: BUILD_VERSION from Cargo.toml, kiosk scaling, new apps, Rust warnings
Critical:
- BUILD_VERSION was hardcoded as "1.3.0-alpha" — now reads from Cargo.toml
This caused ALL ISOs to show v1.3.0 regardless of actual binary version
Kiosk:
- Remove --disable-gpu flags (broke display scaling on some monitors)
- Add --start-fullscreen --window-size for reliable fullscreen
New apps:
- Nostr VPN, FIPS, Routstr, noStrudel, BotFights, NWNN, 484 Kitchen,
Call the Operator, Arch Presentation, Syntropy Institute, T-0
Rust: suppress dead_code and unused_assignments warnings
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 00:35:52 +01:00
|
|
|
--renderer-process-limit=2 \
|
2026-06-12 03:00:15 -04:00
|
|
|
--window-size=1920,1080 \
|
fix: BUILD_VERSION from Cargo.toml, kiosk scaling, new apps, Rust warnings
Critical:
- BUILD_VERSION was hardcoded as "1.3.0-alpha" — now reads from Cargo.toml
This caused ALL ISOs to show v1.3.0 regardless of actual binary version
Kiosk:
- Remove --disable-gpu flags (broke display scaling on some monitors)
- Add --start-fullscreen --window-size for reliable fullscreen
New apps:
- Nostr VPN, FIPS, Routstr, noStrudel, BotFights, NWNN, 484 Kitchen,
Call the Operator, Arch Presentation, Syntropy Institute, T-0
Rust: suppress dead_code and unused_assignments warnings
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 00:35:52 +01:00
|
|
|
--window-position=0,0 \
|
|
|
|
|
--start-fullscreen \
|
2026-06-12 03:00:15 -04:00
|
|
|
--force-device-scale-factor=1 \
|
2026-03-31 02:42:44 +01:00
|
|
|
--disable-background-networking \
|
|
|
|
|
--disable-background-timer-throttling \
|
|
|
|
|
--disable-backgrounding-occluded-windows \
|
fix: container DNS, nginx chown, onboarding guard, seed UX, install flow
Backend:
- Add --add-host host.containers.internal:host-gateway to LND and Bitcoin
Knots containers (fixes DNS resolution failure in rootless podman)
- Add --user 0:0 and DAC_OVERRIDE to nginx UI sidecar containers
(fixes chown crash in rootless podman for bitcoin-ui, electrs-ui, lnd-ui)
- Add hostadd to Rust Podman API client for web UI container installs
- Add Chromium privacy flags to kiosk launcher (disable telemetry)
Frontend:
- Fix onboarding reset on raw IP visits (trust localStorage as first-class
signal, skip boot screen when server is up but not onboarded)
- Fix seed regression: persist challenge indices in sessionStorage so going
back from Verify doesn't change which words are asked
- Remove glass container from seed Generate/Verify/Restore screens
- Add Back button to Restore from Seed screen
- Replace Network card: Tor (purple), VPN status (orange), Bitcoin sync (orange)
- Add ElectrumX to curated app list with correct .webp icon
- Install flow: navigate to My Apps immediately with toast, hide
installed/installing apps from marketplace and discover views
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 13:06:57 +01:00
|
|
|
--disable-breakpad \
|
|
|
|
|
--disable-metrics \
|
|
|
|
|
--disable-metrics-reporting \
|
|
|
|
|
--disable-domain-reliability \
|
2026-03-31 02:42:44 +01:00
|
|
|
--js-flags="--max-old-space-size=128" \
|
2026-04-02 11:10:08 +01:00
|
|
|
--user-data-dir=/var/lib/archipelago/chromium-kiosk
|
2026-03-12 12:56:59 +00:00
|
|
|
sleep 3
|
|
|
|
|
done
|
|
|
|
|
|
2026-06-12 03:00:15 -04:00
|
|
|
kill "$XPID" 2>/dev/null || true
|