feat: add local ad-free weather page

This commit is contained in:
2026-05-27 13:33:44 +00:00
parent fd519a64b0
commit 1b06a29e53
5 changed files with 598 additions and 262 deletions
+16 -3
View File
@@ -9,6 +9,8 @@ KIOSK_REMOTE="jgitta@100.64.0.1"
REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
HOME_SRC="$REPO_DIR/home-screen-index.html"
HOME_DST="/home/jgitta/kiosk-home/index.html"
WEATHER_SRC="$REPO_DIR/weather.html"
WEATHER_DST="/home/jgitta/kiosk-home/weather.html"
CONFIG_SRC="$REPO_DIR/config.json"
# Auto-increment patch version (0.2.0 → 0.2.1 → 0.2.2 ...)
VERSION_FILE="$REPO_DIR/VERSION"
@@ -54,6 +56,12 @@ else
echo " WARNING: $HOME_SRC missing — home screen not updated"
fi
if [ -f "$WEATHER_SRC" ]; then
cp "$WEATHER_SRC" "$WEATHER_DST"
chown jgitta:jgitta "$WEATHER_DST" 2>/dev/null || true
echo " Synced weather page"
fi
echo "==> Committing and pushing to Gitea..."
git -C "$REPO_DIR" add -A
git -C "$REPO_DIR" commit -m "$COMMIT_MSG" 2>/dev/null || echo " (nothing new to commit)"
@@ -61,7 +69,11 @@ git -C "$REPO_DIR" remote set-url origin "http://$GITEA_USER:$GITEA_TOKEN@192.16
git -C "$REPO_DIR" push origin master || echo " (push failed — check network)"
echo "==> Restarting kiosk-dev..."
/usr/local/bin/kiosk-restart
if [ -f "/usr/local/bin/kiosk-restart" ]; then
/usr/local/bin/kiosk-restart
else
ssh kiosk-dev "/usr/local/bin/kiosk-restart"
fi
echo "==> Trying production kiosk..."
KIOSK=""
@@ -80,8 +92,9 @@ if [ -n "$KIOSK" ]; then
cd /home/jgitta/kiosk-browser
git pull
# Inject config at deploy time
config_json=\$(cat config.json | sed 's/\\\\/\\\\\\\\/g' | sed 's/\"/\\\\\"/g' | tr '\n' ' ')
sed \"s|const config = {};|const config = \$config_json;|\" home-screen-index.html > /home/jgitta/kiosk-home/index.html
config_json=\\\$(cat config.json | sed 's/\\\\\\\\/\\\\\\\\\\\\\\\\/g' | sed 's/\\\"/\\\\\\\"/g' | tr '\\\n' ' ')
sed \"s|const config = {};|const config = \\\$config_json;|\" home-screen-index.html > /home/jgitta/kiosk-home/index.html
cp weather.html /home/jgitta/kiosk-home/weather.html
/usr/local/bin/kiosk-restart
"
echo " Production updated."