Files
hobbs-iac/compose/hf-pdocker-02/hobbs-organizer/provision-shield.sh
jeremy e9c7e9df1a feat: self-host Hobbs Family Organizer (Shield TV dashboard) on hf-pdocker-02:8340
- tv app/Hobbs-Family-Organizer-Self-Hosted-v1.0.0: release bundle (Next.js app + Shield APK v1.4 + source)
- compose/hf-pdocker-02/hobbs-organizer: override (local-disk secrets, watchtower off), .env (port 8340), Shield provisioning script
- CLAUDE.md: service tree + internal ports
Trusted-LAN mode. Secrets live only on .100 /var/lib/hobbs-organizer/secrets (not in git).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E9NnVEico3WvFxLyjy1iW3
2026-11-04 18:27:22 -06:00

18 lines
1.2 KiB
Bash

#!/usr/bin/env bash
# Usage: provision-shield.sh <ip> <base_url> (bash port of configure-shield.ps1, trusted-LAN http)
set -euo pipefail
D="$1:5555"; URL="$2"; PKG=com.dayline.tv; APK=/home/glyptic/hobbs-shield/Hobbs-Family-Organizer-Local-v1.4.apk
adb connect "$D" >/dev/null; [ "$(adb -s "$D" get-state)" = device ]
echo "before: $(adb -s "$D" shell dumpsys package $PKG | grep -m1 versionName)"
adb -s "$D" shell run-as $PKG ls files
adb -s "$D" install -r "$APK"
echo "after: $(adb -s "$D" shell dumpsys package $PKG | grep -m1 versionName)"
put() { printf '%s' "$2" | adb -s "$D" shell "run-as $PKG sh -c 'umask 077; cat > files/.$1.new && chmod 600 files/.$1.new && mv files/.$1.new files/$1'"; }
put base_url "$URL"
adb -s "$D" shell "run-as $PKG rm -f files/access_token"
put allow_insecure_http enabled
adb -s "$D" shell run-as $PKG ls -l files
FG=$(adb -s "$D" shell dumpsys activity activities | grep -m1 mResumedActivity); echo "foreground: $FG"; echo "$FG" | grep -q -E "com.dayline.tv|launcher|tvlauncher|projengmenu" || { echo SKIP-LAUNCH: TV in use; exit 0; }
adb -s "$D" shell am force-stop $PKG
adb -s "$D" shell am start -W -n $PKG/.MainActivity | grep -E 'Status|Activity'