[PR #91] [CLOSED] Add parameterized controls and standalone binary build #100

Closed
opened 2026-03-03 11:14:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/debloper/xiosk/pull/91
Author: @parthsidpara
Created: 7/27/2025
Status: Closed

Base: mainHead: v4/sea-and-parameterization


📝 Commits (1)

  • 42f9435 Add parameterized controls and standalone binary build

📊 Changes

11 files changed (+595 additions, -167 deletions)

View changed files

.github/workflows/release.yml (+119 -0)
📝 .gitignore (+6 -0)
build.js (+43 -0)
📝 config.json.sample (+37 -23)
📝 index.js (+105 -21)
📝 package.json (+6 -2)
📝 scripts/setup.sh (+98 -66)
📝 scripts/switcher.sh (+71 -18)
📝 services/piosk-dashboard.template (+2 -1)
📝 web/index.html (+48 -4)
📝 web/script.js (+60 -32)

📄 Description

PR Summary

A. Parameterized Controls

The primary goal was to allow users to set a custom display duration and refresh cycle for each URL in the PiOSK dashboard and to improve the UX, giving a visual clue for the setting changes that are not yet applied.

  • Dashboard UI:
    The web dashboard has been updated with "Duration" (in seconds) and "Cycles" (number of views before a refresh) input fields for each URL entry.
    image

  • Configuration:
    The config.json file structure was modified to store these new duration and cycles values for each URL object.

  • System Script Update:
    The switcher.sh script was completely rewritten. It now reads the duration and cycle count for each tab from the config.json file and maintains an independent timer and refresh counter for each. This provides the control required.

B. Standalone Binary Deployment

To simplify installation and eliminate dependencies for the end-user, the project has been configured to be distributed as a single executable file.

  • SEA Support:
    We are using the native Single Executable Application (SEA) feature built into Node.js. This allows us to package our application directly into a Node.js runtime.

  • The Need for a Bundler:
    A key challenge with SEAs is that they cannot natively include external code dependencies (like the express web server).
    To solve this, we have integrated the esbuild bundler into our build process. During our release cycle on GitHub, esbuild combines our application code and all its dependencies into a single JavaScript file.
    This bundled file is then injected into the Node.js binary. This is a necessary compile-time step to create a truly self-contained executable.

  • User Experience:
    The final installation process for the user remains a single command:

    curl ... | sudo bash ...
    

    This script automatically detects the user's Raspberry Pi architecture (ARM32/ARM64), downloads the correct pre-compiled binary from our GitHub Releases, and configures the system services to run the PiOSK automatically on boot.


Testing and Current Status

Local Validation

All components have been successfully tested in an Ubuntu desktop environment:

  • The web dashboard functions as expected.
  • The local build process (bundling with esbuild and creating the binary) completes successfully.
  • The final compiled PiOSK binary runs correctly, serving the dashboard without needing Node.js or npm installed.
  • The runner.sh and switcher.sh scripts were tested manually and confirmed to work as intended.

Next Steps

  • Test the end-to-end installation and operation on a Raspberry Pi device with both 32-bit and 64-bit OS.

  • Run the setup.sh script to validate:

    • The automated download of the correct binary.
    • The system service configuration.
  • Perform a full system reboot to confirm PiOSK launches automatically as designed.

  • Update documentation once all changes have been successfully verified.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/debloper/xiosk/pull/91 **Author:** [@parthsidpara](https://github.com/parthsidpara) **Created:** 7/27/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `v4/sea-and-parameterization` --- ### 📝 Commits (1) - [`42f9435`](https://github.com/debloper/xiosk/commit/42f9435572b408102c33dd24915a3ed3871989ba) Add parameterized controls and standalone binary build ### 📊 Changes **11 files changed** (+595 additions, -167 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/release.yml` (+119 -0) 📝 `.gitignore` (+6 -0) ➕ `build.js` (+43 -0) 📝 `config.json.sample` (+37 -23) 📝 `index.js` (+105 -21) 📝 `package.json` (+6 -2) 📝 `scripts/setup.sh` (+98 -66) 📝 `scripts/switcher.sh` (+71 -18) 📝 `services/piosk-dashboard.template` (+2 -1) 📝 `web/index.html` (+48 -4) 📝 `web/script.js` (+60 -32) </details> ### 📄 Description ## PR Summary ### **A. Parameterized Controls** The primary goal was to allow users to set a custom display duration and refresh cycle for each URL in the PiOSK dashboard and to improve the UX, giving a visual clue for the setting changes that are not yet applied. * **Dashboard UI**: The web dashboard has been updated with `"Duration"` (in seconds) and `"Cycles"` (number of views before a refresh) input fields for each URL entry. <img width="1919" height="1151" alt="image" src="https://github.com/user-attachments/assets/1f563efe-d4f7-4df3-9b1b-3e426f87c4fb" /> * **Configuration**: The `config.json` file structure was modified to store these new `duration` and `cycles` values for each URL object. * **System Script Update**: The `switcher.sh` script was completely rewritten. It now reads the `duration` and `cycle` count for each tab from the `config.json` file and maintains an independent timer and refresh counter for each. This provides the control required. ### **B. Standalone Binary Deployment** To simplify installation and eliminate dependencies for the end-user, the project has been configured to be distributed as a single executable file. * **SEA Support**: We are using the native Single Executable Application (SEA) feature built into Node.js. This allows us to package our application directly into a Node.js runtime. * **The Need for a Bundler**: A key challenge with SEAs is that they cannot natively include external code dependencies (like the `express` web server). To solve this, we have integrated the `esbuild` bundler into our build process. During our release cycle on GitHub, `esbuild` combines our application code and all its dependencies into a single JavaScript file. This bundled file is then injected into the Node.js binary. This is a necessary compile-time step to create a truly self-contained executable. * **User Experience**: The final installation process for the user remains a single command: ```bash curl ... | sudo bash ... ``` This script automatically detects the user's Raspberry Pi architecture (`ARM32`/`ARM64`), downloads the correct pre-compiled binary from our GitHub Releases, and configures the system services to run the PiOSK automatically on boot. --- ## Testing and Current Status ### **Local Validation** All components have been successfully tested in an Ubuntu desktop environment: * The web dashboard functions as expected. * The local build process (bundling with `esbuild` and creating the binary) completes successfully. * The final compiled PiOSK binary runs correctly, serving the dashboard **without needing Node.js or npm installed**. * The `runner.sh` and `switcher.sh` scripts were tested manually and confirmed to work as intended. ### **Next Steps** - [ ] Test the **end-to-end installation and operation** on a Raspberry Pi device with both **32-bit and 64-bit OS**. - [ ] Run the `setup.sh` script to validate: * The **automated download** of the correct binary. * The **system service configuration**. - [ ] Perform a full system reboot to confirm PiOSK **launches automatically** as designed. - [ ] **Update documentation** once all changes have been successfully verified. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 11:14:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/xiosk#100
No description provided.