Commit Graph

257 Commits

Author SHA1 Message Date
7b8864a036 debug(secubox): add verbose logging for appstore install
Added debugging output to understand why appstore catalog isn't being
included in package builds. The install section now:
- Checks if source file exists before attempting install
- Shows full paths being used
- Displays directory contents if file is missing
- Exits with error if file not found (fail-fast)

This will help diagnose whether the issue is:
- Wrong CURDIR path during build
- Files not present in build directory
- Permissions issue preventing access

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 13:33:57 +01:00
43568ef41b fix(secubox): make postinst script non-failing and add auto-recovery
The postinst script was failing installation (exit 1) when the appstore
catalog wasn't found, which prevented package upgrades from completing.

Changes:
1. Removed exit 1 - installation now continues even if file is missing
2. Added auto-recovery: tries to restore from /rom overlay if available
3. Provides clear status feedback (✓ or ✗) for appstore catalog
4. Gives helpful error message with recovery instructions
5. Always exits with 0 to allow installation to complete

This fixes upgrades from 0.7.0-r2 to 0.7.0-r4 where the directory
structure changed from .appstore to appstore.

Version: 0.7.0-4

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 13:17:07 +01:00
c3cc47bb40 fix(secubox): remove directories from PKG_FILE_MODES to fix build
The build was failing with:
  chown: cannot access '/usr/share/secubox': No such file or directory

This happened because PKG_FILE_MODES was trying to set permissions on
directories that don't exist at the time file modes are applied during
package creation.

Solution:
- Removed all directory entries from PKG_FILE_MODES
- Removed apps.json file entry (INSTALL_DATA sets 644 automatically)
- Kept only executable files that need explicit 755 permissions

How it works now:
- $(INSTALL_DIR) automatically creates directories with 755 permissions
- $(INSTALL_DATA) automatically installs files with 644 permissions
- PKG_FILE_MODES only specifies exceptions (executable scripts = 755)
- postinst script sets permissions again as safety measure

This follows OpenWrt package best practices where PKG_FILE_MODES
should only specify permissions that differ from the defaults set
by the installation macros.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 13:14:38 +01:00
201b869486 chore: remove old .appstore directory from git tracking
Cleanup after renaming .appstore/ to appstore/ directory.
These files are now tracked in their new location.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 13:07:19 +01:00
0edb6ef69a fix(secubox): improve Makefile install and add postinst verification
Enhanced package installation to ensure appstore files are properly
installed with correct permissions during both fresh installs and upgrades.

Changes to Makefile:
1. Added explicit PKG_FILE_MODES for all data directories and files:
   - /usr/share/secubox: 755
   - /usr/share/secubox/appstore: 755
   - /usr/share/secubox/appstore/apps.json: 644
   - /usr/share/secubox/profiles: 755

2. Improved install section:
   - Added file existence check before installing profiles
   - Added install verification message for appstore catalog
   - Better comments for clarity

3. Added postinst script:
   - Verifies appstore catalog exists after installation
   - Sets proper permissions on all data directories/files
   - Reloads RPCD service to pick up new methods
   - Provides installation feedback to user
   - Fails with warning if appstore catalog missing

This ensures the appstore will be populated on fresh firmware installs
and properly updated during package upgrades.

Version: 0.7.0-3

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 13:05:33 +01:00
edd29ad481 chore(secubox): bump version to 0.7.0-2
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 12:39:07 +01:00
b00d13b84a fix(secubox): rename .appstore to appstore to fix package build
Renamed .appstore directory to appstore (without dot prefix) to ensure
proper inclusion in OpenWrt package builds. Hidden directories (starting
with .) can be problematic during tarball creation and package installation.

Changes:
- Renamed .appstore/ to appstore/
- Updated Makefile install path references
- Updated RPCD script APPSTORE_JSON path
- Fixed file permissions to 644 for apps.json

This fixes the issue where appstore appears empty on fresh firmware
installations.

New path: /usr/share/secubox/appstore/apps.json
Old path: /usr/share/secubox/.appstore/apps.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 12:38:47 +01:00
086e62584e feat: add luci-app-secubox-bonus package with website content
Created new independent package to integrate SecuBox marketing and
documentation website. Includes demo pages, tutorials, and multi-language
content previously deployed separately.

Package contents:
- 36 static files (HTML, JS, JSON)
- 16 module demo pages (auth, bandwidth, cdn-cache, client-guardian, etc.)
- 3 blog tutorials (setup guides)
- 13 language translations (en, fr, de, es, pt, it, nl, ru, ar, zh, ja, ko, hi)
- Campaign and landing pages

Files accessible at: /luci-static/secubox/
Main URL: http://router-ip/luci-static/secubox/index.html

Package info:
- Version: 0.1.0-1
- Size: ~500KB
- Dependencies: luci-base only
- No RPCD/backend components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 12:12:55 +01:00
e2c2f64167 feat(secubox): implement conditional debug logging
Added debugMode flag that checks URL hash or localStorage setting.
Debug logging only outputs when enabled via:
- URL: /#/admin/secubox/apps#debug
- Console: localStorage.setItem('secubox_debug', 'true')

All debug logs prefixed with [AppStore] or [Modules] for clarity.
Warnings and errors remain in production for critical issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 11:59:35 +01:00
60ff5ad3f1 feat(secubox): add close button to app details modal
Added a modal footer with a Close button in the app details view.
The footer includes:
- Styled separator line with border-top
- Right-aligned Close button
- Calls ui.hideModal() on click

This provides a clear way to dismiss the modal without needing to
click outside or use the escape key.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 11:55:54 +01:00
298961a537 chore(secubox): bump version to 0.7.0-1
Updated package version from 0.6.1-0 to 0.7.0-1 to reflect:
- Fixed appstore race condition causing empty initial load
- Fixed RPC expect parameter for getAppstoreApps
- Improved error handling in apps and modules views
- Added debug logging for troubleshooting
- Fixed modules render data flow

Updated API version from 0.3.1 to 0.7.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 11:52:07 +01:00
f08d28d70b fix(secubox): correct RPC expect parameter for getAppstoreApps
Fixed appstore showing "No applications match the selected filter" by correcting
the RPC declaration expect parameter.

Issue: The RPC declaration had:
  expect: { apps: [], categories: {} }

This caused the RPC framework to return only the apps array instead of the full
response object, resulting in:
  - data = Array(5) instead of { apps: [...], categories: {...} }
  - data.apps = undefined
  - data.categories = undefined

Fix: Changed to:
  expect: { }

This returns the full response object as-is from the backend, allowing proper
access to both data.apps and data.categories properties.

Also added extensive debug logging to troubleshoot the data flow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 11:51:13 +01:00
bd032be85f fix(secubox): resolve race condition in appstore and modules data loading
Fixed issue where first page load would show empty apps/modules list, requiring
a refresh to display data.

Changes:
- Added error handling in refreshData() for both apps.js and modules.js
- Added null/empty data checks before storing results
- Fixed render() to use data parameter first, then fallback to cached instance data
- Added console logging for debugging empty responses
- Added user-friendly error notifications when API calls fail

The render function now properly uses:
  var apps = (data && data.apps) || this.appsData || [];
  var modules = (data && data.modules) || this.modulesData || [];

This ensures the data passed from load() is used on first render, preventing
the empty state on initial page load.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 11:48:18 +01:00
3793606c7b chore(cdn-cache): bump version to 0.5.0-1
Updated package version from 0.4.1-3 to 0.5.0-1
Updated API version from 0.2.2 to 0.5.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 11:08:19 +01:00
a066033bbc chore(netdata-dashboard): bump version to 0.5.0-1
Updated package version from 0.4.0-1 to 0.5.0-1 to reflect:
- Fixed ACL permissions (seccubox_logs, collect_debug)
- Fixed API module imports in all views
- Added missing API methods (getAllData, getCpu alias)
- Added utility functions (formatKB, getStatusClass, getTempClass)
- Resolved multiple "function not defined" errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 11:07:32 +01:00
f2fc384586 fix(netdata-dashboard): add missing utility functions to API
Added utility functions that views depend on:
- formatKB() - Format kilobytes with automatic unit conversion (KB/MB/GB/TB)
- getStatusClass() - Return CSS class based on percentage thresholds
  (good: <50%, info: 50-74%, warning: 75-89%, critical: >=90%)
- getTempClass() - Return CSS class based on temperature in Celsius
  (good: <60°C, info: 60-69°C, warning: 70-79°C, critical: >=80°C)

Resolves "API.formatKB is not a function", "API.getStatusClass is not a function",
and "API.getTempClass is not a function" errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 11:06:36 +01:00
d1346aae0e fix(netdata-dashboard): add missing API methods and aliases
- Added getAllData() method to fetch all system stats in one call
- Added getCpu() alias for getCPU() for consistency with view expectations
- getAllData() returns a combined object with stats, cpu, memory, disk, network, processes, and system data

This resolves "API.getAllData is not a function" and "API.getCpu is not a function" errors
by ensuring the API exports match what the views are calling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 11:04:52 +01:00
8b0d75a8d9 fix(netdata-dashboard): correct API module imports in all views
- Changed from 'require netdata-dashboard.api as api' to 'require netdata-dashboard/api as API'
- Updated all api. references to API. in realtime.js, system.js, network.js, and processes.js
- Resolves "api.getAllData is not a function" and "api.getCpu is not a function" errors

The dot notation (netdata-dashboard.api) doesn't work with LuCI's module loader.
The correct syntax uses slash (netdata-dashboard/api) and follows the convention
of uppercase API for consistency with other modules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 11:03:14 +01:00
d97fff3b9e fix(netdata-dashboard): add missing RPC methods to ACL
- Added seccubox_logs to read permissions
- Added collect_debug to read permissions
- Resolves "Access denied" error for seccubox_logs endpoint

Note: The method name has a typo (seccubox instead of secubox) but
keeping it for consistency with the existing RPC handler implementation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 10:59:13 +01:00
c8b261ea5a fix(client-guardian): correct API module imports in logs and alerts views
- Changed from L.require('client-guardian.api') to 'require client-guardian/api as API'
- Updated all api. references to API. in both files
- Resolves "api.getLogs is not a function" and "api.getAlerts is not a function" errors

The L.require() pattern doesn't work properly with async module loading in LuCI.
Using the proper 'require' directive ensures the module is loaded correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 10:56:53 +01:00
829aa1d399 fix(client-guardian): add missing uci module import in settings.js
- Added 'require uci' to fix "uci is not defined" error
- Ensures UCI configuration can be loaded properly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 09:33:55 +01:00
36aea4ffbd fix(client-guardian): correct RPC namespace and add missing ACL methods
- Fixed RPC namespace from "client-guardian" to "luci.client-guardian"
- Added missing read methods: get_client, list_sessions, get_policy
- Added missing write methods: set_policy, authorize_client, deauthorize_client
- Resolves "Access denied" errors for zones and other endpoints

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 09:32:17 +01:00
9177bbbfdf fix(client-guardian): correct API method names in all views
Fixed inconsistency between API method declarations and their usage.
The api.js exports methods with names like getClients, getStatus, etc.
but views were calling them as callClients, callStatus, etc.

Changes across 7 view files:
- api.callStatus() → api.getStatus()
- api.callClients() → api.getClients()
- api.callZones() → api.getZones()
- api.callGetAlerts() → api.getAlerts()
- api.callGetLogs() → api.getLogs()
- api.callParental() → api.getParental()
- api.callPortal() → api.getPortal()
- api.callApproveClient() → api.approveClient()
- api.callUpdateClient() → api.updateClient()
- api.callBanClient() → api.banClient()
- api.callQuarantineClient() → api.quarantineClient()
- api.callSendTestAlert() → api.sendTestAlert()
- api.callUpdatePortal() → api.updatePortal()
- api.callUpdateZone() → api.updateZone()

This fixes TypeError: api.callClients is not a function errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 09:26:47 +01:00
9cee74064c fix: properly disable lucihttp and cgi-io in SDK config
The previous config used commented-out format which didn't actually
disable the packages, causing them to be built and fail.

Changes:
- Changed from: echo "# CONFIG_PACKAGE_lucihttp is not set"
- Changed to:   echo "CONFIG_PACKAGE_lucihttp=n"
- Same for cgi-io
- Added CONFIG_BROKEN=y to allow missing dependencies

This matches the local-build.sh approach and prevents SDK from trying
to compile these problematic packages that our scripts don't need.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 06:09:21 +01:00
1684d9d9e7 chore: set OpenWrt 24.10.5 as default version in GitHub Actions
Changed default OpenWrt version from 25.12.0-rc1 to 24.10.5 to match
local-build.sh configuration and ensure stable builds by default.

Changes in both workflows:
- build-openwrt-packages.yml: default and env fallback
- build-secubox-images.yml: default and env fallback
- Reordered options to show 24.10.5 first

Users can still manually select other versions when triggering workflows.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 22:03:42 +01:00
ee97a781ee fix: enable secubox-app and luci-theme-secubox in SDK config
The packages were being copied to the SDK but not enabled in .config,
causing no artifacts to be generated for these packages.

Changes:
- Add CONFIG_PACKAGE_secubox-app=m to SDK .config
- Add CONFIG_PACKAGE_luci-theme-secubox=m to SDK .config

This ensures both packages are built when running the package build workflow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 22:00:08 +01:00
67a9f62c45 chore: sync claude settings 2025-12-30 21:43:51 +01:00
3207cb7588 fix: sync GitHub Actions workflows with local-build.sh config
Critical fixes to align CI/CD with local build configuration:

Package Build Workflow (build-openwrt-packages.yml):
- Add secubox-app to package list and build logic
- Add luci-theme-secubox to package list and build logic
- Extend artifact collection for both new packages
- Update package listing in build logs

Firmware Build Workflow (build-secubox-images.yml):
- Add secubox-app to SecuBox core packages
- Add luci-theme-secubox to base packages
- Fix dnsmasq package conflict (disable dnsmasq, enable dnsmasq-full)
- Disable 8 problematic packages that cause compilation failures:
  * crowdsec, crowdsec-firewall-bouncer (require backend compilation)
  * luci-app-crowdsec-dashboard (requires Go 1.23+)
  * netdata, netifyd (compilation issues)
  * luci-app-auth-guardian (not stable)
  * luci-app-ksm-manager (not stable)
  * luci-app-traffic-shaper (not stable)
- Extend package copy logic for secubox-app and theme

Impact:
- Prevents dnsmasq package conflict build failures
- Prevents compilation errors from unstable packages
- Ensures secubox-app CLI tool is included in builds
- Ensures cyberpunk theme is included in builds
- Package count now matches: GitHub Actions (13) = local-build.sh (13)
- 100% configuration alignment achieved

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 20:17:25 +01:00
8e4ebeb2d5 chore: update local build tooling 2025-12-30 19:28:20 +01:00
154dbcb948 fix(secubox-app): jsonfilter compatibility 2025-12-30 17:35:53 +01:00
c40c5e8dbc chore: sync luCI modules 2025-12-30 17:17:12 +01:00
0beb9620d4 fix(system-hub): patch diagnostics regression 2025-12-30 16:53:59 +01:00
22e0bc9272 feat(system-hub): extend diagnostics + tests 2025-12-30 16:21:37 +01:00
eeaa0d2f37 fix(bandwidth/traffic-shaper): sync wizard permissions 2025-12-30 15:15:01 +01:00
4c70874fff feat(netifyd/network-modes): add wizard views 2025-12-30 15:11:32 +01:00
280dd91798 release: bump secubox hub to 0.6.1-0 2025-12-30 14:42:45 +01:00
6f115a3cf3 chore: remove legacy secubox-app symlinks 2025-12-30 13:23:30 +01:00
1972099808 docs: add app store spec and sync tooling 2025-12-30 13:14:44 +01:00
72b4a93971 feat(nodogsplash): add secubox wrapper and drop legacy package 2025-12-30 13:11:36 +01:00
029b1796d4 feat(crowdsec): add secubox-app daemon 2025-12-30 13:00:59 +01:00
559e5d40ea feat(crowdsec): refresh dashboard & add WAF view 2025-12-30 12:33:48 +01:00
d71fef2e4e feat(mqtt-bridge): sync latest UI updates 2025-12-30 10:13:14 +01:00
e4c9ec0237 feat(appstore): add normalized catalog manifests 2025-12-30 08:48:41 +01:00
7179d71a6c fix(theme): revert bootstrap helper 2025-12-29 22:38:50 +01:00
9cc3924856 fix(traffic-shaper): ensure network module loaded 2025-12-29 22:30:13 +01:00
b8a7f83cb0 chore: align modules with secubox theme v0.4 2025-12-29 22:13:38 +01:00
88958eef88 mark secubox packages arch-independent 2025-12-29 21:58:50 +01:00
92eff5aad7 refactor secubox app packaging and theme 2025-12-29 21:57:12 +01:00
06ac101e5a Fix MQTT bridge controller path entries 2025-12-29 19:39:32 +01:00
fde18de048 Add nodogsplash package for firmware builds 2025-12-29 18:56:29 +01:00