mirror of
https://github.com/kiddin9/openwrt-packages.git
synced 2025-01-08 13:27:48 +08:00
🎉 Sync 2024-09-15 01:17:29
This commit is contained in:
parent
02cea45bd6
commit
7fab35999e
60
aic8800/Makefile
Normal file
60
aic8800/Makefile
Normal file
@ -0,0 +1,60 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (c) 2023-2024 AnYun
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=aic8800
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2024-03-04
|
||||
PKG_SOURCE_URL:=https://github.com/radxa-pkg/aic8800.git
|
||||
PKG_SOURCE_VERSION:=75fd5545a3e7a8ec2c2b022f0088cc352ad2b623
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
MAKE_PATH:=src/SDIO/driver_fw/driver/aic8800
|
||||
PKG_EXTMOD_SUBDIRS:=$(MAKE_PATH)
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/aic8800
|
||||
SUBMENU:=Wireless Drivers
|
||||
TITLE:=SKI WB800D80S wireless support
|
||||
DEPENDS:=+kmod-mac80211 +kmod-mmc \
|
||||
+@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/$(MAKE_PATH)/aic8800_bsp/aic8800_bsp.ko \
|
||||
$(PKG_BUILD_DIR)/$(MAKE_PATH)/aic8800_fdrv/aic8800_fdrv.ko
|
||||
AUTOLOAD:=$(call AutoProbe,aic8800_bsp aic8800_fdrv)
|
||||
MODPARAMS.aic8800_fdrv:=he_on=n
|
||||
endef
|
||||
|
||||
NOSTDINC_FLAGS := \
|
||||
$(KERNEL_NOSTDINC_FLAGS) \
|
||||
-I$(PKG_BUILD_DIR) \
|
||||
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
|
||||
-I$(STAGING_DIR)/usr/include/mac80211-backport \
|
||||
-I$(STAGING_DIR)/usr/include/mac80211/uapi \
|
||||
-I$(STAGING_DIR)/usr/include/mac80211 \
|
||||
-include backport/backport.h
|
||||
|
||||
EXTRA_CFLAGS:= -DBUILD_OPENWRT
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
M="$(PKG_BUILD_DIR)/$(MAKE_PATH)/" \
|
||||
modules
|
||||
endef
|
||||
|
||||
define KernelPackage/aic8800/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/aic8800
|
||||
$(CP) $(PKG_BUILD_DIR)/src/SDIO/driver_fw/fw/aic8800D80/* $(1)/lib/firmware/aic8800
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,aic8800))
|
114
aic8800/patches/010-fixes-build.patch
Normal file
114
aic8800/patches/010-fixes-build.patch
Normal file
@ -0,0 +1,114 @@
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
|
||||
@@ -2932,7 +2932,7 @@ static struct rwnx_vif *rwnx_interface_a
|
||||
vif->ap.generation = 0;
|
||||
vif->ap.mesh_pm = NL80211_MESH_POWER_ACTIVE;
|
||||
vif->ap.next_mesh_pm = NL80211_MESH_POWER_ACTIVE;
|
||||
- // no break
|
||||
+ fallthrough;
|
||||
case NL80211_IFTYPE_AP:
|
||||
INIT_LIST_HEAD(&vif->ap.sta_list);
|
||||
memset(&vif->ap.bcn, 0, sizeof(vif->ap.bcn));
|
||||
@@ -3349,7 +3349,7 @@ static int rwnx_cfg80211_change_iface(st
|
||||
INIT_LIST_HEAD(&vif->ap.proxy_list);
|
||||
vif->ap.create_path = false;
|
||||
vif->ap.generation = 0;
|
||||
- // no break
|
||||
+ fallthrough;
|
||||
case NL80211_IFTYPE_AP:
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
INIT_LIST_HEAD(&vif->ap.sta_list);
|
||||
@@ -5257,6 +5257,7 @@ static int rwnx_cfg80211_mgmt_tx(struct
|
||||
switch (RWNX_VIF_TYPE(rwnx_vif)) {
|
||||
case NL80211_IFTYPE_AP_VLAN:
|
||||
rwnx_vif = rwnx_vif->ap_vlan.master;
|
||||
+ fallthrough;
|
||||
case NL80211_IFTYPE_AP:
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
case NL80211_IFTYPE_MESH_POINT:
|
||||
@@ -5569,7 +5570,7 @@ rwnx_cfg80211_tdls_mgmt(struct wiphy *wi
|
||||
printk("%s: only one TDLS link is supported!\n", __func__);
|
||||
status_code = WLAN_STATUS_REQUEST_DECLINED;
|
||||
}
|
||||
- /* fall-through */
|
||||
+ fallthrough;
|
||||
case WLAN_TDLS_SETUP_REQUEST:
|
||||
case WLAN_TDLS_TEARDOWN:
|
||||
case WLAN_TDLS_DISCOVERY_REQUEST:
|
||||
@@ -5889,6 +5890,7 @@ static int rwnx_fill_station_info(struct
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)
|
||||
case FORMATMOD_HE_MU:
|
||||
sinfo->rxrate.he_ru_alloc = rx_vect1->he.ru_size;
|
||||
+ fallthrough;
|
||||
case FORMATMOD_HE_SU:
|
||||
case FORMATMOD_HE_ER:
|
||||
sinfo->rxrate.flags = RATE_INFO_FLAGS_HE_MCS;
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_tx.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_tx.c
|
||||
@@ -524,7 +524,7 @@ int rwnx_send_add_if (struct rwnx_hw *rw
|
||||
//case NL80211_IFTYPE_P2P_DEVICE:
|
||||
case NL80211_IFTYPE_P2P_CLIENT:
|
||||
add_if_req_param->p2p = true;
|
||||
- // no break
|
||||
+ fallthrough;
|
||||
#endif /* CONFIG_RWNX_FULLMAC */
|
||||
case NL80211_IFTYPE_STATION:
|
||||
add_if_req_param->type = MM_STA;
|
||||
@@ -537,7 +537,7 @@ int rwnx_send_add_if (struct rwnx_hw *rw
|
||||
#ifdef CONFIG_RWNX_FULLMAC
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
add_if_req_param->p2p = true;
|
||||
- // no break
|
||||
+ fallthrough;
|
||||
#endif /* CONFIG_RWNX_FULLMAC */
|
||||
case NL80211_IFTYPE_AP:
|
||||
add_if_req_param->type = MM_AP;
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_tdls.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_tdls.c
|
||||
@@ -255,17 +255,24 @@ rwnx_add_wmm_info_ie(struct sk_buff *skb
|
||||
static u8 rwnx_ac_from_wmm(int ac)
|
||||
{
|
||||
switch (ac) {
|
||||
- default:
|
||||
- WARN_ON_ONCE(1);
|
||||
case 0:
|
||||
return AC_BE;
|
||||
+ break;
|
||||
case 1:
|
||||
return AC_BK;
|
||||
+ break;
|
||||
case 2:
|
||||
return AC_VI;
|
||||
+ break;
|
||||
case 3:
|
||||
return AC_VO;
|
||||
+ break;
|
||||
+ default:
|
||||
+ WARN_ON_ONCE(1);
|
||||
+ break;
|
||||
}
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_tx.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_tx.c
|
||||
@@ -325,6 +325,7 @@ u16 rwnx_select_txq(struct rwnx_vif *rwn
|
||||
/* AP_VLAN interface is not used for a 4A STA,
|
||||
fallback searching sta amongs all AP's clients */
|
||||
rwnx_vif = rwnx_vif->ap_vlan.master;
|
||||
+ fallthrough;
|
||||
case NL80211_IFTYPE_AP:
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
{
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_txq.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_txq.c
|
||||
@@ -635,6 +635,7 @@ static inline void rwnx_txq_vif_for_each
|
||||
}
|
||||
case NL80211_IFTYPE_AP_VLAN:
|
||||
rwnx_vif = rwnx_vif->ap_vlan.master;
|
||||
+ fallthrough;
|
||||
case NL80211_IFTYPE_AP:
|
||||
case NL80211_IFTYPE_MESH_POINT:
|
||||
case NL80211_IFTYPE_P2P_GO:
|
12
aic8800/patches/020-update-path.patch
Normal file
12
aic8800/patches/020-update-path.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/Makefile
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
CONFIG_SDIO_SUPPORT := y
|
||||
CONFIG_SDIO_PWRCTRL := y
|
||||
-CONFIG_AIC_FW_PATH = "/vendor/etc/firmware"
|
||||
-#CONFIG_AIC_FW_PATH = "/lib/firmware/aic8800"
|
||||
+#CONFIG_AIC_FW_PATH = "/vendor/etc/firmware"
|
||||
+CONFIG_AIC_FW_PATH = "/lib/firmware/aic8800"
|
||||
export CONFIG_AIC_FW_PATH
|
||||
ccflags-y += -DCONFIG_AIC_FW_PATH=\"$(CONFIG_AIC_FW_PATH)\"
|
||||
|
92
aic8800/patches/030-wireless-5.15.patch
Normal file
92
aic8800/patches/030-wireless-5.15.patch
Normal file
@ -0,0 +1,92 @@
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_compat.h
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_compat.h
|
||||
@@ -52,7 +52,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 60)
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 60) || defined(BUILD_OPENWRT)
|
||||
#define IEEE80211_MAX_AMPDU_BUF IEEE80211_MAX_AMPDU_BUF_HE
|
||||
#define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB
|
||||
#define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
|
||||
@@ -2998,7 +2998,7 @@ static struct rwnx_vif *rwnx_interface_a
|
||||
} else
|
||||
vif->use_4addr = false;
|
||||
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) || defined(BUILD_OPENWRT)
|
||||
if (cfg80211_register_netdevice(ndev))
|
||||
#else
|
||||
if (register_netdevice(ndev))
|
||||
@@ -3271,7 +3271,7 @@ static int rwnx_cfg80211_del_iface(struc
|
||||
|
||||
if (dev->reg_state == NETREG_REGISTERED) {
|
||||
/* Will call rwnx_close if interface is UP */
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) || defined(BUILD_OPENWRT)
|
||||
cfg80211_unregister_netdevice(dev);
|
||||
#else
|
||||
unregister_netdevice(dev);
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_mod_params.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_mod_params.c
|
||||
@@ -1312,7 +1312,7 @@ static void rwnx_set_he_capa(struct rwnx
|
||||
if (rwnx_hw->mod_params->stbc_on)
|
||||
he_cap->he_cap_elem.phy_cap_info[2] |= IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ;
|
||||
|
||||
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
|
||||
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0) || defined(BUILD_OPENWRT)
|
||||
he_cap->he_cap_elem.phy_cap_info[3] |= IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_16_QAM |
|
||||
IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1 |
|
||||
IEEE80211_HE_PHY_CAP3_RX_PARTIAL_BW_SU_IN_20MHZ_MU;
|
||||
@@ -1330,7 +1330,7 @@ static void rwnx_set_he_capa(struct rwnx
|
||||
}
|
||||
he_cap->he_cap_elem.phy_cap_info[5] |= IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK |
|
||||
IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK;
|
||||
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
|
||||
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0) || defined(BUILD_OPENWRT)
|
||||
he_cap->he_cap_elem.phy_cap_info[6] |= IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU |
|
||||
IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU |
|
||||
IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB |
|
||||
@@ -1429,7 +1429,7 @@ static void rwnx_set_he_capa(struct rwnx
|
||||
#endif
|
||||
if (rwnx_hw->mod_params->stbc_on)
|
||||
he_cap->he_cap_elem.phy_cap_info[2] |= IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ;
|
||||
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
|
||||
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0) || defined(BUILD_OPENWRT)
|
||||
he_cap->he_cap_elem.phy_cap_info[3] |= IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_16_QAM |
|
||||
IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1 |
|
||||
IEEE80211_HE_PHY_CAP3_RX_PARTIAL_BW_SU_IN_20MHZ_MU;
|
||||
@@ -1446,7 +1446,7 @@ static void rwnx_set_he_capa(struct rwnx
|
||||
}
|
||||
he_cap->he_cap_elem.phy_cap_info[5] |= IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK |
|
||||
IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK;
|
||||
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
|
||||
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0) || defined(BUILD_OPENWRT)
|
||||
he_cap->he_cap_elem.phy_cap_info[6] |= IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU |
|
||||
IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU |
|
||||
IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB |
|
||||
@@ -1732,7 +1732,7 @@ void rwnx_custregd(struct rwnx_hw *rwnx_
|
||||
wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED;
|
||||
|
||||
rtnl_lock();
|
||||
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
|
||||
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0) || defined(BUILD_OPENWRT)
|
||||
if (regulatory_set_wiphy_regd_sync(wiphy, getRegdomainFromRwnxDB(wiphy, default_ccode))){
|
||||
wiphy_err(wiphy, "Failed to set custom regdomain\n");
|
||||
}
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_radar.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_radar.c
|
||||
@@ -1282,7 +1282,11 @@ static void rwnx_radar_detected(struct r
|
||||
chan_def = rwnx_hw->chanctx_table[rwnx_hw->cur_chanctx].chan_def;
|
||||
|
||||
rwnx_radar_cancel_cac(&rwnx_hw->radar);
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) || defined(BUILD_OPENWRT)
|
||||
+ __cfg80211_radar_event(rwnx_hw->wiphy, &chan_def, true, GFP_KERNEL);
|
||||
+#else
|
||||
cfg80211_radar_event(rwnx_hw->wiphy, &chan_def, GFP_KERNEL);
|
||||
+#endif
|
||||
|
||||
#endif /* CONFIG_RWNX_FULLMAC */
|
||||
}
|
159
aic8800/patches/031-wireless-6.1.patch
Normal file
159
aic8800/patches/031-wireless-6.1.patch
Normal file
@ -0,0 +1,159 @@
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
|
||||
@@ -776,7 +776,7 @@ static void rwnx_csa_finish(struct work_
|
||||
spin_unlock_bh(&rwnx_hw->cb_lock);
|
||||
#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION3)
|
||||
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0, 0);
|
||||
-#elif (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION)
|
||||
+#elif (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION) || defined(BUILD_OPENWRT)
|
||||
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef, 0);
|
||||
#else
|
||||
cfg80211_ch_switch_notify(vif->ndev, &csa->chandef);
|
||||
@@ -3540,7 +3540,7 @@ bool key_flag = false;
|
||||
* when adding a group key.
|
||||
*/
|
||||
static int rwnx_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev,
|
||||
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
|
||||
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
|
||||
int link_id,
|
||||
#endif
|
||||
u8 key_index, bool pairwise, const u8 *mac_addr,
|
||||
@@ -3637,7 +3637,7 @@ bool key_flag = false;
|
||||
*
|
||||
*/
|
||||
static int rwnx_cfg80211_get_key(struct wiphy *wiphy, struct net_device *netdev,
|
||||
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
|
||||
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
|
||||
int link_id,
|
||||
#endif
|
||||
u8 key_index, bool pairwise, const u8 *mac_addr,
|
||||
@@ -3655,7 +3655,7 @@ static int rwnx_cfg80211_get_key(struct
|
||||
* and @key_index, return -ENOENT if the key doesn't exist.
|
||||
*/
|
||||
static int rwnx_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev,
|
||||
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
|
||||
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
|
||||
int link_id,
|
||||
#endif
|
||||
u8 key_index, bool pairwise, const u8 *mac_addr)
|
||||
@@ -3694,7 +3694,7 @@ static int rwnx_cfg80211_del_key(struct
|
||||
*/
|
||||
static int rwnx_cfg80211_set_default_key(struct wiphy *wiphy,
|
||||
struct net_device *netdev,
|
||||
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
|
||||
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
|
||||
int link_id,
|
||||
#endif
|
||||
u8 key_index, bool unicast, bool multicast)
|
||||
@@ -3709,7 +3709,7 @@ static int rwnx_cfg80211_set_default_key
|
||||
*/
|
||||
static int rwnx_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
|
||||
struct net_device *netdev,
|
||||
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
|
||||
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
|
||||
int link_id,
|
||||
#endif
|
||||
u8 key_index)
|
||||
@@ -3796,7 +3796,7 @@ static int rwnx_cfg80211_connect(struct
|
||||
key_params.seq_len = 0;
|
||||
key_params.cipher = sme->crypto.cipher_group;
|
||||
rwnx_cfg80211_add_key(wiphy, dev,
|
||||
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
|
||||
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2) || defined(BUILD_OPENWRT)
|
||||
0,
|
||||
#endif
|
||||
sme->key_idx, false, NULL, &key_params);
|
||||
@@ -4063,7 +4063,7 @@ static int rwnx_cfg80211_add_station(str
|
||||
sta->vif_idx = rwnx_vif->vif_index;
|
||||
sta->vlan_idx = sta->vif_idx;
|
||||
sta->qos = (params->sta_flags_set & BIT(NL80211_STA_FLAG_WME)) != 0;
|
||||
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
|
||||
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
|
||||
sta->ht = params->link_sta_params.ht_capa ? 1 : 0;
|
||||
sta->vht = params->link_sta_params.vht_capa ? 1 : 0;
|
||||
#else
|
||||
@@ -4469,7 +4469,7 @@ static int rwnx_cfg80211_change_station(
|
||||
sta->vif_idx = rwnx_vif->vif_index;
|
||||
sta->vlan_idx = sta->vif_idx;
|
||||
sta->qos = (params->sta_flags_set & BIT(NL80211_STA_FLAG_WME)) != 0;
|
||||
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
|
||||
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
|
||||
sta->ht = params->link_sta_params.ht_capa ? 1 : 0;
|
||||
sta->vht = params->link_sta_params.vht_capa ? 1 : 0;
|
||||
#else
|
||||
@@ -4716,7 +4716,7 @@ static int rwnx_cfg80211_change_beacon(s
|
||||
/**
|
||||
* * @stop_ap: Stop being an AP, including stopping beaconing.
|
||||
*/
|
||||
-#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION)
|
||||
+#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION) || defined(BUILD_OPENWRT)
|
||||
static int rwnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev, unsigned int link_id)
|
||||
#else
|
||||
static int rwnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
|
||||
@@ -5190,7 +5190,7 @@ static int rwnx_cfg80211_dump_survey(str
|
||||
*/
|
||||
static int rwnx_cfg80211_get_channel(struct wiphy *wiphy,
|
||||
struct wireless_dev *wdev,
|
||||
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
|
||||
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
|
||||
unsigned int link_id,
|
||||
#endif
|
||||
struct cfg80211_chan_def *chandef)
|
||||
@@ -5487,7 +5487,7 @@ int rwnx_cfg80211_channel_switch (struct
|
||||
INIT_WORK(&csa->work, rwnx_csa_finish);
|
||||
#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION4
|
||||
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false, 0);
|
||||
-#elif LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2
|
||||
+#elif LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2 || defined(BUILD_OPENWRT)
|
||||
cfg80211_ch_switch_started_notify(dev, &csa->chandef, 0, params->count, false);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
|
||||
cfg80211_ch_switch_started_notify(dev, &csa->chandef, params->count, params->block_tx);
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_rx.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_rx.c
|
||||
@@ -836,7 +836,7 @@ static inline int rwnx_rx_sm_connect_ind
|
||||
|
||||
do {
|
||||
bss = cfg80211_get_bss(wdev->wiphy, NULL, rwnx_vif->sta.bssid,
|
||||
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
|
||||
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
|
||||
wdev->u.client.ssid, wdev->u.client.ssid_len,
|
||||
#else
|
||||
wdev->ssid, wdev->ssid_len,
|
||||
@@ -866,7 +866,7 @@ static inline int rwnx_rx_sm_connect_ind
|
||||
#else
|
||||
WLAN_CAPABILITY_ESS,
|
||||
#endif
|
||||
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
|
||||
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
|
||||
(int)wdev->u.client.ssid_len,
|
||||
wdev->u.client.ssid,
|
||||
#else
|
||||
@@ -887,7 +887,7 @@ static inline int rwnx_rx_sm_connect_ind
|
||||
rwnx_vif->sta.bssid[0], rwnx_vif->sta.bssid[1], rwnx_vif->sta.bssid[2],
|
||||
rwnx_vif->sta.bssid[3], rwnx_vif->sta.bssid[4], rwnx_vif->sta.bssid[5]);
|
||||
|
||||
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
|
||||
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
|
||||
wdev->u.client.ssid_len = (int)rwnx_vif->sta.ssid_len;
|
||||
memcpy(wdev->u.client.ssid, rwnx_vif->sta.ssid, wdev->u.client.ssid_len);
|
||||
#else
|
||||
@@ -927,7 +927,7 @@ static inline int rwnx_rx_sm_connect_ind
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
struct cfg80211_roam_info info;
|
||||
memset(&info, 0, sizeof(info));
|
||||
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
|
||||
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
|
||||
if (rwnx_vif->ch_index < NX_CHAN_CTXT_CNT)
|
||||
info.links[0].channel = rwnx_hw->chanctx_table[rwnx_vif->ch_index].chan_def.chan;
|
||||
info.links[0].bssid = (const u8 *)ind->bssid.array;
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_tx.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_msg_tx.c
|
||||
@@ -1941,7 +1941,7 @@ int rwnx_send_me_sta_add(struct rwnx_hw
|
||||
{
|
||||
struct me_sta_add_req *req;
|
||||
|
||||
-#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION
|
||||
+#if LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION || defined(BUILD_OPENWRT)
|
||||
struct link_station_parameters *link_sta_params = ¶ms->link_sta_params;
|
||||
#else
|
||||
struct station_parameters *link_sta_params = params;
|
13
aic8800/patches/032-wireless-6.6.patch
Normal file
13
aic8800/patches/032-wireless-6.6.patch
Normal file
@ -0,0 +1,13 @@
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_compat.h
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_compat.h
|
||||
@@ -47,8 +47,8 @@
|
||||
#else
|
||||
#define HIGH_KERNEL_VERSION KERNEL_VERSION(6, 0, 0)
|
||||
#define HIGH_KERNEL_VERSION2 KERNEL_VERSION(6, 1, 0)
|
||||
-#define HIGH_KERNEL_VERSION3 KERNEL_VERSION(6, 3, 0)
|
||||
-#define HIGH_KERNEL_VERSION4 KERNEL_VERSION(6, 3, 0)
|
||||
+#define HIGH_KERNEL_VERSION3 KERNEL_VERSION(6, 9, 0)
|
||||
+#define HIGH_KERNEL_VERSION4 KERNEL_VERSION(6, 9, 0)
|
||||
#endif
|
||||
|
||||
|
32
aic8800/patches/040-disable-log.patch
Normal file
32
aic8800/patches/040-disable-log.patch
Normal file
@ -0,0 +1,32 @@
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aic_bsp_main.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_bsp/aic_bsp_main.c
|
||||
@@ -15,7 +15,7 @@
|
||||
#define DRV_AUTHOR "AICSemi"
|
||||
#define DRV_VERS_MOD "1.0"
|
||||
|
||||
-int aicwf_dbg_level_bsp = LOGERROR|LOGINFO|LOGDEBUG|LOGTRACE;
|
||||
+int aicwf_dbg_level_bsp = LOGDATA;
|
||||
|
||||
static struct platform_device *aicbsp_pdev;
|
||||
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
|
||||
@@ -503,7 +503,7 @@ static const int rwnx_hwq2uapsd[NL80211_
|
||||
|
||||
|
||||
extern uint8_t scanning;
|
||||
-int aicwf_dbg_level = LOGERROR|LOGINFO|LOGDEBUG|LOGTRACE;
|
||||
+int aicwf_dbg_level = LOGWAKELOCK;
|
||||
module_param(aicwf_dbg_level, int, 0660);
|
||||
int testmode = 0;
|
||||
char aic_fw_path[200];
|
||||
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_tx.c
|
||||
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_tx.c
|
||||
@@ -169,7 +169,6 @@ void rwnx_ps_bh_traffic_req(struct rwnx_
|
||||
// sta->mac_addr))
|
||||
// return;
|
||||
if (!sta->ps.active) {
|
||||
- printk("sta %pM is not in Power Save mode", sta->mac_addr);
|
||||
return;
|
||||
}
|
||||
#ifdef CREATE_TRACE_POINTS
|
@ -308,24 +308,29 @@ if [ -z "$COPS" ]; then
|
||||
fi
|
||||
fi
|
||||
[ -z "$COPS" ] && COPS=$COPS_NUM
|
||||
case "$COPS" in
|
||||
*\ *)
|
||||
COPS=$(echo "$COPS" | awk '{if(NF==2 && tolower($1)==tolower($2)){print $1}else{print $0}}')
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$COPS" =~ " " ]]; then
|
||||
COPS=$(echo "$COPS" | awk '{if(NF==2 && tolower($1)==tolower($2)){print $1}else{print $0}}')
|
||||
fi
|
||||
|
||||
isp=$(sms_tool -d $DEVICE at "AT+COPS?"|sed -n '2p'|cut -d '"' -f2|tr -d '\r')
|
||||
isp=$(sms_tool -d "$DEVICE" at "AT+COPS?" | sed -n '2p' | cut -d '"' -f2 | tr -d '\r')
|
||||
isp_num="$COPS_MCC $COPS_MNC"
|
||||
isp_numws="$COPS_MCC$COPS_MNC"
|
||||
|
||||
if [[ "$COPS" =~ ^[0-9]+$ ]]; then
|
||||
if [[ "$COPS" == "$isp_num" || "$COPS" == "$isp_numws" ]]; then
|
||||
if [[ -n "$isp" ]]; then
|
||||
COPS=$(awk -F[\;] '/^'$isp';/ {print $3}' $RES/mccmnc.dat | xargs)
|
||||
LOC=$(awk -F[\;] '/^'$isp';/ {print $2}' $RES/mccmnc.dat)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$COPS" in
|
||||
*[!0-9]* | '')
|
||||
# Non-numeric characters or is blank
|
||||
;;
|
||||
*)
|
||||
if [ "$COPS" = "$isp_num" ] || [ "$COPS" = "$isp_numws" ]; then
|
||||
if [ -n "$isp" ]; then
|
||||
COPS=$(awk -F[\;] '/^'"$isp"';/ {print $3}' $RES/mccmnc.dat | xargs)
|
||||
LOC=$(awk -F[\;] '/^'"$isp"';/ {print $2}' $RES/mccmnc.dat)
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# operator location from temporary config
|
||||
LOCATIONFILE=/tmp/location
|
||||
@ -348,14 +353,19 @@ if [ -e "$LOCATIONFILE" ]; then
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [[ "$COPS_MCC$COPS_MNC" =~ ^[0-9]+$ ]]; then
|
||||
if [ -n "$LOC" ]; then
|
||||
LOC=$(awk -F[\;] '/^'$COPS_MCC$COPS_MNC';/ {print $2}' $RES/mccmnc.dat)
|
||||
echo "$LOC" > /tmp/location
|
||||
else
|
||||
echo "-" > /tmp/location
|
||||
fi
|
||||
fi
|
||||
case "$COPS_MCC$COPS_MNC" in
|
||||
*[!0-9]* | '')
|
||||
# Non-numeric characters or is blank
|
||||
;;
|
||||
*)
|
||||
if [ -n "$LOC" ]; then
|
||||
LOC=$(awk -F[\;] '/^'"$COPS_MCC$COPS_MNC"';/ {print $2}' $RES/mccmnc.dat)
|
||||
echo "$LOC" > /tmp/location
|
||||
else
|
||||
echo "-" > /tmp/location
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
T=$(echo "$O" | awk -F[,\ ] '/^\+CPIN:/ {print $0;exit}' | xargs)
|
||||
|
@ -61,29 +61,59 @@ return view.extend({
|
||||
o = s.taboption('basic', form.Flag, 'enabled', _('Enable'), _('Enable apfree-wifidog service.'));
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.taboption('basic', form.Flag, 'no_auth_server', _('No Auth Server'), _('Do not use authentication server.'));
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.taboption('basic', form.Value, 'device_id', _('Device ID'), _('The ID of the device.'));
|
||||
o.depends('no_auth_server', '0');
|
||||
o.rmempty = false;
|
||||
o.datatype = 'string';
|
||||
o.optional = false;
|
||||
|
||||
o = s.taboption('basic', form.Value, 'auth_server_hostname', _('Auth Server Hostname'),
|
||||
_('The domain or IP address of the authentication server.'));
|
||||
o.depends('no_auth_server', '0');
|
||||
o.rmempty = false;
|
||||
o.datatype = 'or(host,ip4addr)';
|
||||
o.optional = false;
|
||||
|
||||
o = s.taboption('basic', form.Value, 'auth_server_port', _('Auth Server Port'),
|
||||
_('The port of the authentication server.'));
|
||||
o.depends('no_auth_server', '0');
|
||||
o.rmempty = false;
|
||||
o.datatype = 'port';
|
||||
o.optional = false;
|
||||
|
||||
o = s.taboption('basic', form.Value, 'auth_server_path', _('Auth Server URI path'),
|
||||
_('The URI path of the authentication server.'));
|
||||
o.depends('no_auth_server', '0');
|
||||
o.rmempty = false;
|
||||
o.datatype = 'string';
|
||||
o.optional = false;
|
||||
|
||||
o = s.taboption('basic', form.FileUpload, 'auth_server_offline_page', _('Upload offline Page'),
|
||||
_('The offline page of the authentication server.'));
|
||||
o.depends('no_auth_server', '1');
|
||||
o.rmempty = false;
|
||||
o.optional = true
|
||||
o.datatype = 'file';
|
||||
o.root_directory = '/etc/wifidogx';
|
||||
|
||||
o = s.taboption('basic', form.Value, 'auth_server_offline_file', _('Offline Page Full Path'),
|
||||
_('The full path of the uploaded offline page.'));
|
||||
o.depends('no_auth_server', '1');
|
||||
o.rmempty = false;
|
||||
o.datatype = 'string';
|
||||
o.optional = true;
|
||||
o.placeholder = '/etc/wifidogx/';
|
||||
|
||||
o = s.taboption('basic', form.Value, 'local_portal', _('Local Portal'),
|
||||
_('The local portal url.'));
|
||||
o.depends('no_auth_server', '1');
|
||||
o.rmempty = false;
|
||||
o.datatype = 'string';
|
||||
o.optional = true;
|
||||
|
||||
o = s.taboption('basic', form.ListValue, 'log_level', _('Log Level'),
|
||||
_('The log level of the apfree-wifidog.'));
|
||||
o.value(7, _('Debug'));
|
||||
@ -125,6 +155,7 @@ return view.extend({
|
||||
o.rmempty = false;
|
||||
o.optional = true;
|
||||
|
||||
|
||||
// advanced settings
|
||||
o = s.taboption('advanced', form.Flag, 'enable_websocket', _('Enable WebSocket'),
|
||||
_('Enable websocket support.'));
|
||||
|
@ -220,4 +220,28 @@ msgid "Gateway Settings"
|
||||
msgstr "网关设置"
|
||||
|
||||
msgid "Log Level"
|
||||
msgstr "日志级别"
|
||||
msgstr "日志级别"
|
||||
|
||||
msgid "No Auth Server"
|
||||
msgstr "无认证服务器"
|
||||
|
||||
msgid "Do not use authentication server."
|
||||
msgstr "不使用认证服务器"
|
||||
|
||||
msgid "The offline page of the authentication server."
|
||||
msgstr "认证服务器离线用户展示页面"
|
||||
|
||||
msgid "Upload offline Page"
|
||||
msgstr "上传离线页面"
|
||||
|
||||
msgid "Offline Page Full Path"
|
||||
msgstr "离线页面完整路径"
|
||||
|
||||
msgid "The full path of the uploaded offline page."
|
||||
msgstr "上传的离线页面的完整路径"
|
||||
|
||||
msgid "Local Portal"
|
||||
msgstr "本地门户"
|
||||
|
||||
msgid "The local portal url."
|
||||
msgstr "本地门户跳转URL"
|
@ -11,7 +11,10 @@
|
||||
"uci": ["wifidogx"]
|
||||
},
|
||||
"write": {
|
||||
"uci": ["wifidogx"]
|
||||
"uci": ["wifidogx"],
|
||||
"file": {
|
||||
"/etc/wifidogx/*": [ "write" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_MAINTAINER:=Thaolga <https://github.com/Thaolga/luci-app-nekoclash>
|
||||
PKG_NAME:=luci-app-nekoclash
|
||||
PKG_VERSION:=1.3.0
|
||||
PKG_RELEASE:=27
|
||||
PKG_RELEASE:=28
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
|
@ -1,14 +1,13 @@
|
||||
<?php
|
||||
|
||||
ob_start();
|
||||
include './cfg.php';
|
||||
$subscriptionPath = '/etc/neko/proxy_provider/';
|
||||
$subscriptionFile = $subscriptionPath . 'subscriptions.json';
|
||||
$autoUpdateConfigFile = $subscriptionPath . 'auto_update_config.json';
|
||||
$clashFile = $subscriptionPath . 'clash_config.yaml';
|
||||
|
||||
$message = "";
|
||||
$decodedContent = "";
|
||||
$subscriptions = [];
|
||||
$autoUpdateConfig = ['auto_update_enabled' => false, 'update_time' => '00:00'];
|
||||
|
||||
if (!file_exists($subscriptionPath)) {
|
||||
mkdir($subscriptionPath, 0755, true);
|
||||
@ -18,13 +17,8 @@ if (!file_exists($subscriptionFile)) {
|
||||
file_put_contents($subscriptionFile, json_encode([]));
|
||||
}
|
||||
|
||||
if (!file_exists($autoUpdateConfigFile)) {
|
||||
file_put_contents($autoUpdateConfigFile, json_encode($autoUpdateConfig));
|
||||
}
|
||||
|
||||
$subscriptions = json_decode(file_get_contents($subscriptionFile), true);
|
||||
if (!$subscriptions) {
|
||||
$subscriptions = [];
|
||||
for ($i = 0; $i < 7; $i++) {
|
||||
$subscriptions[$i] = [
|
||||
'url' => '',
|
||||
@ -33,8 +27,6 @@ if (!$subscriptions) {
|
||||
}
|
||||
}
|
||||
|
||||
$autoUpdateConfig = json_decode(file_get_contents($autoUpdateConfigFile), true);
|
||||
|
||||
if (isset($_POST['update'])) {
|
||||
$index = intval($_POST['index']);
|
||||
$url = $_POST['subscription_url'] ?? '';
|
||||
@ -60,18 +52,6 @@ if (isset($_POST['update'])) {
|
||||
file_put_contents($subscriptionFile, json_encode($subscriptions));
|
||||
}
|
||||
|
||||
if (isset($_POST['set_auto_update'])) {
|
||||
$updateTime = $_POST['update_time'] ?? '00:00';
|
||||
$autoUpdateEnabled = isset($_POST['auto_update_enabled']);
|
||||
|
||||
$autoUpdateConfig = [
|
||||
'auto_update_enabled' => $autoUpdateEnabled,
|
||||
'update_time' => $updateTime
|
||||
];
|
||||
|
||||
file_put_contents($autoUpdateConfigFile, json_encode($autoUpdateConfig));
|
||||
$message = "自动更新设置已保存!";
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN" data-bs-theme="<?php echo substr($neko_theme, 0, -4) ?>">
|
||||
|
@ -114,28 +114,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
echo '<p>文件内容已更新:' . htmlspecialchars(basename($fileToSave)) . '</p>';
|
||||
}
|
||||
|
||||
if (isset($_FILES['customFileInput']) && isset($_POST['customDir'])) {
|
||||
$customDir = rtrim($_POST['customDir'], '/') . '/';
|
||||
if (!is_dir($customDir)) {
|
||||
if (!mkdir($customDir, 0755, true)) {
|
||||
echo '自定义目录创建失败!';
|
||||
}
|
||||
}
|
||||
|
||||
$file = $_FILES['customFileInput'];
|
||||
$uploadFilePath = $customDir . basename($file['name']);
|
||||
|
||||
if ($file['error'] === UPLOAD_ERR_OK) {
|
||||
if (move_uploaded_file($file['tmp_name'], $uploadFilePath)) {
|
||||
echo '文件上传到自定义目录成功:' . htmlspecialchars(basename($file['name']));
|
||||
} else {
|
||||
echo '文件上传到自定义目录失败!';
|
||||
}
|
||||
} else {
|
||||
echo '上传错误:' . $file['error'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['customFile'])) {
|
||||
$customDir = rtrim($_GET['customDir'], '/') . '/';
|
||||
$customFilePath = $customDir . basename($_GET['customFile']);
|
||||
@ -522,119 +500,37 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>文件上传和管理</title>
|
||||
<title>Mihomo 文件管理</title>
|
||||
<link href="./assets/bootstrap/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
color: #E0E0E0;
|
||||
background-color: red;
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #87ceeb;
|
||||
background-size: cover;
|
||||
color: #E0E0E0;
|
||||
}
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 90%;
|
||||
max-width: 900px;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
background: rgba(30, 30, 30, 0.8);
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
margin-top: 50px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
h1, h2, .help-text {
|
||||
h1, h2 {
|
||||
color: #00FF7F;
|
||||
}
|
||||
.form-inline {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
.form-inline .form-control-file {
|
||||
flex: 1;
|
||||
}
|
||||
.file-upload-button {
|
||||
padding: 10px 20px;
|
||||
background-color: #03DAC6;
|
||||
color: #121212;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.file-upload-button:hover {
|
||||
background-color: #018786;
|
||||
}
|
||||
.list-group {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.list-group-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
background: #2C2C2C;
|
||||
border-bottom: 1px solid #444;
|
||||
}
|
||||
.list-group-item a {
|
||||
color: #BB86FC;
|
||||
text-decoration: none;
|
||||
}
|
||||
.button-group {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
.button-group form {
|
||||
display: inline;
|
||||
}
|
||||
.button-group .btn {
|
||||
margin-left: 5px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
}
|
||||
.btn-danger {
|
||||
background-color: #CF6679;
|
||||
color: #121212;
|
||||
}
|
||||
.btn-danger:hover {
|
||||
background-color: #B00020;
|
||||
}
|
||||
.btn-success {
|
||||
background-color: #03DAC6;
|
||||
color: #121212;
|
||||
}
|
||||
.btn-success:hover {
|
||||
background-color: #018786;
|
||||
}
|
||||
.btn-warning {
|
||||
background-color: #F4B400;
|
||||
color: #121212;
|
||||
}
|
||||
.btn-warning:hover {
|
||||
background-color: #C79400;
|
||||
.table th, .table td {
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.editor {
|
||||
height: 300px;
|
||||
width: 90%;
|
||||
min-width: 800px;
|
||||
max-width: 800px;
|
||||
width: 100%;
|
||||
background-color: #2C2C2C;
|
||||
color: #E0E0E0;
|
||||
padding: 15px;
|
||||
@ -644,226 +540,288 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
margin-top: 20px;
|
||||
overflow: auto;
|
||||
}
|
||||
.nav-buttons {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 20px;
|
||||
.btn-danger {
|
||||
background-color: #CF6679;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.nav-buttons .btn {
|
||||
padding: 10px 20px;
|
||||
.btn-danger:hover {
|
||||
background-color: #B00020;
|
||||
}
|
||||
.btn-success {
|
||||
background-color: #03DAC6;
|
||||
color: #121212;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.nav-buttons .btn:hover {
|
||||
.btn-success:hover {
|
||||
background-color: #018786;
|
||||
}
|
||||
.input-group {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
.btn-warning {
|
||||
background-color: #F4B400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.input-group label {
|
||||
margin-right: 10px;
|
||||
white-space: nowrap;
|
||||
color: #00FF7F;
|
||||
.btn-warning:hover {
|
||||
background-color: #C79400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.input-group input {
|
||||
flex: 1;
|
||||
padding: 5px;
|
||||
border: 1px solid #444;
|
||||
border-radius: 5px;
|
||||
.btn-primary {
|
||||
background-color: #03DAC6;
|
||||
border: none;
|
||||
}
|
||||
.btn-primary:hover {
|
||||
background-color: #018786;
|
||||
}
|
||||
.modal-header, .modal-body, .modal-footer {
|
||||
background: #f8f9fa;
|
||||
color: #333;
|
||||
}
|
||||
.modal-content {
|
||||
background: #ffffff;
|
||||
border: 1px solid #ced4da;
|
||||
}
|
||||
.modal-body {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.form-control {
|
||||
background-color: #2C2C2C;
|
||||
color: #E0E0E0;
|
||||
border: 1px solid #444;
|
||||
}
|
||||
button[name="update"] {
|
||||
background-color: #FF6347;
|
||||
color: white;
|
||||
padding: 5px 10px;
|
||||
border: none;
|
||||
.form-control:focus {
|
||||
border-color: #03DAC6;
|
||||
box-shadow: 0 0 0 0.2rem rgba(3, 218, 198, 0.25);
|
||||
}
|
||||
.log-output {
|
||||
background-color: #2C2C2C;
|
||||
border: 1px solid #444;
|
||||
border-radius: 5px;
|
||||
color: #E0E0E0;
|
||||
padding: 10px;
|
||||
margin-top: 20px;
|
||||
height: 200px;
|
||||
overflow-y: scroll;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.subscription-card {
|
||||
background: #3C3C3C;
|
||||
border: 1px solid #444;
|
||||
color: #E0E0E0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.subscription-card .card-body {
|
||||
padding: 10px;
|
||||
}
|
||||
.custom-file-name {
|
||||
background-color: #2C2C2C;
|
||||
color: #E0E0E0;
|
||||
border: 1px solid #444;
|
||||
}
|
||||
.card .form-control {
|
||||
background-color: #2C2C2C;
|
||||
color: #E0E0E0;
|
||||
border: 1px solid #444;
|
||||
}
|
||||
.card .form-control:focus {
|
||||
border-color: #03DAC6;
|
||||
box-shadow: 0 0 0 0.2rem rgba(3, 218, 198, 0.25);
|
||||
}
|
||||
.form-inline .form-control-file {
|
||||
display: none;
|
||||
}
|
||||
.btn-group {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.btn-group .btn {
|
||||
height: 38px;
|
||||
line-height: 1.5;
|
||||
padding: 0 10px;
|
||||
text-align: center;
|
||||
}
|
||||
.upload-btn {
|
||||
cursor: pointer;
|
||||
margin-top: 10px;
|
||||
}
|
||||
button[name="update"]:hover {
|
||||
background-color: darkgreen;
|
||||
.btn-group .btn-rename {
|
||||
max-width: 80px;
|
||||
padding: 2px 6px;
|
||||
font-size: 0.875rem;
|
||||
width: auto;
|
||||
white-space: nowrap;
|
||||
border-radius: 4px !important;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.form-spacing {
|
||||
margin-bottom: 30px;
|
||||
@media (max-width: 768px) {
|
||||
.btn-group {
|
||||
flex-direction: column;
|
||||
}
|
||||
.btn-group .btn {
|
||||
width: 100%;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.nav-buttons {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.nav-buttons .btn {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
button {
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 5px 10px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
button:hover {
|
||||
background-color: darkgreen;
|
||||
}
|
||||
|
||||
.navigation {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.navigation .btn {
|
||||
padding: 12px 24px;
|
||||
background-color: #03DAC6;
|
||||
color: #121212;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
font-size: 16px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.navigation .btn:hover {
|
||||
background-color: #018786;
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container text-center">
|
||||
<h1 class="text-primary">Mihomo文件管理器</h1>
|
||||
|
||||
<section id="proxy-management" class="section-gap">
|
||||
<h2 class="text-success">代理文件管理</h2>
|
||||
<form action="" method="post" enctype="multipart/form-data" class="upload-form mb-3">
|
||||
<div class="input-group">
|
||||
<input type="file" name="fileInput" id="fileInput" class="form-control-file">
|
||||
<button type="submit" class="btn btn-primary btn-custom">上传</button>
|
||||
</div>
|
||||
</form>
|
||||
<ul class="list-group list-group-flush">
|
||||
<h1 style="margin-top: 40px; margin-bottom: 20px;">Mihomo 文件管理</h1>
|
||||
<h2>代理文件管理</h2>
|
||||
<table class="table table-dark table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>文件名</th>
|
||||
<th>大小</th>
|
||||
<th>修改时间</th>
|
||||
<th>执行操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($proxyFiles as $file): ?>
|
||||
<?php $filePath = $uploadDir . $file; ?>
|
||||
<li class="list-group-item">
|
||||
<a href="download.php?file=<?php echo urlencode($file); ?>"><?php echo htmlspecialchars($file); ?></a>
|
||||
<span class="file-size">(大小: <?php echo file_exists($filePath) ? formatSize(filesize($filePath)) : '文件不存在'; ?>)</span>
|
||||
<div class="button-group">
|
||||
<form action="" method="post">
|
||||
<input type="hidden" name="deleteFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<button type="submit" class="btn btn-danger" onclick="return confirm('确定要删除这个文件吗?');">删除</button>
|
||||
</form>
|
||||
<form action="" method="post">
|
||||
<input type="hidden" name="oldFileName" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<input type="text" name="newFileName" class="form-control form-control-sm" placeholder="新文件名" required>
|
||||
<input type="hidden" name="fileType" value="proxy">
|
||||
<button type="submit" class="btn btn-warning">重命名</button>
|
||||
</form>
|
||||
<form action="" method="post">
|
||||
<input type="hidden" name="editFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<input type="hidden" name="fileType" value="proxy">
|
||||
<button type="submit" class="btn btn-success">编辑</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</section>
|
||||
<tr>
|
||||
<td><a href="download.php?file=<?php echo urlencode($file); ?>"><?php echo htmlspecialchars($file); ?></a></td>
|
||||
<td><?php echo file_exists($filePath) ? formatSize(filesize($filePath)) : '文件不存在'; ?></td>
|
||||
<td><?php echo htmlspecialchars(date('Y-m-d H:i:s', filemtime($filePath))); ?></td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<form action="" method="post" class="d-inline">
|
||||
<input type="hidden" name="deleteFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('确定要删除这个文件吗?');">
|
||||
<i class="fas fa-trash"></i> 删除
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<button type="button" class="btn btn-success btn-sm btn-rename" data-toggle="modal" data-target="#renameModal" data-filename="<?php echo htmlspecialchars($file); ?>">
|
||||
<i class="fas fa-edit"></i> 重命名
|
||||
</button>
|
||||
|
||||
<form action="" method="post" class="d-inline">
|
||||
<input type="hidden" name="editFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<input type="hidden" name="fileType" value="proxy">
|
||||
<button type="submit" class="btn btn-warning btn-sm">
|
||||
<i class="fas fa-pen"></i> 编辑
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<section id="config-management" class="section-gap">
|
||||
<h2 class="text-success">配置文件管理</h2>
|
||||
<form action="" method="post" enctype="multipart/form-data" class="upload-form mb-3">
|
||||
<div class="input-group">
|
||||
<input type="file" name="configFileInput" id="configFileInput" class="form-control-file">
|
||||
<button type="submit" class="btn btn-primary btn-custom">上传</button>
|
||||
<form action="" method="post" enctype="multipart/form-data" class="form-inline d-inline upload-btn">
|
||||
<input type="file" name="fileInput" class="form-control-file" required id="fileInput-<?php echo htmlspecialchars($file); ?>" onchange="this.form.submit()">
|
||||
<button type="button" class="btn btn-info" onclick="document.getElementById('fileInput-<?php echo htmlspecialchars($file); ?>').click();">
|
||||
<i class="fas fa-upload"></i> 上传
|
||||
</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="renameModal" tabindex="-1" role="dialog" aria-labelledby="renameModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="renameModalLabel">重命名文件</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<ul class="list-group list-group-flush">
|
||||
<div class="modal-body">
|
||||
<form id="renameForm" action="" method="post">
|
||||
<input type="hidden" name="oldFileName" id="oldFileName">
|
||||
<div class="form-group">
|
||||
<label for="newFileName">新文件名</label>
|
||||
<input type="text" class="form-control" id="newFileName" name="newFileName" required>
|
||||
</div>
|
||||
<p>是否确定要重命名这个文件?</p>
|
||||
<input type="hidden" name="fileType" value="proxy">
|
||||
<div class="form-group text-right">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||
<button type="submit" class="btn btn-primary">确定</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>配置文件管理</h2>
|
||||
<table class="table table-dark table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>文件名</th>
|
||||
<th>大小</th>
|
||||
<th>修改时间</th>
|
||||
<th>执行操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($configFiles as $file): ?>
|
||||
<?php $filePath = $configDir . $file; ?>
|
||||
<li class="list-group-item">
|
||||
<a href="download.php?file=<?php echo urlencode($file); ?>"><?php echo htmlspecialchars($file); ?></a>
|
||||
<span class="file-size">(大小: <?php echo file_exists($filePath) ? formatSize(filesize($filePath)) : '文件不存在'; ?>)</span>
|
||||
<div class="button-group">
|
||||
<form action="" method="post">
|
||||
<input type="hidden" name="deleteConfigFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<button type="submit" class="btn btn-danger" onclick="return confirm('确定要删除这个文件吗?');">删除</button>
|
||||
</form>
|
||||
<form action="" method="post">
|
||||
<input type="hidden" name="oldFileName" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<input type="text" name="newFileName" class="form-control form-control-sm" placeholder="新文件名" required>
|
||||
<input type="hidden" name="fileType" value="config">
|
||||
<button type="submit" class="btn btn-warning">重命名</button>
|
||||
</form>
|
||||
<form action="" method="post">
|
||||
<input type="hidden" name="editFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<input type="hidden" name="fileType" value="config">
|
||||
<button type="submit" class="btn btn-success">编辑</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
<tr>
|
||||
<td><a href="download.php?file=<?php echo urlencode($file); ?>"><?php echo htmlspecialchars($file); ?></a></td>
|
||||
<td><?php echo file_exists($filePath) ? formatSize(filesize($filePath)) : '文件不存在'; ?></td>
|
||||
<td><?php echo htmlspecialchars(date('Y-m-d H:i:s', filemtime($filePath))); ?></td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<form action="" method="post" class="d-inline">
|
||||
<input type="hidden" name="deleteConfigFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('确定要删除这个文件吗?');"><i class="fas fa-trash"></i> 删除</button>
|
||||
</form>
|
||||
<button type="button" class="btn btn-success btn-sm btn-rename" data-toggle="modal" data-target="#renameModal" data-filename="<?php echo htmlspecialchars($file); ?>"><i class="fas fa-edit"></i> 重命名</button>
|
||||
|
||||
<form action="" method="post" class="d-inline">
|
||||
<input type="hidden" name="editFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<input type="hidden" name="fileType" value="config">
|
||||
<button type="submit" class="btn btn-warning btn-sm"><i class="fas fa-pen"></i> 编辑</button>
|
||||
</form>
|
||||
<form action="" method="post" enctype="multipart/form-data" class="form-inline d-inline upload-btn">
|
||||
<input type="file" name="configFileInput" class="form-control-file" required id="fileInput-<?php echo htmlspecialchars($file); ?>" onchange="this.form.submit()">
|
||||
<button type="button" class="btn btn-info" onclick="document.getElementById('fileInput-<?php echo htmlspecialchars($file); ?>').click();"><i class="fas fa-upload"></i> 上传</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php if (isset($fileContent)): ?>
|
||||
<?php if (isset($_POST['editFile'])): ?>
|
||||
<?php $fileToEdit = ($_POST['fileType'] === 'proxy') ? $uploadDir . basename($_POST['editFile']) : $configDir . basename($_POST['editFile']); ?>
|
||||
<h2 class="mt-5">编辑文件: <?php echo $editingFileName; ?></h2>
|
||||
<p>最后更新日期: <?php echo date('Y-m-d H:i:s', filemtime($fileToEdit)); ?></p>
|
||||
<div class="editor-container">
|
||||
<form action="" method="post">
|
||||
<textarea name="saveContent" id="editor" class="editor"><?php echo $fileContent; ?></textarea><br>
|
||||
<input type="hidden" name="fileName" value="<?php echo htmlspecialchars($_POST['editFile']); ?>">
|
||||
<input type="hidden" name="fileType" value="<?php echo htmlspecialchars($_POST['fileType']); ?>">
|
||||
<button type="submit" class="btn btn-primary mt-2" onclick="checkJsonSyntax()"><i class="fas fa-save"></i> 保存内容</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<div class="navigation">
|
||||
<a href="javascript:history.back()" class="btn">返回上一级菜单</a>
|
||||
<a href="/nekoclash/upload.php" class="btn">返回当前菜单</a>
|
||||
<a href="/nekoclash/configs.php" class="btn">返回配置菜单</a>
|
||||
<a href="/nekoclash" class="btn">返回主菜单</a>
|
||||
<a href="javascript:history.back()" class="btn btn-success">返回上一级菜单</a>
|
||||
<a href="/nekoclash/upload.php" class="btn btn-success">返回当前菜单</a>
|
||||
<a href="/nekoclash/configs.php" class="btn btn-success">返回配置菜单</a>
|
||||
<a href="/nekoclash" class="btn btn-success">返回主菜单</a>
|
||||
</div>
|
||||
<section id="custom-dir-upload" class="section-gap">
|
||||
<h2 class="text-success">自定义目录文件上传</h2>
|
||||
<form action="" method="post" enctype="multipart/form-data" class="upload-form mb-3">
|
||||
<div class="input-group">
|
||||
<input type="text" name="customDir" id="customDir" class="form-control" placeholder="自定义目录" required>
|
||||
<input type="file" name="customFileInput" id="customFileInput" class="form-control-file ml-2" required>
|
||||
<button type="submit" class="btn btn-primary btn-custom">上传到自定义目录</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
if (isset($_GET['customDir'])) {
|
||||
$customDir = rtrim($_GET['customDir'], '/') . '/';
|
||||
if (is_dir($customDir)) {
|
||||
$customFiles = array_diff(scandir($customDir), array('.', '..'));
|
||||
echo '<ul class="list-group list-group-flush">';
|
||||
foreach ($customFiles as $file) {
|
||||
echo '<li class="list-group-item d-flex justify-content-between align-items-center">';
|
||||
echo '<a href="?customDir=' . urlencode($customDir) . '&customFile=' . urlencode($file) . '">' . htmlspecialchars($file) . '</a>';
|
||||
echo ' (大小: ' . formatSize(filesize($customDir . $file)) . ')';
|
||||
echo '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
} else {
|
||||
echo '<div class="alert alert-danger" role="alert">目录不存在!</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if (isset($fileContent)): ?>
|
||||
<?php $fileToEdit = ($_POST['fileType'] === 'proxy') ? $uploadDir . basename($_POST['editFile']) : $configDir . basename($_POST['editFile']); ?>
|
||||
<h2 style="color: #00FF7F;">编辑文件: <?php echo $editingFileName; ?></h2>
|
||||
<p>最后更新日期: <?php echo date('Y-m-d H:i:s', filemtime($fileToEdit)); ?></p>
|
||||
<form action="" method="post">
|
||||
<textarea name="saveContent" rows="15" cols="150" class="editor"><?php echo $fileContent; ?></textarea><br>
|
||||
<input type="hidden" name="fileName" value="<?php echo htmlspecialchars($_POST['editFile']); ?>">
|
||||
<input type="hidden" name="fileType" value="<?php echo htmlspecialchars($_POST['fileType']); ?>">
|
||||
<input type="submit" value="保存内容">
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<section id="subscription-management" class="section-gap">
|
||||
<h2 class="text-success">订阅管理</h2>
|
||||
<h2 class="text-success" style="margin-top: 20px; margin-bottom: 20px;">订阅管理</h2>
|
||||
<p class="help-text" style="text-align: left; font-family: Arial, sans-serif; line-height: 1.5; font-size: 14px;">
|
||||
<strong>1. 注意:</strong> 通用模板(<code>tuanbe.yaml</code>)最多支持<strong>7个</strong>订阅链接,请勿更改默认名称。
|
||||
<strong>1. 注意:</strong> 通用模板(<code>mihomo.yaml</code>)最多支持<strong>7个</strong>订阅链接,请勿更改默认名称。
|
||||
<button id="pasteButton" class="btn btn-primary">生成订阅链接网站</button>
|
||||
<button id="base64Button" class="btn btn-primary">Base64 在线编码解码</button>
|
||||
</p>
|
||||
|
||||
<p class="help-text" style="text-align: left; font-family: Arial, sans-serif; line-height: 1.5; font-size: 14px;">
|
||||
@ -884,28 +842,80 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<input type="text" name="subscription_url" id="subscription_url_<?php echo $i; ?>" value="<?php echo htmlspecialchars($subscriptions[$i]['url']); ?>" required class="form-control">
|
||||
<input type="text" name="custom_file_name" id="custom_file_name_<?php echo $i; ?>" value="<?php echo htmlspecialchars($subscriptions[$i]['file_name']); ?>" class="form-control ml-2" placeholder="自定义文件名">
|
||||
<input type="hidden" name="index" value="<?php echo $i; ?>">
|
||||
<button type="submit" name="update" class="btn btn-primary btn-custom ml-2">更新配置</button>
|
||||
<button type="submit" name="update" class="btn btn-primary btn-custom ml-2"><i class="fas fa-sync-alt"></i>更新配置</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php endfor; ?>
|
||||
</section>
|
||||
|
||||
<section id="base64-conversion" class="section-gap">
|
||||
<section id="base64-conversion" class="section-gap">
|
||||
<h2 class="text-success">Base64 节点信息转换</h2>
|
||||
<form method="post">
|
||||
<div class="input-group form-spacing">
|
||||
<label for="base64_content" class="sr-only">Base64 内容:</label>
|
||||
<textarea name="base64_content" id="base64_content" rows="4" class="form-control" required></textarea>
|
||||
<button type="submit" name="convert_base64" class="btn btn-primary btn-custom ml-2">生成节点信息</button>
|
||||
<div class="form-group">
|
||||
<textarea name="base64_content" id="base64_content" rows="4" class="form-control" placeholder="粘贴 Base64 内容..." required></textarea>
|
||||
</div>
|
||||
<button type="submit" name="convert_base64" class="btn btn-primary btn-custom">生成节点信息</button>
|
||||
</form>
|
||||
</section>
|
||||
<h1 style="color: #00FF7F;">节点转换工具</h1>
|
||||
<form method="post">
|
||||
<textarea name="input" rows="10" cols="50" placeholder="粘贴 ss//vless//vmess//trojan//hysteria2 节点信息..."></textarea>
|
||||
<button type="submit" name="convert">转换</button>
|
||||
</form>
|
||||
|
||||
<section id="node-conversion" class="section-gap">
|
||||
<h1 class="text-success">节点转换工具</h1>
|
||||
<form method="post">
|
||||
<div class="form-group">
|
||||
<textarea name="input" rows="10" class="form-control" placeholder="粘贴 ss//vless//vmess//trojan//hysteria2 节点信息..."></textarea>
|
||||
</div>
|
||||
<button type="submit" name="convert" class="btn btn-primary">转换</button>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="renameModal" tabindex="-1" role="dialog" aria-labelledby="renameModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="renameModalLabel">重命名文件</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="renameForm" action="" method="post">
|
||||
<input type="hidden" name="oldFileName" id="oldFileName">
|
||||
<div class="form-group">
|
||||
<label for="newFileName">新文件名</label>
|
||||
<input type="text" class="form-control" id="newFileName" name="newFileName" required>
|
||||
</div>
|
||||
<p>是否确定要重命名这个文件?</p>
|
||||
<input type="hidden" name="fileType" value="config">
|
||||
<div class="form-group text-right">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||
<button type="submit" class="btn btn-primary">确定</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="./assets/bootstrap/jquery-3.5.1.slim.min.js"></script>
|
||||
<script src="./assets/bootstrap/popper.min.js"></script>
|
||||
<script src="./assets/bootstrap/bootstrap.min.js"></script>
|
||||
<script>
|
||||
document.getElementById('pasteButton').onclick = function() {
|
||||
window.open('https://paste.gg', '_blank');
|
||||
}
|
||||
document.getElementById('base64Button').onclick = function() {
|
||||
window.open('https://base64.us', '_blank');
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$('#renameModal').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget);
|
||||
var oldFileName = button.data('filename');
|
||||
var modal = $(this);
|
||||
modal.find('#oldFileName').val(oldFileName);
|
||||
modal.find('#newFileName').val(oldFileName);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -267,6 +267,8 @@ if (isset($_POST['update_index'])) {
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Sing-box文件管理器</title>
|
||||
<link href="./assets/bootstrap/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #87ceeb;
|
||||
@ -301,24 +303,25 @@ if (isset($_POST['update_index'])) {
|
||||
}
|
||||
.btn-danger {
|
||||
background-color: #CF6679;
|
||||
color: #121212;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.btn-danger:hover {
|
||||
background-color: #B00020;
|
||||
}
|
||||
.btn-success {
|
||||
background-color: #03DAC6;
|
||||
color: #121212;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.btn-success:hover {
|
||||
background-color: #018786;
|
||||
}
|
||||
.btn-warning {
|
||||
background-color: #F4B400;
|
||||
color: #121212;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.btn-warning:hover {
|
||||
background-color: #C79400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.btn-primary {
|
||||
background-color: #03DAC6;
|
||||
@ -399,11 +402,13 @@ if (isset($_POST['update_index'])) {
|
||||
cursor: pointer;
|
||||
}
|
||||
.btn-group .btn-rename {
|
||||
max-width: 60px;
|
||||
max-width: 80px;
|
||||
padding: 2px 6px;
|
||||
font-size: 0.875rem;
|
||||
width: auto;
|
||||
white-space: nowrap;
|
||||
border-radius: 4px !important;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.btn-group {
|
||||
@ -450,18 +455,18 @@ if (isset($_POST['update_index'])) {
|
||||
<div class="btn-group">
|
||||
<form action="" method="post" class="d-inline">
|
||||
<input type="hidden" name="deleteConfigFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('确定要删除这个文件吗?');">删除</button>
|
||||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('确定要删除这个文件吗?');"><i class="fas fa-trash"></i> 删除</button>
|
||||
</form>
|
||||
<button type="button" class="btn btn-success btn-sm btn-rename" data-toggle="modal" data-target="#renameModal" data-filename="<?php echo htmlspecialchars($file); ?>">重命名</button>
|
||||
|
||||
<button type="button" class="btn btn-success btn-sm btn-rename" data-toggle="modal" data-target="#renameModal" data-filename="<?php echo htmlspecialchars($file); ?>"><i class="fas fa-edit"></i> 重命名</button>
|
||||
|
||||
<form action="" method="post" class="d-inline">
|
||||
<input type="hidden" name="editFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<input type="hidden" name="fileType" value="config">
|
||||
<button type="submit" class="btn btn-warning btn-sm">编辑</button>
|
||||
<button type="submit" class="btn btn-warning btn-sm"><i class="fas fa-pen"></i> 编辑</button>
|
||||
</form>
|
||||
<form action="" method="post" enctype="multipart/form-data" class="form-inline d-inline upload-btn">
|
||||
<input type="file" name="configFileInput" class="form-control-file" required id="fileInput-<?php echo htmlspecialchars($file); ?>" onchange="this.form.submit()">
|
||||
<button type="button" class="btn btn-info" onclick="document.getElementById('fileInput-<?php echo htmlspecialchars($file); ?>').click();">上传</button>
|
||||
<button type="button" class="btn btn-info" onclick="document.getElementById('fileInput-<?php echo htmlspecialchars($file); ?>').click();"><i class="fas fa-upload"></i> 上传</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
@ -480,7 +485,7 @@ if (isset($_POST['update_index'])) {
|
||||
<textarea name="saveContent" id="editor" class="editor"><?php echo $fileContent; ?></textarea><br>
|
||||
<input type="hidden" name="fileName" value="<?php echo htmlspecialchars($_POST['editFile']); ?>">
|
||||
<input type="hidden" name="fileType" value="<?php echo htmlspecialchars($_POST['fileType']); ?>">
|
||||
<button type="submit" class="btn btn-primary mt-2" onclick="checkJsonSyntax()">保存内容</button>
|
||||
<button type="submit" class="btn btn-primary mt-2" onclick="checkJsonSyntax()"><i class="fas fa-save"></i> 保存内容</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@ -504,7 +509,7 @@ if (isset($_POST['update_index'])) {
|
||||
<label for="custom_file_name_<?php echo $i; ?>">自定义文件名 <?php echo ($i === 0) ? '(固定为 config.json)' : ''; ?></label>
|
||||
<input type="text" name="custom_file_name_<?php echo $i; ?>" id="custom_file_name_<?php echo $i; ?>" class="form-control form-control-sm" value="<?php echo htmlspecialchars($subscriptionData['subscriptions'][$i]['file_name'] ?? ($i === 0 ? 'config.json' : '')); ?>" <?php echo ($i === 0) ? 'readonly' : ''; ?> >
|
||||
</div>
|
||||
<button type="submit" name="update_index" value="<?php echo $i; ?>" class="btn btn-info btn-sm">更新订阅 <?php echo $i + 1; ?></button>
|
||||
<button type="submit" name="update_index" value="<?php echo $i; ?>" class="btn btn-info btn-sm"><i class="fas fa-sync-alt"></i> 更新订阅 <?php echo $i + 1; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -536,7 +541,7 @@ if (isset($_POST['update_index'])) {
|
||||
<label for="newFileName">新文件名</label>
|
||||
<input type="text" class="form-control" id="newFileName" name="newFileName" required>
|
||||
</div>
|
||||
<p>是否确实要重命名这个文件?</p>
|
||||
<p>是否确定要重命名这个文件?</p>
|
||||
<input type="hidden" name="fileType" value="config">
|
||||
<div class="form-group text-right">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||
|
@ -163,21 +163,7 @@ domain:store.steampowered.com'
|
||||
|
||||
config shunt_rules 'AIGC'
|
||||
option remarks 'AIGC'
|
||||
option domain_list 'geosite:openai
|
||||
geosite:anthropic
|
||||
domain:aistudio.google.com
|
||||
domain:ai.google.dev
|
||||
domain:gemini.google.com
|
||||
domain:generativelanguage.googleapis.com
|
||||
domain:makersuite.google.com
|
||||
domain:alkalicore-pa.clients6.google.com
|
||||
domain:alkalimakersuite-pa.clients6.google.com
|
||||
domain:deepmind.com
|
||||
domain:deepmind.google
|
||||
domain:geller-pa.googleapis.com
|
||||
domain:proactivebackend-pa.googleapis.com
|
||||
domain:generativeai.google
|
||||
domain:meta.ai'
|
||||
option domain_list 'geosite:category-ai-chat-!cn'
|
||||
|
||||
config shunt_rules 'Streaming'
|
||||
option remarks 'Streaming'
|
||||
|
@ -717,20 +717,20 @@ add_firewall_rule() {
|
||||
ipset -! create $IPSET_LANLIST nethash maxelem 1048576
|
||||
ipset -! create $IPSET_VPSLIST nethash maxelem 1048576
|
||||
ipset -! create $IPSET_SHUNTLIST nethash maxelem 1048576
|
||||
ipset -! create $IPSET_GFW nethash maxelem 1048576
|
||||
ipset -! create $IPSET_CHN nethash maxelem 1048576
|
||||
ipset -! create $IPSET_BLACKLIST nethash maxelem 1048576
|
||||
ipset -! create $IPSET_WHITELIST nethash maxelem 1048576
|
||||
ipset -! create $IPSET_BLOCKLIST nethash maxelem 1048576
|
||||
ipset -! create $IPSET_GFW nethash maxelem 1048576 timeout 172800
|
||||
ipset -! create $IPSET_CHN nethash maxelem 1048576 timeout 172800
|
||||
ipset -! create $IPSET_BLACKLIST nethash maxelem 1048576 timeout 172800
|
||||
ipset -! create $IPSET_WHITELIST nethash maxelem 1048576 timeout 172800
|
||||
ipset -! create $IPSET_BLOCKLIST nethash maxelem 1048576 timeout 172800
|
||||
|
||||
ipset -! create $IPSET_LANLIST6 nethash family inet6 maxelem 1048576
|
||||
ipset -! create $IPSET_VPSLIST6 nethash family inet6 maxelem 1048576
|
||||
ipset -! create $IPSET_SHUNTLIST6 nethash family inet6 maxelem 1048576
|
||||
ipset -! create $IPSET_GFW6 nethash family inet6 maxelem 1048576
|
||||
ipset -! create $IPSET_CHN6 nethash family inet6 maxelem 1048576
|
||||
ipset -! create $IPSET_BLACKLIST6 nethash family inet6 maxelem 1048576
|
||||
ipset -! create $IPSET_WHITELIST6 nethash family inet6 maxelem 1048576
|
||||
ipset -! create $IPSET_BLOCKLIST6 nethash family inet6 maxelem 1048576
|
||||
ipset -! create $IPSET_GFW6 nethash family inet6 maxelem 1048576 timeout 172800
|
||||
ipset -! create $IPSET_CHN6 nethash family inet6 maxelem 1048576 timeout 172800
|
||||
ipset -! create $IPSET_BLACKLIST6 nethash family inet6 maxelem 1048576 timeout 172800
|
||||
ipset -! create $IPSET_WHITELIST6 nethash family inet6 maxelem 1048576 timeout 172800
|
||||
ipset -! create $IPSET_BLOCKLIST6 nethash family inet6 maxelem 1048576 timeout 172800
|
||||
|
||||
local shunt_ids=$(uci show $CONFIG | grep "=shunt_rules" | awk -F '.' '{print $2}' | awk -F '=' '{print $1}')
|
||||
|
||||
@ -742,15 +742,15 @@ add_firewall_rule() {
|
||||
config_n_get $shunt_id ip_list | tr -s "\r\n" "\n" | sed -e "/^$/d" | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | sed -e "s/^/add $IPSET_SHUNTLIST6 &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
done
|
||||
|
||||
cat $RULES_PATH/chnroute | tr -s '\n' | grep -v "^#" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_CHN &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/proxy_ip | tr -s '\n' | grep -v "^#" | sed -e "/^$/d" | grep -E "(\.((2(5[0-5]|[0-4][0-9]))|[0-1]?[0-9]{1,2})){3}" | sed -e "s/^/add $IPSET_BLACKLIST &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/direct_ip | tr -s '\n' | grep -v "^#" | sed -e "/^$/d" | grep -E "(\.((2(5[0-5]|[0-4][0-9]))|[0-1]?[0-9]{1,2})){3}" | sed -e "s/^/add $IPSET_WHITELIST &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/block_ip | tr -s '\n' | grep -v "^#" | sed -e "/^$/d" | grep -E "(\.((2(5[0-5]|[0-4][0-9]))|[0-1]?[0-9]{1,2})){3}" | sed -e "s/^/add $IPSET_BLOCKLIST &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/chnroute | tr -s '\n' | grep -v "^#" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_CHN &/g" -e "s/$/ timeout 0/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/proxy_ip | tr -s '\n' | grep -v "^#" | sed -e "/^$/d" | grep -E "(\.((2(5[0-5]|[0-4][0-9]))|[0-1]?[0-9]{1,2})){3}" | sed -e "s/^/add $IPSET_BLACKLIST &/g" -e "s/$/ timeout 0/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/direct_ip | tr -s '\n' | grep -v "^#" | sed -e "/^$/d" | grep -E "(\.((2(5[0-5]|[0-4][0-9]))|[0-1]?[0-9]{1,2})){3}" | sed -e "s/^/add $IPSET_WHITELIST &/g" -e "s/$/ timeout 0/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/block_ip | tr -s '\n' | grep -v "^#" | sed -e "/^$/d" | grep -E "(\.((2(5[0-5]|[0-4][0-9]))|[0-1]?[0-9]{1,2})){3}" | sed -e "s/^/add $IPSET_BLOCKLIST &/g" -e "s/$/ timeout 0/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
|
||||
cat $RULES_PATH/chnroute6 | tr -s '\n' | grep -v "^#" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_CHN6 &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/proxy_ip | tr -s '\n' | grep -v "^#" | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_BLACKLIST6 &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/direct_ip | tr -s '\n' | grep -v "^#" | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_WHITELIST6 &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/block_ip | tr -s '\n' | grep -v "^#" | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_BLOCKLIST6 &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/chnroute6 | tr -s '\n' | grep -v "^#" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_CHN6 &/g" -e "s/$/ timeout 0/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/proxy_ip | tr -s '\n' | grep -v "^#" | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_BLACKLIST6 &/g" -e "s/$/ timeout 0/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/direct_ip | tr -s '\n' | grep -v "^#" | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_WHITELIST6 &/g" -e "s/$/ timeout 0/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
cat $RULES_PATH/block_ip | tr -s '\n' | grep -v "^#" | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_BLOCKLIST6 &/g" -e "s/$/ timeout 0/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
|
||||
ipset -! -R <<-EOF
|
||||
$(gen_lanlist | sed -e "s/^/add $IPSET_LANLIST /")
|
||||
@ -781,7 +781,7 @@ add_firewall_rule() {
|
||||
[ -n "$ISP_DNS" ] && {
|
||||
#echolog "处理 ISP DNS 例外..."
|
||||
for ispip in $ISP_DNS; do
|
||||
ipset -! add $IPSET_WHITELIST $ispip
|
||||
ipset -! add $IPSET_WHITELIST $ispip timeout 0
|
||||
echolog " - [$?]追加ISP IPv4 DNS到白名单:${ispip}"
|
||||
done
|
||||
}
|
||||
@ -789,7 +789,7 @@ add_firewall_rule() {
|
||||
[ -n "$ISP_DNS6" ] && {
|
||||
#echolog "处理 ISP IPv6 DNS 例外..."
|
||||
for ispip6 in $ISP_DNS6; do
|
||||
ipset -! add $IPSET_WHITELIST6 $ispip6
|
||||
ipset -! add $IPSET_WHITELIST6 $ispip6 timeout 0
|
||||
echolog " - [$?]追加ISP IPv6 DNS到白名单:${ispip6}"
|
||||
done
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mihomo
|
||||
PKG_RELEASE:=54
|
||||
PKG_RELEASE:=55
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git
|
||||
PKG_SOURCE_DATE:=2024-09-11
|
||||
PKG_SOURCE_VERSION:=4c3fe98ebd85bc995320c99baa5937f9cd67aeaf
|
||||
PKG_SOURCE_DATE:=2024-09-13
|
||||
PKG_SOURCE_VERSION:=e33d4a4769ac943d3fa9940bdb62b59240556cc4
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
@ -16,7 +16,7 @@ PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
|
||||
PKG_BUILD_VERSION:=alpha-$(shell printf '%.8s' $(PKG_SOURCE_VERSION))
|
||||
PKG_BUILD_VERSION:=alpha-e33d4a4
|
||||
PKG_BUILD_TIME:=$(shell date -u -Iseconds)
|
||||
|
||||
GO_PKG:=github.com/metacubex/mihomo
|
||||
@ -36,7 +36,7 @@ define Package/mihomo
|
||||
endef
|
||||
|
||||
define Package/mihomo/description
|
||||
A rule based proxy in Go.
|
||||
A rule based proxy in Go.
|
||||
endef
|
||||
|
||||
define Package/mihomo/conffiles
|
||||
|
@ -64,7 +64,7 @@ config mixin 'mixin'
|
||||
list 'fake_ip_filters' '+.lan'
|
||||
list 'fake_ip_filters' '+.local'
|
||||
option 'fake_ip_cache' '1'
|
||||
option 'respect_rules' '1'
|
||||
option 'dns_respect_rules' '0'
|
||||
option 'dns_ipv6' '0'
|
||||
option 'dns_system_hosts' '0'
|
||||
option 'dns_hosts' '0'
|
||||
|
@ -2,9 +2,6 @@
|
||||
|
||||
. "$IPKG_INSTROOT/etc/mihomo/scripts/constants.sh"
|
||||
|
||||
# since 1.8.0
|
||||
|
||||
|
||||
# commit
|
||||
uci commit mihomo
|
||||
|
||||
|
@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ppp
|
||||
PKG_RELEASE:=68
|
||||
PKG_RELEASE:=69
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/paulusmack/ppp
|
||||
PKG_SOURCE_DATE:=2021-01-04
|
||||
PKG_SOURCE_VERSION:=1d0bff9bc81e3a0ed4e3c643d1a45b12aa3bde96
|
||||
PKG_SOURCE_VERSION:=53e6846dffe2b0e2645581d70eabbc0cb0da78e3
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=BSD-4-Clause
|
||||
|
Loading…
Reference in New Issue
Block a user