Skip to content

feat(ikuai): add native app market package with LuCI-equivalent config#512

Merged
stackia merged 6 commits into
mainfrom
codex/ikuai-native-package
Jun 12, 2026
Merged

feat(ikuai): add native app market package with LuCI-equivalent config#512
stackia merged 6 commits into
mainfrom
codex/ikuai-native-package

Conversation

@stackia

@stackia stackia commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a native iKuai app market package for rtp2httpd (type: 0), running directly on the router via scripts/start.sh / scripts/stop.sh instead of Docker Compose. The package bundles a static Linux binary, lifecycle hooks, user-facing readme, and option.json metadata so most settings can be configured from the iKuai app UI.

What's included

  • Package layout under ikuai-support/rtp2httpd/ following iKuai's native app structure (manifest.json, app/, scripts/, ui/, readme, changelog)
  • Lifecycle scripts: install/uninstall hooks plus start/stop with pidfile management and logging to log/run.log
  • UI configuration: 30 option.json fields covering the same settings as the OpenWrt LuCI app (listen address/port, upstream interfaces, performance tuning, external M3U, auth, CORS, FFmpeg snapshot, etc.)
  • Advanced config fallback: app/config/rtp2httpd.conf reserved for UI-unavailable settings (e.g. inline [services] channel list); UI-managed values are passed via CLI and take precedence
  • User readme: installation and usage guide for end users (not developer docs)
  • Build script: scripts/build-ikuai-ipkg.sh stages the package, injects the release binary and app icon, syncs manifest.json version/arch, and produces ikuai-support/dist/rtp2httpd-<version>-<arch>.ipkg

Notable implementation details

  • start.sh passes UI settings as command-line flags and loads --config last, avoiding a double-bind bug when the bundled config contained a [bind] section
  • .env is parsed line-by-line (not sourced) so values with spaces or shell metacharacters are handled safely
  • Boolean LuCI toggles are represented as 0/1 integers in option.json because iKuai's schema has no documented switch/list types for native apps
  • Upstream interface pickers from LuCI are text fields (interface name, e.g. eth1) since iKuai has no device selector widget

Test plan

  • sh -n on all package and build scripts
  • JSON validation for manifest.json and option.json
  • Built rtp2httpd-3.12.2-x86_64.ipkg via scripts/build-ikuai-ipkg.sh
  • Verified packaged binary is statically linked x86_64 ELF; scripts are executable; no .gitkeep in archive
  • Smoke-tested start.sh / stop.sh argument assembly with a stub binary
  • End-to-end validation on iKuai hardware (pending official review — no test environment available locally)

Notes for iKuai review

Please verify on real iKuai firmware:

  • Native app type 0 is accepted by the app market
  • All 30 option.json fields render correctly (especially optional text fields and the password-typed token)
  • App "Open" button behavior with APP_PORT_WEB (service root / returns 404; users should open /status or /player)
  • Multicast/IPTV playback depends on host network and upstream interface configuration

@stackia stackia changed the title feat(ikuai): add native package support feat(ikuai): add native ikuai package support Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-512.eastasia.1.azurestaticapps.net

1 similar comment
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-512.eastasia.1.azurestaticapps.net

@stackia stackia force-pushed the codex/ikuai-native-package branch from cd1aed8 to 5f394d4 Compare June 8, 2026 06:25
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-512.eastasia.1.azurestaticapps.net

Expand option.json to cover LuCI settings, fix double-bind when UI port
changes, harden env parsing in start.sh, and rewrite the user readme.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-512.eastasia.1.azurestaticapps.net

@github-actions

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-512.eastasia.1.azurestaticapps.net

@stackia stackia changed the title feat(ikuai): add native ikuai package support feat(ikuai): add native app market package with LuCI-equivalent config Jun 12, 2026
Drop nohup from start.sh and write manifest version without the v prefix.
Also ignore macOS .DS_Store files.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-512.eastasia.1.azurestaticapps.net

@stackia stackia marked this pull request as ready for review June 12, 2026 04:31
@stackia stackia requested a review from Copilot June 12, 2026 04:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4b3f9378f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ikuai-support/rtp2httpd/scripts/start.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds first-class iKuai “native app market” packaging for rtp2httpd, allowing it to run directly on iKuai routers (type 0) with lifecycle hooks, a UI-driven option.json configuration surface, and a build script that produces a distributable .ipkg.

Changes:

  • Added ikuai-support/rtp2httpd/ native package layout (manifest, scripts, UI metadata, default env/config, and end-user readme/changelog).
  • Implemented start/stop + install/uninstall lifecycle scripts that assemble CLI flags from UI-managed environment variables and write logs/pidfiles under the package directory.
  • Added scripts/build-ikuai-ipkg.sh to stage the package, inject icon + release binary, and produce ikuai-support/dist/rtp2httpd-<version>-<arch>.ipkg (and updated .gitignore accordingly).

Reviewed changes

Copilot reviewed 15 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/build-ikuai-ipkg.sh Stages and builds the iKuai .ipkg, syncing manifest version/image and injecting binary + icon.
ikuai-support/rtp2httpd/ui/ico/.gitkeep Keeps icon directory present in git.
ikuai-support/rtp2httpd/scripts/start.sh Starts rtp2httpd, loading .env/environment, assembling CLI flags, writing pid/log.
ikuai-support/rtp2httpd/scripts/stop.sh Stops rtp2httpd via pidfile with TERM/KILL fallback and run logging.
ikuai-support/rtp2httpd/scripts/PRE_INST.sh Pre-install hook to create dirs and set binary executable bit.
ikuai-support/rtp2httpd/scripts/POST_INST.sh Post-install hook to ensure binary mode and log install status.
ikuai-support/rtp2httpd/scripts/PRE_UNINST.sh Pre-uninstall hook to stop the service and log uninstall status.
ikuai-support/rtp2httpd/scripts/POST_UNINST.sh Post-uninstall hook to remove pidfile and log uninstall status.
ikuai-support/rtp2httpd/readme End-user usage guide for iKuai users (Chinese).
ikuai-support/rtp2httpd/changelog iKuai package changelog.
ikuai-support/rtp2httpd/manifest.json iKuai app manifest (name/version/image/type/requirements).
ikuai-support/rtp2httpd/app/option.json iKuai UI configuration schema mapping to env vars consumed by start.sh.
ikuai-support/rtp2httpd/app/.env Default UI-configurable environment variables for the package.
ikuai-support/rtp2httpd/app/environment Optional runtime env overlay loaded after .env.
ikuai-support/rtp2httpd/app/config/rtp2httpd.conf Advanced config fallback file for settings not represented in UI.
ikuai-support/rtp2httpd/app/bin/.gitkeep Keeps the bin directory present in git.
ikuai-support/rtp2httpd/log/run.log Placeholder runtime log file in package tree.
ikuai-support/rtp2httpd/log/install.log Placeholder install/uninstall log file in package tree.
.gitignore Ignores iKuai staging/dist outputs and macOS .DS_Store.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ikuai-support/rtp2httpd/scripts/start.sh Outdated
Comment thread ikuai-support/rtp2httpd/scripts/stop.sh
Comment thread ikuai-support/rtp2httpd/scripts/PRE_UNINST.sh
Comment thread ikuai-support/rtp2httpd/scripts/POST_UNINST.sh
Comment thread ikuai-support/rtp2httpd/scripts/POST_INST.sh
Redact r2h-token in startup logs, verify pidfile ownership via /proc
before stopping, and ensure log directory exists in install hooks.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-512.eastasia.1.azurestaticapps.net

@stackia stackia merged commit 3cd3ac0 into main Jun 12, 2026
10 checks passed
@stackia stackia deleted the codex/ikuai-native-package branch June 12, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants