From 07823423e5d14ead258d210f1cde186a5f76ab8a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 20 Apr 2026 23:10:47 +0000 Subject: [PATCH 1/3] 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 --- ubuntu-based-kiosk-v0.9.9.1.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu-based-kiosk-v0.9.9.1.sh b/ubuntu-based-kiosk-v0.9.9.1.sh index d4f10f3..2fe67de 100644 --- a/ubuntu-based-kiosk-v0.9.9.1.sh +++ b/ubuntu-based-kiosk-v0.9.9.1.sh @@ -10823,7 +10823,7 @@ upgrade_kiosk() { # Extract content and write to file (use sudo tee for reliability) sed -n "${content_start},${content_end}p" "$script_path" | sudo tee "$output_file" > /dev/null - if [[ -s "$output_file" ]]; then + if sudo test -s "$output_file"; then echo " ✓ $fname (lines $content_start-$content_end)" return 0 else From 4b7ab7c0bee33291620fcd4ba4aab38961225732 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 21 Apr 2026 00:16:55 +0000 Subject: [PATCH 2/3] 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 --- ubuntu-based-kiosk-v0.9.9.1.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ubuntu-based-kiosk-v0.9.9.1.sh b/ubuntu-based-kiosk-v0.9.9.1.sh index 2fe67de..91a7631 100644 --- a/ubuntu-based-kiosk-v0.9.9.1.sh +++ b/ubuntu-based-kiosk-v0.9.9.1.sh @@ -796,7 +796,14 @@ configure_timezone() { if [[ -n "$new_tz" ]]; then if timedatectl list-timezones | grep -q "^${new_tz}$"; then - sudo timedatectl set-timezone "$new_tz" && log_success "Timezone updated to $new_tz" + if sudo timedatectl set-timezone "$new_tz"; then + log_success "Timezone updated to $new_tz" + else + # Fallback: set timezone directly without D-Bus + sudo ln -sf "/usr/share/zoneinfo/$new_tz" /etc/localtime + echo "$new_tz" | sudo tee /etc/timezone > /dev/null + log_success "Timezone updated to $new_tz (direct)" + fi else log_error "Invalid timezone: $new_tz" fi @@ -3908,7 +3915,10 @@ first_time_install() { echo read -r -p "Proceed with installation? (y/n): " proceed [[ ! "$proceed" =~ ^[Yy]$ ]] && exit 0 - + + # Cache sudo credentials upfront so they don't expire mid-install + sudo -v + echo echo "[1/27] Installing packages..." sudo apt update From 145320998e1af0ace15035d6d535aeab85026c92 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 21 Apr 2026 00:59:09 +0000 Subject: [PATCH 3/3] chore: bump version to 1.0.0 and rename script file https://claude.ai/code/session_01M3tiofbGfmTddeMcXr8nXr --- ...ased-kiosk-v0.9.9.1.sh => ubuntu-based-kiosk-v1.0.0.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename ubuntu-based-kiosk-v0.9.9.1.sh => ubuntu-based-kiosk-v1.0.0.sh (99%) diff --git a/ubuntu-based-kiosk-v0.9.9.1.sh b/ubuntu-based-kiosk-v1.0.0.sh similarity index 99% rename from ubuntu-based-kiosk-v0.9.9.1.sh rename to ubuntu-based-kiosk-v1.0.0.sh index 91a7631..1f5b60c 100644 --- a/ubuntu-based-kiosk-v0.9.9.1.sh +++ b/ubuntu-based-kiosk-v1.0.0.sh @@ -1,9 +1,9 @@ #!/bin/bash ################################################################################ -### Ubuntu Based Kiosk v0.9.9.1 ### +### Ubuntu Based Kiosk v1.0.0 ### ################################################################################ # -# RELEASE v0.9.9.1 - Silent Upgrade & Power Button Fixes +# RELEASE v1.0.0 - Silent Upgrade & Power Button Fixes # - Silent upgrade: no user input required, extracts files from script # - Import now allows selecting backup by number instead of typing path # - Improved power button handler with better Electron process detection @@ -55,7 +55,7 @@ set -euo pipefail ### SECTION 1: CONSTANTS & GLOBALS ################################################################################ -SCRIPT_VERSION="0.9.9.1" +SCRIPT_VERSION="1.0.0" KIOSK_USER="kiosk" BUILD_USER="${SUDO_USER:-$(whoami)}" KIOSK_HOME="/home/${KIOSK_USER}" @@ -4044,7 +4044,7 @@ process.on('uncaughtException',(e)=>{ }); const CONFIG_FILE=path.join(__dirname,'config.json'); -const VERSION='0.9.9.1'; +const VERSION='1.0.0'; let mainWindow,views=[],hiddenViews=[],tabs=[],currentIndex=0,showingHidden=false; let pinWindow=null,promptWindow=null,pauseWindow=null,htmlKeyboardWindow=null;