Create luci-app-nekoclash.patch

This commit is contained in:
kiddin9 2024-09-11 13:44:24 +08:00 committed by GitHub
parent dd74486ace
commit 16b80199bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,50 @@
--- a/luci-app-nekoclash/root/etc/uci-defaults/99_neko
+++ b/luci-app-nekoclash/root/etc/uci-defaults/99_neko
@@ -24,11 +24,31 @@ fi
echo "[ `date +%T` ] - Checking Files"
files_check() {
- uci set uhttpd.main.index_page='index.php'
- uci set uhttpd.main.interpreter='.php=/usr/bin/php-cgi'
- uci commit uhttpd
+ if [ -n "$(command -v nginx)" ];then
+cat << 'EOF' > /etc/nginx/conf.d/nekoclash.locations
+location /nekoclash {
+ alias /www/nekoclash;
+ index index.php index.html index.htm;
- /etc/init.d/uhttpd restart
+ location ~ \.php$ {
+ if (!-f $request_filename) {
+ return 404;
+ }
+ fastcgi_pass 127.0.0.1:1026;
+ fastcgi_index index.php;
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ }
+}
+EOF
+ /etc/init.d/nginx restart
+ else
+ uci set uhttpd.main.index_page='index.php'
+ uci set uhttpd.main.interpreter='.php=/usr/bin/php-cgi'
+ uci commit uhttpd
+
+ /etc/init.d/uhttpd restart
+ fi
case "$arch" in
aarch64)
--- a/luci-app-nekoclash/Makefile
+++ b/luci-app-nekoclash/Makefile
@@ -16,7 +16,7 @@ define Package/$(PKG_NAME)
SUBMENU:=3. Applications
TITLE:=LuCI support for mihomo
PKGARCH:=all
- DEPENDS:=+kmod-tun +bash +curl +jq +php8 +php8-cgi +php8-mod-curl
+ DEPENDS:=+kmod-tun +bash +curl +jq +php8 +php8-fastcgi +php8-cgi +php8-mod-curl
endef
define Package/$(PKG_NAME)/description