diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a93d558..ab48895 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,4 +22,26 @@ jobs: - name: Run unit tests run: python -m unittest discover -s tests -v - name: Check shell scripts - run: bash -n install.sh configure.sh run_monitor.sh run_dashboard.sh + run: bash -n install.sh configure.sh run_monitor.sh run_dashboard.sh clients/webos/renew-devmode.sh clients/webos/install-renewal-timer.sh + + webos-package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "16.20.2" + - name: Install LG webOS CLI + run: npm install -g @webos-tools/cli + - name: Package UplinkWitness TV + run: | + mkdir -p dist/webos + ares-package ./clients/webos + mv com.lucaxtech.app.uplinkwitness_*.ipk dist/webos/ + ls -lh dist/webos/ + - name: Upload webOS IPK + uses: actions/upload-artifact@v4 + with: + name: uplinkwitness-tv-ipk + path: dist/webos/*.ipk + if-no-files-found: error diff --git a/clients/webos/README.md b/clients/webos/README.md new file mode 100644 index 0000000..e04e9c1 --- /dev/null +++ b/clients/webos/README.md @@ -0,0 +1,120 @@ +# UplinkWitness TV for LG webOS + +This directory contains the installable launcher shell for the UplinkWitness TV client. + +Primary physical target for the first validation is the LG OLED55E8PLA / webOS TV 4.x generation. The package deliberately uses a small ES5-compatible launcher and opens the TV interface served by the UplinkWitness host at `/wallboard?webos=1`. + +## Why a hosted UI + +The TV package provides the LG launcher integration, icon, persistent server address and fullscreen app container. The actual dashboard is served by the Raspberry Pi / Linux host. + +This keeps monitoring and presentation in one UplinkWitness version, avoids duplicating the diagnostic engine on the television, avoids cross-origin API plumbing, and allows dashboard improvements to arrive with normal UplinkWitness updates without reinstalling the IPK. + +The universal `/wallboard` browser fallback remains available even when the LG package is not installed. + +## Requirements + +On the TV: + +- LG Developer Mode app installed from the LG Content Store +- Developer Mode enabled +- TV and development computer on the same LAN + +On the development computer: + +- Node.js + npm +- current LG webOS CLI (`@webos-tools/cli`) + +Install the CLI: + + npm install -g @webos-tools/cli + ares -V + +## Package + +From the UplinkWitness repository root: + + ares-package ./clients/webos + +The expected package name begins with: + + com.lucaxtech.app.uplinkwitness_0.1.0_ + +CI also packages the client and publishes an `uplinkwitness-tv-ipk` workflow artifact so the exact tested IPK can be installed without rebuilding it locally. + +## Register the TV + +In the Developer Mode app on the TV, enable Developer Mode and Key Server. Note the TV LAN IP and the six-character passphrase shown by the app. + +Then on the development computer: + + ares-setup-device --add livingroom-tv -i "host=TV_IP" -i "port=9922" -i "username=prisoner" + ares-novacom --device livingroom-tv --getkey + +Enter the passphrase shown on the TV when requested. + +Check connectivity: + + ares-setup-device --list + +## Install and launch + +Replace the package filename with the one produced by `ares-package` or downloaded from CI: + + ares-install --device livingroom-tv ./com.lucaxtech.app.uplinkwitness_0.1.0_all.ipk + ares-launch --device livingroom-tv com.lucaxtech.app.uplinkwitness + +The first launch asks for the UplinkWitness server URL. Enter the address shown by `install.sh` on the monitored host, for example: + + http://your-host.local:8080 + +If mDNS is not resolved by the TV, use the host LAN address instead: + + http://192.168.x.x:8080 + +The launcher intentionally does not ship with an installation-specific hostname prefilled. The server address is stored locally by the TV app after a successful configuration and survives normal app restarts. + +A small **Server settings** button remains available in the launcher shell for the Magic Remote pointer. The Yellow key is also accepted as a shortcut when the launcher shell itself has keyboard focus; it is not relied on as the only recovery path. + +## TV controls + +Inside the UplinkWitness TV interface: + +- Left / Right: switch Overview, Network, Router, Incidents +- Magic Remote pointer: tabs remain clickable +- Back while inside a secondary section: return to Overview +- Magic Remote `Server settings`: reopen the saved-host configuration + +## Compatibility rules + +The TV UI intentionally avoids: + +- CSS Grid +- JavaScript modules +- arrow functions / modern-only syntax +- external JavaScript or CDN dependencies +- direct monitoring logic on the TV + +The graphics target is 1920x1080. + +## Developer Mode renewal + +LG Developer Mode sessions expire unless they are extended. With the current `@webos-tools/cli`, renewal is performed by launching the Developer Mode app with the extension parameter: + + ares-launch --device livingroom-tv com.palmdts.devmode -p "extend=true" + +This command has been physically validated on the OLED55E8PLA and returned the displayed remaining session to approximately 1000 hours. + +For an always-on Raspberry Pi or Linux host, first register the TV and retrieve its key for the same Linux user that runs UplinkWitness. Then install the included weekly systemd timer: + + ./clients/webos/install-renewal-timer.sh livingroom-tv + +The installer performs one real renewal before installing anything, copies the renewal helper to `/usr/local/lib/uplinkwitness/`, and enables `uplinkwitness-webos-renew.timer`. The timer renews approximately once per week and also schedules an attempt after the Linux host boots. + +Useful checks: + + systemctl list-timers uplinkwitness-webos-renew.timer + sudo systemctl start uplinkwitness-webos-renew.service + journalctl -u uplinkwitness-webos-renew.service + +The timer contains no TV IP address or host-specific UplinkWitness URL. It uses the webOS device alias already registered by `ares-setup-device` for the Linux user. diff --git a/clients/webos/appinfo.json b/clients/webos/appinfo.json new file mode 100644 index 0000000..212bdcf --- /dev/null +++ b/clients/webos/appinfo.json @@ -0,0 +1,15 @@ +{ + "id": "com.lucaxtech.app.uplinkwitness", + "version": "0.1.0", + "vendor": "Luca Serioli", + "type": "web", + "main": "index.html", + "title": "UplinkWitness TV", + "appDescription": "TV client for the UplinkWitness connection black box", + "icon": "icon.png", + "largeIcon": "largeicon.png", + "iconColor": "#111827", + "resolution": "1920x1080", + "handlesRelaunch": true, + "transparent": false +} diff --git a/clients/webos/icon.png b/clients/webos/icon.png new file mode 100644 index 0000000..50fd8cf Binary files /dev/null and b/clients/webos/icon.png differ diff --git a/clients/webos/index.html b/clients/webos/index.html new file mode 100644 index 0000000..f962a98 --- /dev/null +++ b/clients/webos/index.html @@ -0,0 +1,141 @@ + + +
+ + +