Offline CUPS from the normal menu, local-file sites, build-dep install

- CUPS (Addons -> CUPS Printing, from ./install.sh or the Web UI) now
  installs from the offline bundle by itself when the kiosk can't reach
  the Ubuntu archive: lib/config.sh's run_with_offline_fallback switches
  apt to the bundle (kiosk-offline-apt on) around the install and back
  afterwards. No-op on manual installs or when online.
- Fix cups_is_installed reporting "not installed" for an installed CUPS:
  `dpkg -l | grep -q` under install.sh's pipefail fails when grep exits
  early and dpkg takes SIGPIPE. Uses dpkg-query on the one package now.
- Sites: an absolute path (/home/kiosk/docs/menu.pdf) is accepted and
  turned into a percent-encoded file:// URL, identically in the Sites
  menu (sites_parse_url) and the Web UI (parseUrl, with tests). Electron
  42 shows local HTML, PDFs (built-in viewer) and images as-is.
- iso/build-iso.sh checks its build tools (plus the --offline ones) and
  offers to `sudo apt install` what's missing; --install-deps does it
  without asking. --offline now refuses non-amd64 hosts up front.

Tested: offline chroot of the 26.04.1 server filesystem - action_install_cups
installed CUPS + printer-driver-all/hplip/gutenprint from the bundle with
no network and left apt back on normal sources; webui test suite passes;
Electron 42 rendered a file:// PDF and PNG with spaces/# in the path;
build-iso.sh stopped with the install command when apt-utils was missing
and no TTY, and installed it and built the ISO with --install-deps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cjz8a58eB5P9sUweqd3NHm
This commit is contained in:
Claude
2026-10-03 13:29:04 +00:00
parent 0b5d958fcc
commit 5792e201b6
9 changed files with 119 additions and 31 deletions
+13 -11
View File
@@ -69,7 +69,6 @@ boot of the installed system it runs `./install.sh` automatically on the
console.
```bash
sudo apt install xorriso curl git openssl
git clone https://github.com/outis1one/ubuntu-based-kiosk.git
cd ubuntu-based-kiosk
iso/build-iso.sh # downloads + verifies the latest 26.04.x server ISO
@@ -77,6 +76,10 @@ iso/build-iso.sh # downloads + verifies the latest 26.04.x server ISO
sudo dd if=iso/build/ubuntu-26.04.*-kiosk-amd64.iso of=/dev/sdX bs=4M status=progress oflag=sync
```
The script checks for its build tools (`xorriso`, `curl`, `git`, `openssl`)
and offers to install any that are missing with `sudo apt install`. Pass
`--install-deps` to install them without asking.
By default the installer only asks for **network** (WiFi works here),
**disk**, and your **admin username/password** — language, keyboard and the
SSH server are answered for you. On first boot, `install.sh` runs
@@ -100,8 +103,7 @@ Useful options (`iso/build-iso.sh --help` for all):
### Offline installs (`--offline`)
```bash
sudo apt install apt-utils python3 gnupg ubuntu-keyring # once, on top of the tools above
iso/build-iso.sh --offline
iso/build-iso.sh --offline # also offers to install apt-utils, python3, gnupg, ubuntu-keyring
# -> iso/build/ubuntu-26.04.x-kiosk-offline-amd64.iso (~3.2 GB)
```
@@ -114,14 +116,10 @@ This adds a ~420 MB bundle to the ISO:
On first boot it still installs online when there's internet. With none,
it waits 90 seconds and then installs entirely from the bundle. The bundle
stays on the kiosk at `/opt/kiosk-offline`, so CUPS can be added later
with no internet too:
```bash
sudo kiosk-offline-apt on # apt uses the bundle only
./install.sh # Addons -> CUPS Printing
sudo kiosk-offline-apt off # back to normal updates
```
stays on the kiosk at `/opt/kiosk-offline`, so **Addons → CUPS Printing**
(in `./install.sh` or the Web UI) works with no internet too: when it can't
reach the Ubuntu archive, it installs from the bundle by itself and then
switches apt back to normal.
Notes:
- Build it on an **amd64** Ubuntu/Debian machine, or let the GitHub
@@ -195,6 +193,10 @@ The kiosk machine still needs a working internet connection (ethernet, or WiFi c
- **Home URL** - Auto-return after inactivity on manual or hidden sites
- **Pause functionality** - Temporarily pause rotation (configurable per-site)
- **Navigation menu** - Quick access to all sites via key icon (top-left hot corner)
- **Local files** - Enter an absolute path (e.g. `/home/kiosk/docs/menu.pdf`)
instead of a web address and it's shown from the kiosk's own disk:
HTML pages, PDFs (built-in viewer), and images. Works offline. The file
must be readable by the `kiosk` user.
### Touch Controls
- **2-finger horizontal swipe** - Switch between sites