diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index aaabe49..687466e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -9,18 +9,8 @@ permissions:
contents: write
jobs:
- build:
+ build-ipk:
runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- arch:
- - x86_64
- - aarch64_generic
- - arm_cortex-a7_neon-vfpv4
- - arm_cortex-a15_neon-vfpv4
- - mips_24kc
- - mipsel_24kc
steps:
- name: Checkout code
@@ -39,23 +29,71 @@ jobs:
make
sudo make install
- - name: Build binaries
+ - name: Build IPK binaries
run: |
chmod +x build.sh
./build.sh
+ - name: Upload IPK artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: ipk-packages
+ path: dist/*
+ retention-days: 1
+
+ build-apk:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ arch:
+ - x86_64
+ - aarch64_generic
+ - arm_cortex-a7_neon-vfpv4
+ - arm_cortex-a15_neon-vfpv4
+ - mips_24kc
+ - mipsel_24kc
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v5
+
- name: Build APK
uses: openwrt/gh-action-sdk@v9
env:
ARCH: ${{ matrix.arch }}
FEEDNAME: ua3f_ci
PACKAGES: openwrt
- V: sc
-
- - name: move apks to dist folder
+
+ - name: Rename APK with arch suffix
run: |
- mkdir -p dist
- cp bin/packages/${{ matrix.arch }}/ua3f_ci/*.apk dist/
+ cd bin/packages/${{ matrix.arch }}/ua3f_ci/
+ for f in *.apk; do mv "$f" "${f/.apk/-${{ matrix.arch }}.apk}" 2>/dev/null || true; done
+
+ - name: Upload APK artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: apk-packages-${{ matrix.arch }}
+ path: bin/packages/${{ matrix.arch }}/ua3f_ci/*.apk
+ retention-days: 1
+
+ release:
+ needs: [build-ipk, build-apk]
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Download IPK artifacts
+ uses: actions/download-artifact@v4
+ with:
+ name: ipk-packages
+ path: dist/
+
+ - name: Download APK artifacts
+ uses: actions/download-artifact@v4
+ with:
+ pattern: apk-packages-*
+ path: dist/
+ merge-multiple: true
- name: Get version from tag
id: get_version
diff --git a/build.sh b/build.sh
index 7a62f89..00f2650 100755
--- a/build.sh
+++ b/build.sh
@@ -8,7 +8,7 @@
set -e
project_name="ua3f"
-release_version="1.8.3"
+release_version="1.8.4"
target=main.go
dist=./dist
release_dir=./bin
diff --git a/ipkg/CONTROL/control b/ipkg/CONTROL/control
index da6f4dd..c1c1816 100644
--- a/ipkg/CONTROL/control
+++ b/ipkg/CONTROL/control
@@ -1,5 +1,5 @@
Package: ua3f
-Version: 1.8.3-1
+Version: 1.8.4-1
Depends: luci-compat, ipset, iptables, iptables-mod-tproxy, iptables-mod-extra, iptables-mod-nat-extra, kmod-ipt-conntrack, iptables-mod-ipopt, iptables-mod-nfqueue, iptables-mod-conntrack-extra, kmod-nf-conntrack-netlink
Source: /feed/openwrt
SourceName: UA3F
diff --git a/ipkg/CONTROL/control-e b/ipkg/CONTROL/control-e
index da6f4dd..c1c1816 100644
--- a/ipkg/CONTROL/control-e
+++ b/ipkg/CONTROL/control-e
@@ -1,5 +1,5 @@
Package: ua3f
-Version: 1.8.3-1
+Version: 1.8.4-1
Depends: luci-compat, ipset, iptables, iptables-mod-tproxy, iptables-mod-extra, iptables-mod-nat-extra, kmod-ipt-conntrack, iptables-mod-ipopt, iptables-mod-nfqueue, iptables-mod-conntrack-extra, kmod-nf-conntrack-netlink
Source: /feed/openwrt
SourceName: UA3F
diff --git a/openwrt/Makefile b/openwrt/Makefile
index cf3d849..77f59f4 100644
--- a/openwrt/Makefile
+++ b/openwrt/Makefile
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=UA3F
-PKG_VERSION:=1.8.3
+PKG_VERSION:=1.8.4
PKG_RELEASE:=1
# PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -37,6 +37,7 @@ endef
define Build/Prepare
$(CP) ../src/* $(PKG_BUILD_DIR)
+ $(CP) ./files $(PKG_BUILD_DIR)/
po2lmo ./po/zh_cn/ua3f.po $(PKG_BUILD_DIR)/ua3f.zh-cn.lmo
endef
diff --git a/openwrt/files/luci/model/cbi/ua3f.lua b/openwrt/files/luci/model/cbi/ua3f.lua
index 8e24ef6..33e0d76 100644
--- a/openwrt/files/luci/model/cbi/ua3f.lua
+++ b/openwrt/files/luci/model/cbi/ua3f.lua
@@ -6,7 +6,7 @@ local NamedSection = cbi.NamedSection
local ua3f = cbi.Map("ua3f",
"UA3F",
[[
- Version: 1.8.3
+ Version: 1.8.4
Across the Campus we can reach every corner in the world.
]]
diff --git a/openwrt/files/luci/model/cbi/ua3f/fields.lua b/openwrt/files/luci/model/cbi/ua3f/fields.lua
index 4b2f326..de7ed70 100644
--- a/openwrt/files/luci/model/cbi/ua3f/fields.lua
+++ b/openwrt/files/luci/model/cbi/ua3f/fields.lua
@@ -139,6 +139,7 @@ function M.add_log_fields(section)
log_level:value("INFO")
log_level:value("WARN")
log_level:value("ERROR")
+ log_level.default = "ERROR"
log_level.description = translate(
"Sets the logging level. Do not keep the log level set to DEBUG/INFO for an extended period of time.")
diff --git a/openwrt/files/ua3f.init b/openwrt/files/ua3f.init
index c2a84f5..2176c72 100755
--- a/openwrt/files/ua3f.init
+++ b/openwrt/files/ua3f.init
@@ -92,7 +92,7 @@ start_service() {
config_get ua "main" "ua" "FFF"
config_get ua_regex "main" "ua_regex" ""
config_get_bool partial_replace "main" "partial_replace" 0
- config_get log_level "main" "log_level" "INFO"
+ config_get log_level "main" "log_level" "ERROR"
config_get rewrite_mode "main" "rewrite_mode" "GLOBAL"
config_get rewrite_rules "main" "rewrite_rules" ""
config_get_bool set_ttl "main" "set_ttl" 0
@@ -132,7 +132,7 @@ start_service() {
procd_close_instance
- LOG "Started $NAME service."
+ LOG "$NAME service started"
}
service_triggers() {
diff --git a/openwrt/files/ua3f.uci b/openwrt/files/ua3f.uci
index d04697b..2d96002 100644
--- a/openwrt/files/ua3f.uci
+++ b/openwrt/files/ua3f.uci
@@ -10,7 +10,7 @@ config 'ua3f' 'main'
option ua_regex ''
option partial_replace '0'
option direct_forward '0'
- option log_level 'error'
+ option log_level 'ERROR'
option log_lines '1000'
option set_ttl '0'
option del_tcpts '0'
diff --git a/src/internal/netfilter/firewall.go b/src/internal/netfilter/firewall.go
index 7721342..0afe453 100644
--- a/src/internal/netfilter/firewall.go
+++ b/src/internal/netfilter/firewall.go
@@ -71,7 +71,7 @@ var (
"meta l4proto != tcp",
"return",
)
- NftRuleIgnoreBrLAN = knftables.Concat(
+ NftRuleIgnoreNotBrLAN = knftables.Concat(
"iifname != \"br-lan\"",
"return",
)
diff --git a/src/internal/server/nfqueue/nftables.go b/src/internal/server/nfqueue/nftables.go
index 889fac2..48f524f 100644
--- a/src/internal/server/nfqueue/nftables.go
+++ b/src/internal/server/nfqueue/nftables.go
@@ -58,25 +58,21 @@ func (s *Server) NftSetNfqueue(tx *knftables.Transaction, table *knftables.Table
Rule: netfilter.NftRuleIgnoreNotTCP,
})
- // nft add rule ip $NFT_TABLE postrouting ct direction reply counter return
tx.Add(&knftables.Rule{
Chain: chain.Name,
Rule: netfilter.NftRuleIgnoreReply,
})
- // nft add rule ip $NFT_TABLE postrouting ip daddr @$UA3F_LANSET counter return
tx.Add(&knftables.Rule{
Chain: chain.Name,
Rule: netfilter.NftRuleIgnoreLAN,
})
- // nft add rule ip $NFT_TABLE postrouting tcp dport {$SKIP_PORTS} return
tx.Add(&knftables.Rule{
Chain: chain.Name,
Rule: netfilter.NftRuleIgnorePorts,
})
- // nft add rule ip $NFT_TABLE postrouting ct mark 201 counter return
tx.Add(&knftables.Rule{
Chain: chain.Name,
Rule: knftables.Concat(
diff --git a/src/internal/server/redirect/nftables.go b/src/internal/server/redirect/nftables.go
index 7ecda19..33b0e14 100644
--- a/src/internal/server/redirect/nftables.go
+++ b/src/internal/server/redirect/nftables.go
@@ -55,7 +55,7 @@ func (s *Server) NftSetRedirect(tx *knftables.Transaction, table *knftables.Tabl
tx.Add(&knftables.Rule{
Chain: chain.Name,
- Rule: netfilter.NftRuleIgnoreBrLAN,
+ Rule: netfilter.NftRuleIgnoreNotBrLAN,
})
tx.Add(&knftables.Rule{
diff --git a/src/main.go b/src/main.go
index c81f544..13d1756 100644
--- a/src/main.go
+++ b/src/main.go
@@ -16,7 +16,7 @@ import (
"github.com/sunbk201/ua3f/internal/statistics"
)
-const version = "1.8.3"
+const version = "1.8.4"
func main() {
cfg, showVer := config.Parse()