Compare commits

...
182 Commits
Author SHA1 Message Date
Claude c1370edc3e Migrate Display & Interaction menu; drop version number from installer filename; bump to v2.0.0
- menus/display.sh: second menu migrated onto lib/menu.sh + lib/config.sh,
  covering touch gesture mode, link navigation security, and the
  pause/keyboard/navigation button toggles (previously three separate
  Core Settings entries). Deliberately a different shape from Sites
  (toggle list vs. list CRUD) to exercise the framework more broadly.
  Wired into install.sh's top-level menu alongside Sites.

- Renamed ubuntu-based-kiosk-v1.0.3.sh -> ubuntu-based-kiosk.sh so the
  installer can be updated in place instead of growing a new
  version-numbered filename every release; released versions are now
  tracked via git history and the in-script changelog. Updated all
  Readme download/re-run commands accordingly. Older versioned files
  (ubuntu-based-kiosk-v*.sh, install_kiosk_*.sh) are left in place as
  archived releases.

- Bumped SCRIPT_VERSION to 2.0.0 (new script-level changelog entry) and
  the Readme version/changelog to match, given the new modular
  management path, the rename, and the two real bugs fixed along the
  way (settings clobbered on save, off-by-one in reorder).

Verified before moving on to the web admin work:
- Regression: re-ran the full Sites scratch-config test suite (add,
  edit, delete, reorder, home) - still clean, no invalid-input paths hit.
- New: scratch-config test for every display.sh action (touch mode,
  navigation security, all three toggles), confirming values persist
  through save/reload and that a previously-added site survives
  untouched across Display-menu saves.
- End-to-end: ran the real install.sh (not just sourced functions) as a
  genuine non-root, non-"kiosk" user with real sudo, driving actual menu
  input through Sites -> add a page -> Display -> toggle a setting ->
  exit. Confirmed final config.json on disk matches every action taken,
  and both guard clauses (run as root; no installed kiosk found) fire
  correctly.
2026-08-18 15:48:21 +00:00
Claude 21a0768c8c Add modular menu framework, migrate Sites & Page Timing onto it
Start of pulling the menu system out of the 12k-line single-file
installer so individual menus can change without risking the rest of
the script (network, VNC, addons, etc). This is groundwork for the
planned web-based management UI, which will share the same lib/config.sh
read/write layer instead of duplicating it.

- lib/menu.sh: generic numbered-menu framework (auto-numbered entries,
  "0" always exits/returns) plus the validated input helpers menus need.
- lib/config.sh: single load/save for config.json. Fixes a latent bug
  where the old Sites menu wrote config.json without first loading
  swipe/navigation/lockout settings, silently resetting them to
  defaults on save.
- menus/sites.sh: Sites & Page Timing fully migrated - add/edit/delete/
  reorder pages, set duration (auto-rotate/manual/hidden) and home page.
  Also fixes an off-by-one in the ported reorder logic (moving an item
  landed one slot short of the requested position) caught by testing.
- install.sh: new entry point for managing an already-installed kiosk
  via `git clone` + `./install.sh`, wired to the Sites menu. Does not
  yet replace first-time provisioning, which still uses the existing
  single-file installer.

All new site CRUD/reorder/home-page paths were exercised against a
scratch config.json (add with/without basic auth, edit duration, set
home + timeout, 2- and 3-item reorders in both directions, delete) to
confirm the resulting config.json matches expectations.
2026-08-18 15:26:16 +00:00
Outis ccf73d41bd Merge pull request #110 from outis1one/claude/offline-install-readme-kfpr5u
Claude/offline install readme kfpr5u
2026-08-02 19:46:41 -04:00
Claude 10c4c22f44 Route audio to HDMI automatically when an external display is connected
Previously nothing switched PipeWire's default sink, so audio always stayed on the laptop/built-in speakers regardless of HDMI mirroring. Adds /usr/local/bin/kiosk-audio-route.sh, which finds a sink whose name contains 'hdmi' and makes it the default (moving any already-playing streams onto it) whenever an external display is connected, falling back to the non-HDMI sink when it isn't. Called from autostart once PipeWire is confirmed ready, and from kiosk-hotplug.sh alongside the existing display mirroring on every plug/unplug event. Documents the behavior and manual fallback in the README.
2026-08-02 22:54:23 +00:00
Claude 6f6d34512e Mirror external display at the kiosk's exact resolution, not its own native mode
Previously mirroring used 'xrandr --auto', which picks the external output's own native resolution (e.g. a TV's 1920x1080) rather than matching the kiosk/laptop panel's resolution. Extracts the shared mirroring logic (previously duplicated between autostart and the hotplug handler) into /usr/local/bin/kiosk-mirror-display.sh, which now checks whether the external output natively lists the primary's resolution and uses it directly, or generates a matching mode with cvt and forces it via --newmode/--addmode when it doesn't. Documents the behavior and a manual fallback for displays that reject non-native CVT timings in the README.
2026-08-02 22:51:08 +00:00
Claude f01781de41 Add live HDMI/display hotplug handling via udev + systemd
Adds a udev rule (DRM 'change' events) that triggers a new kiosk-hotplug.service, which re-runs the same xrandr mirroring logic as the Openbox autostart script. External displays plugged in after boot now get mirrored without requiring a login or lightdm restart. Named kiosk-hotplug (not kiosk-display-*) to avoid collision with the existing kiosk-display-* wildcard cleanup in remove_all_schedules(). Also removes the udev rule during Complete Uninstall and documents the behavior in the README.
2026-08-02 22:37:39 +00:00
Claude 68a7345f5b Mirror external HDMI/monitor output onto primary display automatically
Openbox autostart now detects any connected output beyond the primary and mirrors the kiosk content onto it via xrandr, instead of leaving detected-but-unused external displays dark. Also documents the behavior, its limitation (applies at session start, not live hotplug), and adds an HDMI troubleshooting section to the README.
2026-08-02 22:34:19 +00:00
Claude b5d37fa646 Install net-tools and ncdu; curl/git already covered
apt install already includes curl and git; adds net-tools and ncdu to the same idempotent apt install so they're present on fresh installs without duplicating already-installed packages.
2026-08-02 22:15:15 +00:00
Outis de9c97aa06 Merge pull request #109 from outis1one/claude/offline-install-readme-kfpr5u
Add offline/air-gapped download instructions to README
2026-08-02 18:11:50 -04:00
Claude ca00674e4c Add offline/air-gapped download instructions to README
Clarifies that the installer script can be downloaded on another machine and transferred via USB, while noting the kiosk machine still needs internet access during install for apt/npm packages.
2026-08-02 22:06:48 +00:00
Outis 0c809d7e53 Merge pull request #108 from outis1one/claude/brave-tesla-hwf1m8
Claude/brave tesla hwf1m8
2026-06-16 14:17:35 -04:00
Claude 29b5783052 Fix LightDM autologin on fresh server installs (nopasswdlogin group + missing config)
Two bugs caused the login screen to appear on new Ubuntu 24.04 server hardware:

1. Ubuntu 24.04's PAM config checks 'user ingroup nopasswdlogin', not 'autologin'.
   Add kiosk user to nopasswdlogin group (and autologin for older versions).

2. The upgrade path never wrote /etc/lightdm/lightdm.conf.d/10-kiosk.conf,
   so on new hardware running through upgrade the file simply didn't exist.

Refactor: extract configure_lightdm_autologin() shared helper called from
both fresh install (step 19/27) and upgrade, so both paths are consistent.
Also use [Seat:*] instead of [SeatDefaults] for forward compatibility.

https://claude.ai/code/session_01VQ13Fwq4MXxwThLfCXBeGr
2026-06-16 18:15:05 +00:00
Claude 91d905f45a Fix LightDM autologin on Ubuntu 22.04+ (new hardware)
[SeatDefaults] is silently ignored by LightDM on newer Ubuntu versions.
Replace with [Seat:*] which is the correct section name for Ubuntu 22.04+.

Also add the kiosk user to the autologin group, which newer Ubuntu
requires for passwordless autologin to work.

Without these fixes, LightDM shows the login screen instead of
auto-logging in and launching the kiosk app.

https://claude.ai/code/session_01VQ13Fwq4MXxwThLfCXBeGr
2026-06-16 18:04:36 +00:00
Outis de197f77d3 Merge pull request #107 from outis1one/claude/brave-tesla-hwf1m8
Fix all file existence checks to run as kiosk user
2026-06-16 13:40:01 -04:00
Claude 879e2ecd14 Fix all file existence checks to run as kiosk user
/home/kiosk is mode 700 so root cannot traverse it. Every [[ -f ]] or
[[ ! -f ]] check on paths inside /home/kiosk was silently returning
'not found' even after the kiosk user had successfully written the file.

Replace all three [[ ! -f "$electron_bin" ]] checks and the
[[ -f "$sandbox" ]] check in install_electron_binary with
sudo -u "$KIOSK_USER" test -f so they run in the kiosk user's
security context and can actually see the files.

https://claude.ai/code/session_01VQ13Fwq4MXxwThLfCXBeGr
2026-06-16 17:32:32 +00:00
Outis 8116fdf258 Merge pull request #106 from outis1one/claude/brave-tesla-hwf1m8
Restore chmod 644 on tmp zip so kiosk user can read it for unzip
2026-06-16 13:26:25 -04:00
Claude 56e3d17459 Restore chmod 644 on tmp zip so kiosk user can read it for unzip
Accidentally dropped this line when rewriting the extraction block.
mktemp creates the file as root:root 600, so sudo -u kiosk unzip
gets 'Permission denied' trying to open the zipfile.

https://claude.ai/code/session_01VQ13Fwq4MXxwThLfCXBeGr
2026-06-16 17:25:36 +00:00
Outis 35350d9908 Merge pull request #105 from outis1one/claude/brave-tesla-hwf1m8
Fix Electron binary extraction: chown dist/ before extracting as kios…
2026-06-16 13:21:17 -04:00
Claude 43266a4cf0 Fix Electron binary extraction: chown dist/ before extracting as kiosk user
The previous fix incorrectly ran unzip as root, which fails because
/home/kiosk is not accessible to root. The kiosk user is the right
actor for the extraction, but two things blocked it:

1. node_modules/electron/dist/ can be owned by root when npm's electron
   postinstall runs with --unsafe-perm, so the kiosk user gets
   'Permission denied' trying to write there. Fix: sudo chown -R the
   electron directory to the kiosk user before extracting.

2. With set -euo pipefail active (upgrade call had no || guard), a
   failed unzip or chmod would abort the script silently before the
   diagnostic error messages could print. Fix: add || true to both
   commands so the function always reaches the explicit -f check which
   prints the real error and returns 1. The upgrade call already has
   || { log_error ...; return 1; } from the previous commit.

https://claude.ai/code/session_01VQ13Fwq4MXxwThLfCXBeGr
2026-06-16 17:17:37 +00:00
Outis 6621f9221b Merge pull request #104 from outis1one/claude/brave-tesla-hwf1m8
Fix Electron binary extraction failing silently during upgrade
2026-06-16 13:13:09 -04:00
Claude 670b32f53c Fix Electron binary extraction failing silently during upgrade
Two bugs combined to cause the 'Electron binary download failed' error
even though the zip downloaded and unzip reported inflating all files:

1. The upgrade path called install_electron_binary bare (no ||), so
   set -euo pipefail was active inside the function. Any failing command
   (e.g. chmod on a file that wasn't written) killed the script before
   the error messages printed. Fresh install used || exit 1, which
   disables set -e inside the function body. Upgrade now uses
   || { log_error ...; return 1; } to match.

2. The unzip ran as the kiosk user, but node_modules/electron/dist/ can
   be owned by root when npm's electron postinstall script runs with
   --unsafe-perm. The kiosk user can't write there, so unzip's write
   errors go to stderr (not visible in the log) while inflating: lines
   still appear on stdout. The binary is never actually written.
   Fix: run mkdir/unzip/chmod as root, then chown -R to kiosk.

https://claude.ai/code/session_01VQ13Fwq4MXxwThLfCXBeGr
2026-06-16 17:11:56 +00:00
Outis c3ea52dda0 Merge pull request #103 from outis1one/claude/gifted-bohr-dfzdig
Fix permission denied on Electron zip: chmod 644 before kiosk-user unzip
2026-06-16 12:56:55 -04:00
Claude 174bbe46ae Fix permission denied on Electron zip: chmod 644 before kiosk-user unzip
mktemp creates the tmp zip owned by root with mode 600.
sudo -u kiosk unzip then fails with "Permission denied".
Add chmod 644 immediately after download so the kiosk user can read it.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 16:54:51 +00:00
Outis 572f0ed01b Merge pull request #102 from outis1one/claude/gifted-bohr-dfzdig
Detect pipe execution; show clear upgrade error instead of cryptic pa…
2026-06-16 12:50:00 -04:00
Claude b7e35c84c9 Detect pipe execution; show clear upgrade error instead of cryptic path failure
When the script is run via curl|bash or wget|bash, BASH_SOURCE[0] is a
pipe descriptor, not a real file. The upgrade function grep-extracts
heredocs from the script file, so it fails with a confusing path error.

Fixes:
- Set SCRIPT_FILE global at startup (empty string when piped)
- upgrade_kiosk() checks SCRIPT_FILE before asking "Continue?" and shows
  a clear message explaining how to download the script to a file first
- Removes the silent failure path (no more cryptic "Cannot find script at
  /proc/.../pipe:[...]" error)

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 16:45:58 +00:00
Outis 9a9352a9c2 Merge pull request #101 from outis1one/claude/gifted-bohr-dfzdig
Add unzip to apt packages; guard install_electron_binary against miss…
2026-06-16 12:40:25 -04:00
Claude 440b074245 Add unzip to apt packages; guard install_electron_binary against missing unzip
Fresh Ubuntu 24.04 minimal installs don't include unzip. The wget fallback
in install_electron_binary() downloaded the 120MB Electron zip successfully
but then failed on the unzip call. Two fixes:
1. Add unzip to the main apt install step so it's always present.
2. Auto-install unzip inside install_electron_binary() as a safety net for
   upgrades on existing systems that may not have it.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 16:39:36 +00:00
Outis 46d42b46c6 Merge pull request #100 from outis1one/claude/gifted-bohr-dfzdig
feat: match any touch screen for libinput (universal touch support)
2026-06-16 11:05:53 -04:00
Claude 27aaf5a15c feat: match any touch screen for libinput, not just Wacom "Finger" devices
Drop the MatchProduct "Finger" restriction from the xorg libinput rule,
leaving only MatchIsTouchscreen "on". MatchIsTouchscreen is set by udev
from hardware capabilities, so it matches finger touch screens of any
brand (ELAN, Goodix, eGalax, Wacom, etc.) while never matching keyboards,
mice, or pen/stylus digitizers (which are tagged as tablets, not
touchscreens). This makes the script work on any touch hardware without
hardcoding device names. Behavior on existing Wacom machines is unchanged
since their finger device matched either way.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 15:05:28 +00:00
Outis 981aaf2b6b Merge pull request #99 from outis1one/claude/gifted-bohr-dfzdig
fix: touchscreen input — keyring grab + libinput multitouch driver
2026-06-16 10:53:13 -04:00
Claude 66a633b22c fix: resolve touch input with keyring flag + libinput driver
Two genuinely separate root causes were behind the dead touchscreen:

1. GNOME keyring grab — under LightDM autologin the keyring stays locked.
   When Chromium accessed it, the gcr-prompter unlock dialog grabbed all
   keyboard and touch input at the X level. The app rendered (timers ran)
   but ignored every tap and keypress. Fix: --password-store=basic stops
   Electron from using the keyring, so the dialog never appears.

2. Wacom driver single-touch emulation — the wacom X driver only does
   single-touch pointer emulation and never passes real multitouch to
   Chromium, so 1-finger and 2-finger swipe gestures could not fire.
   Fix: force the finger touch device to the libinput driver via
   /etc/X11/xorg.conf.d/99-finger-libinput.conf. libinput delivers proper
   XI2 multitouch which Chromium turns into real JS touch events. The
   pen/stylus stays on the wacom driver.

Removed the earlier dead-end attempts (xsetwacom MapToOutput / CTM reset,
Wacom Enable Touch Gesture, 99-wacom-touch.conf) which were all chasing the
wrong cause while the keyring grab masked any real testing. The upgrade path
removes the stale 99-wacom-touch.conf so it can't override libinput.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 14:52:31 +00:00
Claude 4e7fbe497c fix: use xsetwacom MapToOutput instead of xinput set-prop for CTM
The Wacom driver owns the Coordinate Transformation Matrix and silently
overrides any xinput set-prop changes. xsetwacom MapToOutput tells the
driver to recalculate the CTM for the primary connected output, which is
the correct API and persists across driver resets.

Dynamically detects the primary output (eDP1, HDMI1, DP1, etc.) so the
fix works on any machine without hardcoding a display name.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 13:55:09 +00:00
Outis f7f1624e02 Merge pull request #98 from outis1one/claude/gifted-bohr-dfzdig
fix: reset Coordinate Transformation Matrix so touches land on correct screen coordinates
2026-06-16 09:45:08 -04:00
Claude 3315ccc44a fix: reset Coordinate Transformation Matrix to identity in start.sh
The Wacom driver can initialise the CTM to all-zeros, which maps every
touch event to screen coordinate (0,0). The touchscreen appears completely
dead even though the hardware and kernel are working correctly.

Reset the CTM to the identity matrix for every touch/finger device at
startup, before launching Electron, so coordinates are always correct.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 13:44:50 +00:00
Outis c58addcecb Merge pull request #97 from outis1one/claude/gifted-bohr-dfzdig
fix: correct xorg MatchProduct glob pattern for Wacom touch config
2026-06-16 09:13:53 -04:00
Claude 14172782c9 fix: correct xorg MatchProduct glob — Wacom*Finger* not Wacom.*Finger
xorg uses fnmatch (shell glob) for MatchProduct, where . is a literal
dot. Wacom.*Finger never matched "Wacom HID 48E3 Finger touch" because
there is no literal dot in that string. Wacom*Finger* matches correctly.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 13:13:41 +00:00
Outis 279dcd2b66 Merge pull request #96 from outis1one/claude/gifted-bohr-dfzdig
fix: xorg.conf.d Wacom touch mode — driver starts in XI2 touch event mode
2026-06-16 09:08:50 -04:00
Claude 5cbade03d7 fix: add xorg.conf.d Wacom touch config so driver starts in touch event mode
Without /etc/X11/xorg.conf.d/99-wacom-touch.conf the Wacom driver initialises
the finger touch device in pointer emulation mode (generating RawButtonPress/
RawButtonRelease/RawMotion). Electron never sees TouchBegin/TouchEnd events so
touchstart/pointerdown(touch) never fire in the renderer.

Setting Option "Gesture" "on" and Option "Touch" "on" at the driver level means
the device initialises in XI2 touch mode on every X server start, regardless of
any post-init xinput set-prop calls.

Added to both fresh install (step 18) and upgrade function.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 13:08:38 +00:00
Outis 73eed4a123 Merge pull request #95 from outis1one/claude/gifted-bohr-dfzdig
fix: export XAUTHORITY in start.sh so touch init never fails with auth error
2026-06-16 08:57:35 -04:00
Claude 95027fe6fe fix: export XAUTHORITY in start.sh so xinput touch init never hits auth error
Without XAUTHORITY set, xinput can fail with "Authorization required"
if the display manager doesn't propagate it through the session environment.
Hardcode the kiosk user's .Xauthority path to guarantee xinput works.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 12:57:21 +00:00
Outis 8b9d688993 Merge pull request #94 from outis1one/claude/gifted-bohr-dfzdig
chore: restore original ubuntu-based-kiosk-v1.0.2.sh alongside v1.0.3
2026-06-15 22:29:29 -04:00
Claude 55039c510b chore: restore original ubuntu-based-kiosk-v1.0.2.sh alongside v1.0.3
Keep v1.0.2 in the repo as a stable fallback while v1.0.3 touch screen
support is being validated on different hardware.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 02:27:13 +00:00
Outis 7f54944ad8 Merge pull request #93 from outis1one/claude/gifted-bohr-dfzdig
Claude/gifted bohr dfzdig
2026-06-15 22:24:24 -04:00
Claude 00dd806e9c chore: bump version to v1.0.3 and rename script file
Update all version strings (header, SCRIPT_VERSION, JS VERSION constant)
and rename ubuntu-based-kiosk-v1.0.2.sh → ubuntu-based-kiosk-v1.0.3.sh.
Update README with v1.0.3 change log and archive v1.0.2 as previous.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 02:23:43 +00:00
Claude 6f18a2f897 fix: detect touch screens dynamically instead of hardcoding Wacom device name
The xinput loop now scans all input devices at startup, matches anything
with "touch" or "finger" in the name (excluding touchpads/trackpads), and
attempts to enable Wacom touch gestures on each match. Non-Wacom devices
silently ignore the set-prop call, so the loop is safe on any hardware.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 02:21:09 +00:00
Outis 93b944fdb8 Merge pull request #92 from outis1one/claude/gifted-bohr-dfzdig
fix: enable Wacom touch gestures on startup and update start.sh on up…
2026-06-15 22:20:24 -04:00
Claude c18615a78e fix: enable Wacom touch gestures on startup and update start.sh on upgrade
Add xinput call to start.sh so Wacom HID 48E3 touch gesture support is
initialized every time the kiosk starts, not just after lightdm restarts.
Also add start.sh to the upgrade extraction list so it is updated in place
instead of keeping the stale version from the original install.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 02:19:03 +00:00
Outis dcf3ba11c7 Merge pull request #91 from outis1one/claude/gifted-bohr-dfzdig
fix: add PointerEvent fallback for swipe detection
2026-06-15 22:02:00 -04:00
Claude 37663be91b fix: add PointerEvent fallback for swipe detection
touchstart/touchend never fire on this device (confirmed by zero [TOUCH]
log entries). The activity tracker already uses pointerdown/pointerup and
works fine, proving PointerEvents reach the preload. Added pointer event
handlers that mirror the touch handlers for all gestures (2-finger swipe,
3-finger toggle, 1-finger arrow keys). A 500ms debounce on the IPC send
prevents double-firing on devices where both event types fire.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 01:59:25 +00:00
Outis 690f2daf3c Merge pull request #90 from outis1one/claude/gifted-bohr-dfzdig
revert: restore v1.0.0 touch handler approach for two-finger swipe
2026-06-15 21:55:10 -04:00
Claude 8f886854f2 revert: restore v1.0.0 touch handler approach for two-finger swipe
capture:true and --touch-events=enabled were added to handle Authelia's
login page blocking touch events. Authelia now auto-logs in on startup
so the login page never shows. Reverting to the v1.0.0 approach (passive:true
only, no --touch-events flag) which had working two-finger swipe.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 01:52:46 +00:00
Outis 22fb77581c Merge pull request #89 from outis1one/claude/gifted-bohr-dfzdig
fix: add --touch-events=enabled to Electron launch flags
2026-06-15 21:41:57 -04:00
Claude f40d8e337c fix: add --touch-events=enabled to Electron launch flags
With --ozone-platform=x11, Chromium defaults touch event detection to
'auto' and may not identify the hardware as a touchscreen, so touchstart/
touchend never fire in the renderer. --touch-events=enabled forces W3C
touch events on unconditionally, restoring two-finger swipe navigation.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 01:16:58 +00:00
Outis b92180c4b2 Merge pull request #88 from outis1one/claude/gifted-bohr-dfzdig
fix: preserve node_modules during upgrade to avoid re-downloading Ele…
2026-06-15 20:56:00 -04:00
Claude d595464400 fix: preserve node_modules during upgrade to avoid re-downloading Electron
The upgrade was wiping node_modules then relying on npm to re-download the
~120MB Electron binary. npm returns exit 0 even when the download times out,
leaving the kiosk with no Electron binary and a blank screen on next boot.

node_modules only needs to be deleted on a fresh install or when explicitly
changing Electron version. For a JS-file-only upgrade, npm install without
a wipe is either a no-op (no changes) or applies dependency updates cleanly.
The install_electron_binary fallback remains as a safety net.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 00:52:22 +00:00
Outis 69be816dfe Merge pull request #87 from outis1one/claude/gifted-bohr-dfzdig
fix: use sudo to remove root-owned config backup after upgrade
2026-06-15 20:40:52 -04:00
Claude 543a442775 fix: use sudo to remove root-owned config backup after upgrade
Backup is created with sudo cp (owned by root), so the cleanup rm -f
fails with "Operation not permitted" when run without sudo.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 00:39:53 +00:00
Outis 3f1984f9fa Merge pull request #86 from outis1one/claude/gifted-bohr-dfzdig
docs: update Authelia setup instructions to use MERGE workflow
2026-06-15 20:32:36 -04:00
Claude 3d5a5839b3 fix: use capture:true on touch event listeners to prevent page JS interference
Touch handlers used bubble phase (no capture:true), so any page script that
called stopPropagation() on touchstart/touchend — e.g. Authelia's login form
or scroll containers — silently blocked the preload's swipe detection.

Using capture:true fires the preload's listeners in the capture phase (before
any element-level handlers), so swipe works even on pages with their own
touch handling. Applied to both preloads (standard and auto-show keyboard).

Also adds missing [TOUCH] 2-finger HORIZONTAL console.log to the standard
preload so swipe events are visible in electron.log for debugging.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 00:31:14 +00:00
Claude 31eb750514 docs: clarify Authelia access_control merge with before/after example
The duplicate-block pitfall (YAML silently ignores duplicate keys, causing
a white screen) is now called out explicitly in both the script's printed
output and the README. Added a before/after example showing the correct
merged result with the kiosk one_factor rule above the two_factor wildcard.
Also explains why one_factor is required (TOTP/WebAuthn need interactive
second step, impossible via API).

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 00:25:11 +00:00
Claude effb726979 fix: add 10-second timeout to Authelia fetch to prevent white screen
Without a timeout, session.defaultSession.fetch() hangs for 1-2 minutes
on TCP timeout when Authelia is unreachable (wrong URL, server down,
firewall). Since createWindow() awaits autheliaAuthenticate(), the main
window is visible but no BrowserView is attached during that wait —
causing a persistent white screen with ibeam cursor.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-16 00:15:18 +00:00
Claude 0eef318e78 docs: update Authelia setup instructions to use MERGE workflow
- Step 3 now says MERGE (not replace/append) with clear warning to keep existing config
- access_control: kiosk one_factor rule must go ABOVE any existing two_factor rule,
  with explanation that Authelia applies rules top-down (first match wins)
- session block: keep existing values; only add the block if none exists yet
- Kiosk can only do one_factor — TOTP/WebAuthn via API is not possible
- Updated in both configure_authelia() printed output and README Authentication section

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-15 23:55:53 +00:00
Outis 09dfcd40af Merge pull request #85 from outis1one/claude/gifted-bohr-dfzdig
fix: shared install_electron_binary() covers both fresh install and u…
2026-06-15 19:39:31 -04:00
Claude 0b52ec27fb fix: shared install_electron_binary() covers both fresh install and upgrade
The upgrade_kiosk() path deleted node_modules then ran npm install but
never checked the binary or set chrome-sandbox permissions — so every
upgrade produced a blank screen.

Changes:
- Extract electron binary verification, fallback downloads, and
  chrome-sandbox chmod 4755 into a shared install_electron_binary()
  function called by both step 17/27 (fresh install) and step 5/6
  (upgrade_kiosk) so neither path can silently skip the permission fix
- Add repair_electron() function: stops display, re-runs
  install_electron_binary, restarts lightdm — no SSH needed
- Wire repair_electron as Advanced menu option 12 "Fix Blank Screen"

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-15 23:38:37 +00:00
Outis b003daba85 Merge pull request #84 from outis1one/claude/gifted-bohr-dfzdig
fix: robust Electron binary download with timeouts, retry, and wget f…
2026-06-15 19:35:57 -04:00
Claude bd4d4cadc8 fix: robust Electron binary download with timeouts, retry, and wget fallback
The ~120MB Electron binary download was silently failing because npm's
default 60s fetch timeout is too short on slower connections.

Changes to step 17/27:
- Set npm fetch-timeout to 600s and retries to 5 before running npm install
- If binary still missing after npm install, retry via install.js with
  ELECTRON_FORCE_DOWNLOAD=true
- If still missing, fall back to direct wget download of the exact
  versioned zip from GitHub releases (300s timeout, 3 tries, shows progress)
- Exit 1 with clear message if all three attempts fail
- Log chrome-sandbox permission step for visibility

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-15 23:34:00 +00:00
Outis 66ec66362f Merge pull request #83 from outis1one/claude/gifted-bohr-dfzdig
Claude/gifted bohr dfzdig
2026-06-15 19:20:56 -04:00
Claude 2556863129 fix: use sudo for all config.json access in configure_authelia
/home/kiosk/ has 750 permissions so the install user can't read inside
it. The -f check and both jq reads were running as the current user and
failing silently, causing the false "config.json not found" error.

Changed:
  [[ ! -f "$config_file" ]]  →  sudo test -f "$config_file"
  jq -r ... "$config_file"   →  sudo -u kiosk jq -r ... "$config_file"
  jq ... > "$tmp"            →  sudo -u kiosk jq ... > "$tmp" && sudo mv

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-15 23:20:14 +00:00
Claude 4c3f5576b9 fix: detect and retry Electron binary download when npm install silently fails
npm install returns 0 even when Electron's postinstall binary download
fails, leaving node_modules/electron/dist/electron missing and causing
a blank screen with no useful error.

After npm install, explicitly check for the binary. If absent, retry
via ELECTRON_FORCE_DOWNLOAD=true node install.js. If still missing,
print a clear error and exit 1 instead of silently continuing to a
broken install.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-15 22:52:49 +00:00
Outis 7634ddbaaf Merge pull request #82 from outis1one/claude/gifted-bohr-dfzdig
Claude/gifted bohr dfzdig
2026-06-15 11:56:26 -04:00
Claude f1febbd914 release: v1.0.2 - Authelia auto-login, pipewire fix, dynamic README
New file ubuntu-based-kiosk-v1.0.2.sh containing all changes made
since v1.0.1:
- Authelia auto-login addon (Addons → 5): AES-256 encrypted credentials,
  startup API auth, full Dockerized server-side setup printed on save
- Fix: PipeWire .config dirs created as root caused Permission denied
  at step [5.5/27] on fresh Ubuntu 24.04 minimal installs
- README install commands now pull latest script dynamically via
  GitHub contents API (no more hardcoded version numbers)

SCRIPT_VERSION and VERSION constants updated to 1.0.2.
README changelog and current version updated to 1.0.2.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-15 14:57:51 +00:00
Claude 05538611cf docs: add Authelia server-side setup guide to script output and README
After configure_authelia() saves credentials, it now prints the full
Dockerized Authelia server-side checklist: argon2 hash generation
command, users.yml kiosk user template, configuration.yml session
duration and access_control rules, and a docker compose restart step.

README gains a new Authentication section under Optional Add-ons
covering the same steps in Markdown with a table comparing Authelia
SSO vs HTTP Basic Auth (both can coexist).

Also clarifies that the Authelia password is encrypted at rest and
not stored in plain text.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-15 14:49:32 +00:00
Claude 2a5fb6188b feat: Authelia auto-login with machine-ID-bound AES-256 encryption
Adds an Authelia Auto-Login addon (Addons menu → 5) that:
- Prompts for Authelia URL, username, and password
- Encrypts the password with AES-256-CBC keyed from /etc/machine-id
  via scrypt (the encrypted blob is machine-specific and useless elsewhere)
- Stores autheliaURL, autheliaUsername, autheliaEncryptedPassword in config.json

On every kiosk startup, main.js decrypts the password and calls
Authelia's /api/firstfactor with keepMeLoggedIn:true before any
BrowserViews are created. Electron's session.defaultSession handles
the Set-Cookie response automatically, so all sites load already
authenticated.

To set up credentials via SSH:
  ssh user@kiosk
  ./ubuntu-based-kiosk-v*.sh  →  Addons → 5. Authelia Auto-Login

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-15 14:35:41 +00:00
Outis b956af05e2 Merge pull request #81 from outis1one/claude/gifted-bohr-dfzdig
fix: create pipewire config dirs as kiosk user to avoid permission de…
2026-06-15 10:12:29 -04:00
Claude 42aafff219 fix: create pipewire config dirs as kiosk user to avoid permission denied
sudo mkdir -p created the .config/pipewire/pipewire.conf.d directories
owned by root, causing the subsequent sudo -u kiosk tee to fail with
"Permission denied" at step [5.5/27] on a fresh install.

Switching to sudo -u kiosk mkdir -p ensures the directories are owned
by the kiosk user before the tee writes into them.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-15 14:11:56 +00:00
Outis 44b04067ce Merge pull request #80 from outis1one/claude/gifted-bohr-dfzdig
docs: remove hardcoded version numbers from install instructions
2026-06-15 09:47:03 -04:00
Claude c2d9b34d53 docs: remove hardcoded version numbers from install instructions
Quick Install section now queries the GitHub contents API to find and
download the latest ubuntu-based-kiosk-v*.sh script dynamically, so the
README never needs a manual version bump when a new release is pushed.

Post-install "run again" references use `ls ubuntu-based-kiosk-v*.sh | sort -V | tail -1`
for the same reason.

Also bumps version references from 1.0.0 → 1.0.1, Electron 41 → 42,
Node.js 20 → 22, and adds the v1.0.1 changelog entry.

https://claude.ai/code/session_01EyjEQLWbTXcZgbMDarf7NU
2026-06-15 13:45:26 +00:00
Outis 91515e5dff Merge pull request #79 from outis1one/claude/fix-kiosk-upgrade-script-zHQ5X
Claude/fix kiosk upgrade script z hq5 x
2026-06-02 22:53:16 -04:00
Outis 8b13426215 Merge pull request #78 from outis1one/claude/ecstatic-bohr-SERdJ
Add v1.0.1: update Node.js 20→22 LTS and Electron 39→42
2026-06-02 21:18:01 -04:00
Claude dc8f2b3a9c Add v1.0.1: update Node.js 20→22 LTS and Electron 39→42
Node.js 20 reached EOL April 2026; bumps nodesource setup to 22.x.
Electron pin updated from ^39.2.4 to ^42.0.0 (current stable).

https://claude.ai/code/session_0143uHgfTvF3Pv1oDinkhJRX
2026-06-03 01:16:43 +00:00
Claude 11173bbcda Add --allow-server-ssh --disable-ssh-auth to netbird up commands
NetBird v0.60 changed SSH to JWT/IdP-based auth by default.
Using --disable-ssh-auth keeps access controlled purely by NetBird
ACL policies (machine-level, like pre-v0.60 behaviour) without
requiring an identity provider or OIDC flow.

https://claude.ai/code/session_01M3tiofbGfmTddeMcXr8nXr
2026-04-21 02:55:48 +00:00
Claude a7894ede51 v1.0.1-beta: replace nodeIntegration/contextIsolation:false with contextBridge preload
All 6 popup BrowserWindows (lockout, prompt, pause, pin, keyboard ×2)
now use contextIsolation:true + popup-preload.js instead of the
deprecated nodeIntegration:true pattern. A new popup-preload.js file
exposes crypto.hashPassword, fs.readPin, ipcRenderer.send/on/once to
the renderer via contextBridge. All affected HTML files updated to use
window.electronAPI.* instead of direct require('electron') calls.
The popup-preload.js heredoc is also added to the upgrade extract_file
list so upgrades re-extract it correctly.

https://claude.ai/code/session_01M3tiofbGfmTddeMcXr8nXr
2026-04-21 01:29:27 +00:00
Claude 589a65bc55 feat: add v1.0.1-beta with BrowserView → WebContentsView migration
BrowserView has been deprecated since Electron 29 and will be removed
in a future major release. This beta migrates all usage to the
WebContentsView API introduced in Electron 28.

Changes in main.js:
- Import WebContentsView instead of BrowserView
- Add bringViewToTop() helper (remove+re-add as last child = on top)
- createWindow: new WebContentsView / contentView.addChildView
- attachView: contentView.removeChildView + bringViewToTop
- showLockoutScreen: contentView.removeChildView for all views
- unlockScreen: bringViewToTop to restore hidden view
- returnToTabs: bringViewToTop instead of setTopBrowserView
- showHiddenTab: bringViewToTop instead of setTopBrowserView

v1.0.0 is kept unchanged. The legacy update_mainjs_keyboard() patch
function is guarded by a grep check that prevents it running against
the new WebContentsView-based main.js.

https://claude.ai/code/session_01M3tiofbGfmTddeMcXr8nXr
2026-04-21 01:12:22 +00:00
Claude 5085a19805 chore: upgrade Electron from v39.2.4 to v41.2.1
No breaking changes affecting the kiosk app between these versions:
- BrowserView still present (deprecated but not removed until future release)
- WebContentsView destroyed-event change does not apply (app uses BrowserView)
- Session.clearStorageData quotas removal not used
- PDF OOPIF change not relevant

https://claude.ai/code/session_01M3tiofbGfmTddeMcXr8nXr
2026-04-21 01:04:54 +00:00
Claude ae65853f5a docs: update README for v1.0.0
- Bump version references from 0.9.9.1/0.9.8 to 1.0.0
- Update script filename to ubuntu-based-kiosk-v1.0.0.sh throughout
- Add v1.0.0 changelog entries (upgrade fix, sudo/timezone fixes)
- Preserve prior version history (v0.9.9.1, v0.9.8) as changelog
- Update Claude model reference to Sonnet 4.6
- Update last-updated date

https://claude.ai/code/session_01M3tiofbGfmTddeMcXr8nXr
2026-04-21 01:02:08 +00:00
Outis 502baaed44 Merge pull request #77 from outis1one/claude/fix-kiosk-upgrade-script-zHQ5X
Claude/fix kiosk upgrade script z hq5 x
2026-04-20 21:00:18 -04:00
Claude 145320998e chore: bump version to 1.0.0 and rename script file
https://claude.ai/code/session_01M3tiofbGfmTddeMcXr8nXr
2026-04-21 00:59:09 +00:00
Claude 4b7ab7c0be fix: prevent sudo cache expiry during install and add timezone fallback
Two issues caused the timezone step to fail on first run:

1. Sudo credential cache (default 15 min) can expire during the long
   apt install step before configure_timezone runs. Added `sudo -v`
   immediately after the install confirmation prompt to prime the cache
   as late as possible, just before the first long-running step.

2. `sudo timedatectl set-timezone` can fail with "Access denied" if
   polkit/D-Bus is not yet fully ready in the install environment.
   Added a direct fallback (ln -sf localtime + tee /etc/timezone)
   that bypasses D-Bus entirely.

https://claude.ai/code/session_01M3tiofbGfmTddeMcXr8nXr
2026-04-21 00:16:55 +00:00
Claude 07823423e5 fix: use sudo test -s to verify extracted files in upgrade_kiosk
On Ubuntu 22.04+, useradd creates home directories with 750 permissions,
so the non-root user running the script cannot traverse /home/kiosk to
check file existence with [[ -s ]]. sudo tee (running as root) writes the
files successfully, but the bash test always returned false, falsely
reporting all extractions as failed.

Switch to `sudo test -s` to match the pattern already used elsewhere in
the script (line ~10320) when checking files under /home/kiosk.

https://claude.ai/code/session_01M3tiofbGfmTddeMcXr8nXr
2026-04-20 23:10:47 +00:00
outis1one 06c00a5944 Update Readme.md 2025-12-30 08:27:23 -05:00
outis1one 44991d307b Rename ubuntu-based-kiosk.sh to ubuntu-based-kiosk-v0.9.9.1.sh 2025-12-30 08:26:55 -05:00
outis1one 2700f27d1c Merge pull request #76 from outis1one/claude/rename-ubk-ubuntu-kiosk-QoSy9
Rename UBK to Ubuntu Based Kiosk and rename main install script
2025-12-30 08:25:43 -05:00
Claude 96747fa411 Rename UBK to Ubuntu Based Kiosk and rename main install script
- Rename install_kiosk_v0.9.9.1.sh to ubuntu-based-kiosk.sh
- Update all repository URLs from ubk to ubuntu-based-kiosk
- Remove UBK abbreviation from documentation and script headers
- Update installation instructions in Readme.md
2025-12-30 05:28:48 +00:00
outis1one d42bd363be Delete working-I-think.zip 2025-12-28 19:15:18 -05:00
outis1one eba2da9de8 Merge pull request #75 from outis1one/outis1one-patch-1
Add files via upload
2025-12-28 16:51:51 -05:00
outis1one 8098d8d831 Add files via upload 2025-12-28 16:51:38 -05:00
outis1one e8ffe6393f Merge pull request #74 from outis1one/claude/fix-kiosk-issues-qlxTc
Fix power menu IPC and export/import permissions
2025-12-28 16:36:57 -05:00
Claude eb2f31f818 Fix power menu IPC and export/import permissions
- Power menu: Send IPC to views[] instead of mainWindow.webContents
  (preload.js runs in BrowserViews, not mainWindow)
- Export: Add chmod 777 to temp dir, use sudo for all file operations,
  use sudo tar and fix archive ownership
- Import: Use sudo tar, add proper permissions to temp directory
2025-12-28 21:35:37 +00:00
outis1one f02b8341a3 Merge pull request #73 from outis1one/claude/fix-kiosk-issues-qlxTc
Add 30-second auto-dismiss timeout to secondary screens
2025-12-28 15:32:47 -05:00
Claude 79d112794b Add 30-second auto-dismiss timeout to secondary screens
- PIN entry window: auto-closes after 30 seconds of inactivity
- Pause dialog: auto-closes after 30 seconds of inactivity
- Power menu: converted from native dialog to custom overlay with
  30-second timeout (lockout mode still uses native dialog)
- Nav menu already had 30-second timeout

All modal windows and overlays now automatically dismiss after
30 seconds to prevent screens being left open indefinitely.
2025-12-28 18:05:21 +00:00
outis1one d13137278d Merge pull request #72 from outis1one/claude/fix-kiosk-issues-qlxTc
Claude/fix kiosk issues qlx tc
2025-12-28 12:30:57 -05:00
Claude 4ac9676ef5 Power button follows same show/hide logic as nav button
- Power button now starts hidden and appears on user interaction
- Auto-hides after 5 seconds of inactivity (matching nav button)
- Increased size to 60px with 3px border for consistency
- Removed hover transitions for simpler, consistent behavior
2025-12-28 17:29:27 +00:00
Claude c4f93571a9 Add power button, fix EPIPE errors, fix display schedule
- Add red power icon button in top-right corner of UI
- Click power button triggers showPowerMenu via IPC
- Add EPIPE error suppression for stdout/stderr (no more error dialogs)
- Fix display on/off scripts: add XAUTHORITY, hardcode kiosk user
- Add logging to display scripts for debugging
2025-12-28 16:41:36 +00:00
outis1one f47d7d54c9 Merge pull request #71 from outis1one/claude/fix-kiosk-issues-qlxTc
Add error handling to SIGUSR1 power button handler
2025-12-28 11:18:09 -05:00
Claude 27de108579 Add error handling to SIGUSR1 power button handler 2025-12-28 15:58:13 +00:00
outis1one b926d00cf4 Merge pull request #70 from outis1one/claude/fix-kiosk-issues-qlxTc
Claude/fix kiosk issues qlx tc
2025-12-27 20:45:50 -05:00
Claude 7ed5faa2dc Simplify power button: direct SIGUSR1 from root ACPI handler
- Simplified power button script runs as root from acpid
- No longer needs DISPLAY/XAUTHORITY (just sends signal)
- Finds all Electron processes and sends SIGUSR1 to each
- Updated ACPI event handlers to call /usr/local/bin/kiosk-power-button.sh
- Updated test-power-button to actually trigger and test
- Upgrade function now installs simplified handler
2025-12-27 14:23:40 +00:00
Claude e04fc42a85 Fix on-screen keyboard: ignore Ctrl/Alt modifier keys
When pressing Ctrl or Alt on the virtual keyboard, the literal text
"Control" or "Alt" was being inserted into text fields. Now these
modifier keys are properly ignored since they don't function as
standalone keys in input fields.
2025-12-27 03:24:43 +00:00
outis1one 4332ad1b26 Merge pull request #69 from outis1one/claude/fix-kiosk-issues-qlxTc
Fix upgrade: ensure dir exists, use sudo tee directly
2025-12-24 13:55:23 -05:00
Claude 966709547f Fix upgrade: ensure dir exists, use sudo tee directly
- Create kiosk directory if it doesn't exist before extraction
- Use 'sudo tee' instead of 'sudo -u kiosk tee' for reliable writes
- Add line numbers to output for debugging
- chown at end fixes permissions
2025-12-24 18:48:38 +00:00
outis1one 8e98f66215 Merge pull request #68 from outis1one/claude/fix-kiosk-issues-qlxTc
Fix upgrade extraction using grep+sed line numbers
2025-12-24 13:44:26 -05:00
Claude bb82108809 Fix upgrade extraction using grep+sed line numbers
The awk-based extraction had variable scoping issues when run
as a nested function. Switch to grep for finding line numbers
and sed for extraction - more reliable approach.
2025-12-24 18:42:53 +00:00
outis1one 37fbe07eab Merge pull request #67 from outis1one/claude/fix-kiosk-issues-qlxTc
Fix upgrade: use awk extraction, restart lightdm not kiosk
2025-12-24 13:38:44 -05:00
Claude b17adbde2b Fix upgrade: use awk extraction, restart lightdm not kiosk
- Replace sed with awk for more reliable heredoc extraction
- Add debug output showing script path
- Fix restart to use lightdm instead of non-existent kiosk.service
- Kill electron process before upgrade, check electron after
- Add script path validation before extraction
2025-12-24 18:36:20 +00:00
outis1one 6742d8dec6 Merge pull request #66 from outis1one/claude/fix-kiosk-issues-qlxTc
Fix sed patterns in upgrade - remove strict anchors
2025-12-24 13:31:20 -05:00
Claude ec0d3ee633 Fix sed patterns in upgrade - remove strict anchors
The sed patterns were too strict with ^ and $ anchors, causing
extraction to fail on lines with leading whitespace.
2025-12-24 18:27:17 +00:00
outis1one 3896614ffe Merge pull request #65 from outis1one/claude/fix-kiosk-issues-qlxTc
v0.9.9.1: Silent upgrade, import number selection, power button fix
2025-12-24 13:19:45 -05:00
Claude 703339c5e9 v0.9.9.1: Silent upgrade, import number selection, power button fix
- Silent upgrade: extracts app files from script without user input
- Import now shows numbered list, user can select by number
- Improved power button handler with better Electron process detection
- SIGUSR1 now primary method for power menu (more reliable)
- Upgrade automatically regenerates power button handler
- Added XAUTHORITY export for X11 authentication
2025-12-24 18:17:11 +00:00
outis1one 3b35d381f7 Merge pull request #64 from outis1one/claude/fix-kiosk-issues-qlxTc
Claude/fix kiosk issues qlx tc
2025-12-24 09:46:02 -05:00
Claude 2ba980ce94 Add upgrade feature that preserves all settings
- New upgrade_kiosk() function in Core Settings menu (option 10)
- Auto-exports config, timers, and addon configs before reinstall
- Auto-imports everything after reinstall completes
- User just needs to press Enter through installer prompts
- Also fixed SUDO_USER unbound variable issues
2025-12-24 13:36:52 +00:00
Claude da99774c44 Fix SUDO_USER unbound variable in export/import
- Use ${SUDO_USER:-} to avoid unbound variable error with set -u
- Fall back to USER, then /tmp if neither is set
- Validate home_dir exists and is writable
- Use whoami instead of $USER in scp hint
2025-12-24 02:34:52 +00:00
Claude 113adeb119 Fix export/import exit on counter increment with set -e
The script uses 'set -euo pipefail' which causes ((var++)) to exit
when var is 0, since the expression evaluates to 0 (falsey).
Changed to var=$((var + 1)) which always succeeds.
2025-12-24 02:31:13 +00:00
outis1one 0081394796 Merge pull request #63 from outis1one/claude/fix-kiosk-issues-qlxTc
Claude/fix kiosk issues qlx tc
2025-12-23 21:25:14 -05:00
Claude f2f645b7b8 Add VPN configs to settings export/import
Export now includes:
- WireGuard: /etc/wireguard/*.conf files
- Netbird: config.json, state directory (machine keys), user config
- OpenVPN: /etc/openvpn/ directory
- Tailscale: notes installation status (requires re-auth)

Import restores all VPN configs and auto-enables services.
Warns if VPN software not installed after restore.
2025-12-24 02:22:02 +00:00
Claude 2acc8aaa1d Add settings export/import feature for easy backup/restore
- Added export_settings: backs up all config to timestamped .tar.gz
  - Core config (sites, touch controls, passwords)
  - Schedule timers (power, display, quiet hours)
  - Addon configs (Squeezelite, VNC, Easy Asterisk)
- Added import_settings: restores from backup file
  - Lists available backups in home directory
  - Enables timers and sets permissions automatically
- Added to Advanced menu (options 8 and 9)
- Bump version to 0.9.9
2025-12-24 02:16:30 +00:00
outis1one 1a0b5d9f68 Merge pull request #62 from outis1one/claude/fix-kiosk-issues-qlxTc
Fix kiosk power button, pause dialog timeout, and mic static
2025-12-23 21:03:05 -05:00
Claude 5ec37d8457 Fix kiosk power button, pause dialog timeout, and mic static
- Add SIGUSR1 signal handler for power button trigger script fallback
- Add 30-second auto-close timeout to pause dialog popup
- Configure PipeWire noise cancellation/echo suppression for microphone
- Bump version to 0.9.8.1
2025-12-24 01:43:11 +00:00
outis1one 88831e3491 Merge pull request #61 from outis1one/claude/add-asterisk-client-install-EfDNf
Add Easy Asterisk client-only installation option
2025-12-17 01:33:00 -05:00
Claude 20cb5d0a5e Add Easy Asterisk client-only installation option
- Add sub-menu to Easy Asterisk addon with Server/Client/Both options
- Implement Baresip SIP client installation for client-only mode
- Add configuration prompts for server connection details (IP, port, extension, password)
- Create systemd user service for automatic Baresip startup
- Support TLS encryption and auto-answer mode options
- Update status display to show both server and client installation status
2025-12-17 06:19:58 +00:00
outis1one 238018c0ba Delete install_kiosk_v0.9.9.sh 2025-12-10 19:57:03 -05:00
outis1one 9ecfd0f0d5 Merge pull request #59 from outis1one/claude/add-intercom-menu-item-01Gdr4tWRVvDKzdMBG2qekcP
Claude/add intercom menu item 01 gdr4t wr vv d kzd mbg2qekc p
2025-12-10 19:56:16 -05:00
Claude 2048ac7bc8 Fix version regex to support 4-part version numbers (e.g., 0.9.8.7) 2025-12-11 00:53:11 +00:00
Claude 234dd900f6 Integrate Easy Asterisk Intercom into v0.9.8 installer
Added to install_kiosk_v0.9.8.sh:
- SECTION 14.5: Easy Asterisk Intercom addon functions
- get_latest_easy_asterisk_version() - Fetches latest version from GitHub API
- get_installed_easy_asterisk_version() - Checks installed version
- backup_easy_asterisk_configs() - Backs up configs before updates
- restore_easy_asterisk_configs() - Restores configs after install
- download_and_install_easy_asterisk() - Downloads and runs installer
- addon_easy_asterisk_intercom() - Main menu function with update logic

- Added option 4 "Easy Asterisk Intercom" to Addons menu
- Updated show_addon_status() to display Intercom installation status
- Integration uses stable v0.9.8 as base (v0.9.9 was broken)

README updates:
- Fixed all references from v0.9.9 to v0.9.8
- Updated menu paths (2) Addons → (4) Easy Asterisk Intercom
- Corrected version number throughout
- Updated Quick Install section

Features:
- Downloads latest easy-asterisk-v*.sh from GitHub repo
- Automatic version detection and update checking
- Configuration preservation during updates/reruns
- Safe to run multiple times
- User prompts for install/update/rerun decisions
2025-12-10 22:32:22 +00:00
Claude 38e732b976 Remove broken Copilot code that would install wrong Asterisk version
Removed:
- install_easy_asterisk() function that installed Ubuntu Asterisk packages
- configure_easy_asterisk() function for non-existent addon
- Menu option 1 "Install Easy Asterisk" (broken implementation)
- Menu option 5 "Configure Easy Asterisk" (broken implementation)

The removed code would have:
- Installed default Ubuntu Asterisk (apt-get install asterisk)
- Created fake local config files
- Conflicted with actual Easy Asterisk from GitHub repo

Updated:
- Menu renumbered: Intercom is now option 1 (was option 2)
- Configure Intercom is now option 4 (was option 6)
- Updated README to reflect new menu numbers
- Updated error messages with correct option references

Result: Clean implementation with only the working GitHub-based
Easy Asterisk Intercom installer that properly manages versions
and preserves configurations.
2025-12-10 12:52:26 +00:00
outis1one 505e90551f Merge pull request #58 from outis1one/claude/add-intercom-menu-item-01Gdr4tWRVvDKzdMBG2qekcP
Add Easy Asterisk Intercom addon with automatic update management
2025-12-10 07:49:36 -05:00
Claude 62e4a906b9 Add Easy Asterisk Intercom addon with automatic update management
Features:
- Download and install latest Easy Asterisk from GitHub repository
- Automatic version detection using GitHub API
- Smart update checking with user confirmation
- Configuration preservation during updates and reruns
- Backup and restore functionality for configs
- Safe re-run capability without breaking existing setup

Menu changes:
- Added "Install/Update Intercom (Easy Asterisk)" option
- Updated configure_intercom to work with Easy Asterisk installation
- Enhanced configuration interface with file editing support

README updates:
- Added Communication section with Easy Asterisk Intercom
- Documented installation, update, and configuration workflows
- Updated version to 0.9.9
- Added installation locations and management commands

The intercom addon integrates with outis1one/easy-asterisk repository
and follows the pattern of easy-asterisk-v*.sh version files.
2025-12-10 12:21:18 +00:00
outis1one 77eaf19636 Update Readme.md 2025-12-09 23:26:49 -05:00
outis1one 144ff1271a Add install_kiosk_v0.9.9.sh with Easy Asterisk addon integration and intercom option 2025-12-09 16:31:57 -05:00
outis1one d12307b5d2 Add Asterisk-Easy addon installation module 2025-12-09 14:13:34 -05:00
outis1one 0c5e070ed0 Create LICENSE 2025-12-09 11:28:31 -05:00
outis1one c8c8e71acf Update Readme.md 2025-12-09 08:27:08 -05:00
outis1one 85d8396aed Rename install_kiosk_0.9.8.sh to install_kiosk_v0.9.8.sh 2025-12-06 18:39:06 -05:00
outis1one cf612cc7ac Merge pull request #57 from outis1one/claude/fix-power-menu-vpn-01Bfone8eTWK9fQxkvFe8TDk
Fix power menu VPN display and navigation rendering issues
2025-12-04 13:15:28 -05:00
Claude 160c39a47d Fix power menu VPN display and navigation rendering issues
- Fixed power menu showing VPN address twice by excluding VPN interfaces
  (tailscale, wg, netbird, tun, wt) when detecting local IP
- Fixed site bleeding through during navigation by removing all other
  BrowserViews before attaching new one
- Fixed dim navigation popup by forcing reflow and adding fade-in effect
- Added webContents.invalidate() to ensure proper view rendering after switch

These changes improve the visual clarity and reliability of the navigation
system and power menu display.
2025-12-04 18:06:10 +00:00
outis1one c549d0f1e0 Merge pull request #56 from outis1one/claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3
Claude/fix install script 01 ct3j rx ega7ar2 mm gzqzam3
2025-12-02 21:36:02 -05:00
Claude 08638045d5 Improve navigation menu UX and button behavior
Fixed three navigation menu issues:
1. Nav button timeout - now auto-hides after 5 seconds like pause/keyboard buttons
2. Better site selection visual feedback - bolder text, white border, lift effect on hover
3. Independent column scrolling - only sites list scrolls, cheat sheet stays fixed

Navigation button changes:
- Added navButtonHideTimer and NAV_BUTTON_HIDE_DELAY (5 seconds)
- Updated showNavButton() to set auto-hide timer
- Updated hideNavButton() to clear timer
- Matches pause button behavior for consistent UX

Site button styling improvements:
- Hover: bold text, bright white border, lifts up 2px, brighter background
- Click: even darker background, pressed down effect
- Default: subtle border and shadow
- Smooth 0.3s transitions for modern feel
- Much more obvious visual feedback when hovering/selecting

Column scroll changes:
- Content overflow changed from auto to hidden
- Sites column: overflow-y auto, padding for scrollbar
- Cheat sheet column: overflow-y hidden (stays fixed)
- Columns container: max-height 70vh
- Only URL list scrolls, gestures/shortcuts remain visible
2025-12-03 01:55:30 +00:00
Claude 27c8adf040 Remove auto-rotation stop from navigation menu
Navigation menu now jumps to selected site but allows rotation to continue.
The pause button remains the only control for stopping rotation.

Changes:
- Removed manualNavigationMode=true from navigate-to-tab handler
- Removed inactivityExtensionUntil=0 (related to manual mode)
- Updated logging to reflect that rotation continues

Users can now use the navigation menu to quickly jump to any site while
keeping rotation active, or use the pause button if they want to stop on
a specific site.
2025-12-02 21:45:59 +00:00
Claude 31f8d2f973 Fix navigation menu tab switching function name
Resolved ReferenceError: showView is not defined when clicking sites in nav menu.

Changes:
- Changed showView() to attachView() - the correct function name
- Added manualNavigationMode=true to stop auto-rotation on manual navigation
- Added markActivity() to reset inactivity timer
- Added inactivityExtensionUntil=0 to clear extensions
- Added additional logging for debugging
- Added error logging for invalid view indices

This makes navigation menu behavior consistent with nextTab() and
previousTab() functions throughout the codebase.
2025-12-02 21:39:08 +00:00
outis1one 7c14a5b407 Merge pull request #55 from outis1one/claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3
Claude/fix install script 01 ct3j rx ega7ar2 mm gzqzam3
2025-12-02 16:19:01 -05:00
Claude 5db15802a0 Fix navigation menu config IPC handler error
Resolved ReferenceError: config is not defined in the 'get-config' IPC handler.

Changes:
- Modified IPC handler to read config.json directly using fs.readFileSync
- Added proper error handling with try/catch block
- Added fallback to send empty config if file doesn't exist or can't be read
- Added console logging for debugging config transmission

This fixes the JavaScript error that was displaying on screen and prevents
the navigation menu from loading sites properly.
2025-12-02 20:19:25 +00:00
Claude 08594601ec Fix navigation menu bugs in 0.9.8
Fixed Issues:
1. Icon rendering - Replaced emoji 🔑 with SVG key icon for better compatibility
2. JavaScript errors - Added try/catch blocks throughout navigation menu code
3. Sites not loading - Fixed IPC communication with extensive error logging
4. Menu becoming part of rotation - Ensured proper overlay with z-index and pointer-events
5. Missing auto-dismiss - Added 30-second timeout that auto-closes menu
6. Improved close button positioning - Moved to top-right with better visibility

Technical Changes:
- Changed navButton.innerHTML from emoji to SVG path for key icon
- Added NAV_MENU_TIMEOUT constant (30000ms)
- Added navMenuTimer variable for timeout management
- Enhanced createNavMenu() with console logging and error handling
- Fixed content positioning with 'position:relative'
- Added pointer-events:auto to ensure menu captures events
- Enhanced showNavMenu() with try/catch and 30-second auto-dismiss timer
- Enhanced hideNavMenu() with timer cleanup and error handling
- Enhanced toggleNavMenu() with logging
- Fixed loadSitesIntoNav() with error handling
- Enhanced config-data IPC handler with extensive logging and validation
- Changed siteBtn.innerHTML to siteBtn.textContent to prevent XSS
- Added user-select:none to prevent text selection on buttons
- Added stopPropagation to content to prevent background clicks from closing
- Fixed close button event handler with proper logging

Console Output:
- All navigation menu actions now log to console with [NAV] prefix
- Helps diagnose issues: button clicks, menu show/hide, config requests, site loading
- Error messages clearly identify failure points

This should resolve all reported issues with the navigation menu.
2025-12-02 19:00:30 +00:00
outis1one 40052ea3f0 Update Readme.md 2025-12-02 13:29:29 -05:00
outis1one 89ec3e7871 Merge pull request #54 from outis1one/claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3
Claude/fix install script 01 ct3j rx ega7ar2 mm gzqzam3
2025-12-02 13:21:07 -05:00
outis1one a380f8e705 Merge branch 'main' into claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3 2025-12-02 13:20:57 -05:00
Claude a6994601c4 Complete version 0.9.8: Named Sites & Navigation Menu
Bug Fixes:
- Fixed virtual console menu display (now checks both getty and X11 DontVTSwitch)
- Fixed complete_uninstall to properly remove LMS/Squeezelite services
- Fixed full_reinstall to clean all addons and settings (except saved VPN/VNC)

Named Websites Feature:
- Added 'name' field to config.json schema for all sites
- Added NAMES array throughout codebase for site name management
- Added update_site_names() function with menu option (Sites → option 3)
- Names prompted during site addition (both new installs and adding sites)
- Site listings now display as "Name" - URL when name is provided
- All management functions (add, update, delete, reorder) handle names properly
- Names fully integrated with save/load config operations

Navigation Menu Feature:
- Added enableNavButton config option (defaults to true)
- Added navigation button at top-left (purple key icon 🔑)
- Button shows on user interaction (same logic as pause/keyboard buttons)
- Navigation menu overlay with 2-column layout:
  * Column 1: Clickable list of all non-hidden sites (uses names if available)
  * Column 2: Touch gesture cheat sheet and keyboard shortcuts reference
- Menu accessible via key icon click
- IPC handlers added: get-config and navigate-to-tab
- Menu excludes hidden sites (duration === -1) as requested
- Optional feature configurable via Optional Buttons menu

README Updates:
- Updated all version references to 0.9.8
- Updated installation commands to use install_kiosk_0.9.8.sh
- Added comprehensive "Why Use Named Sites?" section with use cases:
  * Home/Family kiosks examples
  * Business kiosks examples
  * Digital signage examples
  * Multi-location setups examples
- Updated Multi-Site Management section to include named sites and navigation menu
- Updated Touch Controls section to reflect correct gesture (3-finger DOWN toggle)
- Updated Project Status to version 0.9.8
- Updated menu access commands throughout document

Technical Implementation:
- preload.js: Added nav button/menu variables, create/show/hide functions
- preload.js: Added IPC listener for 'nav-button-enabled'
- preload.js: Integration with user interaction handlers
- main.js: Added enableNavButton variable and config loading
- main.js: Added 'get-config' and 'navigate-to-tab' IPC handlers
- main.js: Send nav-button-enabled state on page load
- Bash script: Added site name prompts in add_new_sites() and add_new_sites_simple()
- Bash script: Added update_site_names() function for updating existing site names
- Bash script: Updated configure_optional_buttons() to include navigation button
- Bash script: Updated all save/load config operations to handle NAMES array

Script now at 9607 lines (242 lines added for navigation menu feature)
All syntax validated with bash -n
2025-12-02 18:16:25 +00:00
Claude 06f0208c0b WIP: Version 0.9.8 - Named Sites & Navigation Menu (partial)
Bug fixes completed:
- Fixed virtual console menu display bug (checks both getty and X11)
- Fixed complete_uninstall to properly remove LMS/Squeezelite
- Fixed full_reinstall to clean all addons and settings

Named websites feature completed:
- Added 'name' field to config.json schema
- Added site name management throughout (add, update, delete, reorder)
- Added update_site_names() menu option
- Names display in site listings

Navigation button configuration completed:
- Added enableNavButton config option
- Added to optional buttons menu
- Integrated with save/load config

TODO: Navigation menu UI implementation in preload.js still needed
2025-12-02 18:09:36 +00:00
outis1one 1988d62f87 Update Readme.md 2025-12-02 12:32:19 -05:00
outis1one 0a4b2bfb70 Merge pull request #53 from outis1one/claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3
Release version 0.9.7-5: Maintenance & Polish Update
2025-12-02 11:57:01 -05:00
outis1one 390f286b55 Merge branch 'main' into claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3 2025-12-02 11:56:52 -05:00
Claude 2f31a730f6 Release version 0.9.7-5: Maintenance & Polish Update
- Removed PTT (Push-to-Talk) functionality (moved to separate project)
- Fixed power menu to display both local and VPN IP addresses
- Updated Electron to v39.2.4 with enhanced rollback instructions
- Updated README dates to 2025 and version references to 0.9.7-5
- Removed stray text from README printer section
2025-12-02 16:55:09 +00:00
outis1one 6950b6e2bc Merge pull request #52 from outis1one/claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3
Fix core menu option 10 (Full reinstall) not working
2025-12-02 10:18:35 -05:00
Claude 95c7af9ac6 Fix core menu option 10 (Full reinstall) not working
Issue: Option 10 was immediately returning to main menu instead of
performing the reinstall.

Root Cause: The menu case statement had 'return' after full_reinstall,
which caused it to exit the core_settings_menu even when the user
cancelled the reinstall (by not typing 'YES').

Fix: Removed the 'return' statement from line 8994.
Now when users cancel, they stay in the core settings menu.
When reinstall completes, the pause() at the end lets them press enter
and naturally return to the menu for additional configuration.

Note: Option 11 (complete_uninstall) correctly keeps 'return' since
uninstalling should exit the entire menu system.
2025-12-02 15:11:21 +00:00
outis1one 737b336d47 Update Readme.md 2025-12-02 08:41:52 -05:00
outis1one c144b3f647 Merge pull request #51 from outis1one/claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3
Claude/fix install script 01 ct3j rx ega7ar2 mm gzqzam3
2025-12-02 08:41:13 -05:00
outis1one 5d09a7d27b Merge branch 'main' into claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3 2025-12-02 08:41:02 -05:00
Claude 5d63740c05 Release version 0.9.7-4: Gesture & Console Improvements
Major Changes:
1. FIXED: Virtual console Ctrl+Alt+F1-F8 key combinations now work properly
   - Updated configure_virtual_consoles() to modify X11 serverflags
   - Enable/disable now updates both systemd getty AND X11 VT switching
   - Added restart lightdm notification for changes to take effect
   - Fixed initial installation to set X11 VT switching based on user choice
   - Users who previously enabled consoles must re-enable for keys to work

2. IMPROVED: Simplified hidden tab gesture to single toggle
   - 3-finger DOWN now toggles hidden tabs (both show AND hide)
   - Removed separate 3-finger UP gesture (simpler UX)
   - Updated all gesture handlers in both standard and Jitsi modes
   - Updated all console.log messages and documentation

README Updates:
- Updated all version references to 0.9.7-4
- Updated Touch Gesture Quick Reference table
- Simplified gesture: 3-finger DOWN = Toggle hidden tabs
- Updated hidden tabs documentation to reflect toggle behavior
- Added important notes about virtual console fix in 0.9.7-4
- Added instructions to re-enable consoles for existing users
- Updated menu system access examples
- Updated project status to "Gesture & Console Improvements"

This release focuses on fixing the console key combo issue and improving
the hidden tab gesture for easier one-handed use.
2025-12-02 12:48:14 +00:00
Claude 5ceccbb420 Work in progress: Version 0.9.7-4 improvements
Completed Changes:
- Updated version header to 0.9.7-4 with release notes
- FIXED: Virtual console Ctrl+Alt+F1-F8 key combinations now work
  - Updated configure_virtual_consoles() to modify X11 serverflags
  - Enable/disable now updates both systemd getty AND X11 VT switching
  - Added restart lightdm notification for changes to take effect  - Fixed initial installation to set X11 VT switching based on user choice
- FIXED: Swapped hidden tab gestures for easier use
  - 3-finger DOWN now shows hidden tabs (easier than UP)
  - 3-finger UP now returns to normal tabs
  - Updated all gesture handlers and documentation
  - Changed in both standard and Jitsi preload modes

In Progress:
- URL naming feature (requires config schema changes)
- Navigation hot corner menu (substantial new feature)

These changes fix the immediate issues and improve usability.
The navigation menu feature requires extensive additional development.
2025-12-02 12:34:34 +00:00
outis1one dbe881ce44 Update Readme.md 2025-12-01 20:25:55 -05:00
outis1one 1eba5bdf47 Merge pull request #50 from outis1one/claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3
Claude/fix install script 01 ct3j rx ega7ar2 mm gzqzam3
2025-12-01 20:24:37 -05:00
outis1one 3387bee3a2 Merge branch 'main' into claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3 2025-12-01 20:24:26 -05:00
Claude 5ff748b875 Bump version to 0.9.7-3
Version Changes:
- Created install_kiosk_0.9.7-3.sh with updated version number
- Updated script header with release notes for 0.9.7-3
- Updated SCRIPT_VERSION constant to "0.9.7-3"

README Updates:
- Updated all references from 0.9.7-2 to 0.9.7-3
- Updated Quick Install wget command
- Updated Menu System Access examples
- Updated Complete Uninstall examples
- Updated Project Status section
- Updated footer version

Release Notes for 0.9.7-3:
- Fixed missing complete_uninstall function (line 8704 error)
- Added virtual console configuration (Ctrl+Alt+F1-F8)
- Added emergency hotspot to initial installation
- Enhanced security options and documentation
2025-12-02 01:10:13 +00:00
Claude ed87ff257c Update README with new features and hidden tab use cases
Documentation updates:
- Update Quick Install script name to install_kiosk_0.9.7-2.sh
- Document virtual console configuration feature
- Document emergency hotspot configuration during install
- Document complete uninstall functionality
- Add comprehensive "Why Use Hidden Tabs?" section with:
  - Private communication use cases
  - Administrative access scenarios
  - Content management applications
  - Secure entertainment options
  - Business use cases
  - Real-world example scenarios
- Add new "Installation & Management Features" section with:
  - Virtual Console Configuration details
  - Emergency WiFi Hotspot documentation
  - Complete Uninstall process and safety features
- Update menu system documentation
- Update system behavior security notes
- Update version and date to 0.9.7-2, December 2, 2024
2025-12-02 01:00:23 +00:00
outis1one f5a8c320de Update Readme.md 2025-12-01 19:57:22 -05:00
outis1one a1bfd8aabf Rename install_kiosk_0.9.7-2.sh to install_kiosk_0.9.7-3.sh 2025-12-01 19:57:02 -05:00
outis1one 5e840bafd6 Merge pull request #49 from outis1one/claude/fix-install-script-01Ct3jRxEga7ar2MMGzqzam3
Fix install script issues and add new features
2025-12-01 19:56:09 -05:00
Claude 1cd1565239 Fix install script issues and add new features
- Fix line 8704: Add missing complete_uninstall() function
  - Provides full system cleanup and uninstallation
  - Removes kiosk user, services, and all configurations
  - Offers reboot option after uninstall

- Add virtual console configuration feature
  - New configure_virtual_consoles() function
  - Allows enabling/disabling Ctrl+Alt+F1-F8 console access
  - Added to Advanced menu (option 7)
  - Integrated into initial installation with security prompt

- Add emergency hotspot to initial installation
  - Prompts user at end of installation
  - Can be configured immediately or deferred
  - Provides automatic WiFi hotspot when internet is down
2025-12-02 00:42:39 +00:00
outis1one 7ebf4e6820 Delete setup_intercom_simple.sh 2025-11-26 13:30:03 -05:00
outis1one 6d1c0f9bb5 Delete install_mumble.sh 2025-11-26 13:29:54 -05:00
outis1one a31f1817fc Add files via upload 2025-11-24 00:22:24 -05:00
outis1one 3cfdc1e8a0 Delete talkkonnect_complete_install.sh 2025-11-24 00:21:50 -05:00
outis1one abb8d72771 Update Readme.md 2025-11-24 00:21:10 -05:00
outis1one 3c33c14f24 Update Readme.md 2025-11-24 00:03:57 -05:00
18 changed files with 79265 additions and 1563 deletions
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+622 -58
View File
@@ -1,9 +1,9 @@
# Ubuntu Based Kiosk (UBK)
# Ubuntu Based Kiosk
**Current Version:** 0.9.7-2 (check script header for latest version)
**Built with Claude Sonnet 4/.5 AI assistance**
**License:** GPL v3 - Keep derivatives open source
**Repository:** https://github.com/outis1one/ubk/
**Current Version:** 2.0.0 (check script header for latest version)
**Built with Claude Sonnet 4.6 AI assistance**
**License:** GPL v3 - Keep derivatives open source
**Repository:** https://github.com/outis1one/ubuntu-based-kiosk/
---
@@ -43,35 +43,66 @@ Home/office kiosk for reusing old hardware, displaying:
```bash
# Install Ubuntu 24.04 Server
# ***Do not use "kiosk" as a user name when installing, the script creates a restricted user named kiosk and the script will not install if the sudo user/user name when setting up the system is "kiosk".***
# Configure WiFi if no ethernet available
# Enable SSH during installation
# Download and run installer
wget https://github.com/outis1one/ubk/raw/main/install_kiosk_0.9.7.sh
chmod +x install_kiosk_0.9.7.sh
./install_kiosk_0.9.7.sh
# Download and run the installer
wget https://github.com/outis1one/ubuntu-based-kiosk/raw/main/ubuntu-based-kiosk.sh
chmod +x ubuntu-based-kiosk.sh && ./ubuntu-based-kiosk.sh
```
The installer will guide you through configuration during setup.
---
## Offline / Air-Gapped Download
If the kiosk machine can't reach GitHub directly (no browser, restrictive proxy, or you just prefer to grab the script on another computer and carry it over via USB), download it ahead of time instead of using the `curl`/`wget` one-liner above.
> **Note:** This only avoids needing internet access *to fetch the script*. The installer itself still requires the kiosk machine to have internet access while it runs — it uses `apt` to install packages, pulls Node.js from NodeSource, and runs `npm install` to fetch Electron (~120MB). There is currently no fully air-gapped/offline package bundle.
**On a machine with internet access:**
```bash
# Option A: download just the installer script
wget https://github.com/outis1one/ubuntu-based-kiosk/raw/main/ubuntu-based-kiosk.sh
# Option B: download the whole repo as a ZIP (includes install.sh, addon scripts, and older archived installer versions)
wget https://github.com/outis1one/ubuntu-based-kiosk/archive/refs/heads/main.zip
unzip main.zip
```
Copy the downloaded `.sh` file (or the extracted ZIP contents) to a USB drive, then on the kiosk machine:
```bash
# Mount the USB drive and copy the script over, then:
chmod +x ubuntu-based-kiosk.sh
./ubuntu-based-kiosk.sh
```
The kiosk machine still needs a working internet connection (ethernet, or WiFi configured during Ubuntu install) for the script to complete.
---
## Core Features
### Multi-Site Management
- **Single or multiple sites** with independent configurations
- **Named sites** - Optional friendly names for easy identification in navigation menu
- **Auto-rotation** - Sites rotate automatically based on duration
- **Manual sites** - Duration = 0, accessible via swipe only, trigger inactivity timeout
- **Hidden sites** - Duration = -1, PIN-protected access, trigger inactivity timeout
- **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)
### Touch Controls
- **2-finger horizontal swipe** - Switch between sites
- **3-finger up swipe** - Access hidden tabs (PIN required)
- **3-finger down swipe** - Return to normal tabs (from hidden tabs)
- **3-finger down swipe** - Toggle hidden tabs (PIN required to show, swipe again to hide)
- **1-finger swipe** (dual mode) - Navigate within page (arrow keys)
- **On-screen keyboard** - Auto-shows on text fields or click keyboard icon
- **Navigation menu** - Click key icon (top-left) to access site list and gesture cheat sheet
### On-Screen Keyboard
- **HTML-based keyboard** with full QWERTY layout
@@ -81,12 +112,11 @@ The installer will guide you through configuration during setup.
- **Special characters** via shift keys
- Works alongside physical keyboard
### Password Protection & Lockout
### Password Protection & Lockout (all are optional)
- **Session lockout** after configured inactivity
- **Scheduled lockout** at specific time daily
- **Scheduled lockout** at specific time daily
- **Display wake lockout** - Require password after display schedule
- **Boot password** option - Require password on system startup
- **SHA-256 hashed passwords**
- **Full screen blocking** during lockout (no content visible)
### Navigation Security
@@ -94,7 +124,7 @@ The installer will guide you through configuration during setup.
- **Same-origin** - Links within same domain only (recommended)
- **Open** - Unrestricted browsing (trusted environments only)
### Scheduling System
### Scheduling System (all are optional)
- **Power schedule** - Auto-shutdown and RTC wake (hardware dependent)
- **Display schedule** - Turn display off/on at specific times
- **Quiet hours** - Mute audio or stop Squeezelite during hours
@@ -110,6 +140,124 @@ The installer will guide you through configuration during setup.
## Optional Add-ons
### Authentication
#### Authelia Auto-Login (SSO)
Automatically authenticates the kiosk against a self-hosted [Authelia](https://www.authelia.com) instance on every startup. The Authelia password is **not stored in plain text** — it is encrypted with AES-256-CBC using a key derived from the machine's unique `/etc/machine-id`, so the encrypted blob is useless on any other machine.
**Access via menu:** `Addons → 5. Authelia Auto-Login`
After running the addon it prints the full server-side setup, but the summary is below.
##### Kiosk side (SSH in and run the installer)
```bash
ssh user@kiosk-machine
./ubuntu-based-kiosk.sh
# Addons → 5. Authelia Auto-Login
# Enter your Authelia URL, username, and password when prompted
```
##### Authelia server side (Dockerized)
**Step 1 — Generate the argon2 password hash** (run on your Docker host):
```bash
docker run --rm authelia/authelia:latest \
authelia crypto hash generate argon2 \
--password 'yourpassword'
```
Copy the `$argon2id$...` output — that is your hash.
**Step 2 — Add a kiosk user** to `~/docker/authelia/config/users.yml`:
```yaml
kiosk:
displayname: "Kiosk Display"
password: '$argon2id$v=19$m=65536,t=3,p=4$<paste hash here>'
email: kiosk@local.com
groups:
- kiosk
```
**Step 3 — MERGE into `~/docker/authelia/config/configuration.yml`** (do not replace your existing config):
**access_control** — Find your **existing** `access_control:` block and add the kiosk rule as the **first** rule inside it.
> **Do NOT create a second `access_control:` block.** YAML silently ignores duplicate keys — Authelia will never see the kiosk rule and the kiosk will get a white screen.
Authelia reads rules top-down — first match wins. The kiosk rule **must** sit above any `two_factor` wildcard rule, otherwise the wildcard matches first.
**Why `one_factor`?** The kiosk authenticates via the API (`/api/firstfactor` — password only). TOTP and WebAuthn require an interactive second step that is impossible from a script, so the kiosk group must use `one_factor`.
*Before (your existing config):*
```yaml
access_control:
default_policy: deny
rules:
- domain: '*.yourdomain.com'
policy: two_factor
```
*After (add kiosk rule above the two_factor rule — same block, not a new one):*
```yaml
access_control:
default_policy: deny
rules:
- domain: '*.yourdomain.com' # kiosk first — one_factor only
subject: 'group:kiosk'
policy: one_factor
- domain: '*.yourdomain.com' # existing rule stays below
policy: two_factor
```
**session** — Keep your existing session block as-is; no changes needed. The kiosk re-authenticates via API on every startup so session expiry barely matters for it.
If you do **not** yet have a session block, add:
```yaml
session:
expiration: 8h
inactivity: 1h
remember_me: 7d
cookies:
- domain: yourdomain.com
authelia_url: https://auth.yourdomain.com
```
**Step 4 — Restart Authelia:**
```bash
docker compose restart authelia
```
##### How it works
On every kiosk startup, Electron calls Authelia's `/api/firstfactor` endpoint with `keepMeLoggedIn: true` **before** any sites load. Authelia responds with a `Set-Cookie` header that Electron absorbs into its default session. All BrowserViews then load with that session cookie already present.
Because Electron's session persists to disk across reboots (`/home/kiosk/.config/kiosk-app/`), the cookie also survives restarts — the API call on startup just refreshes or extends it.
##### Authelia vs HTTP Basic Auth
Both can be used at the same time — they serve different purposes:
| Method | Where configured | When to use |
|--------|-----------------|-------------|
| **Authelia SSO** | `Addons → Authelia Auto-Login` (global) | Sites protected by an Authelia reverse proxy |
| **HTTP Basic Auth** | Per-site username/password in tab config | Sites that show a browser popup asking for credentials |
---
### Communication
- **Easy Asterisk Intercom** - Voice communication and intercom system
- Downloads latest version from Easy Asterisk repository
- Automatic update detection and installation
- Configuration preservation during updates
- Full Asterisk PBX integration
- SIP/PJSIP support for IP phones and softphones
### Audio
- **Lyrion Music Server (LMS)** - Formerly Logitech Media Server
- **Squeezelite Player** - Network audio player for LMS
@@ -129,7 +277,9 @@ The installer will guide you through configuration during setup.
- **Netbird VPN** - Setup key support
### Advanced
- **Emergency WiFi Hotspot** - Auto-starts if no internet after boot
- **Emergency WiFi Hotspot** - Auto-starts if no internet after boot (configurable during install)
- **Virtual Console Access** - Ctrl+Alt+F1-F8 terminal login (can enable/disable during install)
- **Complete Uninstall** - Full system cleanup and kiosk removal
- **SSH remote access** - For configuration and troubleshooting
---
@@ -137,7 +287,7 @@ The installer will guide you through configuration during setup.
## What This Script Installs
### Core Components
- **Electron** v33.4.11 (Chromium-based app framework)
- **Electron** v42.x (Chromium-based app framework)
- **Node.js** v20.x with npm
- **Openbox** - Lightweight window manager
- **LightDM** - Display manager with autologin
@@ -161,6 +311,9 @@ The installer will guide you through configuration during setup.
- **build-essential** - GCC, make, etc.
- **Python 3** with evdev for PTT
- **jq** - JSON processing
- **curl / git** - Downloading and version control
- **net-tools** - Legacy networking utilities (ifconfig, netstat, etc.)
- **ncdu** - Disk usage analyzer for troubleshooting
---
@@ -168,7 +321,7 @@ The installer will guide you through configuration during setup.
### Security & Lockdown
- **Autologin** as kiosk user
- **VT switching disabled** (Ctrl+Alt+F1-F12 blocked)
- **Virtual consoles** (Ctrl+Alt+F1-F8) - Optional, configurable during install
- **X server key combinations disabled** (Ctrl+Alt+Backspace)
- **Right-click disabled** in kiosk app
- **Screen blanking disabled** with schedule awareness
@@ -219,6 +372,57 @@ id kiosk
sudo -u kiosk DISPLAY=:0 xdpyinfo
```
**External monitor/TV (HDMI) shows nothing, or shows a cropped/scaled picture:**
Any connected display beyond the primary is mirrored automatically at the **primary's exact resolution** (not the external display's own native resolution) — both at kiosk login/boot (via Openbox autostart) and live when plugged/unplugged afterward (via a udev rule that triggers `kiosk-hotplug.service`). Both paths call the same `/usr/local/bin/kiosk-mirror-display.sh`. If the external display doesn't natively list the primary's resolution (e.g. a 1366x768 laptop panel mirrored to a 1920x1080-native TV), a matching mode is generated on the fly with `cvt` and forced onto the output — most monitors/TVs accept a close, non-native CVT timing without issue, but a few strict ones may reject it (see below).
```bash
# List outputs and check if the external display is detected
sudo -u kiosk DISPLAY=:0 XAUTHORITY=/home/kiosk/.Xauthority xrandr
# Look for your output (e.g. HDMI1/HDMI2/HDMI-1) as "connected" with a mode list.
# Check what the mirroring logic actually did (native mode vs. forced CVT mode, or failures)
journalctl | grep "KIOSK:" | tail -20
# Check whether the hotplug handler fired
sudo journalctl -u kiosk-hotplug.service -n 20
# Manually re-trigger it
sudo systemctl start kiosk-hotplug.service
# Run the mirroring logic by hand for more verbose output
sudo -u kiosk DISPLAY=:0 XAUTHORITY=/home/kiosk/.Xauthority bash -x /usr/local/bin/kiosk-mirror-display.sh
```
If the output shows `disconnected`, it's a cabling/port/EDID issue, not software — try a different cable/port or a monitor known to work.
If a forced CVT mode is rejected by the display (blank screen only after mirroring runs, works fine before), that display's EDID doesn't accept out-of-spec timings — you'll need to manually pick one of its natively listed modes instead:
```bash
sudo -u kiosk DISPLAY=:0 XAUTHORITY=/home/kiosk/.Xauthority xrandr --output HDMI2 --mode 1360x768 --same-as eDP1
```
**No sound over HDMI (audio only from laptop/built-in speakers):**
Whenever an external display is connected/mirrored, `kiosk-audio-route.sh` switches PipeWire's default sink to whichever sink's name contains `hdmi`, and moves any already-playing audio stream onto it. It's called at kiosk login (after PipeWire is confirmed ready) and by `kiosk-hotplug.service` on every plug/unplug — see `/usr/local/bin/kiosk-mirror-display.sh` above for the display side of the same hotplug event.
```bash
# List sinks and confirm an HDMI one exists (name will contain "hdmi")
sudo -u kiosk pactl list sinks short
# Check what the routing logic actually did
journalctl | grep "KIOSK: audio routed\|KIOSK: failed to route" | tail -10
# Check current default sink
sudo -u kiosk pactl get-default-sink
# Manually re-trigger routing
sudo systemctl start kiosk-hotplug.service
# Force it by hand if needed (replace with your sink name from the list above)
sudo -u kiosk pactl set-default-sink alsa_output.pci-0000_00_1f.3.hdmi-stereo
```
If no sink name contains `hdmi`, the audio codec on that HDMI port either isn't exposed by ALSA/PipeWire on this hardware, or the monitor/TV doesn't report HDMI audio support in its EDID (common on monitors that only do video) — in that case there's no PipeWire-side fix, audio has to come from the laptop speakers or a separate cable.
**Audio not working:**
```bash
# Check PipeWire (use menu: Advanced → Audio Diagnostics)
@@ -364,8 +568,7 @@ smb://WORKGROUP/COMPUTER/PrinterName
|---------|---------|-----------|--------|
| Swipe | 2 | Left/Right | Switch between sites |
| Swipe | 1 | Left/Right | Navigate within page (arrow keys) |
| Swipe | 3 | Up | Show hidden tabs (PIN required) |
| Swipe | 3 | Down | Return to normal tabs |
| Swipe | 3 | Down | Toggle hidden tabs (PIN required) |
**Keyboard Shortcuts:**
- `Ctrl+Tab` or `Ctrl+]` - Next tab
@@ -382,25 +585,104 @@ smb://WORKGROUP/COMPUTER/PrinterName
```bash
# Run installer script again to access menu
./install_kiosk_0.9.7.sh
./ubuntu-based-kiosk.sh
# Menu structure:
# 1. Core Settings - Sites, WiFi, schedules, passwords
# 2. Addons - LMS, CUPS, VNC, VPNs
# 3. Advanced - Diagnostics, logs, Electron updates
# 1. Core Settings - Sites, WiFi, schedules, passwords, full reinstall, complete uninstall
# 2. Addons - Authelia Auto-Login, Easy Asterisk Intercom, LMS, CUPS, VNC, VPNs
# 3. Advanced - Diagnostics, logs, Electron updates, virtual consoles, emergency hotspot
# 4. Restart Kiosk Display
```
### Installing Easy Asterisk Intercom
The Easy Asterisk Intercom addon provides voice communication capabilities to your kiosk system.
**Access the addon menu:**
```bash
./ubuntu-based-kiosk.sh
# Select: 2) Addons
# Then: 4) Easy Asterisk Intercom
```
**Features:**
- **Automatic installation** - Downloads and installs the latest version from the Easy Asterisk repository
- **Update detection** - Checks for newer versions and prompts to update
- **Safe re-runs** - Can be run multiple times without breaking existing configurations
- **Config preservation** - Automatically backs up and restores configurations during updates
- **Full Asterisk PBX** - Complete telephony features including SIP, extensions, voicemail
**Installation behavior:**
- **First install:** Downloads latest version from https://github.com/outis1one/easy-asterisk
- **Already installed (latest):** Prompts to re-run installation (preserves configs)
- **Update available:** Prompts to update and shows version difference
- **All scenarios:** Configuration files in `/etc/asterisk/` and installation settings are preserved
**Managing Easy Asterisk:**
```bash
# Check installation status
systemctl status asterisk
# View Asterisk console
asterisk -rvvv
# Restart Asterisk
systemctl restart asterisk
# Configure intercom (rerun installation to update)
./ubuntu-based-kiosk.sh
# Select: 2) Addons → 4) Easy Asterisk Intercom
```
**Installation location:**
- Installation files: `/opt/easy-asterisk/`
- Configuration: `/etc/asterisk/`
- Version tracking: `/opt/easy-asterisk/.version`
- Config backups: `/opt/easy-asterisk/config_backup/`
### Updating Electron
```bash
# Via menu: Advanced → Manual Electron Update
# Via menu: Advanced → Manual Electron Update (RECOMMENDED)
# The menu option automatically:
# - Creates backup before updating
# - Shows rollback instructions
# - Handles permissions correctly
# Or manually:
cd /home/kiosk/kiosk-app
sudo -u kiosk npm install electron@latest
sudo systemctl restart lightdm
```
**Rollback if update fails:**
The menu update creates automatic backups in `/home/kiosk/electron-backup-<timestamp>/`
```bash
# 1. Stop display
sudo systemctl stop lightdm
# 2. Find your backup (most recent)
ls -lt /home/kiosk/electron-backup-* | head -1
# 3. Restore backup files (replace timestamp with your backup)
BACKUP=/home/kiosk/electron-backup-<timestamp>
sudo cp $BACKUP/package.json /home/kiosk/kiosk-app/
sudo cp $BACKUP/package-lock.json /home/kiosk/kiosk-app/ 2>/dev/null || true
# 4. Remove failed install and reinstall previous version
sudo rm -rf /home/kiosk/kiosk-app/node_modules/electron
cd /home/kiosk/kiosk-app && sudo -u kiosk npm install --unsafe-perm
# 5. Fix permissions
sudo chown root:root /home/kiosk/kiosk-app/node_modules/electron/dist/chrome-sandbox
sudo chmod 4755 /home/kiosk/kiosk-app/node_modules/electron/dist/chrome-sandbox
# 6. Restart display
sudo systemctl start lightdm
```
---
## Configuration Files
@@ -477,14 +759,98 @@ echo "NOPIN" | sudo -u kiosk tee /home/kiosk/kiosk-app/.jitsi-pin
- Triggers inactivity timeout (returns to home after idle time)
**Hidden (duration = -1):**
- Accessible via 3-finger up swipe + PIN
- Return to normal tabs via 3-finger down swipe or Escape key
- Toggle visibility via 3-finger down swipe + PIN, or F10 key
- Also use Escape key to return to normal tabs
- PIN stored in `/home/kiosk/kiosk-app/.jitsi-pin`
- Default PIN: 1234 (configurable via Sites menu)
- PIN can be 4-8 digits or disabled completely
- Hidden from normal rotation
- **Triggers inactivity timeout** (returns to home after idle time, just like manual sites)
#### Why Use Hidden Tabs?
Hidden tabs are perfect for scenarios where you need access to sensitive or private content on a shared/public kiosk:
**Private Communication:**
- Video conferencing (Jitsi Meet, Zoom, Google Meet)
- Private messaging or chat applications
- Internal communication tools for staff only
- Conference room scheduling interfaces
**Administrative Access:**
- Server administration panels (Proxmox, TrueNAS, router interfaces)
- Security camera feeds
- Home automation controls (Home Assistant, OpenHAB)
- Network monitoring dashboards
**Content Management:**
- Digital signage content editors
- Photo album management (Immich, PhotoPrism)
- Media server administration (Plex, Jellyfin)
- Calendar and scheduling updates
**Secure Entertainment:**
- Personal streaming accounts (prevent others from accessing your watch history)
- Gaming platforms or cloud gaming services
- Adult content controls (parental access only)
- Personal social media (Facebook, Instagram, etc.)
**Business Use Cases:**
- Employee time tracking systems
- Inventory management interfaces
- Point-of-sale backend access
- Staff scheduling and shift management
**Example Scenarios:**
1. **Reception Kiosk:** Public-facing sites rotate (directory, weather, news), but staff can swipe up with PIN to access appointment scheduling, visitor management, or internal messaging.
2. **Family Room Display:** Displays photo slideshows, calendar, and weather, but parents can PIN-access streaming services, smart home controls, or security cameras.
3. **Digital Signage:** Publicly shows announcements and menus, but managers can PIN-access the content management system to make updates.
4. **Conference Room Display:** Shows meeting schedules and company news, but attendees can PIN-access video conferencing or presentation tools.
The hidden tab system provides a balance between public accessibility and private functionality without needing to physically access a terminal or reconfigure the system.
#### Why Use Named Sites?
Named sites provide user-friendly labels that make navigation and management easier, especially when dealing with multiple similar URLs or complex web addresses.
**Benefits:**
- **Easier Navigation:** Click "Photo Gallery" instead of remembering "https://immich.mydomain.com:2283"
- **Better Organization:** Quickly identify sites in the navigation menu without parsing URLs
- **User-Friendly:** Non-technical users can find sites by name instead of domain
- **Cleaner Display:** "Home Assistant" is more readable than "http://192.168.1.50:8123"
- **Professional Appearance:** Business kiosks benefit from descriptive names over technical URLs
**Use Cases:**
**Home/Family Kiosks:**
- "Photo Albums" instead of "https://photoprism.local:2342"
- "Weather" instead of "https://weather.com"
- "Security Cameras" instead of "http://192.168.1.100:8000"
- "Smart Home" instead of "http://homeassistant.local:8123"
**Business Kiosks:**
- "Employee Portal" instead of "https://portal.company.com/employees"
- "Time Clock" instead of "https://timekeeping.company.com/punch"
- "Inventory System" instead of "http://10.0.0.50:8080/inventory"
- "Customer Service" instead of "https://crm.company.com/support"
**Digital Signage:**
- "Dashboard 1" through "Dashboard 5" for rotating content
- "Announcements" instead of "https://cms.local/public/announcements"
- "Menu Board" instead of "http://192.168.1.75/menus/today"
**Multi-Location Setups:**
- "Building A Reception" and "Building B Reception" for identical URL structures
- "Floor 1 Display" through "Floor 10 Display" for elevator kiosks
- "East Wing" and "West Wing" for hospital navigation
Names are completely optional - if left blank, the URL will be displayed as usual. Configure names during initial setup or update them later via: Core Settings → Sites → Update site names.
### Inactivity Extensions
When "Are you still here?" prompt appears (on manual or hidden sites):
@@ -548,6 +914,143 @@ Example: Display off 22:00-06:00, optional password on wake
---
## Installation & Management Features
### Virtual Console Configuration
Virtual consoles provide terminal access via Ctrl+Alt+F1 through F8 keyboard combinations.
**During Installation:**
- Prompted at the end of initial setup
- Default: ENABLED (Ubuntu standard behavior)
- Option to disable for enhanced security
**Security Considerations:**
*Enabled (Default):*
- Allows manual terminal login for troubleshooting
- Useful for SSH failures or network issues
- Standard Ubuntu/Linux behavior
- Can login with kiosk user credentials or main user account
*Disabled (More Secure):*
- Blocks direct terminal access
- Forces all access through SSH or menu system
- Better for public kiosks or untrusted environments
- Can still be re-enabled via Advanced menu (requires existing SSH access)
**Post-Install Management:**
```bash
# Access via menu: Advanced → Virtual Consoles (option 7)
# Note: Changes require restarting the display manager to take effect
# Manual enable
for i in {1..8}; do sudo systemctl unmask getty@tty$i.service; done
sudo systemctl daemon-reload
sudo systemctl restart lightdm
# Manual disable
for i in {1..8}; do sudo systemctl mask getty@tty$i.service; done
sudo systemctl daemon-reload
sudo systemctl restart lightdm
```
**Important Notes:**
- **Version 0.9.7-4** fixed Ctrl+Alt+F1-F8 key combinations (now properly enables/disables X11 VT switching)
- If you enabled virtual consoles in an earlier version, you must re-enable them from the menu for keys to work
- Changes require restarting lightdm: `sudo systemctl restart lightdm`
**Typical TTY Layout:**
- TTY1-6: Login consoles (if enabled)
- TTY7: Graphical kiosk display (X11/LightDM)
- TTY8: Available for additional services
### Emergency WiFi Hotspot
Automatically creates a WiFi access point when internet connectivity is lost.
**During Installation:**
- Prompted at the end of initial setup
- Optional configuration with custom SSID and password
- Can be deferred and configured later
**How It Works:**
1. Service monitors internet connectivity every 30 seconds
2. When internet is lost, automatically:
- Creates WiFi hotspot with configured credentials
- Assigns IP address (default: 10.42.0.1)
- Displays on-screen notification with connection details
- Serves simple web page at http://10.42.0.1
3. When internet returns, hotspot automatically shuts down
**Use Cases:**
- Initial WiFi configuration without keyboard
- Network troubleshooting when SSH is unavailable
- Remote location setup without IT staff present
- Automatic failover for temporary connectivity issues
**Configuration:**
```bash
# Access via menu: Advanced → Emergency Hotspot (option 9)
# Default credentials:
SSID: Kiosk-Emergency
Password: kioskhotspot123
# Once connected to hotspot:
# - SSH: ssh user@10.42.0.1
# - Web: http://10.42.0.1 (shows connection info)
# - Run installer script to reconfigure WiFi
```
**Files Created:**
- `/usr/local/bin/kiosk-emergency-hotspot` - Main service script
- `/etc/systemd/system/kiosk-emergency-hotspot.service` - Systemd service
### Complete Uninstall
Full system cleanup that removes all kiosk components and restores the system to pre-installation state.
**Access:**
```bash
# Core Settings menu → option 11
./ubuntu-based-kiosk.sh
# Choose: Core Settings → Complete Uninstall
```
**What Gets Removed:**
- Kiosk user and all user data
- All Electron and Node.js installations
- LightDM and Openbox window manager
- All systemd services and timers
- All kiosk scripts and configurations
- CUPS printing system
- VNC server
- Emergency hotspot configuration
- All scheduled tasks (power, display, quiet hours)
**What Gets Preserved:**
- VPN configurations (if not manually removed)
- System packages (Ubuntu base system)
- Network configuration (WiFi, ethernet)
- SSH server and settings
- User accounts (except kiosk user)
**Safety Features:**
- Requires typing "UNINSTALL" to confirm
- Re-enables virtual consoles automatically
- Stops all services before removal
- Offers optional reboot after completion
- No way to undo - creates clean slate
**Use When:**
- Repurposing hardware for different use
- Testing/development cleanup
- Complete fresh start needed
- Removing kiosk from production system
---
## Third-Party Software Licenses
This project bundles or installs several open-source components under their respective licenses:
@@ -635,32 +1138,13 @@ This project bundles or installs several open-source components under their resp
- **Repository:** https://github.com/netbirdio/netbird
- **Full License:** https://github.com/netbirdio/netbird/blob/main/LICENSE
### Mumble Client (Voice Communication)
- **License:** BSD-3-Clause
- **Source:** https://www.mumble.info
- **Repository:** https://github.com/mumble-voip/mumble
- **Full License:** https://github.com/mumble-voip/mumble/blob/master/LICENSE
- **Note:** Used in separate voice communication components
### Murmur Server (Mumble Server)
- **License:** BSD-3-Clause
- **Source:** https://www.mumble.info
- **Repository:** https://github.com/mumble-voip/mumble
- **Full License:** https://github.com/mumble-voip/mumble/blob/master/LICENSE
- **Note:** Used in separate voice communication components
### TalkKonnect (Mumble PTT Client)
- **License:** Mozilla Public License 2.0 (MPL-2.0)
- **Source:** https://github.com/talkkonnect/talkkonnect
- **Repository:** https://github.com/talkkonnect/talkkonnect
- **Full License:** https://github.com/talkkonnect/talkkonnect/blob/master/LICENSE
- **Note:** Used in separate voice communication components
---
## UBK Project License
## Ubuntu Based Kiosk Project License
The UBK installer script and original code components are licensed under **GPL-3.0-or-later**.
The Ubuntu Based Kiosk installer script and original code components are licensed under **GPL-3.0-or-later**.
See the LICENSE file in the repository for full terms.
@@ -678,20 +1162,100 @@ See the LICENSE file in the repository for full terms.
---
## Modular Management (new, in progress)
The 12,000+ line single-file installer works, but every menu lives in the
same file as everything else, which makes small changes risky. We're
pulling the *menu system* out into small, independently editable files as
groundwork for the planned web-based GUI (same modules will back both the
terminal menu and the web UI, so they can't drift apart).
**What's here so far:**
- `lib/menu.sh` — a generic numbered-menu framework (auto-numbers entries,
always offers `0` to exit/return, validated input helpers). Menu files
just declare their labels and handler functions; they don't hand-roll
`echo`/`case` loops.
- `lib/config.sh` — the single place that reads/writes `config.json`.
- `menus/sites.sh`**Sites & Page Timing**, fully migrated: add, edit,
delete, and reorder pages, and set the duration/timing mode
(auto-rotate / manual / hidden) and home page — as a working proof of
concept for this approach.
- `menus/display.sh`**Display & Interaction**: touch gesture mode,
link navigation security, and the on-screen pause/keyboard/navigation
button toggles. A second proof of concept covering a different menu
shape (settings toggles vs. the list CRUD in Sites).
- `install.sh` — entry point for the modular tool. Run it against an
*already-installed* kiosk:
```bash
git clone https://github.com/outis1one/ubuntu-based-kiosk/
cd ubuntu-based-kiosk
./install.sh
```
This does **not** yet replace first-time installation — that's still the
single-file script above (`Quick Install`). The rest of Core
Settings/Addons/Advanced will move into `menus/*.sh` the same way, one
menu at a time, and `install.sh` will eventually take over the whole
`show_main_menu` from the legacy script.
---
## Project Status & Future Plans
**Current Version:** 0.9.7 - Site-Specific Extension Fix
**Current Version:** 2.0.0
**Recent Updates (v2.0.0):**
- **Modular management path:** new `lib/menu.sh` (reusable numbered-menu framework: auto-numbered entries, `0` always exits/returns) and `lib/config.sh` (single load/save for `config.json`), with menus migrating into `menus/*.sh` one at a time — **Sites & Page Timing** and **Display & Interaction** are migrated so far. Run via `./install.sh` after cloning the repo, against an already-installed kiosk (see "Modular Management" below). Groundwork for the planned web-based GUI, which will share this same `lib/config.sh` layer.
- **Bug fix:** the old Sites menu could save `config.json` without first loading swipe/navigation/lockout settings, silently resetting them to script defaults.
- **Bug fix:** reordering sites had an off-by-one that left the moved site one slot short of the requested position.
- **Renamed installer:** the main script is now `ubuntu-based-kiosk.sh` (no version number in the filename), updated in place going forward. Released versions are tracked via git history and this changelog instead of the filename; older `ubuntu-based-kiosk-v*.sh` / `install_kiosk_*.sh` files remain in the repo as archived releases.
**Previous (v1.0.3):**
- **HDMI/external display mirroring:** any connected display beyond the primary (e.g. HDMI-out to a monitor/TV) is now mirrored automatically at the primary's exact resolution — generating a custom `cvt` mode if the external display doesn't natively list it — both at kiosk login/boot and live on plug/unplug via a new udev-triggered `kiosk-hotplug.service`. Previously the external output was left inactive even when detected by X, and would otherwise mirror at its own native resolution instead of matching the kiosk panel
- **HDMI audio routing:** audio now follows the same hotplug event — the default PipeWire sink automatically switches to the HDMI audio output when an external display is connected/mirrored, and back to the built-in sink when it's disconnected (`kiosk-audio-route.sh`)
- **Package install:** installer now also installs `net-tools` and `ncdu` (alongside the already-installed `curl` and `git`)
- **Touch input fix (keyring):** added `--password-store=basic` to the Electron launch. Under LightDM autologin the GNOME keyring stays locked; when Chromium accessed it, the keyring unlock dialog grabbed all keyboard/touch input — the kiosk rendered fine but ignored every tap and keypress. This flag stops Electron from using the keyring, so the dialog never appears.
- **Touch gesture fix (libinput):** any touch screen is now forced to the `libinput` driver via `/etc/X11/xorg.conf.d/99-finger-libinput.conf` (matched by hardware capability, so it works on any brand and never affects keyboards, mice, or the pen/stylus). Some drivers — notably `wacom` — only do single-touch pointer emulation and never pass real multitouch to Chromium, so 1-finger and 2-finger swipe gestures could not fire. libinput delivers proper multitouch.
- **Upgrade reliability:** `start.sh` is now refreshed on every upgrade alongside `main.js` and `preload.js`
- **Upgrade fix:** node_modules no longer wiped during upgrade — preserves the ~120MB Electron binary so upgrades don't fail on slow/unreliable connections
- **Authelia fix:** 10-second timeout on Authelia login fetch prevents white screen when Authelia is slow to respond
- **Authelia config:** clearer YAML merge instructions with before/after examples to prevent duplicate `access_control:` block mistake
- **Upgrade fix:** config backup cleanup now uses `sudo rm` to avoid "Operation not permitted" error
**Previous (v1.0.2):**
- **Authelia Auto-Login addon** (`Addons → 5`) — authenticates with Authelia SSO on every startup; password stored encrypted (AES-256 keyed from machine ID, not plain text); prints full Dockerized Authelia server-side setup after configuration
- **Bug fix:** PipeWire config dirs were created as root at step [5.5/27], causing "Permission denied" on fresh installs
- **README:** install commands no longer hardcode version numbers — always fetch latest from GitHub
**Previous (v1.0.1):**
- **Node.js upgrade:** 20 LTS → 22 LTS
- **Electron upgrade:** v39/41 → v42.x
**Previous (v1.0.0):**
- **Upgrade fix:** file extraction now correctly verifies written files on Ubuntu 22.04+ systems where the kiosk home directory has restrictive permissions (750)
- **Install fix:** sudo credentials primed upfront before the long apt install step, preventing cache expiry at the timezone prompt
- **Timezone fix:** fallback to direct `/etc/localtime` symlink when `timedatectl` fails via D-Bus
**Previous (v0.9.9.1):**
- Silent upgrade: no user input required, extracts files directly from script
- Power button fixes
- Import allows selecting backup by number instead of typing path
**Previous (v0.9.8):**
- Easy Asterisk Intercom addon with automatic updates
- Smart version detection and configuration preservation
- Named websites feature for user-friendly site identification
- Navigation menu with key icon
**Planned Features:**
- Web-based GUI configuration interface
- All-in-one ISO installer
- Voice communication integration (Mumble/TalkKonnect)
- Enhanced Raspberry Pi support and testing
**Known Limitations:**
- Raspberry Pi support untested in production
- No web-based configuration (CLI menu only)
- Single display only (extended desktop not supported)
- Extended desktop not supported — additional connected displays (e.g. HDMI-out to a monitor/TV) are automatically **mirrored**, not extended
---
@@ -708,19 +1272,19 @@ Contributions welcome! Please:
## Support & Community
- **Repository:** https://github.com/outis1one/ubk/
- **Issues:** https://github.com/outis1one/ubk/issues
- **Discussions:** https://github.com/outis1one/ubk/discussions
- **Repository:** https://github.com/outis1one/ubuntu-based-kiosk/
- **Issues:** https://github.com/outis1one/ubuntu-based-kiosk/issues
- **Discussions:** https://github.com/outis1one/ubuntu-based-kiosk/discussions
---
## Credits
Built with assistance from **Claude Sonnet 4/.5** (Anthropic AI)
Built with assistance from **Claude Sonnet 4.6** (Anthropic AI)
Special thanks to the maintainers of all upstream projects that make UBK possible.
Special thanks to the maintainers of all upstream projects that make Ubuntu Based Kiosk possible.
---
*Last Updated: November 23 2025*
*Version: Check script header for current version*
*Last Updated: June 15, 2026*
*Version: 1.0.3*
+314
View File
@@ -0,0 +1,314 @@
#!/bin/bash
################################################################################
# Asterisk-Easy Addon Installation Functions
# Description: Addon module for installing and configuring Asterisk-Easy
# Version: 1.0
################################################################################
# Color definitions for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
################################################################################
# Function: install_asterisk_easy
# Description: Main function to install Asterisk-Easy
# Parameters: None
# Returns: 0 on success, 1 on failure
################################################################################
install_asterisk_easy() {
echo -e "${BLUE}================================${NC}"
echo -e "${BLUE}Asterisk-Easy Installation${NC}"
echo -e "${BLUE}================================${NC}"
# Update system packages
echo -e "${YELLOW}Updating system packages...${NC}"
apt-get update -qq
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to update system packages${NC}"
return 1
fi
# Install Asterisk dependencies
echo -e "${YELLOW}Installing Asterisk dependencies...${NC}"
apt-get install -y \
asterisk \
asterisk-config \
asterisk-dev \
asterisk-doc \
asterisk-modules \
asterisk-voicemail \
dahdi \
libpri \
asterisk-dahdi &>/dev/null
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to install Asterisk packages${NC}"
return 1
fi
# Install additional dependencies
echo -e "${YELLOW}Installing additional dependencies...${NC}"
apt-get install -y \
build-essential \
libssl-dev \
libxml2-dev \
libsqlite3-dev \
uuid-dev &>/dev/null
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to install additional dependencies${NC}"
return 1
fi
# Configure Asterisk
echo -e "${YELLOW}Configuring Asterisk...${NC}"
configure_asterisk_easy
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to configure Asterisk-Easy${NC}"
return 1
fi
# Start Asterisk service
echo -e "${YELLOW}Starting Asterisk service...${NC}"
systemctl enable asterisk
systemctl start asterisk
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to start Asterisk service${NC}"
return 1
fi
echo -e "${GREEN}✓ Asterisk-Easy installation completed successfully${NC}"
return 0
}
################################################################################
# Function: configure_asterisk_easy
# Description: Configure Asterisk-Easy with basic settings
# Parameters: None
# Returns: 0 on success, 1 on failure
################################################################################
configure_asterisk_easy() {
local asterisk_dir="/etc/asterisk"
# Check if Asterisk directory exists
if [ ! -d "$asterisk_dir" ]; then
echo -e "${RED}Asterisk configuration directory not found: $asterisk_dir${NC}"
return 1
fi
# Backup original configuration files
echo -e "${YELLOW}Backing up original Asterisk configuration...${NC}"
if [ -f "$asterisk_dir/extensions.conf" ]; then
cp "$asterisk_dir/extensions.conf" "$asterisk_dir/extensions.conf.bak.$(date +%s)"
fi
if [ -f "$asterisk_dir/sip.conf" ]; then
cp "$asterisk_dir/sip.conf" "$asterisk_dir/sip.conf.bak.$(date +%s)"
fi
# Create basic extensions configuration
echo -e "${YELLOW}Creating basic extensions configuration...${NC}"
create_extensions_conf "$asterisk_dir"
# Create basic SIP configuration
echo -e "${YELLOW}Creating basic SIP configuration...${NC}"
create_sip_conf "$asterisk_dir"
return 0
}
################################################################################
# Function: create_extensions_conf
# Description: Create basic extensions configuration file
# Parameters: $1 - Asterisk configuration directory
# Returns: 0 on success, 1 on failure
################################################################################
create_extensions_conf() {
local asterisk_dir="$1"
local extensions_file="$asterisk_dir/extensions.conf"
cat > "$extensions_file" << 'EOF'
[general]
static=yes
writeprotect=no
[default]
exten => 100,1,Dial(SIP/100)
exten => 100,n,Voicemail(100@default)
exten => 100,n,Hangup()
exten => 101,1,Dial(SIP/101)
exten => 101,n,Voicemail(101@default)
exten => 101,n,Hangup()
exten => 102,1,Dial(SIP/102)
exten => 102,n,Voicemail(102@default)
exten => 102,n,Hangup()
exten => 200,1,VoicemailMain(${CALLERID(num)}@default)
exten => 200,n,Hangup()
EOF
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to create extensions configuration${NC}"
return 1
fi
return 0
}
################################################################################
# Function: create_sip_conf
# Description: Create basic SIP configuration file
# Parameters: $1 - Asterisk configuration directory
# Returns: 0 on success, 1 on failure
################################################################################
create_sip_conf() {
local asterisk_dir="$1"
local sip_file="$asterisk_dir/sip.conf"
cat > "$sip_file" << 'EOF'
[general]
context=default
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
pedantic=no
maxexpiry=3600
minexpiry=60
defaultexpiry=120
defaultexpirey=120
rtptimeout=30
rtpholdtimeout=300
videosupport=yes
allowtransfer=yes
nat=force_rport,comedia
[100]
type=friend
secret=123456
host=dynamic
context=default
[101]
type=friend
secret=123456
host=dynamic
context=default
[102]
type=friend
secret=123456
host=dynamic
context=default
EOF
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to create SIP configuration${NC}"
return 1
fi
return 0
}
################################################################################
# Function: verify_asterisk_easy
# Description: Verify Asterisk-Easy installation
# Parameters: None
# Returns: 0 if installed and running, 1 otherwise
################################################################################
verify_asterisk_easy() {
# Check if Asterisk is installed
if ! command -v asterisk &> /dev/null; then
echo -e "${RED}Asterisk is not installed${NC}"
return 1
fi
# Check if Asterisk service is running
if ! systemctl is-active --quiet asterisk; then
echo -e "${YELLOW}Asterisk service is not running${NC}"
return 1
fi
echo -e "${GREEN}✓ Asterisk-Easy is properly installed and running${NC}"
return 0
}
################################################################################
# Function: show_asterisk_easy_status
# Description: Display Asterisk-Easy status information
# Parameters: None
# Returns: 0 on success
################################################################################
show_asterisk_easy_status() {
echo -e "${BLUE}================================${NC}"
echo -e "${BLUE}Asterisk-Easy Status${NC}"
echo -e "${BLUE}================================${NC}"
# Check service status
if systemctl is-active --quiet asterisk; then
echo -e "${GREEN}Service Status: Running${NC}"
else
echo -e "${RED}Service Status: Not Running${NC}"
fi
# Check Asterisk version
if command -v asterisk &> /dev/null; then
local version=$(asterisk -v | grep -oP 'Asterisk \K[0-9.]+')
echo -e "${BLUE}Asterisk Version: $version${NC}"
fi
# Check configuration files
if [ -f "/etc/asterisk/extensions.conf" ]; then
echo -e "${GREEN}✓ Extensions Configuration: Present${NC}"
else
echo -e "${RED}✗ Extensions Configuration: Missing${NC}"
fi
if [ -f "/etc/asterisk/sip.conf" ]; then
echo -e "${GREEN}✓ SIP Configuration: Present${NC}"
else
echo -e "${RED}✗ SIP Configuration: Missing${NC}"
fi
return 0
}
################################################################################
# Function: remove_asterisk_easy
# Description: Remove Asterisk-Easy installation
# Parameters: None
# Returns: 0 on success, 1 on failure
################################################################################
remove_asterisk_easy() {
echo -e "${YELLOW}Removing Asterisk-Easy...${NC}"
# Stop Asterisk service
systemctl stop asterisk
systemctl disable asterisk
# Remove Asterisk packages
apt-get remove -y asterisk asterisk-* &>/dev/null
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to remove Asterisk packages${NC}"
return 1
fi
echo -e "${GREEN}✓ Asterisk-Easy has been removed${NC}"
return 0
}
# Export functions for use in main script
export -f install_asterisk_easy
export -f configure_asterisk_easy
export -f verify_asterisk_easy
export -f show_asterisk_easy_status
export -f remove_asterisk_easy
Executable
+79
View File
@@ -0,0 +1,79 @@
#!/bin/bash
################################################################################
# install.sh - Modular management entry point for Ubuntu Based Kiosk.
#
# This is NOT yet the full system installer - that is still the big
# single-file script (ubuntu-based-kiosk-v1.0.3.sh etc) documented in
# Readme.md, and first-time provisioning of a new kiosk still goes through
# it. This entry point is the start of pulling the *menu system* out of
# that 12k-line file into small, independently editable modules under
# lib/ and menus/, so a change to (say) the Sites menu can't accidentally
# break WiFi setup or the uninstaller three thousand lines away.
#
# Today this wires up Sites & Page Timing (menus/sites.sh) and Display &
# Interaction (menus/display.sh). The rest of Core Settings/Addons/Advanced
# will move over the same way, one menus/*.sh file at a time.
#
# Usage (once the kiosk has already been installed):
# git clone <repo>
# cd ubuntu-based-kiosk
# ./install.sh
################################################################################
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=lib/menu.sh
source "$SCRIPT_DIR/lib/menu.sh"
# shellcheck source=lib/config.sh
source "$SCRIPT_DIR/lib/config.sh"
# shellcheck source=menus/sites.sh
source "$SCRIPT_DIR/menus/sites.sh"
# shellcheck source=menus/display.sh
source "$SCRIPT_DIR/menus/display.sh"
################################################################################
# Preflight
################################################################################
if [[ "$(whoami)" == "kiosk" ]]; then
log_error "Cannot run as user 'kiosk'"
exit 1
fi
if [[ $EUID -eq 0 ]]; then
log_error "Run as a regular user with sudo privileges, not as root"
exit 1
fi
if ! command -v jq &>/dev/null; then
log_error "jq is required but not installed. Run: sudo apt-get install -y jq"
exit 1
fi
if ! is_kiosk_installed; then
echo
log_error "No installed kiosk found at ${KIOSK_DIR}."
echo
echo "This tool manages an already-installed kiosk. To provision a new"
echo "one for the first time, use the full installer instead - see"
echo "Readme.md ('Quick Install') for the current download command."
echo
exit 1
fi
################################################################################
# Top-level menu
################################################################################
main_menu_builder() {
MENU_LABELS=("Sites & Page Timing" "Display & Interaction")
MENU_HANDLERS=(sites_menu display_menu)
}
main_menu_status() {
echo "Managing kiosk at: ${KIOSK_DIR}"
}
run_menu "UBUNTU BASED KIOSK - MANAGEMENT" main_menu_builder main_menu_status "Exit"
@@ -1,13 +1,17 @@
#!/bin/bash
################################################################################
### Ubuntu Based Kiosk (UBK) v0.9.7 ###
### Ubuntu Based Kiosk v0.9.7-3 ###
################################################################################
#
# RELEASE v0.9.7 - phase one complete
# RELEASE v0.9.7-3 - Install improvements & management features
# - Fixed missing complete_uninstall function
# - Added virtual console configuration (Ctrl+Alt+F1-F8)
# - Added emergency hotspot to initial installation
# - Enhanced security options and documentation
#
# Built with Claude Sonnet 4/.5 AI assistance
# License: GPL v3 - Keep derivatives open sour
# Repository: https://github.com/outis1one/ubk/
# License: GPL v3 - Keep derivatives open source
# Repository: https://github.com/outis1one/ubuntu-based-kiosk/
#
# TARGET SYSTEMS:
# - Ubuntu 24.04+ Server (minimal install recommended)
@@ -35,7 +39,7 @@ set -euo pipefail
### SECTION 1: CONSTANTS & GLOBALS
################################################################################
SCRIPT_VERSION="0.9.7"
SCRIPT_VERSION="0.9.7-3"
KIOSK_USER="kiosk"
BUILD_USER="${SUDO_USER:-$(whoami)}"
KIOSK_HOME="/home/${KIOSK_USER}"
@@ -2146,7 +2150,75 @@ disable_emergency_hotspot() {
pause
}
################################################################################
### VIRTUAL CONSOLE CONFIGURATION
################################################################################
configure_virtual_consoles() {
clear
echo "══════════════════════════════════════════════════════════════"
echo " VIRTUAL CONSOLE CONFIGURATION "
echo "══════════════════════════════════════════════════════════════"
echo
echo "Virtual consoles (Ctrl+Alt+F1 through F8) allow manual login"
echo "to a terminal for troubleshooting and system maintenance."
echo
echo "Current status:"
# Check if virtual consoles are enabled
local consoles_disabled=false
if systemctl is-masked getty@tty1.service >/dev/null 2>&1; then
consoles_disabled=true
echo " Virtual consoles: ✗ DISABLED"
else
consoles_disabled=false
echo " Virtual consoles: ✓ ENABLED"
fi
echo
echo "Options:"
echo " 1. Enable virtual consoles (Ctrl+Alt+F1-F8 for manual login)"
echo " 2. Disable virtual consoles (more secure, kiosk only)"
echo " 0. Cancel"
echo
read -r -p "Choose [0-2]: " choice
case "$choice" in
1)
echo
echo "Enabling virtual consoles..."
for i in {1..8}; do
sudo systemctl unmask getty@tty$i.service 2>/dev/null || true
done
sudo systemctl daemon-reload
log_success "Virtual consoles enabled"
echo
echo "You can now access virtual consoles with:"
echo " Ctrl+Alt+F1 through Ctrl+Alt+F8"
echo " (Ctrl+Alt+F7 typically returns to the kiosk)"
pause
;;
2)
echo
read -r -p "Disable all virtual consoles? (y/n): " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
echo "Disabling virtual consoles..."
for i in {1..8}; do
sudo systemctl mask getty@tty$i.service 2>/dev/null || true
done
sudo systemctl daemon-reload
log_success "Virtual consoles disabled"
echo
echo "Virtual console access has been disabled for security."
echo "You can re-enable them from the Tools menu if needed."
pause
fi
;;
0)
return
;;
esac
}
################################################################################
### SECTION 5: POWER/DISPLAY/QUIET SCHEDULES
@@ -3475,6 +3547,124 @@ full_reinstall() {
echo ""
pause
}
complete_uninstall() {
echo ""
echo "══════════════════════════════════════════════════════════════"
echo " COMPLETE UNINSTALL"
echo "══════════════════════════════════════════════════════════════"
echo ""
echo "⚠️ This will COMPLETELY REMOVE:"
echo " • Kiosk user and all data"
echo " • All kiosk configuration and sites"
echo " • All Electron/Node.js installations"
echo " • All browser caches and data"
echo " • CUPS printer system"
echo " • LightDM and Openbox"
echo " • All kiosk schedules and services"
echo " • Emergency hotspot configuration"
echo ""
echo "⚠️ This CANNOT be undone!"
echo ""
read -p "Are you ABSOLUTELY SURE? (type UNINSTALL): " CONFIRM
if [ "$CONFIRM" != "UNINSTALL" ]; then
echo "Cancelled."
return
fi
echo ""
echo "Beginning complete uninstall..."
# Stop all services
echo "[1/12] Stopping all kiosk services..."
sudo systemctl stop lightdm 2>/dev/null || true
sudo systemctl stop kiosk-emergency-hotspot.service 2>/dev/null || true
sudo systemctl stop kiosk-shutdown.timer 2>/dev/null || true
sudo systemctl stop kiosk-display-on.timer 2>/dev/null || true
sudo systemctl stop kiosk-display-off.timer 2>/dev/null || true
sudo systemctl stop kiosk-quiet-start.timer 2>/dev/null || true
sudo systemctl stop kiosk-quiet-end.timer 2>/dev/null || true
sudo systemctl stop kiosk-electron-reload.timer 2>/dev/null || true
sudo systemctl stop x11vnc 2>/dev/null || true
# Remove kiosk user
echo "[2/12] Removing kiosk user..."
if id "$KIOSK_USER" &>/dev/null; then
sudo pkill -u "$KIOSK_USER" 2>/dev/null || true
sudo userdel -r "$KIOSK_USER" 2>/dev/null || true
log_success "Kiosk user removed"
fi
# Remove kiosk files
echo "[3/12] Removing kiosk files..."
sudo rm -rf "$KIOSK_DIR"
sudo rm -rf /home/$KIOSK_USER
# Remove systemd services and timers
echo "[4/12] Removing systemd services..."
sudo rm -f /etc/systemd/system/kiosk-*.service
sudo rm -f /etc/systemd/system/kiosk-*.timer
sudo rm -f /etc/systemd/system/x11vnc.service
sudo systemctl daemon-reload
# Remove scripts
echo "[5/12] Removing scripts..."
sudo rm -f /usr/local/bin/kiosk-*
sudo rm -f /usr/local/bin/rtc-wake.sh
# Remove CUPS
echo "[6/12] Removing CUPS..."
sudo systemctl stop cups 2>/dev/null || true
sudo systemctl disable cups 2>/dev/null || true
sudo apt-get purge -y cups cups-client cups-common 2>/dev/null || true
# Remove Node.js and Electron
echo "[7/12] Removing Node.js..."
sudo apt-get purge -y nodejs npm 2>/dev/null || true
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /usr/local/bin/node
sudo rm -rf /usr/local/bin/npm
# Remove LightDM and Openbox
echo "[8/12] Removing LightDM and Openbox..."
sudo systemctl disable lightdm 2>/dev/null || true
sudo apt-get purge -y lightdm openbox 2>/dev/null || true
# Remove VNC
echo "[9/12] Removing VNC..."
sudo systemctl stop x11vnc 2>/dev/null || true
sudo systemctl disable x11vnc 2>/dev/null || true
sudo apt-get purge -y x11vnc 2>/dev/null || true
# Remove polkit rules
echo "[10/12] Removing polkit rules..."
sudo rm -f /etc/polkit-1/localauthority/50-local.d/kiosk-power.pkla
# System cleanup
echo "[11/12] Cleaning up packages..."
sudo apt-get autoremove -y 2>/dev/null || true
sudo apt-get autoclean 2>/dev/null || true
# Re-enable virtual consoles if they were disabled
echo "[12/12] Re-enabling virtual consoles..."
for i in {1..6}; do
sudo systemctl unmask getty@tty$i.service 2>/dev/null || true
done
echo ""
echo "✓✓✓ KIOSK COMPLETELY UNINSTALLED ✓✓✓"
echo ""
echo "The system has been returned to its pre-kiosk state."
echo "You may want to reboot to ensure all changes take effect."
echo ""
read -r -p "Reboot now? (y/n): " do_reboot
if [[ "$do_reboot" =~ ^[Yy]$ ]]; then
echo "Rebooting..."
sleep 3
sudo reboot
fi
}
################################################################################
### SECTION 8: FIRST TIME INSTALLATION
################################################################################
@@ -6575,6 +6765,52 @@ fi
echo "[26/27] Finalizing installation..."
log_success "Core installation complete!"
echo
# Optional: Configure emergency hotspot
echo
echo "══════════════════════════════════════════════════════════════"
echo " OPTIONAL: Emergency Hotspot "
echo "══════════════════════════════════════════════════════════════"
echo
echo "The emergency hotspot automatically activates when there's no"
echo "internet connection, allowing you to connect and troubleshoot."
echo
read -r -p "Configure emergency hotspot now? (y/n): " setup_hotspot
if [[ "$setup_hotspot" =~ ^[Yy]$ ]]; then
install_emergency_hotspot
else
log_info "Emergency hotspot can be configured later from Advanced menu"
fi
# Optional: Configure virtual consoles
echo
echo "══════════════════════════════════════════════════════════════"
echo " OPTIONAL: Virtual Console Access "
echo "══════════════════════════════════════════════════════════════"
echo
echo "Virtual consoles (Ctrl+Alt+F1-F8) allow manual terminal login"
echo "for troubleshooting. This is useful but less secure."
echo
echo "Current status: ENABLED (default)"
echo
read -r -p "Keep virtual consoles enabled? (y/n): " keep_consoles
if [[ ! "$keep_consoles" =~ ^[Yy]$ ]]; then
echo
echo "Disabling virtual consoles for security..."
for i in {1..8}; do
sudo systemctl mask getty@tty$i.service 2>/dev/null || true
done
sudo systemctl daemon-reload
log_success "Virtual consoles disabled"
echo
echo "You can re-enable them later from Advanced menu (option 7)"
else
log_info "Virtual consoles remain enabled (Ctrl+Alt+F1-F8)"
fi
echo
echo "[27/27] Installation complete!"
echo
echo "Next steps:"
echo " • Rerun this script to configure addons"
echo " • Reboot to start the kiosk"
@@ -8957,12 +9193,13 @@ advanced_menu() {
echo " 4. Audio Diagnostics"
echo " 5. Fix Squeezelite Audio"
echo " 6. Factory Reset Config"
echo " 7. Virtual Consoles (Ctrl+Alt+F1-F8)"
echo " 9. Emergency Hotspot"
echo " 10. Network Test"
echo " 0. Return"
echo
read -r -p "Choose [0-10]: " choice
case "$choice" in
1) manual_electron_update ;;
2) system_diagnostics ;;
@@ -8970,6 +9207,7 @@ advanced_menu() {
4) audio_diagnostics ;;
5) fix_squeezelite_audio ;;
6) factory_reset ;;
7) configure_virtual_consoles ;;
9) configure_emergency_hotspot ;;
10) network_test ;;
0) return ;;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+202
View File
@@ -0,0 +1,202 @@
#!/bin/bash
################################################################################
# lib/config.sh - config.json read/write for the kiosk Electron app.
#
# Every menu that touches sites/timing/settings works against the same
# in-memory bash arrays (URLS, DURS, USERS, PASSES, NAMES, ...) and the same
# two functions below. Load once when a menu opens, save after each change.
#
# IMPORTANT: save_config() rewrites config.json from these globals in full.
# Any menu that calls save_config() MUST call load_existing_config() first
# (even if it only touches sites), otherwise settings it doesn't know about
# (swipe mode, navigation security, lockout, etc) get silently reset to
# script defaults. This bit the old single-file Sites menu, which read
# tabs directly via jq but never loaded the rest of the settings - fixed
# here by making load_existing_config() the one canonical loader.
################################################################################
: "${KIOSK_USER:=kiosk}"
: "${KIOSK_HOME:=/home/${KIOSK_USER}}"
: "${KIOSK_DIR:=${KIOSK_HOME}/kiosk-app}"
: "${CONFIG_PATH:=${KIOSK_DIR}/config.json}"
# Site/tab arrays
declare -a URLS=()
declare -a DURS=()
declare -a USERS=()
declare -a PASSES=()
declare -a NAMES=()
# Other top-level config.json settings we must round-trip even though the
# Sites menu doesn't edit most of them.
AUTOSWITCH="true"
SWIPE_MODE="dual"
ALLOW_NAVIGATION="same-origin"
HOME_TAB_INDEX=-1
INACTIVITY_TIMEOUT=120
ENABLE_PAUSE_BUTTON="true"
ENABLE_KEYBOARD_BUTTON="true"
ENABLE_NAV_BUTTON="true"
ENABLE_PASSWORD_PROTECTION="false"
LOCKOUT_PASSWORD=""
LOCKOUT_TIMEOUT=0
LOCKOUT_AT_TIME=""
LOCKOUT_ACTIVE_START=""
LOCKOUT_ACTIVE_END=""
REQUIRE_PASSWORD_ON_BOOT="false"
kiosk_user_exists() {
id "$KIOSK_USER" &>/dev/null
}
is_kiosk_installed() {
kiosk_user_exists && sudo -u "$KIOSK_USER" test -f "$KIOSK_DIR/main.js" 2>/dev/null
}
is_service_active() {
local service="$1"
systemctl is-active --quiet "$service" 2>/dev/null
}
# Load every setting config.json has into the bash globals above.
# Safe to call with no existing config file - leaves script defaults in place.
load_existing_config() {
if ! sudo -u "$KIOSK_USER" test -f "$CONFIG_PATH" 2>/dev/null; then
return 0
fi
URLS=()
DURS=()
USERS=()
PASSES=()
NAMES=()
local tab_count
tab_count=$(sudo -u "$KIOSK_USER" jq -r '.tabs | length' "$CONFIG_PATH" 2>/dev/null || echo "0")
if [[ "$tab_count" -gt 0 ]]; then
for ((i = 0; i < tab_count; i++)); do
URLS+=("$(sudo -u "$KIOSK_USER" jq -r ".tabs[$i].url" "$CONFIG_PATH")")
DURS+=("$(sudo -u "$KIOSK_USER" jq -r ".tabs[$i].duration" "$CONFIG_PATH")")
USERS+=("$(sudo -u "$KIOSK_USER" jq -r ".tabs[$i].username // empty" "$CONFIG_PATH")")
PASSES+=("$(sudo -u "$KIOSK_USER" jq -r ".tabs[$i].password // empty" "$CONFIG_PATH")")
NAMES+=("$(sudo -u "$KIOSK_USER" jq -r ".tabs[$i].name // empty" "$CONFIG_PATH")")
done
fi
HOME_TAB_INDEX=$(sudo -u "$KIOSK_USER" jq -r '.homeTabIndex // -1' "$CONFIG_PATH" 2>/dev/null || echo "-1")
INACTIVITY_TIMEOUT=$(sudo -u "$KIOSK_USER" jq -r '.inactivityTimeout // 120' "$CONFIG_PATH" 2>/dev/null || echo "120")
ALLOW_NAVIGATION=$(sudo -u "$KIOSK_USER" jq -r '.allowNavigation // "same-origin"' "$CONFIG_PATH" 2>/dev/null || echo "same-origin")
SWIPE_MODE=$(sudo -u "$KIOSK_USER" jq -r '.swipeMode // "dual"' "$CONFIG_PATH" 2>/dev/null || echo "dual")
local pause_btn keyboard_btn nav_btn password_enabled boot_password
pause_btn=$(sudo -u "$KIOSK_USER" jq -r '.enablePauseButton // true' "$CONFIG_PATH" 2>/dev/null)
[[ "$pause_btn" == "true" ]] && ENABLE_PAUSE_BUTTON="true" || ENABLE_PAUSE_BUTTON="false"
keyboard_btn=$(sudo -u "$KIOSK_USER" jq -r '.enableKeyboardButton // true' "$CONFIG_PATH" 2>/dev/null)
[[ "$keyboard_btn" == "true" ]] && ENABLE_KEYBOARD_BUTTON="true" || ENABLE_KEYBOARD_BUTTON="false"
nav_btn=$(sudo -u "$KIOSK_USER" jq -r '.enableNavButton // true' "$CONFIG_PATH" 2>/dev/null)
[[ "$nav_btn" == "true" ]] && ENABLE_NAV_BUTTON="true" || ENABLE_NAV_BUTTON="false"
password_enabled=$(sudo -u "$KIOSK_USER" jq -r '.enablePasswordProtection // false' "$CONFIG_PATH" 2>/dev/null)
[[ "$password_enabled" == "true" ]] && ENABLE_PASSWORD_PROTECTION="true" || ENABLE_PASSWORD_PROTECTION="false"
LOCKOUT_PASSWORD=$(sudo -u "$KIOSK_USER" jq -r '.lockoutPassword // ""' "$CONFIG_PATH" 2>/dev/null || echo "")
LOCKOUT_TIMEOUT=$(sudo -u "$KIOSK_USER" jq -r '.lockoutTimeout // 0' "$CONFIG_PATH" 2>/dev/null || echo "0")
LOCKOUT_AT_TIME=$(sudo -u "$KIOSK_USER" jq -r '.lockoutAtTime // ""' "$CONFIG_PATH" 2>/dev/null || echo "")
LOCKOUT_ACTIVE_START=$(sudo -u "$KIOSK_USER" jq -r '.lockoutActiveStart // ""' "$CONFIG_PATH" 2>/dev/null || echo "")
LOCKOUT_ACTIVE_END=$(sudo -u "$KIOSK_USER" jq -r '.lockoutActiveEnd // ""' "$CONFIG_PATH" 2>/dev/null || echo "")
boot_password=$(sudo -u "$KIOSK_USER" jq -r '.requirePasswordOnBoot // false' "$CONFIG_PATH" 2>/dev/null)
[[ "$boot_password" == "true" ]] && REQUIRE_PASSWORD_ON_BOOT="true" || REQUIRE_PASSWORD_ON_BOOT="false"
}
# Write every bash global back out to config.json, then offer to reload the
# kiosk display so the change takes effect immediately.
save_config() {
if ! kiosk_user_exists; then
log_error "Kiosk user doesn't exist - run the full installer first"
return 1
fi
sudo mkdir -p "$KIOSK_DIR"
sudo chown -R "$KIOSK_USER:$KIOSK_USER" "$KIOSK_DIR"
local tmp
tmp=$(mktemp)
local dual_json="false"
[[ "$SWIPE_MODE" == "dual" ]] && dual_json="true"
local pause_btn_json="true"
[[ "$ENABLE_PAUSE_BUTTON" == "false" ]] && pause_btn_json="false"
local keyboard_btn_json="true"
[[ "$ENABLE_KEYBOARD_BUTTON" == "false" ]] && keyboard_btn_json="false"
local nav_btn_json="true"
[[ "$ENABLE_NAV_BUTTON" == "false" ]] && nav_btn_json="false"
local password_json="false"
[[ "$ENABLE_PASSWORD_PROTECTION" == "true" ]] && password_json="true"
local boot_password_json="false"
[[ "$REQUIRE_PASSWORD_ON_BOOT" == "true" ]] && boot_password_json="true"
jq -n \
--argjson autoswitch true \
--argjson enableTouch true \
--argjson dualSwipe "$dual_json" \
--arg swipeMode "$SWIPE_MODE" \
--arg allowNavigation "$ALLOW_NAVIGATION" \
--argjson homeTabIndex "${HOME_TAB_INDEX:--1}" \
--argjson inactivityTimeout "${INACTIVITY_TIMEOUT:-120}" \
--argjson enablePauseButton "$pause_btn_json" \
--argjson enableKeyboardButton "$keyboard_btn_json" \
--argjson enableNavButton "$nav_btn_json" \
--argjson enablePasswordProtection "$password_json" \
--arg lockoutPassword "${LOCKOUT_PASSWORD:-}" \
--argjson lockoutTimeout "${LOCKOUT_TIMEOUT:-0}" \
--arg lockoutAtTime "${LOCKOUT_AT_TIME:-}" \
--arg lockoutActiveStart "${LOCKOUT_ACTIVE_START:-}" \
--arg lockoutActiveEnd "${LOCKOUT_ACTIVE_END:-}" \
--argjson requirePasswordOnBoot "$boot_password_json" \
'{autoswitch:$autoswitch,enableTouch:$enableTouch,dualSwipe:$dualSwipe,swipeMode:$swipeMode,allowNavigation:$allowNavigation,homeTabIndex:$homeTabIndex,inactivityTimeout:$inactivityTimeout,enablePauseButton:$enablePauseButton,enableKeyboardButton:$enableKeyboardButton,enableNavButton:$enableNavButton,enablePasswordProtection:$enablePasswordProtection,lockoutPassword:$lockoutPassword,lockoutTimeout:$lockoutTimeout,lockoutAtTime:$lockoutAtTime,lockoutActiveStart:$lockoutActiveStart,lockoutActiveEnd:$lockoutActiveEnd,requirePasswordOnBoot:$requirePasswordOnBoot,tabs:[]}' > "$tmp"
if [[ ${#URLS[@]} -gt 0 ]]; then
for idx in "${!URLS[@]}"; do
local url="${URLS[$idx]:-}"
local dur="${DURS[$idx]:-0}"
local user="${USERS[$idx]:-}"
local pass="${PASSES[$idx]:-}"
local name="${NAMES[$idx]:-}"
jq --arg u "$url" \
--argjson d "$dur" \
--arg user "$user" \
--arg pass "$pass" \
--arg name "$name" \
'.tabs += [{"url":$u,"duration":$d,"username":$user,"password":$pass,"name":$name}]' \
"$tmp" > "${tmp}.new"
mv -f "${tmp}.new" "$tmp"
done
fi
sudo -u "$KIOSK_USER" bash -c "cat > '$CONFIG_PATH'" < "$tmp"
sudo -u "$KIOSK_USER" chmod 644 "$CONFIG_PATH"
rm -f "$tmp"
log_success "Configuration saved"
if is_service_active lightdm; then
echo
if ask_yes_no "Reload kiosk now to apply changes?" "y"; then
echo "Reloading kiosk..."
sudo systemctl restart lightdm
sleep 2
log_success "Kiosk reloaded"
else
log_warning "Remember to reload: sudo systemctl restart lightdm"
fi
fi
}
+240
View File
@@ -0,0 +1,240 @@
#!/bin/bash
################################################################################
# lib/menu.sh - Reusable numbered-menu framework + validated input helpers.
#
# Goal: menu *behavior* (numbering, "0 to exit/return", input validation)
# lives here once. Individual menus/*.sh files only supply their content
# (labels + handler functions) and never re-implement the loop/echo/case
# boilerplate that made the old single-file installer hard to change safely.
#
# Usage:
# my_menu_builder() {
# MENU_LABELS=("Do thing A" "Do thing B")
# MENU_HANDLERS=(action_a action_b)
# }
# run_menu "MY MENU TITLE" my_menu_builder [my_status_func]
#
# The builder runs fresh on every redraw, so labels/handlers can change
# based on current state (e.g. "no sites yet" vs "5 sites configured").
################################################################################
################################################################################
# Logging
################################################################################
log_info() {
echo "[INFO] $*"
}
log_error() {
echo "[ERROR] $*" >&2
}
log_success() {
echo "$*"
}
log_warning() {
echo "$*"
}
pause() {
read -r -p "Press Enter to continue..."
}
################################################################################
# Validated input helpers
################################################################################
validate_yes_no() {
local answer="$1"
case "${answer,,}" in
y|yes|yeah|yep|yup|sure|ok|okay) return 0 ;;
n|no|nope|nah) return 1 ;;
*) return 2 ;; # invalid
esac
}
ask_yes_no() {
local prompt="$1"
local default="${2:-n}"
local answer
while true; do
read -r -p "$prompt (y/n) [$default]: " answer
answer="${answer:-$default}"
validate_yes_no "$answer"
local result=$?
if [[ $result -eq 0 ]]; then
return 0
elif [[ $result -eq 1 ]]; then
return 1
else
echo "❌ Invalid input. Please enter 'y' for yes or 'n' for no"
echo
fi
done
}
validate_integer() {
local value="$1"
local min="${2:--2147483648}"
local max="${3:-2147483647}"
if [[ $value =~ ^-?[0-9]+$ ]]; then
if [[ $value -ge $min && $value -le $max ]]; then
return 0
fi
fi
return 1
}
ask_integer() {
local prompt="$1"
local default="$2"
local min="${3:--2147483648}"
local max="${4:-2147483647}"
local value
while true; do
read -r -p "$prompt [$default]: " value
value="${value:-$default}"
if validate_integer "$value" "$min" "$max"; then
echo "$value"
return 0
else
echo "❌ Invalid number. Please enter an integer between $min and $max" >&2
echo >&2
fi
done
}
validate_url() {
local url="$1"
if [[ $url =~ ^(https?|file|data)://.*$ ]] || [[ $url =~ ^about: ]]; then
return 0
else
return 1
fi
}
ask_url() {
local prompt="$1"
local default="$2"
local url
while true; do
read -r -p "$prompt [$default]: " url
url="${url:-$default}"
if validate_url "$url"; then
echo "$url"
return 0
else
echo "❌ Invalid URL. Must start with http://, https://, file://, data:, or about:" >&2
echo >&2
fi
done
}
ask_text() {
local prompt="$1"
local default="${2:-}"
local value
read -r -p "$prompt [$default]: " value
echo "${value:-$default}"
}
validate_menu_choice() {
local choice="$1"
local max="$2"
validate_integer "$choice" 0 "$max"
}
ask_menu_choice() {
local max="$1"
local choice
while true; do
read -r -p "Choose [0-$max]: " choice
if validate_menu_choice "$choice" "$max"; then
echo "$choice"
return 0
else
echo "❌ Invalid choice. Please enter a number between 0 and $max" >&2
echo >&2
fi
done
}
################################################################################
# Menu framework
################################################################################
print_menu_header() {
local title="$1"
echo "══════════════════════════════════════════════════════════"
printf " %s\n" "$title"
echo "══════════════════════════════════════════════════════════"
echo
}
# run_menu TITLE BUILDER_FUNC [STATUS_FUNC] [EXIT_LABEL]
#
# BUILDER_FUNC must set the globals MENU_LABELS and MENU_HANDLERS (parallel
# indexed arrays). It is called once per redraw, so it can reflect current
# state. STATUS_FUNC, if given, is called right after the header to print
# read-only context (current settings, current list, etc).
#
# Entries are auto-numbered 1..N. "0" always returns from run_menu - no
# menu file needs to hand-roll its own exit case.
run_menu() {
local title="$1"
local builder="$2"
local status_func="${3:-}"
local exit_label="${4:-Return}"
while true; do
clear
print_menu_header "$title"
if [[ -n "$status_func" ]]; then
"$status_func"
echo
fi
local -a MENU_LABELS=()
local -a MENU_HANDLERS=()
"$builder"
if [[ "${#MENU_LABELS[@]}" -eq 0 ]]; then
log_warning "Nothing to do here yet."
echo " 0. $exit_label"
echo
ask_menu_choice 0 >/dev/null
return 0
fi
local i=1
for label in "${MENU_LABELS[@]}"; do
printf " %2d. %s\n" "$i" "$label"
i=$((i + 1))
done
echo " 0. $exit_label"
echo
local choice
choice=$(ask_menu_choice "${#MENU_LABELS[@]}")
if [[ "$choice" == "0" ]]; then
return 0
fi
"${MENU_HANDLERS[$((choice - 1))]}"
done
}
+137
View File
@@ -0,0 +1,137 @@
#!/bin/bash
################################################################################
# menus/display.sh - "Display & Interaction" menu.
#
# Second menu migrated off the old single-file installer, folding together
# three small settings screens that used to be separate Core Settings
# entries (Touch controls, Navigation security, Optional Features). All
# three are simple scalar/boolean fields on config.json, so this is a
# deliberately different shape from menus/sites.sh's list CRUD - a toggle
# list where each entry shows its current value and flips/edits itself,
# saving immediately (same immediate-save pattern as Sites, so behavior
# stays consistent no matter which menu you're in).
#
# Depends on: lib/menu.sh, lib/config.sh being sourced first.
################################################################################
display_status() {
echo "Touch gesture mode: $SWIPE_MODE"
echo "Link navigation: $ALLOW_NAVIGATION"
echo "Pause button: $(display_onoff "$ENABLE_PAUSE_BUTTON")"
echo "Keyboard button: $(display_onoff "$ENABLE_KEYBOARD_BUTTON")"
echo "Navigation button: $(display_onoff "$ENABLE_NAV_BUTTON")"
}
display_onoff() {
[[ "$1" == "true" ]] && echo "ON" || echo "OFF"
}
display_menu_builder() {
MENU_LABELS=(
"Touch gesture mode (currently: $SWIPE_MODE)"
"Link navigation security (currently: $ALLOW_NAVIGATION)"
"Toggle pause button (currently: $(display_onoff "$ENABLE_PAUSE_BUTTON"))"
"Toggle on-screen keyboard button (currently: $(display_onoff "$ENABLE_KEYBOARD_BUTTON"))"
"Toggle navigation/help button (currently: $(display_onoff "$ENABLE_NAV_BUTTON"))"
)
MENU_HANDLERS=(
action_set_touch_mode
action_set_navigation_security
action_toggle_pause_button
action_toggle_keyboard_button
action_toggle_nav_button
)
}
display_menu() {
load_existing_config
run_menu "DISPLAY & INTERACTION" display_menu_builder display_status
}
################################################################################
# Touch gesture mode
################################################################################
action_set_touch_mode() {
echo
echo "DUAL-DIRECTION (recommended for touchscreens):"
echo " 2-finger swipe = switch pages, 1-finger swipe = navigate within page"
echo "STANDARD (simpler):"
echo " 2-finger swipe = switch pages only, 1-finger swipes do nothing"
echo
local default
[[ "$SWIPE_MODE" == "dual" ]] && default="y" || default="n"
if ask_yes_no "Use dual-direction mode?" "$default"; then
SWIPE_MODE="dual"
else
SWIPE_MODE="standard"
fi
log_success "Touch mode: $SWIPE_MODE"
save_config
}
################################################################################
# Navigation security
################################################################################
action_set_navigation_security() {
echo
echo " r) restricted - only the loaded URL, no link clicking"
echo " s) same-origin - can click links within the same domain (recommended)"
echo " o) open - can click any link, browse anywhere"
echo
local choice
read -r -p "(r)estricted / (s)ame-origin / (o)pen [${ALLOW_NAVIGATION}]: " choice
case "${choice,,}" in
r) ALLOW_NAVIGATION="restricted" ;;
o) ALLOW_NAVIGATION="open" ;;
s) ALLOW_NAVIGATION="same-origin" ;;
"") ;; # keep current value
*) log_warning "Unrecognized choice, keeping '$ALLOW_NAVIGATION'" ;;
esac
log_success "Link navigation: $ALLOW_NAVIGATION"
save_config
}
################################################################################
# On-screen button toggles
################################################################################
action_toggle_pause_button() {
if [[ "$ENABLE_PAUSE_BUTTON" == "true" ]]; then
ENABLE_PAUSE_BUTTON="false"
log_warning "Pause button disabled"
else
ENABLE_PAUSE_BUTTON="true"
log_success "Pause button enabled"
fi
save_config
}
action_toggle_keyboard_button() {
if [[ "$ENABLE_KEYBOARD_BUTTON" == "true" ]]; then
ENABLE_KEYBOARD_BUTTON="false"
log_warning "On-screen keyboard button disabled"
else
ENABLE_KEYBOARD_BUTTON="true"
log_success "On-screen keyboard button enabled"
fi
save_config
}
action_toggle_nav_button() {
if [[ "$ENABLE_NAV_BUTTON" == "true" ]]; then
ENABLE_NAV_BUTTON="false"
log_warning "Navigation/help button disabled"
else
ENABLE_NAV_BUTTON="true"
log_success "Navigation/help button enabled"
fi
save_config
}
+363
View File
@@ -0,0 +1,363 @@
#!/bin/bash
################################################################################
# menus/sites.sh - "Sites & Page Timing" menu.
#
# First real menu built on lib/menu.sh + lib/config.sh, as a proof of
# concept for pulling menus out of the old 12k-line installer one at a
# time. Covers exactly what was asked for first: adding, deleting, and
# changing pages, and the timing (duration) of each.
#
# Depends on: lib/menu.sh, lib/config.sh being sourced first.
################################################################################
# Index of the page currently being edited by the nested "edit page" menu.
SITE_EDIT_IDX=""
################################################################################
# Small helpers
################################################################################
# Normalize whatever the user typed into a URL, same rules the old
# installer used: bare host -> https://, bare IP -> http://.
sites_parse_url() {
local raw="$1"
if [[ "$raw" =~ ^https?:// ]]; then
echo "$raw"
elif [[ "$raw" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "http://${raw}"
else
echo "https://${raw}"
fi
}
# Human label for a duration value: >0 seconds = auto-rotate, 0 = manual,
# -1 = hidden (PIN-gated).
sites_duration_label() {
local dur="$1"
if [[ "$dur" == "-1" ]]; then
echo "hidden"
elif [[ "$dur" == "0" ]]; then
echo "manual"
else
echo "auto-rotate ${dur}s"
fi
}
sites_display_label() {
local idx="$1"
local label="${URLS[$idx]}"
[[ -n "${NAMES[$idx]:-}" ]] && label="\"${NAMES[$idx]}\" - ${URLS[$idx]}"
echo "$label"
}
################################################################################
# Status line shown above the main Sites menu
################################################################################
sites_status() {
if [[ "${#URLS[@]}" -eq 0 ]]; then
echo "No pages configured yet."
return
fi
echo "Current pages:"
local has_rotation=false
for idx in "${!URLS[@]}"; do
local dur="${DURS[$idx]}"
local flags=""
[[ "$dur" != "0" && "$dur" != "-1" ]] && has_rotation=true
[[ -n "${USERS[$idx]:-}" ]] && flags+=" [auth]"
[[ "$HOME_TAB_INDEX" == "$idx" ]] && flags+=" [HOME]"
printf " %2d. %s (%s)%s\n" "$((idx + 1))" "$(sites_display_label "$idx")" "$(sites_duration_label "$dur")" "$flags"
done
echo
if $has_rotation; then
echo "Auto-rotation: active (pages with duration > 0)"
else
echo "Auto-rotation: off (all pages manual/hidden)"
fi
if [[ "$HOME_TAB_INDEX" != "-1" ]]; then
echo "Home page: #$((HOME_TAB_INDEX + 1)), ${INACTIVITY_TIMEOUT}s inactivity timeout"
else
echo "Home page: disabled"
fi
}
################################################################################
# Top-level Sites menu
################################################################################
sites_menu_builder() {
MENU_LABELS=("Add a page")
MENU_HANDLERS=(action_add_page)
if [[ "${#URLS[@]}" -gt 0 ]]; then
MENU_LABELS+=("Edit a page" "Delete a page")
MENU_HANDLERS+=(action_pick_and_edit_page action_delete_page)
fi
if [[ "${#URLS[@]}" -gt 1 ]]; then
MENU_LABELS+=("Reorder pages")
MENU_HANDLERS+=(action_reorder_page)
fi
if [[ "${#URLS[@]}" -gt 0 ]]; then
MENU_LABELS+=("Set/clear home page")
MENU_HANDLERS+=(action_set_home_page)
fi
}
sites_menu() {
load_existing_config
run_menu "SITES & PAGE TIMING" sites_menu_builder sites_status
}
################################################################################
# Add
################################################################################
action_add_page() {
echo
echo "Duration controls rotation:"
echo " > 0 = auto-rotates every X seconds"
echo " 0 = manual only (swipe/nav menu to reach it)"
echo " -1 = hidden (PIN-gated, F10 or 3-finger swipe)"
echo
local raw_url url dur name needs_auth user pass
read -r -p "URL: " raw_url
if [[ -z "$raw_url" ]]; then
echo "Cancelled"
return
fi
url=$(sites_parse_url "$raw_url")
dur=$(ask_integer "Duration in seconds (-1=hidden, 0=manual)" "180" -1 86400)
name=$(ask_text "Page name (optional, blank = show URL)" "")
user=""
pass=""
if ask_yes_no "Does this page need HTTP Basic Auth?" "n"; then
read -r -p " Username: " user
read -r -s -p " Password: " pass
echo
fi
URLS+=("$url")
DURS+=("$dur")
USERS+=("$user")
PASSES+=("$pass")
NAMES+=("$name")
log_success "Added: $url ($(sites_duration_label "$dur"))"
save_config
}
################################################################################
# Edit (nested menu on the selected page)
################################################################################
action_pick_and_edit_page() {
echo
for idx in "${!URLS[@]}"; do
echo " $((idx + 1)). $(sites_display_label "$idx")"
done
echo
local num
num=$(ask_integer "Edit which page? (0=cancel)" "0" 0 "${#URLS[@]}")
[[ "$num" == "0" ]] && return
SITE_EDIT_IDX=$((num - 1))
run_menu "EDIT PAGE #${num}" edit_page_menu_builder edit_page_status
}
edit_page_status() {
local idx="$SITE_EDIT_IDX"
echo "URL: ${URLS[$idx]}"
echo "Name: ${NAMES[$idx]:-(none)}"
echo "Timing: $(sites_duration_label "${DURS[$idx]}")"
if [[ -n "${USERS[$idx]:-}" ]]; then
echo "Basic auth: enabled (user: ${USERS[$idx]})"
else
echo "Basic auth: disabled"
fi
}
edit_page_menu_builder() {
MENU_LABELS=("Change URL" "Change name" "Change timing (duration)" "Change Basic Auth")
MENU_HANDLERS=(action_edit_url action_edit_name action_edit_duration action_edit_auth)
}
action_edit_url() {
local idx="$SITE_EDIT_IDX"
local raw_url
raw_url=$(ask_text "New URL" "${URLS[$idx]}")
URLS[$idx]=$(sites_parse_url "$raw_url")
log_success "URL updated"
save_config
}
action_edit_name() {
local idx="$SITE_EDIT_IDX"
NAMES[$idx]=$(ask_text "New name (blank = show URL)" "${NAMES[$idx]:-}")
log_success "Name updated"
save_config
}
action_edit_duration() {
local idx="$SITE_EDIT_IDX"
echo
echo " > 0 = auto-rotates every X seconds"
echo " 0 = manual only"
echo " -1 = hidden (PIN-gated)"
DURS[$idx]=$(ask_integer "Duration in seconds" "${DURS[$idx]}" -1 86400)
log_success "Timing updated: $(sites_duration_label "${DURS[$idx]}")"
save_config
}
action_edit_auth() {
local idx="$SITE_EDIT_IDX"
if ask_yes_no "Enable HTTP Basic Auth for this page?" "$([[ -n "${USERS[$idx]:-}" ]] && echo y || echo n)"; then
read -r -p " Username: " USERS_new
read -r -s -p " Password: " PASSES_new
echo
USERS[$idx]="$USERS_new"
PASSES[$idx]="$PASSES_new"
log_success "Basic Auth updated"
else
USERS[$idx]=""
PASSES[$idx]=""
log_success "Basic Auth disabled"
fi
save_config
}
################################################################################
# Delete
################################################################################
action_delete_page() {
echo
for idx in "${!URLS[@]}"; do
echo " $((idx + 1)). $(sites_display_label "$idx")"
done
echo
local num
num=$(ask_integer "Delete which page? (0=cancel)" "0" 0 "${#URLS[@]}")
[[ "$num" == "0" ]] && { echo "Cancelled"; return; }
local del_idx=$((num - 1))
echo "Deleting: $(sites_display_label "$del_idx")"
unset 'URLS[del_idx]' 'DURS[del_idx]' 'USERS[del_idx]' 'PASSES[del_idx]' 'NAMES[del_idx]'
URLS=("${URLS[@]}")
DURS=("${DURS[@]}")
USERS=("${USERS[@]}")
PASSES=("${PASSES[@]}")
NAMES=("${NAMES[@]}")
if [[ "$HOME_TAB_INDEX" == "$del_idx" ]]; then
HOME_TAB_INDEX=-1
log_warning "Home page was deleted - home feature disabled"
elif [[ "$HOME_TAB_INDEX" -gt "$del_idx" ]]; then
HOME_TAB_INDEX=$((HOME_TAB_INDEX - 1))
fi
log_success "Page deleted"
save_config
}
################################################################################
# Reorder
################################################################################
action_reorder_page() {
echo
echo "Current order:"
for idx in "${!URLS[@]}"; do
echo " $((idx + 1)). $(sites_display_label "$idx")"
done
echo
local max="${#URLS[@]}"
local from_num to_num
from_num=$(ask_integer "Move which page? (0=cancel)" "0" 0 "$max")
[[ "$from_num" == "0" ]] && { echo "Cancelled"; return; }
to_num=$(ask_integer "Move to position?" "1" 1 "$max")
local from_idx=$((from_num - 1))
local to_idx=$((to_num - 1))
if [[ "$from_idx" == "$to_idx" ]]; then
echo "Same position - no change"
return
fi
# Work out where the home page (if any, and not the one being moved)
# will land, before we touch the arrays. Removing the moved item and
# then re-inserting it at $to_idx always places it at index $to_idx of
# the *final* array - no further adjustment needed there. Everything
# else only shifts by the remove and the insert individually.
local new_home_idx="$HOME_TAB_INDEX"
if [[ "$HOME_TAB_INDEX" == "$from_idx" ]]; then
new_home_idx="$to_idx"
elif [[ "$HOME_TAB_INDEX" != "-1" ]]; then
[[ "$from_idx" -lt "$HOME_TAB_INDEX" ]] && new_home_idx=$((new_home_idx - 1))
[[ "$to_idx" -le "$new_home_idx" ]] && new_home_idx=$((new_home_idx + 1))
fi
HOME_TAB_INDEX="$new_home_idx"
local move_url="${URLS[$from_idx]}" move_dur="${DURS[$from_idx]}" \
move_user="${USERS[$from_idx]}" move_pass="${PASSES[$from_idx]}" move_name="${NAMES[$from_idx]}"
unset 'URLS[from_idx]' 'DURS[from_idx]' 'USERS[from_idx]' 'PASSES[from_idx]' 'NAMES[from_idx]'
URLS=("${URLS[@]}")
DURS=("${DURS[@]}")
USERS=("${USERS[@]}")
PASSES=("${PASSES[@]}")
NAMES=("${NAMES[@]}")
URLS=("${URLS[@]:0:$to_idx}" "$move_url" "${URLS[@]:$to_idx}")
DURS=("${DURS[@]:0:$to_idx}" "$move_dur" "${DURS[@]:$to_idx}")
USERS=("${USERS[@]:0:$to_idx}" "$move_user" "${USERS[@]:$to_idx}")
PASSES=("${PASSES[@]:0:$to_idx}" "$move_pass" "${PASSES[@]:$to_idx}")
NAMES=("${NAMES[@]:0:$to_idx}" "$move_name" "${NAMES[@]:$to_idx}")
log_success "Pages reordered"
save_config
}
################################################################################
# Home page
################################################################################
action_set_home_page() {
echo
if [[ "$HOME_TAB_INDEX" != "-1" ]]; then
echo "Current home page: #$((HOME_TAB_INDEX + 1)), ${INACTIVITY_TIMEOUT}s timeout"
else
echo "Home page currently disabled"
fi
echo
for idx in "${!URLS[@]}"; do
echo " $((idx + 1)). $(sites_display_label "$idx")"
done
echo
local num
num=$(ask_integer "Set which page as home? (0=disable)" "0" 0 "${#URLS[@]}")
if [[ "$num" == "0" ]]; then
HOME_TAB_INDEX=-1
log_success "Home page disabled"
save_config
return
fi
HOME_TAB_INDEX=$((num - 1))
local timeout_min
timeout_min=$(ask_integer "Inactivity timeout in minutes" "2" 1 240)
INACTIVITY_TIMEOUT=$((timeout_min * 60))
log_success "Home page: #${num} (${timeout_min}m inactivity timeout)"
save_config
}
-715
View File
@@ -1,715 +0,0 @@
#!/bin/bash
################################################################################
### UBK Mumble/Talkiepi Intercom Setup ###
### Simple CLI-based Installation ###
################################################################################
#
# This script provides a lightweight intercom solution using:
# - Murmur: The Mumble server
# - talkiepi: A simple, lightweight barnard-based Mumble client
#
# Advantages over talkkonnect:
# - Much simpler codebase and build process
# - Fewer dependencies
# - Direct CLI arguments for server, user, password, channel
# - More stable and less fragile
#
################################################################################
VERSION="2.0.0"
KIOSK_USER="${KIOSK_USER:-kiosk}"
################################################################################
### HELPER FUNCTIONS
################################################################################
log_error() {
echo "[ERROR] $*" >&2
}
log_success() {
echo "$*"
}
log_warning() {
echo "$*"
}
pause() {
read -r -p "Press Enter to continue..."
}
get_ip_address() {
hostname -I | awk '{print $1}' || echo "No IP"
}
################################################################################
### STATUS CHECK FUNCTIONS
################################################################################
check_murmur_status() {
local installed=false
local running=false
if systemctl list-unit-files | grep -q "mumble-server.service"; then
installed=true
if systemctl is-active --quiet mumble-server; then
running=true
fi
fi
echo "$installed:$running"
}
check_talkiepi_status() {
local installed=false
local running=false
if [[ -f /usr/local/bin/talkiepi ]] || [[ -f /etc/systemd/system/talkiepi.service ]]; then
installed=true
if systemctl is-active --quiet talkiepi; then
running=true
fi
fi
echo "$installed:$running"
}
################################################################################
### MURMUR SERVER INSTALLATION
################################################################################
install_murmur_server() {
echo
echo "═══════════════════════════════════════════════════════════════"
echo " INSTALLING MURMUR SERVER"
echo "═══════════════════════════════════════════════════════════════"
echo
echo "[1/5] Installing mumble-server package..."
sudo apt update
sudo apt install -y mumble-server
echo "[2/5] Getting configuration details..."
read -r -s -p "SuperUser password: " superuser_pass
echo
read -r -s -p "Server password (clients need this): " server_pass
echo
read -r -p "Welcome text [Welcome to Kiosk Intercom]: " welcome_text
welcome_text="${welcome_text:-Welcome to Kiosk Intercom}"
echo "[3/5] Creating configuration..."
local config_file="/etc/mumble-server.ini"
# Create config if it doesn't exist
if [[ ! -f "$config_file" ]]; then
sudo tee "$config_file" > /dev/null <<'MURMURCONF'
# Murmur configuration file
# Database location
database=/var/lib/mumble-server/mumble-server.sqlite
# Network settings
port=64738
host=0.0.0.0
# Logging
logfile=/var/log/mumble-server/mumble-server.log
# Limits
users=10
bandwidth=72000
# Welcome message
welcometext=Welcome
# Server password
serverpassword=
# Allow pings
allowping=true
# Enable HTML
allowhtml=true
MURMURCONF
log_success "Config file created"
fi
# Update configuration
sudo sed -i "s|^welcometext=.*|welcometext=$welcome_text|" "$config_file"
sudo sed -i "s|^port=.*|port=64738|" "$config_file"
sudo sed -i "s|^users=.*|users=10|" "$config_file"
sudo sed -i "s|^bandwidth=.*|bandwidth=72000|" "$config_file"
if [[ -n "$server_pass" ]]; then
sudo sed -i "s|^serverpassword=.*|serverpassword=$server_pass|" "$config_file"
fi
echo "[4/5] Setting SuperUser password..."
sudo systemctl stop mumble-server 2>/dev/null || true
sleep 2
echo "$superuser_pass" | sudo murmurd -ini "$config_file" -supw - 2>/dev/null || {
log_warning "Could not set SuperUser password via murmurd command"
echo "You can set it later with: sudo murmurd -ini $config_file -supw YOUR_PASSWORD"
}
echo "[5/5] Starting service..."
sudo systemctl enable mumble-server
sudo systemctl start mumble-server
# Configure firewall
sudo ufw allow 64738/tcp comment 'Mumble/Murmur' 2>/dev/null || true
sudo ufw allow 64738/udp comment 'Mumble/Murmur' 2>/dev/null || true
sleep 3
local server_ip=$(get_ip_address)
log_success "Murmur server installed"
echo
echo "═══════════════════════════════════════════════════════════════"
echo " Server: $server_ip:64738"
echo " SuperUser: SuperUser / $superuser_pass"
[[ -n "$server_pass" ]] && echo " Password: $server_pass"
echo "═══════════════════════════════════════════════════════════════"
pause
}
################################################################################
### TALKIEPI CLIENT INSTALLATION
################################################################################
install_talkiepi_with_config() {
local server_addr="$1"
local server_port="$2"
local tp_user="$3"
local tp_pass="$4"
local tp_channel="$5"
echo
echo "═══════════════════════════════════════════════════════════════"
echo " INSTALLING TALKIEPI CLIENT"
echo "═══════════════════════════════════════════════════════════════"
echo
echo "talkiepi is a lightweight Mumble client based on barnard"
echo "Much simpler and more stable than talkkonnect"
echo
local TARGET_USER="$KIOSK_USER"
local TARGET_UID=$(id -u "$TARGET_USER")
local TARGET_HOME="/home/$TARGET_USER"
# Verify home directory exists
if [ ! -d "$TARGET_HOME" ]; then
log_error "Home directory does not exist: $TARGET_HOME"
pause
return 1
fi
# --- System Prep ------------------------------------------------------
echo "[1/5] Installing system dependencies..."
sudo apt update
sudo apt install -y git golang libopenal-dev libopus-dev
# --- Clone and Build Talkiepi -----------------------------------------
echo "[2/5] Cloning talkiepi repository..."
cd "$TARGET_HOME"
if [ -d "talkiepi" ]; then
sudo rm -rf talkiepi
fi
# Clone as the target user
sudo -u "$TARGET_USER" git clone https://github.com/dchote/talkiepi.git
cd talkiepi
echo "[3/5] Building talkiepi..."
export GOPATH="$TARGET_HOME/gocode"
export GOBIN="$TARGET_HOME/bin"
# Install gopus dependency
sudo -u "$TARGET_USER" go get github.com/dchote/gopus
# Build talkiepi
sudo -u "$TARGET_USER" go build -o "$TARGET_HOME/bin/talkiepi" cmd/talkiepi/main.go
if [ ! -f "$TARGET_HOME/bin/talkiepi" ]; then
log_error "Build failed!"
pause
return 1
fi
# Stop any running instances
if systemctl is-active --quiet talkiepi 2>/dev/null; then
sudo systemctl stop talkiepi
fi
# Install binary
sudo cp "$TARGET_HOME/bin/talkiepi" /usr/local/bin/talkiepi
sudo chmod +x /usr/local/bin/talkiepi
log_success "Binary installed to /usr/local/bin/talkiepi"
# --- User Permissions -------------------------------------------------
echo "[4/5] Setting up permissions..."
if ! groups "$TARGET_USER" | grep -q audio; then
sudo usermod -a -G audio "$TARGET_USER"
log_success "Added $TARGET_USER to 'audio' group"
fi
# --- Create Systemd Service -------------------------------------------
echo "[5/5] Creating systemd service..."
# Build the command line arguments
local TALKIEPI_ARGS="-server ${server_addr}:${server_port} -username ${tp_user}"
if [[ -n "$tp_pass" ]]; then
TALKIEPI_ARGS="$TALKIEPI_ARGS -password ${tp_pass}"
fi
if [[ -n "$tp_channel" ]]; then
TALKIEPI_ARGS="$TALKIEPI_ARGS -channel ${tp_channel}"
fi
# Add insecure flag for local/self-signed certs
TALKIEPI_ARGS="$TALKIEPI_ARGS -insecure"
sudo tee /etc/systemd/system/talkiepi.service > /dev/null <<EOFSVC
[Unit]
Description=Talkiepi Lightweight Mumble Client
After=network-online.target sound.target
Wants=network-online.target
[Service]
Type=simple
User=$TARGET_USER
Group=$TARGET_USER
WorkingDirectory=$TARGET_HOME
ExecStart=/usr/local/bin/talkiepi $TALKIEPI_ARGS
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal
Environment="XDG_RUNTIME_DIR=/run/user/$TARGET_UID"
[Install]
WantedBy=multi-user.target
EOFSVC
sudo systemctl daemon-reload
sudo systemctl enable talkiepi
sudo systemctl start talkiepi
sleep 3
log_success "talkiepi installed successfully!"
echo "═══════════════════════════════════════════════════════════════"
echo " Server: $server_addr:$server_port"
echo " Username: $tp_user"
echo " Channel: ${tp_channel:-Root}"
echo " Binary: /usr/local/bin/talkiepi"
echo "═══════════════════════════════════════════════════════════════"
echo
# Show status
if systemctl is-active --quiet talkiepi; then
log_success "Service is running"
echo "View logs: sudo journalctl -u talkiepi -f"
else
log_warning "Service may have issues"
echo "Check logs: sudo journalctl -u talkiepi -n 50"
fi
pause
}
install_talkiepi_only() {
echo
echo "═══════════════════════════════════════════════════════════════"
echo " TALKIEPI - CONNECT TO EXISTING SERVER"
echo "═══════════════════════════════════════════════════════════════"
echo
echo "Enter Murmur/Mumble server details:"
read -r -p "Server address (IP or domain): " server_addr
read -r -p "Port [64738]: " server_port
server_port="${server_port:-64738}"
read -r -p "Username: " tp_user
read -r -s -p "Password (leave empty if none): " tp_pass
echo
read -r -p "Channel [Root]: " tp_channel
tp_channel="${tp_channel:-Root}"
install_talkiepi_with_config "$server_addr" "$server_port" "$tp_user" "$tp_pass" "$tp_channel"
}
install_murmur_and_talkiepi() {
echo
echo "═══════════════════════════════════════════════════════════════"
echo " ALL-IN-ONE: SERVER + CLIENT"
echo "═══════════════════════════════════════════════════════════════"
echo
echo "Installing Murmur server..."
install_murmur_server
echo
echo "Now installing talkiepi client..."
echo "Configuring to connect to local server..."
# Auto-configure for local server
AUTO_SERVER="127.0.0.1"
AUTO_PORT="64738"
read -r -p "Username for talkiepi [kiosk]: " tp_user
tp_user="${tp_user:-kiosk}"
read -r -s -p "Server password: " tp_pass
echo
install_talkiepi_with_config "$AUTO_SERVER" "$AUTO_PORT" "$tp_user" "$tp_pass" "Root"
}
################################################################################
### SERVICE MANAGEMENT
################################################################################
toggle_murmur_service() {
echo
if systemctl is-active --quiet mumble-server; then
echo "Stopping Murmur server..."
sudo systemctl stop mumble-server
log_success "Murmur stopped"
else
echo "Starting Murmur server..."
sudo systemctl start mumble-server
sleep 2
if systemctl is-active --quiet mumble-server; then
log_success "Murmur started"
else
log_error "Failed to start - check logs: sudo journalctl -u mumble-server"
fi
fi
pause
}
toggle_talkiepi_service() {
echo
if systemctl is-active --quiet talkiepi; then
echo "Stopping talkiepi..."
sudo systemctl stop talkiepi
log_success "talkiepi stopped"
else
echo "Starting talkiepi..."
sudo systemctl start talkiepi
sleep 2
if systemctl is-active --quiet talkiepi; then
log_success "talkiepi started"
else
log_error "Failed to start - check logs: sudo journalctl -u talkiepi"
fi
fi
pause
}
################################################################################
### LOGS AND DIAGNOSTICS
################################################################################
view_talkiepi_logs() {
echo
echo "Recent talkiepi logs:"
echo "═══════════════════════════════════════════════════════════════"
sudo journalctl -u talkiepi -n 50 --no-pager
echo
pause
}
view_murmur_logs() {
echo
echo "Recent Murmur server logs:"
echo "═══════════════════════════════════════════════════════════════"
sudo journalctl -u mumble-server -n 50 --no-pager
echo
pause
}
################################################################################
### UNINSTALLATION
################################################################################
uninstall_murmur() {
echo
read -r -p "Uninstall Murmur server? (yes/no): " confirm
[[ "$confirm" != "yes" ]] && return
echo "Uninstalling..."
sudo systemctl stop mumble-server 2>/dev/null || true
sudo systemctl disable mumble-server 2>/dev/null || true
sudo apt remove -y mumble-server 2>/dev/null || true
read -r -p "Remove configuration and database? (y/n): " remove_data
if [[ "$remove_data" =~ ^[Yy]$ ]]; then
sudo rm -rf /var/lib/mumble-server
sudo rm -f /etc/mumble-server.ini
log_success "Murmur and data removed"
else
log_success "Murmur removed (data preserved)"
fi
pause
}
uninstall_talkiepi() {
echo
read -r -p "Uninstall talkiepi? (yes/no): " confirm
[[ "$confirm" != "yes" ]] && return
echo "Uninstalling talkiepi..."
# Stop and disable service
if systemctl is-active --quiet talkiepi 2>/dev/null; then
sudo systemctl stop talkiepi
fi
if systemctl is-enabled --quiet talkiepi 2>/dev/null; then
sudo systemctl disable talkiepi
fi
# Remove systemd service file
if [[ -f /etc/systemd/system/talkiepi.service ]]; then
sudo rm -f /etc/systemd/system/talkiepi.service
sudo systemctl daemon-reload
fi
# Remove binary
if [[ -f /usr/local/bin/talkiepi ]]; then
sudo rm -f /usr/local/bin/talkiepi
fi
# Remove source directory
read -r -p "Also remove source directory? (y/n): " remove_source
if [[ "$remove_source" =~ ^[Yy]$ ]] && [[ -d "/home/$KIOSK_USER/talkiepi" ]]; then
sudo rm -rf "/home/$KIOSK_USER/talkiepi"
sudo rm -rf "/home/$KIOSK_USER/gocode"
sudo rm -rf "/home/$KIOSK_USER/bin"
fi
log_success "talkiepi uninstalled"
pause
}
################################################################################
### MAIN MENU
################################################################################
show_status() {
local murmur_status=$(check_murmur_status)
local murmur_installed=$(echo "$murmur_status" | cut -d: -f1)
local murmur_running=$(echo "$murmur_status" | cut -d: -f2)
local tp_status=$(check_talkiepi_status)
local tp_installed=$(echo "$tp_status" | cut -d: -f1)
local tp_running=$(echo "$tp_status" | cut -d: -f2)
echo
echo "═══════════════════════════════════════════════════════════════"
echo " INTERCOM STATUS"
echo "═══════════════════════════════════════════════════════════════"
echo
# Murmur status
if [[ "$murmur_installed" == "true" ]]; then
echo "Murmur Server: ✓ Installed"
if [[ "$murmur_running" == "true" ]]; then
echo " Status: Running"
local server_ip=$(get_ip_address)
echo " Address: $server_ip:64738"
else
echo " Status: Stopped"
fi
echo
else
echo "Murmur Server: Not installed"
echo
fi
# talkiepi status
if [[ "$tp_installed" == "true" ]]; then
echo "talkiepi Client: ✓ Installed"
if [[ "$tp_running" == "true" ]]; then
echo " Status: Running"
else
echo " Status: Stopped"
fi
echo
else
echo "talkiepi Client: Not installed"
echo
fi
}
main_menu() {
while true; do
clear
echo "═══════════════════════════════════════════════════════════════"
echo " UBK INTERCOM SETUP v${VERSION}"
echo " Mumble/Talkiepi (Lightweight & Stable)"
echo "═══════════════════════════════════════════════════════════════"
show_status
local murmur_status=$(check_murmur_status)
local murmur_installed=$(echo "$murmur_status" | cut -d: -f1)
local murmur_running=$(echo "$murmur_status" | cut -d: -f2)
local tp_status=$(check_talkiepi_status)
local tp_installed=$(echo "$tp_status" | cut -d: -f1)
local tp_running=$(echo "$tp_status" | cut -d: -f2)
echo "═══════════════════════════════════════════════════════════════"
echo " INSTALLATION OPTIONS"
echo "═══════════════════════════════════════════════════════════════"
local menu_num=1
# Installation options (shown when nothing installed)
if [[ "$murmur_installed" == "false" && "$tp_installed" == "false" ]]; then
echo " $menu_num. Install All-in-One (Server + Client)"
local opt_all_in_one=$menu_num
((menu_num++))
echo " $menu_num. Install Murmur Server Only"
local opt_server_only=$menu_num
((menu_num++))
echo " $menu_num. Install talkiepi Client Only"
local opt_client_only=$menu_num
((menu_num++))
else
# Murmur management options
if [[ "$murmur_installed" == "true" ]]; then
echo
echo "Murmur Server:"
if [[ "$murmur_running" == "true" ]]; then
echo " $menu_num. Stop Murmur"
else
echo " $menu_num. Start Murmur"
fi
local opt_murmur_toggle=$menu_num
((menu_num++))
echo " $menu_num. View Murmur Logs"
local opt_murmur_logs=$menu_num
((menu_num++))
echo " $menu_num. Uninstall Murmur"
local opt_murmur_uninstall=$menu_num
((menu_num++))
else
echo
echo " $menu_num. Install Murmur Server"
local opt_install_murmur=$menu_num
((menu_num++))
fi
# talkiepi management options
if [[ "$tp_installed" == "true" ]]; then
echo
echo "talkiepi Client:"
if [[ "$tp_running" == "true" ]]; then
echo " $menu_num. Stop talkiepi"
else
echo " $menu_num. Start talkiepi"
fi
local opt_tp_toggle=$menu_num
((menu_num++))
echo " $menu_num. View talkiepi Logs"
local opt_tp_logs=$menu_num
((menu_num++))
echo " $menu_num. Uninstall talkiepi"
local opt_tp_uninstall=$menu_num
((menu_num++))
else
echo
echo " $menu_num. Install talkiepi Client"
local opt_install_tp=$menu_num
((menu_num++))
fi
fi
echo
echo "═══════════════════════════════════════════════════════════════"
echo " 0. Exit"
echo "═══════════════════════════════════════════════════════════════"
echo
read -r -p "Choose [0-$((menu_num-1))]: " choice
# Handle menu selection
case "$choice" in
0)
echo "Exiting..."
exit 0
;;
${opt_all_in_one:-})
install_murmur_and_talkiepi
;;
${opt_server_only:-})
install_murmur_server
;;
${opt_client_only:-})
install_talkiepi_only
;;
${opt_install_murmur:-})
install_murmur_server
;;
${opt_install_tp:-})
install_talkiepi_only
;;
${opt_murmur_toggle:-})
toggle_murmur_service
;;
${opt_murmur_logs:-})
view_murmur_logs
;;
${opt_murmur_uninstall:-})
uninstall_murmur
;;
${opt_tp_toggle:-})
toggle_talkiepi_service
;;
${opt_tp_logs:-})
view_talkiepi_logs
;;
${opt_tp_uninstall:-})
uninstall_talkiepi
;;
*)
echo "Invalid choice"
sleep 1
;;
esac
done
}
################################################################################
### ENTRY POINT
################################################################################
# Check if running as root
if [[ $EUID -eq 0 ]]; then
log_error "This script should not be run as root"
echo "Please run as: ./setup_intercom_simple.sh"
exit 1
fi
# Check if kiosk user exists
if ! id "$KIOSK_USER" &>/dev/null; then
log_warning "User '$KIOSK_USER' does not exist"
read -r -p "Enter the username to use for installation: " KIOSK_USER
if ! id "$KIOSK_USER" &>/dev/null; then
log_error "User '$KIOSK_USER' not found"
exit 1
fi
fi
# Run main menu
main_menu
-784
View File
@@ -1,784 +0,0 @@
#!/usr/bin/env bash
# ======================================================================
# File: install_talkkonnect_x86_complete.sh
# Purpose: Complete Talkkonnect installation for Ubuntu 24.04 x86_64
# Fixes Opus architecture issues and creates working config
# Author: Compiled from troubleshooting session
# Date: November 2025
# ======================================================================
set -e
echo "======================================================================="
echo "TalkKonnect Complete Installation Script for x86_64"
echo "This script will:"
echo " 1. Install system dependencies"
echo " 2. Install Go 1.24.1"
echo " 3. Clone and patch TalkKonnect for x86_64"
echo " 4. Build the binary"
echo " 5. Create configuration files"
echo " 6. Set up systemd service"
echo "======================================================================="
echo ""
# Check if this is a Chromebook or multi-user audio setup
echo "Audio Setup Detection:"
echo " - If you have audio working under a different user (e.g. 'kiosk'),"
echo " talkkonnect should run as that user to share the PipeWire session"
echo " - This also enables audio ducking between applications"
echo ""
read -p "Run talkkonnect as a different user? [kiosk]: " TARGET_USER
TARGET_USER=${TARGET_USER:-kiosk}
if [ "$TARGET_USER" != "$USER" ]; then
# Verify the target user exists
if ! id "$TARGET_USER" &>/dev/null; then
echo "[!] Error: User '$TARGET_USER' does not exist"
exit 1
fi
# Get target user's UID for XDG_RUNTIME_DIR
TARGET_UID=$(id -u "$TARGET_USER")
TARGET_HOME=$(eval echo ~"$TARGET_USER")
echo "[+] Will install for user: $TARGET_USER (UID: $TARGET_UID)"
echo "[+] Home directory: $TARGET_HOME"
else
TARGET_UID=$(id -u)
TARGET_HOME="$HOME"
echo "[+] Installing for current user: $USER"
fi
echo ""
read -p "Press Enter to continue or Ctrl-C to abort..."
# --- System Prep ------------------------------------------------------
echo ""
echo "[+] Updating system packages..."
sudo apt update
sudo apt upgrade -y
echo "[+] Installing dependencies..."
sudo apt install -y wget git build-essential pkg-config \
libasound2-dev libopus-dev libopus0 libopusfile-dev \
libpipewire-0.3-dev libevdev-dev libopenal-dev alsa-utils
# --- Go Installation --------------------------------------------------
echo ""
echo "[+] Installing Go 1.24.1..."
sudo rm -rf /usr/local/go /usr/lib/go* /usr/bin/go
wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz
sudo ln -sf /usr/local/go/bin/go /usr/bin/go
rm -f go1.24.1.linux-amd64.tar.gz
export PATH="/usr/local/go/bin:$PATH"
go version
# --- Clone TalkKonnect ------------------------------------------------
echo ""
echo "[+] Cloning TalkKonnect repository..."
cd ~
if [ -d "talkkonnect" ]; then
echo "[!] Removing existing talkkonnect directory..."
rm -rf talkkonnect
fi
git clone https://github.com/talkkonnect/talkkonnect.git
cd talkkonnect
echo "[+] Current version:"
git log --oneline -1
# --- Critical Fix: Patch gopus for x86_64 -----------------------------
echo ""
echo "======================================================================="
echo "[+] APPLYING X86_64 OPUS FIX"
echo "======================================================================="
echo "[+] The talkkonnect gopus package embeds Opus source for ARM"
echo "[+] but it's incomplete for x86_64. We'll patch it to use system libopus"
echo ""
# Create vendor directory
go mod vendor
# Check that gopus exists in vendor
if [ ! -d "vendor/github.com/talkkonnect/gopus" ]; then
echo "[!] ERROR: gopus not found in vendor!"
exit 1
fi
echo "[+] Backing up original opus_nonshared.go..."
cp vendor/github.com/talkkonnect/gopus/opus_nonshared.go \
vendor/github.com/talkkonnect/gopus/opus_nonshared.go.original
echo "[+] Creating x86_64-compatible opus_nonshared.go..."
cat > vendor/github.com/talkkonnect/gopus/opus_nonshared.go << 'EOFOPUS'
// +build amd64,cgo 386,cgo
package gopus
// #cgo pkg-config: opus
// #cgo LDFLAGS: -lm
//
// #include <stdio.h>
// #include <stdlib.h>
// #include <opus.h>
//
// enum {
// gopus_ok = OPUS_OK,
// gopus_bad_arg = OPUS_BAD_ARG,
// gopus_small_buffer = OPUS_BUFFER_TOO_SMALL,
// gopus_internal = OPUS_INTERNAL_ERROR,
// gopus_invalid_packet = OPUS_INVALID_PACKET,
// gopus_unimplemented = OPUS_UNIMPLEMENTED,
// gopus_invalid_state = OPUS_INVALID_STATE,
// gopus_alloc_fail = OPUS_ALLOC_FAIL,
// };
//
// enum {
// gopus_application_voip = OPUS_APPLICATION_VOIP,
// gopus_application_audio = OPUS_APPLICATION_AUDIO,
// gopus_restricted_lowdelay = OPUS_APPLICATION_RESTRICTED_LOWDELAY,
// gopus_bitrate_max = OPUS_BITRATE_MAX,
// };
//
// void gopus_setvbr(OpusEncoder *encoder, int vbr) {
// opus_encoder_ctl(encoder, OPUS_SET_VBR(vbr));
// }
//
// void gopus_setbitrate(OpusEncoder *encoder, int bitrate) {
// opus_encoder_ctl(encoder, OPUS_SET_BITRATE(bitrate));
// }
//
// opus_int32 gopus_bitrate(OpusEncoder *encoder) {
// opus_int32 bitrate;
// opus_encoder_ctl(encoder, OPUS_GET_BITRATE(&bitrate));
// return bitrate;
// }
//
// void gopus_setapplication(OpusEncoder *encoder, int application) {
// opus_encoder_ctl(encoder, OPUS_SET_APPLICATION(application));
// }
//
// opus_int32 gopus_application(OpusEncoder *encoder) {
// opus_int32 application;
// opus_encoder_ctl(encoder, OPUS_GET_APPLICATION(&application));
// return application;
// }
//
// void gopus_encoder_resetstate(OpusEncoder *encoder) {
// opus_encoder_ctl(encoder, OPUS_RESET_STATE);
// }
//
// void gopus_decoder_resetstate(OpusDecoder *decoder) {
// opus_decoder_ctl(decoder, OPUS_RESET_STATE);
// }
import "C"
import (
"errors"
"unsafe"
)
type Application int
const (
Voip Application = C.gopus_application_voip
Audio Application = C.gopus_application_audio
RestrictedLowDelay Application = C.gopus_restricted_lowdelay
)
const (
BitrateMaximum = C.gopus_bitrate_max
)
type Encoder struct {
data []byte
cEncoder *C.struct_OpusEncoder
}
func NewEncoder(sampleRate, channels int, application Application) (*Encoder, error) {
encoder := &Encoder{}
encoder.data = make([]byte, int(C.opus_encoder_get_size(C.int(channels))))
encoder.cEncoder = (*C.struct_OpusEncoder)(unsafe.Pointer(&encoder.data[0]))
ret := C.opus_encoder_init(encoder.cEncoder, C.opus_int32(sampleRate), C.int(channels), C.int(application))
if err := getErr(ret); err != nil {
return nil, err
}
return encoder, nil
}
func (e *Encoder) Encode(pcm []int16, frameSize, maxDataBytes int) ([]byte, error) {
pcmPtr := (*C.opus_int16)(unsafe.Pointer(&pcm[0]))
data := make([]byte, maxDataBytes)
dataPtr := (*C.uchar)(unsafe.Pointer(&data[0]))
encodedC := C.opus_encode(e.cEncoder, pcmPtr, C.int(frameSize), dataPtr, C.opus_int32(len(data)))
encoded := int(encodedC)
if encoded < 0 {
return nil, getErr(C.int(encodedC))
}
return data[0:encoded], nil
}
func (e *Encoder) SetVbr(vbr bool) {
var cVbr C.int
if vbr {
cVbr = 1
} else {
cVbr = 0
}
C.gopus_setvbr(e.cEncoder, cVbr)
}
func (e *Encoder) SetBitrate(bitrate int) {
C.gopus_setbitrate(e.cEncoder, C.int(bitrate))
}
func (e *Encoder) Bitrate() int {
return int(C.gopus_bitrate(e.cEncoder))
}
func (e *Encoder) SetApplication(application Application) {
C.gopus_setapplication(e.cEncoder, C.int(application))
}
func (e *Encoder) Application() Application {
return Application(C.gopus_application(e.cEncoder))
}
func (e *Encoder) ResetState() {
C.gopus_encoder_resetstate(e.cEncoder)
}
type Decoder struct {
data []byte
cDecoder *C.struct_OpusDecoder
channels int
}
func NewDecoder(sampleRate, channels int) (*Decoder, error) {
decoder := &Decoder{}
decoder.data = make([]byte, int(C.opus_decoder_get_size(C.int(channels))))
decoder.cDecoder = (*C.struct_OpusDecoder)(unsafe.Pointer(&decoder.data[0]))
ret := C.opus_decoder_init(decoder.cDecoder, C.opus_int32(sampleRate), C.int(channels))
if err := getErr(ret); err != nil {
return nil, err
}
decoder.channels = channels
return decoder, nil
}
func (d *Decoder) Decode(data []byte, frameSize int, fec bool) ([]int16, error) {
var dataPtr *C.uchar
if len(data) > 0 {
dataPtr = (*C.uchar)(unsafe.Pointer(&data[0]))
}
dataLen := C.opus_int32(len(data))
output := make([]int16, d.channels*frameSize)
outputPtr := (*C.opus_int16)(unsafe.Pointer(&output[0]))
var cFec C.int
if fec {
cFec = 1
} else {
cFec = 0
}
cRet := C.opus_decode(d.cDecoder, dataPtr, dataLen, outputPtr, C.int(frameSize), cFec)
ret := int(cRet)
if ret < 0 {
return nil, getErr(cRet)
}
return output[:ret*d.channels], nil
}
func (d *Decoder) ResetState() {
C.gopus_decoder_resetstate(d.cDecoder)
}
func GetSamplesPerFrame(data []byte, samplingRate int) (int, error) {
dataPtr := (*C.uchar)(unsafe.Pointer(&data[0]))
cSamplingRate := C.opus_int32(samplingRate)
cRet := C.opus_packet_get_samples_per_frame(dataPtr, cSamplingRate)
return int(cRet), nil
}
func CountFrames(data []byte) (int, error) {
dataPtr := (*C.uchar)(unsafe.Pointer(&data[0]))
cLen := C.opus_int32(len(data))
cRet := C.opus_packet_get_nb_frames(dataPtr, cLen)
if err := getErr(cRet); err != nil {
return 0, err
}
return int(cRet), nil
}
var (
ErrBadArgument = errors.New("bad argument")
ErrSmallBuffer = errors.New("buffer is too small")
ErrInternal = errors.New("internal error")
ErrInvalidPacket = errors.New("invalid packet")
ErrUnimplemented = errors.New("unimplemented")
ErrInvalidState = errors.New("invalid state")
ErrAllocFail = errors.New("allocation failed")
ErrUnknown = errors.New("unknown error")
)
func getErr(code C.int) error {
switch code {
case C.gopus_ok:
return nil
case C.gopus_bad_arg:
return ErrBadArgument
case C.gopus_small_buffer:
return ErrSmallBuffer
case C.gopus_internal:
return ErrInternal
case C.gopus_invalid_packet:
return ErrInvalidPacket
case C.gopus_unimplemented:
return ErrUnimplemented
case C.gopus_invalid_state:
return ErrInvalidState
case C.gopus_alloc_fail:
return ErrAllocFail
default:
return ErrUnknown
}
}
EOFOPUS
echo "[+] Patched opus_nonshared.go to use system libopus"
# --- Build TalkKonnect ------------------------------------------------
echo ""
echo "======================================================================="
echo "[+] BUILDING TALKKONNECT"
echo "======================================================================="
cd ~/talkkonnect/cmd/talkkonnect
export CGO_ENABLED=1
export CGO_CFLAGS="$(pkg-config --cflags opus)"
export CGO_LDFLAGS="$(pkg-config --libs opus) -lm"
echo "[+] Building (this may take a few minutes)..."
go build -mod=vendor -v -o ~/talkkonnect-binary . 2>&1 | tee /tmp/talkkonnect_build.log
if [ ! -f ~/talkkonnect-binary ]; then
echo ""
echo "[!] BUILD FAILED!"
echo "[!] Last 50 lines of build log:"
tail -50 /tmp/talkkonnect_build.log
exit 1
fi
echo ""
echo "[+] Installing binary..."
# Stop any running talkkonnect instances first
if systemctl is-active --quiet talkkonnect 2>/dev/null; then
echo "[+] Stopping existing talkkonnect service..."
sudo systemctl stop talkkonnect
fi
# Kill any stray processes
if pgrep -x talkkonnect > /dev/null; then
echo "[+] Killing running talkkonnect processes..."
sudo pkill -9 talkkonnect
sleep 1
fi
# Now install the binary
sudo cp ~/talkkonnect-binary /usr/local/bin/talkkonnect
sudo chmod +x /usr/local/bin/talkkonnect
rm ~/talkkonnect-binary
echo "[+] Binary installed successfully!"
echo "[+] Checking dependencies:"
ldd /usr/local/bin/talkkonnect | grep -E "(opus|alsa)" || echo " (may be statically linked)"
# --- User Permissions -------------------------------------------------
echo ""
echo "[+] Setting up user permissions..."
# Add target user to input group for keyboard PTT
if ! groups "$TARGET_USER" | grep -q input; then
sudo usermod -a -G input "$TARGET_USER"
echo "[+] Added $TARGET_USER to 'input' group"
if [ "$TARGET_USER" = "$USER" ]; then
echo "[!] IMPORTANT: Log out and back in for this to take effect!"
echo "[!] Or run: newgrp input"
NEEDS_RELOGIN=true
fi
else
echo "[+] User $TARGET_USER already in 'input' group"
NEEDS_RELOGIN=false
fi
# Add target user to audio group
if ! groups "$TARGET_USER" | grep -q audio; then
sudo usermod -a -G audio "$TARGET_USER"
echo "[+] Added $TARGET_USER to 'audio' group"
fi
# --- Configuration ----------------------------------------------------
echo ""
echo "======================================================================="
echo "[+] CREATING CONFIGURATION"
echo "======================================================================="
# Verify target user's home directory exists
if [ ! -d "$TARGET_HOME" ]; then
echo "[!] Error: Home directory for user '$TARGET_USER' does not exist: $TARGET_HOME"
echo "[!] Please ensure the user account is properly set up with a home directory"
echo "[!] You may need to run: sudo mkhomedir_helper $TARGET_USER"
exit 1
fi
CONFIG_DIR="$TARGET_HOME/.config/talkkonnect"
# Create config directory with appropriate permissions
if [ "$TARGET_USER" != "$USER" ]; then
# Need to use sudo to create directory in another user's home
sudo -u "$TARGET_USER" mkdir -p "$CONFIG_DIR"
echo "[+] Created config directory as user: $TARGET_USER"
else
mkdir -p "$CONFIG_DIR"
echo "[+] Created config directory"
fi
# Create config file (use tee with sudo to handle permissions)
sudo tee "$CONFIG_DIR/talkkonnect.xml" > /dev/null << 'EOFXML'
<?xml version="1.0" encoding="UTF-8"?>
<document type="talkkonnect/xml">
<global>
<software>
<settings outputdevice="default"
logfilenameandpath="/home/user/.config/talkkonnect/talkkonnect.log"
logging="both"
daemonize="false"
cancelconnect="false"
simplexwithvox="false"
nextserverindex="0"/>
<autoprovisioning enabled="false"/>
</software>
<hardware>
<settings targetboard="pc"
voiceactivitytimersecs="200"/>
<io>
<pins enabled="false"/>
</io>
</hardware>
</global>
<accounts>
<account name="default" default="true">
<serverandport>your.mumble.server:64738</serverandport>
<username>your_username</username>
<password>your_password</password>
<insecure>false</insecure>
<register>false</register>
<certificate></certificate>
<channel>Root</channel>
<ident></ident>
<tokens enabled="false"></tokens>
<voicetargets enabled="false">
<id id="1" iscurrent="false" name="default">
<channels></channels>
<users></users>
</id>
</voicetargets>
</account>
</accounts>
<beacon enabled="false"/>
<audio>
<input>
<settings enabled="true"
device="default"
samplerate="48000"
channels="1"
codec="opus"
framespersecond="50"/>
</input>
<output>
<settings enabled="true"
device="default"
samplerate="48000"
channels="1"/>
</output>
</audio>
<ptt enabled="false">
<usbkeyboard enabled="false"/>
</ptt>
<voiceactivity enabled="true">
<settings threshold="0.3"
holdtimems="1000"
holdtimeoutms="2000"/>
</voiceactivity>
<sounds enabled="false"/>
<txtts enabled="false"/>
<smtp enabled="false"/>
<api enabled="false"/>
<printxml enabled="false"/>
</document>
EOFXML
# Update the log path to use actual username (needs sudo since file was created with tee)
sudo sed -i "s|/home/user/|$TARGET_HOME/|g" "$CONFIG_DIR/talkkonnect.xml"
# Set proper ownership - always needed since we used sudo tee
sudo chown -R "$TARGET_USER:$TARGET_USER" "$CONFIG_DIR"
sudo chmod 755 "$CONFIG_DIR"
sudo chmod 644 "$CONFIG_DIR/talkkonnect.xml"
echo "[+] Set ownership of config directory to $TARGET_USER"
echo "[+] Created configuration file: $CONFIG_DIR/talkkonnect.xml"
# --- Audio Mixer Detection --------------------------------------------
echo ""
echo "[+] Detecting audio configuration for user: $TARGET_USER..."
# Detect audio devices as the target user
if [ "$TARGET_USER" != "$USER" ]; then
# Get target user's runtime directory
AUDIO_DEVICES=$(sudo -u "$TARGET_USER" XDG_RUNTIME_DIR=/run/user/$TARGET_UID aplay -l 2>/dev/null)
PIPEWIRE_SINKS=$(sudo -u "$TARGET_USER" XDG_RUNTIME_DIR=/run/user/$TARGET_UID pactl list sinks short 2>/dev/null)
else
AUDIO_DEVICES=$(aplay -l 2>/dev/null)
PIPEWIRE_SINKS=$(pactl list sinks short 2>/dev/null)
fi
# Determine best audio device
AUDIO_DEVICE="default"
AUDIO_BACKEND="alsa"
if echo "$AUDIO_DEVICES" | grep -q "card 0:"; then
# ALSA devices found
CARD_NAME=$(echo "$AUDIO_DEVICES" | grep "card 0:" | head -1 | sed 's/.*card 0: \([^[]*\).*/\1/' | xargs)
echo "[+] Found ALSA card: $CARD_NAME"
# Use hw:0,0 for direct ALSA access (better for Chromebooks)
AUDIO_DEVICE="hw:0,0"
echo "[+] Using ALSA device: $AUDIO_DEVICE"
elif echo "$PIPEWIRE_SINKS" | grep -v "auto_null" | grep -q "alsa_output"; then
# PipeWire/PulseAudio sinks found
SINK_NAME=$(echo "$PIPEWIRE_SINKS" | grep -v "auto_null" | grep "alsa_output" | head -1 | awk '{print $2}')
echo "[+] Found PipeWire sink: $SINK_NAME"
AUDIO_DEVICE="pulse"
AUDIO_BACKEND="pulse"
echo "[+] Using PulseAudio/PipeWire backend"
else
echo "[!] Warning: No specific audio device detected, using 'default'"
fi
# Try to unmute and set volume
MIXER_CONTROL=$(sudo -u "$TARGET_USER" amixer scontrols 2>/dev/null | grep -oP "Simple mixer control '\K[^']+(?=',0)" | head -1)
if [ -n "$MIXER_CONTROL" ]; then
echo "[+] Found mixer control: $MIXER_CONTROL"
# Try to unmute and set volume
sudo -u "$TARGET_USER" amixer set "$MIXER_CONTROL" unmute 2>/dev/null && echo "[+] Unmuted $MIXER_CONTROL" || echo "[!] Could not unmute $MIXER_CONTROL"
sudo -u "$TARGET_USER" amixer set "$MIXER_CONTROL" 80% 2>/dev/null && echo "[+] Set $MIXER_CONTROL to 80%" || echo "[!] Could not set volume"
else
echo "[!] Warning: No ALSA mixer controls found"
echo "[!] Audio may work through PipeWire, but you may need to configure it manually"
fi
echo "[+] Audio configuration summary:"
echo " Backend: $AUDIO_BACKEND"
echo " Device: $AUDIO_DEVICE"
if [ -n "$CARD_NAME" ]; then
echo " Card: $CARD_NAME"
fi
# --- Systemd Service --------------------------------------------------
echo ""
echo "[+] Creating systemd service for user: $TARGET_USER..."
SERVICE_FILE="/etc/systemd/system/talkkonnect.service"
sudo tee "$SERVICE_FILE" > /dev/null <<EOFSVC
[Unit]
Description=TalkKonnect Headless Mumble Transceiver
After=network-online.target sound.target
Wants=network-online.target
[Service]
Type=simple
User=$TARGET_USER
Group=$TARGET_USER
WorkingDirectory=$TARGET_HOME
ExecStart=/usr/local/bin/talkkonnect -config $CONFIG_DIR/talkkonnect.xml
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal
# Use target user's PipeWire/PulseAudio session
Environment="XDG_RUNTIME_DIR=/run/user/$TARGET_UID"
[Install]
WantedBy=multi-user.target
EOFSVC
sudo systemctl daemon-reload
sudo systemctl enable talkkonnect
echo "[+] Systemd service created and enabled"
# --- Audio Ducking Setup (Optional) -----------------------------------
if [ "$TARGET_USER" != "$USER" ]; then
echo ""
echo "[+] Setting up audio ducking for user: $TARGET_USER..."
echo "[+] This will lower other audio when talkkonnect is transmitting"
# Create a script to enable ducking
DUCKING_SCRIPT="$TARGET_HOME/.config/talkkonnect/enable-ducking.sh"
cat > /tmp/enable-ducking.sh << 'EOFDUCKING'
#!/bin/bash
# Enable audio ducking - lowers music/media when on PTT
pactl load-module module-role-ducking \
trigger_roles=phone \
ducking_roles=music,video \
volume=30% 2>/dev/null || echo "Ducking already enabled"
EOFDUCKING
if [ "$TARGET_USER" != "$USER" ]; then
sudo cp /tmp/enable-ducking.sh "$DUCKING_SCRIPT"
sudo chown "$TARGET_USER:$TARGET_USER" "$DUCKING_SCRIPT"
sudo chmod +x "$DUCKING_SCRIPT"
else
cp /tmp/enable-ducking.sh "$DUCKING_SCRIPT"
chmod +x "$DUCKING_SCRIPT"
fi
rm /tmp/enable-ducking.sh
echo "[+] Ducking script created: $DUCKING_SCRIPT"
echo "[+] Run as $TARGET_USER to enable: $DUCKING_SCRIPT"
fi
# --- Completion -------------------------------------------------------
echo ""
echo "======================================================================="
echo "✓✓✓ INSTALLATION COMPLETE! ✓✓✓"
echo "======================================================================="
echo ""
if [ "$TARGET_USER" != "$USER" ]; then
echo "⚠️ IMPORTANT: Talkkonnect is configured to run as user: $TARGET_USER"
echo " This allows it to share the PipeWire audio session with your apps"
echo " All configuration files are in: $TARGET_HOME/.config/talkkonnect/"
echo ""
fi
if [ "$NEEDS_RELOGIN" = true ]; then
echo "⚠️ IMPORTANT: You were added to the 'input' group"
echo " You must LOG OUT and LOG BACK IN for keyboard PTT to work!"
echo " (Or run: newgrp input)"
echo ""
fi
echo "BEFORE RUNNING: Edit the configuration file with your Mumble server details"
echo ""
if [ "$TARGET_USER" != "$USER" ]; then
echo " 1. Edit config file (as $TARGET_USER or with sudo):"
echo " sudo nano $CONFIG_DIR/talkkonnect.xml"
else
echo " 1. Edit config file:"
echo " nano $CONFIG_DIR/talkkonnect.xml"
fi
echo ""
echo " 2. Update these settings:"
echo " - <serverandport>: Your Mumble server address and port"
echo " - <username>: Your Mumble username"
echo " - <password>: Your Mumble password (if required)"
echo " - <channel>: Channel to join on connect"
echo " - <insecure>: Set to 'true' if server has self-signed cert"
echo ""
echo " 3. Optional - Enable keyboard/USB button PTT (voice activation is enabled by default):"
echo " - Set <ptt enabled=\"true\">"
echo " - For USB mini keyboard: Find device with 'sudo evtest'"
echo " - Set <usbkeyboard enabled=\"true\" device=\"/dev/input/eventX\" keycode=\"KEY_F13\"/>"
echo " - Tip: Program your USB keyboard to send F13-F24 to avoid conflicts"
echo " - Set <voiceactivity enabled=\"false\"/>"
if [ "$TARGET_USER" = "$USER" ]; then
echo " - Make sure you're in 'input' group: groups | grep input"
fi
echo ""
echo "TESTING:"
if [ "$TARGET_USER" != "$USER" ]; then
echo " Test manually as $TARGET_USER:"
echo " sudo -u $TARGET_USER /usr/local/bin/talkkonnect -config $CONFIG_DIR/talkkonnect.xml"
else
echo " Test manually first:"
echo " /usr/local/bin/talkkonnect -config $CONFIG_DIR/talkkonnect.xml"
fi
echo ""
echo " Once working, start the service:"
echo " sudo systemctl start talkkonnect"
echo ""
echo " Check status:"
echo " sudo systemctl status talkkonnect"
echo ""
echo " View logs:"
echo " journalctl -u talkkonnect -f"
echo " cat $CONFIG_DIR/talkkonnect.log"
echo ""
if [ "$TARGET_USER" != "$USER" ]; then
echo "AUDIO DUCKING:"
echo " To enable audio ducking (lower other apps when transmitting):"
echo " sudo -u $TARGET_USER $CONFIG_DIR/enable-ducking.sh"
echo ""
fi
echo "FILES:"
echo " Binary: /usr/local/bin/talkkonnect"
echo " Config: $CONFIG_DIR/talkkonnect.xml"
echo " Service: /etc/systemd/system/talkkonnect.service"
echo " Source: ~/talkkonnect"
echo " Logs: $CONFIG_DIR/talkkonnect.log"
if [ "$TARGET_USER" != "$USER" ]; then
echo " Ducking: $CONFIG_DIR/enable-ducking.sh"
fi
echo ""
echo "TROUBLESHOOTING:"
echo " - Build log: /tmp/talkkonnect_build.log"
echo " - Runtime logs: $CONFIG_DIR/talkkonnect.log"
echo " - System logs: journalctl -u talkkonnect -f"
echo " - If audio issues: check 'aplay -L' and 'arecord -L'"
echo " - If 'unable to unmute' error: run 'amixer scontrols' to see controls"
echo " - If cert errors: set <insecure>true</insecure> in config"
echo " - For keyboard PTT: ensure you're in 'input' group (groups)"
echo " - If crash after connect: ensure voicetargets section exists in XML"
echo ""
echo "KNOWN ISSUES:"
echo " - Voice activation is enabled by default (PTT disabled)"
echo " - Keyboard PTT requires logout/login after installation"
echo " - Self-signed certs need <insecure>true</insecure>"
if [ "$TARGET_USER" != "$USER" ]; then
echo " - Config files owned by $TARGET_USER - edit with sudo or su"
echo " - Audio ducking must be enabled manually (see above)"
fi
echo ""
echo "CHROMEBOOK-SPECIFIC:"
echo " - If no audio: ensure $TARGET_USER can access /dev/snd devices"
echo " - Check audio as target user: sudo -u $TARGET_USER aplay -l"
echo " - PipeWire session: /run/user/$TARGET_UID/pipewire-0"
echo ""
echo "======================================================================="
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+12020
View File
File diff suppressed because it is too large Load Diff