4.5 KiB
4.5 KiB
Workflows
Setup
- Normalize permissions
./secubox-tools/fix-permissions.sh --local - Install git hooks (pre-push validator)
./secubox-tools/install-git-hooks.sh - Run the baseline validation (7 checks)
./secubox-tools/validate-modules.sh - Cache the SDK and validate via local-build
./secubox-tools/local-build.sh validate - Inspect module status & docs using
DOCUMENTATION-INDEX.md,MODULE_STATUS.md, and each module’s README before editing.
Build Packages
- Single module via SDK
make package/luci-app-<module>/compile V=s - Local CI-equivalent build
./secubox-tools/local-build.sh build luci-app-<module> # or build all architectures ./secubox-tools/local-build.sh build - Firmware images (preload SecuBox packages)
./secubox-tools/local-build.sh build-firmware mochabin
Run / Validate on a Device
- Copy the package or run the standardized deploy script:
ROUTER=root@192.168.8.191 ./deploy-module-template.sh system-hub # For other modules: replace system-hub, script backs up, copies JS/CSS/RPCD/menu/ACL, fixes perms, clears cache, restarts rpcd/uhttpd. - Fix remote permissions & restart services (safety net):
./secubox-tools/fix-permissions.sh --remote root@192.168.8.191 - Functional smoke tests:
ssh root@router "ubus list | grep luci.<module>" ssh root@router "ubus call luci.<module> status" ssh root@router "/etc/init.d/rpcd restart && /etc/init.d/uhttpd restart" - Clear LuCI cache if manual copy:
rm -f /tmp/luci-indexcache /tmp/luci-modulecache/*.
Linting & Formatting
- JSON:
jsonlint root/usr/share/luci/menu.d/*.json root/usr/share/rpcd/acl.d/*.json - Shell scripts:
shellcheck root/usr/libexec/rpcd/* secubox-tools/*.sh - Ubux objects:
./secubox-tools/validate-module-generation.sh luci-app-<module>
CI Overview
- build-openwrt-packages.yml – Multi-arch SDK builds (.ipk/.apk) triggered on push/PR/tags/workflow_dispatch.
- test-validate.yml – Runs validation scripts, shellcheck, JSON lint.
- build-secubox-images.yml – Builds firmware images per device profile.
Use
Actions > Run workflowwith inputs (package name, OpenWrt version, architectures) to trigger manual builds.
Release & Deploy
- Tag release
git tag -a v1.x.y -m "Release notes" git push origin v1.x.y - Use deploy modules script for router installs; for combined releases, run
deploy-system-hub.sh,deploy-secubox-dashboard.sh, or otherdeploy-*.shwrappers which copy relevant files, callfix-permissions, clear caches, and restart services. - Post-deploy validation:
ubus list,logread | grep -i error, open the LuCI tab in a private browser window to bypass cache. - Rollback plan:
deploy-module-template.shcreates backups under/root/luci-backups/<timestamp>; restore manually viascpif needed.
Debugging Cookbook (Top Issues)
- HTTP 404 for view – Menu path mismatch; fix
root/usr/share/luci/menu.d/*.jsonto matchhtdocs/.../view/<module>/<view>.js, redeploy, flush LuCI cache. - RPC -32000 Object not found – RPCD script name or permissions wrong; rename to
luci.<module>, ensure 755, restartrpcd. - 403 on CSS/JS – File deployed with 600/700 perms; run
./secubox-tools/fix-permissions.sh --remotetargeting the router. - Design regression – Missing CSS variables or dark mode selectors; re-import
system-hub/common.css, replace hardcoded colors withvar(--sh-*), add[data-theme="dark"]overrides. - Menu not showing – ACL missing the module or dependencies unsatisfied; update ACL JSON and confirm
depends.aclin menu entry includes your package. - Build fails in CI – Run
./secubox-tools/local-build.sh fulllocally; check for missing Makefile fields or JSON syntax errors. - ubus returns malformed JSON – Ensure RPCD handlers call
json_init,json_add_*,json_dumpfor every branch. - LuCI JS error “factory yields invalid constructor” – API modules must export
baseclass.extend, not plain objects; instantiate via.new()in views when necessary. - Device storage full – Pre-deploy check
df -h | grep overlay; remove/tmp/*.ipkor/root/luci-backups/*as suggested inQUICK-START.md. - Permissions drift after manual SCP – Always run
./secubox-tools/fix-permissions.sh --remote <router>after copying files outside the deploy scripts.