From 9bad706ec61e56d8a10d24318f98cecd8fff8852 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Mon, 22 Dec 2025 16:13:16 +0100 Subject: [PATCH] Initial commit: SecuBox v1.0.0 - fixed packages makefiles --- .github/workflows/build-openwrt-packages.yml | 2 +- cleanup-packages.sh | 0 fix-makefiles.sh | 97 ++++++++++ luci-app-auth-guardian/Makefile | 49 +---- luci-app-bandwidth-manager/Makefile | 53 +----- luci-app-media-flow/Makefile | 48 +---- luci-app-vhost-manager/Makefile | 48 +---- makefiles/luci-app-auth-guardian/Makefile | 16 ++ makefiles/luci-app-bandwidth-manager/Makefile | 16 ++ makefiles/luci-app-media-flow/Makefile | 16 ++ makefiles/luci-app-secubox/Makefile | 16 ++ makefiles/luci-app-vhost-manager/Makefile | 16 ++ secubox-makefile-fixes.zip | Bin 0 -> 7833 bytes templates/Makefile.template | 179 ++++++------------ 14 files changed, 273 insertions(+), 283 deletions(-) mode change 100644 => 100755 cleanup-packages.sh create mode 100644 fix-makefiles.sh create mode 100644 makefiles/luci-app-auth-guardian/Makefile create mode 100644 makefiles/luci-app-bandwidth-manager/Makefile create mode 100644 makefiles/luci-app-media-flow/Makefile create mode 100644 makefiles/luci-app-secubox/Makefile create mode 100644 makefiles/luci-app-vhost-manager/Makefile create mode 100644 secubox-makefile-fixes.zip diff --git a/.github/workflows/build-openwrt-packages.yml b/.github/workflows/build-openwrt-packages.yml index 4925417..fa67304 100644 --- a/.github/workflows/build-openwrt-packages.yml +++ b/.github/workflows/build-openwrt-packages.yml @@ -22,7 +22,7 @@ on: architectures: description: 'Architectures to build (comma-separated or "all")' required: false - default: 'x86-64' + default: 'aarch64-cortex-a72' env: OPENWRT_VERSION: ${{ github.event.inputs.openwrt_version || '23.05.5' }} diff --git a/cleanup-packages.sh b/cleanup-packages.sh old mode 100644 new mode 100755 diff --git a/fix-makefiles.sh b/fix-makefiles.sh new file mode 100644 index 0000000..8cb2d60 --- /dev/null +++ b/fix-makefiles.sh @@ -0,0 +1,97 @@ +#!/bin/bash +# fix-makefiles.sh +# Script to fix Makefiles for OpenWrt LuCI packages + +set -e + +echo "🔧 SecuBox Makefile Fixer" +echo "=========================" +echo "" + +FIXED=0 +SKIPPED=0 + +for makefile in luci-app-*/Makefile; do + if [[ ! -f "$makefile" ]]; then + continue + fi + + PKG_DIR=$(dirname "$makefile") + PKG_NAME=$(basename "$PKG_DIR") + + echo "📦 Processing: $PKG_NAME" + + # Check if already has luci.mk include + if grep -q 'include.*feeds/luci/luci\.mk' "$makefile"; then + echo " ✅ Already has luci.mk include" + SKIPPED=$((SKIPPED + 1)) + continue + fi + + # Check if has package.mk include (alternative valid format) + if grep -q 'include.*package\.mk' "$makefile" && grep -q 'BuildPackage' "$makefile"; then + echo " ✅ Uses package.mk with BuildPackage (valid)" + SKIPPED=$((SKIPPED + 1)) + continue + fi + + # Need to fix - create backup first + cp "$makefile" "${makefile}.bak" + + # Extract existing values + PKG_VERSION=$(grep "^PKG_VERSION:=" "$makefile" | cut -d'=' -f2 || echo "1.0.0") + PKG_RELEASE=$(grep "^PKG_RELEASE:=" "$makefile" | cut -d'=' -f2 || echo "1") + PKG_LICENSE=$(grep "^PKG_LICENSE:=" "$makefile" | cut -d'=' -f2 || echo "Apache-2.0") + LUCI_TITLE=$(grep "^LUCI_TITLE:=" "$makefile" | cut -d'=' -f2- || echo "LuCI - $PKG_NAME") + LUCI_DEPENDS=$(grep "^LUCI_DEPENDS:=" "$makefile" | cut -d'=' -f2- || echo "+luci-base") + + # If no LUCI_TITLE, try to extract from define Package section + if [[ -z "$LUCI_TITLE" || "$LUCI_TITLE" == "LuCI - $PKG_NAME" ]]; then + TITLE_LINE=$(grep -A5 "define Package/" "$makefile" | grep "TITLE" | head -1 | cut -d'=' -f2-) + if [[ -n "$TITLE_LINE" ]]; then + LUCI_TITLE="$TITLE_LINE" + fi + fi + + # Generate new Makefile + cat > "$makefile" << MAKEFILE_EOF +include \$(TOPDIR)/rules.mk + +PKG_NAME:=${PKG_NAME} +PKG_VERSION:=${PKG_VERSION:-1.0.0} +PKG_RELEASE:=${PKG_RELEASE:-1} +PKG_LICENSE:=${PKG_LICENSE:-Apache-2.0} +PKG_MAINTAINER:=CyberMind + +LUCI_TITLE:=${LUCI_TITLE:-LuCI - SecuBox Module} +LUCI_DEPENDS:=${LUCI_DEPENDS:-+luci-base} +LUCI_PKGARCH:=all + +include \$(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildance +MAKEFILE_EOF + + echo " 🔧 Fixed Makefile (backup: ${makefile}.bak)" + FIXED=$((FIXED + 1)) + +done + +echo "" +echo "=========================" +echo "📊 Summary" +echo "=========================" +echo "Fixed: $FIXED" +echo "Skipped: $SKIPPED" +echo "" + +if [[ $FIXED -gt 0 ]]; then + echo "⚠️ Review the fixed Makefiles and adjust LUCI_TITLE and LUCI_DEPENDS as needed" + echo "" + echo "📝 Example correct values:" + echo " LUCI_TITLE:=LuCI - CrowdSec Security Dashboard" + echo " LUCI_DEPENDS:=+luci-base +rpcd +curl" +fi + +echo "" +echo "✅ Done!" diff --git a/luci-app-auth-guardian/Makefile b/luci-app-auth-guardian/Makefile index 2297044..7963e72 100644 --- a/luci-app-auth-guardian/Makefile +++ b/luci-app-auth-guardian/Makefile @@ -1,49 +1,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-auth-guardian -PKG_VERSION:=1.0.0 +PKG_VERSION:=2.0.0 PKG_RELEASE:=1 +PKG_LICENSE:=Apache-2.0 PKG_MAINTAINER:=CyberMind -PKG_LICENSE:=MIT -include $(INCLUDE_DIR)/package.mk +LUCI_TITLE:=LuCI - Auth Guardian (Captive Portal & OAuth) +LUCI_DESCRIPTION:=Authentication system with captive portal, OAuth2 (Google, GitHub), voucher management, and session control for SecuBox. +LUCI_DEPENDS:=+luci-base +rpcd +curl +nodogsplash +LUCI_PKGARCH:=all -define Package/luci-app-auth-guardian - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=3. Applications - TITLE:=Auth Guardian - Authentication & Session Manager - DEPENDS:=+luci-base +rpcd +nodogsplash - PKGARCH:=all -endef +include $(TOPDIR)/feeds/luci/luci.mk -define Package/luci-app-auth-guardian/description - Comprehensive authentication and session management: - - Captive portal with customizable splash pages - - OAuth2/OIDC integration (Google, GitHub, etc.) - - Cookie-based session management - - MAC authentication bypass - - Voucher/ticket system - - Time-based access control - - User/device tracking -endef - -define Build/Compile -endef - -define Package/luci-app-auth-guardian/install - $(INSTALL_DIR) $(1)/usr/libexec/rpcd - $(INSTALL_BIN) ./root/usr/libexec/rpcd/luci.auth-guardian $(1)/usr/libexec/rpcd/ - $(INSTALL_DIR) $(1)/usr/share/luci/menu.d - $(INSTALL_DATA) ./root/usr/share/luci/menu.d/*.json $(1)/usr/share/luci/menu.d/ - $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d - $(INSTALL_DATA) ./root/usr/share/rpcd/acl.d/*.json $(1)/usr/share/rpcd/acl.d/ - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./root/etc/config/authguard $(1)/etc/config/ - $(INSTALL_DIR) $(1)/www/luci-static/resources/view/auth-guardian - $(INSTALL_DATA) ./htdocs/luci-static/resources/view/auth-guardian/*.js $(1)/www/luci-static/resources/view/auth-guardian/ - $(INSTALL_DIR) $(1)/www/luci-static/resources/auth-guardian - $(INSTALL_DATA) ./htdocs/luci-static/resources/auth-guardian/*.js $(1)/www/luci-static/resources/auth-guardian/ -endef - -$(eval $(call BuildPackage,luci-app-auth-guardian)) +# call BuildPackage - OpenWrt buildroot diff --git a/luci-app-bandwidth-manager/Makefile b/luci-app-bandwidth-manager/Makefile index d22588c..e2db143 100644 --- a/luci-app-bandwidth-manager/Makefile +++ b/luci-app-bandwidth-manager/Makefile @@ -1,53 +1,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-bandwidth-manager -PKG_VERSION:=1.0.0 +PKG_VERSION:=2.0.0 PKG_RELEASE:=1 +PKG_LICENSE:=Apache-2.0 PKG_MAINTAINER:=CyberMind -PKG_LICENSE:=MIT -include $(INCLUDE_DIR)/package.mk +LUCI_TITLE:=LuCI - Bandwidth Manager (QoS & Quotas) +LUCI_DESCRIPTION:=Advanced bandwidth management with CAKE QoS, per-client quotas, automatic media detection, and traffic scheduling for SecuBox. +LUCI_DEPENDS:=+luci-base +rpcd +tc-full +kmod-sched-cake +sqm-scripts +LUCI_PKGARCH:=all -define Package/luci-app-bandwidth-manager - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=3. Applications - TITLE:=Bandwidth Manager - QoS, Quotas & Media Detection - DEPENDS:=+luci-base +rpcd +tc +kmod-sched-cake +kmod-sched-fq-codel - PKGARCH:=all -endef +include $(TOPDIR)/feeds/luci/luci.mk -define Package/luci-app-bandwidth-manager/description - Advanced bandwidth management for OpenWrt with: - - Per-client and per-group quotas (daily/monthly) - - Bandwidth throttling and shaping - - 8-level QoS priority classes - - Automatic media detection (VoIP, Gaming, Streaming) - - Time-based scheduling - - Real-time statistics and graphs -endef - -define Build/Compile -endef - -define Package/luci-app-bandwidth-manager/install - $(INSTALL_DIR) $(1)/usr/libexec/rpcd - $(INSTALL_BIN) ./root/usr/libexec/rpcd/luci.bandwidth-manager $(1)/usr/libexec/rpcd/ - $(INSTALL_DIR) $(1)/usr/share/luci/menu.d - $(INSTALL_DATA) ./root/usr/share/luci/menu.d/*.json $(1)/usr/share/luci/menu.d/ - $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d - $(INSTALL_DATA) ./root/usr/share/rpcd/acl.d/*.json $(1)/usr/share/rpcd/acl.d/ - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./root/etc/config/bandwidth $(1)/etc/config/ - $(INSTALL_DIR) $(1)/www/luci-static/resources/view/bandwidth-manager - $(INSTALL_DATA) ./htdocs/luci-static/resources/view/bandwidth-manager/*.js $(1)/www/luci-static/resources/view/bandwidth-manager/ - $(INSTALL_DIR) $(1)/www/luci-static/resources/bandwidth-manager - $(INSTALL_DATA) ./htdocs/luci-static/resources/bandwidth-manager/*.js $(1)/www/luci-static/resources/bandwidth-manager/ -endef - -define Package/luci-app-bandwidth-manager/postinst -#!/bin/sh -[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/rpcd reload -endef - -$(eval $(call BuildPackage,luci-app-bandwidth-manager)) +# call BuildPackage - OpenWrt buildroot diff --git a/luci-app-media-flow/Makefile b/luci-app-media-flow/Makefile index c8aba0e..c092402 100644 --- a/luci-app-media-flow/Makefile +++ b/luci-app-media-flow/Makefile @@ -1,48 +1,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-media-flow -PKG_VERSION:=1.0.0 +PKG_VERSION:=2.0.0 PKG_RELEASE:=1 +PKG_LICENSE:=Apache-2.0 PKG_MAINTAINER:=CyberMind -PKG_LICENSE:=MIT -include $(INCLUDE_DIR)/package.mk +LUCI_TITLE:=LuCI - Media Flow (Streaming Detection) +LUCI_DESCRIPTION:=Real-time streaming service detection and monitoring for Netflix, YouTube, Twitch, Zoom, Teams with quality indicators for SecuBox. +LUCI_DEPENDS:=+luci-base +rpcd +netifyd +LUCI_PKGARCH:=all -define Package/luci-app-media-flow - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=3. Applications - TITLE:=Media Flow - Streaming & Media Detection - DEPENDS:=+luci-base +rpcd +netifyd - PKGARCH:=all -endef +include $(TOPDIR)/feeds/luci/luci.mk -define Package/luci-app-media-flow/description - Advanced media and streaming traffic detection: - - Real-time protocol identification (RTSP, HLS, DASH) - - Streaming service detection (Netflix, YouTube, Twitch) - - VoIP/Video call identification (Zoom, Teams, Meet) - - Media quality monitoring - - Bandwidth allocation for media - - Content type classification -endef - -define Build/Compile -endef - -define Package/luci-app-media-flow/install - $(INSTALL_DIR) $(1)/usr/libexec/rpcd - $(INSTALL_BIN) ./root/usr/libexec/rpcd/luci.media-flow $(1)/usr/libexec/rpcd/ - $(INSTALL_DIR) $(1)/usr/share/luci/menu.d - $(INSTALL_DATA) ./root/usr/share/luci/menu.d/*.json $(1)/usr/share/luci/menu.d/ - $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d - $(INSTALL_DATA) ./root/usr/share/rpcd/acl.d/*.json $(1)/usr/share/rpcd/acl.d/ - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./root/etc/config/mediaflow $(1)/etc/config/ - $(INSTALL_DIR) $(1)/www/luci-static/resources/view/media-flow - $(INSTALL_DATA) ./htdocs/luci-static/resources/view/media-flow/*.js $(1)/www/luci-static/resources/view/media-flow/ - $(INSTALL_DIR) $(1)/www/luci-static/resources/media-flow - $(INSTALL_DATA) ./htdocs/luci-static/resources/media-flow/*.js $(1)/www/luci-static/resources/media-flow/ -endef - -$(eval $(call BuildPackage,luci-app-media-flow)) +# call BuildPackage - OpenWrt buildroot diff --git a/luci-app-vhost-manager/Makefile b/luci-app-vhost-manager/Makefile index 2c545f6..6c87e4d 100644 --- a/luci-app-vhost-manager/Makefile +++ b/luci-app-vhost-manager/Makefile @@ -1,48 +1,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-vhost-manager -PKG_VERSION:=1.0.0 +PKG_VERSION:=2.0.0 PKG_RELEASE:=1 +PKG_LICENSE:=Apache-2.0 PKG_MAINTAINER:=CyberMind -PKG_LICENSE:=MIT -include $(INCLUDE_DIR)/package.mk +LUCI_TITLE:=LuCI - VHost Manager (Reverse Proxy & SSL) +LUCI_DESCRIPTION:=Virtual host manager for local services like Nextcloud, GitLab, Jellyfin with nginx reverse proxy and automatic SSL certificates for SecuBox. +LUCI_DEPENDS:=+luci-base +rpcd +nginx-ssl +acme +acme-acmesh +LUCI_PKGARCH:=all -define Package/luci-app-vhost-manager - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=3. Applications - TITLE:=VHost Manager - Virtual Hosts & Local SaaS - DEPENDS:=+luci-base +rpcd +nginx +dnsmasq - PKGARCH:=all -endef +include $(TOPDIR)/feeds/luci/luci.mk -define Package/luci-app-vhost-manager/description - Virtual host and local SaaS management: - - Internal virtual hosts configuration - - External service redirection to local alternatives - - Self-hosted SaaS deployment (Nextcloud, GitLab, etc.) - - DNS-based traffic interception - - SSL certificate management - - Reverse proxy configuration -endef - -define Build/Compile -endef - -define Package/luci-app-vhost-manager/install - $(INSTALL_DIR) $(1)/usr/libexec/rpcd - $(INSTALL_BIN) ./root/usr/libexec/rpcd/luci.vhost-manager $(1)/usr/libexec/rpcd/ - $(INSTALL_DIR) $(1)/usr/share/luci/menu.d - $(INSTALL_DATA) ./root/usr/share/luci/menu.d/*.json $(1)/usr/share/luci/menu.d/ - $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d - $(INSTALL_DATA) ./root/usr/share/rpcd/acl.d/*.json $(1)/usr/share/rpcd/acl.d/ - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./root/etc/config/vhost $(1)/etc/config/ - $(INSTALL_DIR) $(1)/www/luci-static/resources/view/vhost-manager - $(INSTALL_DATA) ./htdocs/luci-static/resources/view/vhost-manager/*.js $(1)/www/luci-static/resources/view/vhost-manager/ - $(INSTALL_DIR) $(1)/www/luci-static/resources/vhost-manager - $(INSTALL_DATA) ./htdocs/luci-static/resources/vhost-manager/*.js $(1)/www/luci-static/resources/vhost-manager/ -endef - -$(eval $(call BuildPackage,luci-app-vhost-manager)) +# call BuildPackage - OpenWrt buildroot diff --git a/makefiles/luci-app-auth-guardian/Makefile b/makefiles/luci-app-auth-guardian/Makefile new file mode 100644 index 0000000..7963e72 --- /dev/null +++ b/makefiles/luci-app-auth-guardian/Makefile @@ -0,0 +1,16 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-auth-guardian +PKG_VERSION:=2.0.0 +PKG_RELEASE:=1 +PKG_LICENSE:=Apache-2.0 +PKG_MAINTAINER:=CyberMind + +LUCI_TITLE:=LuCI - Auth Guardian (Captive Portal & OAuth) +LUCI_DESCRIPTION:=Authentication system with captive portal, OAuth2 (Google, GitHub), voucher management, and session control for SecuBox. +LUCI_DEPENDS:=+luci-base +rpcd +curl +nodogsplash +LUCI_PKGARCH:=all + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot diff --git a/makefiles/luci-app-bandwidth-manager/Makefile b/makefiles/luci-app-bandwidth-manager/Makefile new file mode 100644 index 0000000..e2db143 --- /dev/null +++ b/makefiles/luci-app-bandwidth-manager/Makefile @@ -0,0 +1,16 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-bandwidth-manager +PKG_VERSION:=2.0.0 +PKG_RELEASE:=1 +PKG_LICENSE:=Apache-2.0 +PKG_MAINTAINER:=CyberMind + +LUCI_TITLE:=LuCI - Bandwidth Manager (QoS & Quotas) +LUCI_DESCRIPTION:=Advanced bandwidth management with CAKE QoS, per-client quotas, automatic media detection, and traffic scheduling for SecuBox. +LUCI_DEPENDS:=+luci-base +rpcd +tc-full +kmod-sched-cake +sqm-scripts +LUCI_PKGARCH:=all + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot diff --git a/makefiles/luci-app-media-flow/Makefile b/makefiles/luci-app-media-flow/Makefile new file mode 100644 index 0000000..c092402 --- /dev/null +++ b/makefiles/luci-app-media-flow/Makefile @@ -0,0 +1,16 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-media-flow +PKG_VERSION:=2.0.0 +PKG_RELEASE:=1 +PKG_LICENSE:=Apache-2.0 +PKG_MAINTAINER:=CyberMind + +LUCI_TITLE:=LuCI - Media Flow (Streaming Detection) +LUCI_DESCRIPTION:=Real-time streaming service detection and monitoring for Netflix, YouTube, Twitch, Zoom, Teams with quality indicators for SecuBox. +LUCI_DEPENDS:=+luci-base +rpcd +netifyd +LUCI_PKGARCH:=all + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot diff --git a/makefiles/luci-app-secubox/Makefile b/makefiles/luci-app-secubox/Makefile new file mode 100644 index 0000000..12f28a8 --- /dev/null +++ b/makefiles/luci-app-secubox/Makefile @@ -0,0 +1,16 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-secubox +PKG_VERSION:=2.0.0 +PKG_RELEASE:=1 +PKG_LICENSE:=Apache-2.0 +PKG_MAINTAINER:=CyberMind + +LUCI_TITLE:=LuCI - SecuBox Hub (Central Dashboard) +LUCI_DESCRIPTION:=Central control hub for all SecuBox modules. Provides unified dashboard, module status, system health monitoring, and quick actions. +LUCI_DEPENDS:=+luci-base +rpcd +curl +jq +LUCI_PKGARCH:=all + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot diff --git a/makefiles/luci-app-vhost-manager/Makefile b/makefiles/luci-app-vhost-manager/Makefile new file mode 100644 index 0000000..6c87e4d --- /dev/null +++ b/makefiles/luci-app-vhost-manager/Makefile @@ -0,0 +1,16 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-vhost-manager +PKG_VERSION:=2.0.0 +PKG_RELEASE:=1 +PKG_LICENSE:=Apache-2.0 +PKG_MAINTAINER:=CyberMind + +LUCI_TITLE:=LuCI - VHost Manager (Reverse Proxy & SSL) +LUCI_DESCRIPTION:=Virtual host manager for local services like Nextcloud, GitLab, Jellyfin with nginx reverse proxy and automatic SSL certificates for SecuBox. +LUCI_DEPENDS:=+luci-base +rpcd +nginx-ssl +acme +acme-acmesh +LUCI_PKGARCH:=all + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot diff --git a/secubox-makefile-fixes.zip b/secubox-makefile-fixes.zip new file mode 100644 index 0000000000000000000000000000000000000000..cd380abe4052447e99881c8413597be83c491221 GIT binary patch literal 7833 zcma)B1yq#V8XXXnmXwt4?(RmqTNq@Jp*uySK}tc8p<9L$k(5SY=nw^@1W5@2X$jwO zefJ>>_uZLwX3d&4Yk&VfXaC>7&psN;*O1TvXD>eQMB~4{{PzP5KnAb}+JdaWb|6;{ zT^&@wH9j*X@Y!(pLI)rqEnNcukk0nwkaeP6H36x%IJ>Fw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-h z(b3SFY^aDrUu*{jCgJUOc?M~|Dc{KMh{r?v`@|b>9cf*EiaMoS+QXS|P=F;cIg?mw z+INeoQHZ7p+)IRKQqKLM5K_jpdbHmk5@lM0rv+9>BxZaMau!;kg2cJUx0MG8ZeZr zDK|cyEPV4-E@_1iQSXVPBZ7_EZ40kPrsW}#4i%^N1FXrxRE;@2^rvVIBC>;V!tywG z6&@tt;DPbxRe z=z%1uT;G6o*)hLH_?RWA(8u&|>#RHb$L&rVWWCSl3DApHh#(%ovx_?=58x~1lLae;!}_(OAy${ye<+6;Jj8-jzog z@G_SkW1N*a-)>$!$oN?Xo+8I`7_J>l~3*UOZl89n{YChrkdwu{>(LhC4+V29}8Sya%G{*?@lVfuS_~n zE-iF1JNxIG_Nq|sS3Xpz|DwzVR+k=co=@LdkGPl>{aWr2PW{j12)-znq((nG*?CL2 zxa<2BHRLAX@;%@`0smZtKONVvi(mn-{Hq1ze!bBA3wVD|>n~pH WsshMxUBm4h{QVvo0C@Qq=6?Xas72cV literal 0 HcmV?d00001 diff --git a/templates/Makefile.template b/templates/Makefile.template index db5af3f..104b6f4 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -1,128 +1,75 @@ -# SecuBox LuCI Application Makefile Template -# Copyright (C) 2025 CyberMind.fr -# SPDX-License-Identifier: Apache-2.0 +# Template Makefile for SecuBox LuCI Applications +# ================================================ +# Copy this template and customize for each package include $(TOPDIR)/rules.mk -# ============================================ -# Package Information -# ============================================ -PKG_NAME:=luci-app-TEMPLATE-dashboard -PKG_VERSION:=1.0.0 +# Package metadata +PKG_NAME:=luci-app-PACKAGE_NAME +PKG_VERSION:=2.0.0 PKG_RELEASE:=1 - PKG_LICENSE:=Apache-2.0 -PKG_MAINTAINER:=Gandalf +PKG_MAINTAINER:=CyberMind -# ============================================ -# LuCI Configuration -# ============================================ -LUCI_TITLE:=LuCI TEMPLATE Dashboard -LUCI_DESCRIPTION:=Dashboard for TEMPLATE on OpenWrt -LUCI_DEPENDS:=+luci-base +TEMPLATE +# LuCI specific +LUCI_TITLE:=LuCI - Package Description +LUCI_DESCRIPTION:=Detailed description of what this package does +LUCI_DEPENDS:=+luci-base LUCI_PKGARCH:=all -# Optional: Extra dependencies -# +luci-lib-jsonc +rpcd +uhttpd - +# Include LuCI build system include $(TOPDIR)/feeds/luci/luci.mk -# ============================================ -# Package Definition -# ============================================ -define Package/$(PKG_NAME) - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=3. Applications - TITLE:=$(LUCI_TITLE) - DEPENDS:=$(LUCI_DEPENDS) - PKGARCH:=$(LUCI_PKGARCH) -endef +# Call BuildPackage - this is handled by luci.mk +# No need for explicit Package/xxx/install when using luci.mk -define Package/$(PKG_NAME)/description -$(LUCI_DESCRIPTION) +# === END OF TEMPLATE === -Features: -- Real-time status monitoring -- Configuration management -- Interactive dashboard -- System integration -endef - -# ============================================ -# Installation -# ============================================ -define Package/$(PKG_NAME)/install - # JavaScript views - $(INSTALL_DIR) $(1)/www/luci-static/resources/view/TEMPLATE - $(INSTALL_DATA) ./htdocs/luci-static/resources/view/TEMPLATE/*.js \ - $(1)/www/luci-static/resources/view/TEMPLATE/ - - # API and CSS - $(INSTALL_DIR) $(1)/www/luci-static/resources/TEMPLATE - $(INSTALL_DATA) ./htdocs/luci-static/resources/TEMPLATE/*.js \ - $(1)/www/luci-static/resources/TEMPLATE/ - $(INSTALL_DATA) ./htdocs/luci-static/resources/TEMPLATE/*.css \ - $(1)/www/luci-static/resources/TEMPLATE/ - - # Menu configuration - $(INSTALL_DIR) $(1)/usr/share/luci/menu.d - $(INSTALL_DATA) ./root/usr/share/luci/menu.d/$(PKG_NAME).json \ - $(1)/usr/share/luci/menu.d/ - - # ACL configuration - $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d - $(INSTALL_DATA) ./root/usr/share/rpcd/acl.d/$(PKG_NAME).json \ - $(1)/usr/share/rpcd/acl.d/ - - # RPCD backend - $(INSTALL_DIR) $(1)/usr/libexec/rpcd - $(INSTALL_BIN) ./root/usr/libexec/rpcd/TEMPLATE \ - $(1)/usr/libexec/rpcd/ - - # UCI default config (optional) - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./root/etc/config/TEMPLATE \ - $(1)/etc/config/ - - # UCI defaults (optional - runs on first install) - # $(INSTALL_DIR) $(1)/etc/uci-defaults - # $(INSTALL_BIN) ./root/etc/uci-defaults/$(PKG_NAME) \ - # $(1)/etc/uci-defaults/ -endef - -# ============================================ -# Post-installation -# ============================================ -define Package/$(PKG_NAME)/postinst -#!/bin/sh -[ -n "$${IPKG_INSTROOT}" ] || { - # Reload rpcd to register new methods - /etc/init.d/rpcd reload 2>/dev/null || true - - # Clear LuCI cache - rm -rf /tmp/luci-modulecache 2>/dev/null || true - rm -rf /tmp/luci-indexcache* 2>/dev/null || true - - echo "$(PKG_NAME) installed successfully" -} -exit 0 -endef - -define Package/$(PKG_NAME)/postrm -#!/bin/sh -[ -n "$${IPKG_INSTROOT}" ] || { - # Reload rpcd - /etc/init.d/rpcd reload 2>/dev/null || true - - # Clear LuCI cache - rm -rf /tmp/luci-modulecache 2>/dev/null || true - rm -rf /tmp/luci-indexcache* 2>/dev/null || true -} -exit 0 -endef - -# ============================================ -# Build -# ============================================ -$(eval $(call BuildPackage,$(PKG_NAME))) +# ================================================ +# NOTES FOR DEVELOPERS +# ================================================ +# +# Directory structure expected by luci.mk: +# +# luci-app-mypackage/ +# ├── Makefile # This file +# ├── htdocs/ +# │ └── luci-static/ +# │ └── resources/ +# │ └── view/ +# │ └── mypackage/ +# │ └── main.js # LuCI JavaScript view +# └── root/ +# ├── etc/ +# │ ├── config/ +# │ │ └── mypackage # UCI config file +# │ ├── init.d/ +# │ │ └── mypackage # Init script (executable) +# │ └── uci-defaults/ +# │ └── 99-mypackage # First-run setup (executable) +# └── usr/ +# ├── libexec/ +# │ └── rpcd/ +# │ └── mypackage # RPCD backend script (executable) +# └── share/ +# ├── luci/ +# │ └── menu.d/ +# │ └── luci-app-mypackage.json # Menu entry +# └── rpcd/ +# └── acl.d/ +# └── luci-app-mypackage.json # ACL permissions +# +# ================================================ +# COMMON LUCI_DEPENDS OPTIONS +# ================================================ +# +# +luci-base - Required for all LuCI apps +# +luci-compat - Legacy API compatibility +# +luci-lib-jsonc - JSON-C library +# +rpcd - RPC daemon (for backend scripts) +# +curl - HTTP client +# +jq - JSON processor +# +wireguard-tools - WireGuard utilities +# +qrencode - QR code generator +# +# ================================================