diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 414fd7be..95cd150f 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -191,7 +191,35 @@ "Bash(jsonfilter:*)", "Bash(for app in luci-app-auth-guardian luci-app-bandwidth-manager luci-app-cdn-cache luci-app-client-guardian luci-app-crowdsec-dashboard)", "Bash(do echo \"Moving $app...\")", - "Bash(git mv:*)" + "Bash(git mv:*)", + "Bash(rm:*)", + "Bash(find . -type d -name \"appstore\" ! -path \"*/\\\\.git/*\" ! -path \"*/sdk/*\" -exec sh -c 'echo \"\"{}:\"\" && ls -la \"\"{}\"\" | tail -n +4 | head -5' ;)", + "Bash(find . -type d -name \"modules\" ! -path \"*/\\\\.git/*\" ! -path \"*/sdk/*\" ! -path \"*/node_modules/*\" -exec sh -c 'dir=\"\"{}\"\"; if echo \"\"$dir\"\" | grep -q \"\"secubox\"\"; then echo \"\"$dir:\"\" && ls -la \"\"$dir\"\" 2>/dev/null | tail -n +4 | head -5 || echo \"\" \\(empty\\)\"\"; fi' ;)", + "Bash(find . -type d -name \"components\" ! -path \"*/\\\\.git/*\" ! -path \"*/sdk/*\" ! -path \"*/node_modules/*\" -exec sh -c 'dir=\"\"{}\"\"; if echo \"\"$dir\"\" | grep -q \"\"secubox\"\"; then echo \"\"$dir:\"\" && ls -la \"\"$dir\"\" 2>/dev/null | tail -n +4 | head -5 || echo \"\" \\(empty\\)\"\"; fi' ;)", + "Bash(for file in package/secubox/secubox-core/root/usr/share/secubox/plugins/catalog/*.json)", + "Bash(do jq:*)", + "Bash(then jq -e . \"$file\")", + "Bash(sh:*)", + "Bash(/tmp/deploy-components-modules-fix.sh)", + "Bash(while read d)", + "Bash(do mf=\"$d/Makefile\")", + "Bash(if [ -f \"$mf\" ])", + "Bash(then echo \"$mf\")", + "Bash(for d in package/secubox/luci-app-*/)", + "Bash(do if [ -d \"$d/files\" ])", + "Bash(for d in secubox-tools/local-feed/luci-app-*/)", + "Bash(sudo apt-get update:*)", + "Bash(apt-get update:*)", + "Bash(apt-get install:*)", + "Bash(uvicorn:*)", + "Bash(lsof:*)", + "Bash(netstat:*)", + "Bash(python -c:*)", + "Bash(python -m pytest:*)", + "Bash(source secubox-tools/webui/.venv/bin/activate:*)", + "Bash(python -m app.ingest:*)", + "Bash(python -m json.tool:*)", + "Bash(python -m uvicorn:*)" ] } } diff --git a/.github/workflows/build-openwrt-packages.yml b/.github/workflows/build-openwrt-packages.yml index 8358daf5..696e9bc2 100644 --- a/.github/workflows/build-openwrt-packages.yml +++ b/.github/workflows/build-openwrt-packages.yml @@ -533,17 +533,28 @@ jobs: echo "Note: Our SecuBox packages are PKGARCH:=all (scripts only)" echo "They will be built regardless of dependency availability" - - name: Install Lua in SDK + - name: Install and compile Lua in SDK run: | cd sdk - echo "📦 Installing Lua headers in SDK to prevent lucihttp compilation errors..." + echo "📦 Installing and compiling Lua to provide headers for lucihttp..." - # Install lua package which provides headers needed by lucihttp - # This prevents lua.h missing error but we still don't want lucihttp compiled + # Install lua package ./scripts/feeds install lua - echo "✅ Lua installed" + # Enable lua package for compilation + echo "CONFIG_PACKAGE_lua=m" >> .config + + # Compile lua to get headers in staging_dir + make defconfig + make package/lua/compile -j$(nproc) V=s || true + + # Verify headers are available + if ls staging_dir/target-*/usr/include/lua.h 2>/dev/null; then + echo "✅ Lua headers successfully installed" + else + echo "⚠️ Warning: Lua headers not found, but continuing..." + fi - name: Configure packages run: | diff --git a/secubox-tools/README.md b/secubox-tools/README.md index e96ef579..617db988 100644 --- a/secubox-tools/README.md +++ b/secubox-tools/README.md @@ -36,6 +36,9 @@ Build and test packages locally without pushing to GitHub. Automatically downloa # Build single package ./secubox-tools/local-build.sh build luci-app-system-hub +# Build SecuBox Core package +./secubox-tools/local-build.sh build secubox-core + # Build for specific architecture ./secubox-tools/local-build.sh build --arch aarch64-cortex-a72 diff --git a/secubox-tools/local-build.sh b/secubox-tools/local-build.sh index b932f50b..28a9e465 100755 --- a/secubox-tools/local-build.sh +++ b/secubox-tools/local-build.sh @@ -7,6 +7,7 @@ # ./local-build.sh validate # Run validation only # ./local-build.sh build # Build all packages (x86_64) # ./local-build.sh build luci-app-system-hub # Build single package +# ./local-build.sh build secubox-core # Build SecuBox Core package # ./local-build.sh build --arch aarch64 # Build for specific architecture # ./local-build.sh full # Validate + Build # @@ -483,11 +484,22 @@ FEEDS print_warning "Feed installation had errors, checking if critical..." fi - # Install Lua to provide headers (prevents lua.h missing error in lucihttp) + # Install and compile Lua to provide headers (prevents lua.h missing error in lucihttp) echo "" - echo "📦 Installing Lua package for headers..." + echo "📦 Installing and compiling Lua package for headers..." ./scripts/feeds install lua 2>&1 | grep -v "WARNING:" || true - print_info "Lua installed (provides headers to prevent lucihttp compilation errors)" + + # Enable and compile Lua to get headers in staging_dir + echo "CONFIG_PACKAGE_lua=m" >> .config + make defconfig > /dev/null 2>&1 + echo "Compiling Lua package to install headers..." + make package/lua/compile -j$(nproc) V=s > /tmp/lua_compile.log 2>&1 || true + + if ls staging_dir/target-*/usr/include/lua.h 2>/dev/null > /dev/null; then + print_info "✅ Lua headers successfully installed in staging directory" + else + print_warn "Lua headers not found, but continuing (may cause issues with lucihttp)" + fi # Note: We skip manual dependency installation as it causes hangs # The feeds install -a command above already installed all available packages @@ -1058,11 +1070,23 @@ setup_openwrt_feeds() { print_warning "Feed install had warnings, checking directories..." fi - # Install Lua to provide headers (prevents lua.h missing error in lucihttp) + # Install and compile Lua to provide headers (prevents lua.h missing error in lucihttp) echo "" - print_info "Installing Lua package for headers..." + print_info "Installing and compiling Lua package for headers..." ./scripts/feeds install lua 2>&1 | grep -v "WARNING:" || true + # Enable and compile Lua to get headers in staging_dir + echo "CONFIG_PACKAGE_lua=m" >> .config + make defconfig > /dev/null 2>&1 + echo "Compiling Lua package to install headers..." + make package/lua/compile -j$(nproc) V=s > /tmp/lua_compile.log 2>&1 || true + + if ls staging_dir/target-*/usr/include/lua.h 2>/dev/null > /dev/null; then + print_success "Lua headers successfully installed in staging directory" + else + print_warning "Lua headers not found, but continuing (may cause issues with lucihttp)" + fi + # Verify feeds for feed in packages luci; do if [[ -d "feeds/$feed" ]]; then @@ -1620,7 +1644,7 @@ USAGE: COMMANDS: validate Run validation only (lint, syntax checks) build Build all packages for x86_64 - build Build single package (luci-app-*, luci-theme-*, secubox-app-*) + build Build single package (luci-app-*, luci-theme-*, secubox-app-*, secubox-*) build --arch Build for specific architecture build-firmware Build full firmware image for device debug-firmware Debug firmware build (check config without building) @@ -1657,6 +1681,9 @@ EXAMPLES: # Build single SecuBox app package $0 build secubox-app-nodogsplash + # Build SecuBox Core package + $0 build secubox-core + # Build for specific architecture $0 build --arch aarch64-cortex-a72 @@ -1712,7 +1739,7 @@ main() { arch_specified=true shift 2 ;; - luci-app-*|luci-theme-*|secubox-app-*) + luci-app-*|luci-theme-*|secubox-app-*|secubox-*) single_package="$1" shift ;;