mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-15 16:22:07 +00:00
chore: bump version to 1.8.6
This commit is contained in:
parent
422765cf95
commit
0b011ca992
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
||||
name: Build ${{ matrix.arch }} on ${{ matrix.version }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
fail-fast: true
|
||||
matrix:
|
||||
arch:
|
||||
- x86_64
|
||||
@ -56,7 +56,7 @@ jobs:
|
||||
name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- goos: linux
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=UA3F
|
||||
PKG_VERSION:=1.8.5
|
||||
PKG_VERSION:=1.8.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
# PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
|
||||
@ -6,7 +6,7 @@ local NamedSection = cbi.NamedSection
|
||||
local ua3f = cbi.Map("ua3f",
|
||||
"UA3F",
|
||||
[[
|
||||
<a href="https://github.com/SunBK201/UA3F" target="_blank">Version: 1.8.5</a>
|
||||
<a href="https://github.com/SunBK201/UA3F" target="_blank">Version: 1.8.6</a>
|
||||
<br>
|
||||
Across the Campus we can reach every corner in the world.
|
||||
]]
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
set -e
|
||||
|
||||
project_name="ua3f"
|
||||
release_version="1.8.5"
|
||||
release_version="1.8.6"
|
||||
target=main.go
|
||||
|
||||
LINUX_ARCHS="amd64 arm arm64 mipsle mips64 riscv64 386 mipsle-softfloat mipsle-hardfloat armv7 armv8"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
Package: ua3f
|
||||
Version: 1.8.5-1
|
||||
Version: 1.8.6-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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
Package: ua3f
|
||||
Version: 1.8.5-1
|
||||
Version: 1.8.6-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
|
||||
|
||||
@ -4,12 +4,10 @@ import (
|
||||
"io"
|
||||
"log/slog"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/sunbk201/ua3f/internal/config"
|
||||
"golang.org/x/sys/unix"
|
||||
"gopkg.in/natefinch/lumberjack.v2"
|
||||
)
|
||||
|
||||
@ -100,51 +98,6 @@ func LoadLocalLocation() *time.Location {
|
||||
return time.UTC
|
||||
}
|
||||
|
||||
func GetOSInfo() (attrs []any) {
|
||||
|
||||
attrs = append(attrs,
|
||||
slog.String("GOOS", runtime.GOOS),
|
||||
slog.String("GOARCH", runtime.GOARCH),
|
||||
slog.String("Go Version", runtime.Version()),
|
||||
)
|
||||
|
||||
if hostname, err := os.Hostname(); err == nil {
|
||||
attrs = append(attrs, slog.String("hostname", hostname))
|
||||
}
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "linux", "darwin", "freebsd", "openbsd", "netbsd":
|
||||
var uname unix.Utsname
|
||||
if err := unix.Uname(&uname); err == nil {
|
||||
toStr := func(b []byte) string {
|
||||
n := 0
|
||||
for ; n < len(b); n++ {
|
||||
if b[n] == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return strings.TrimSpace(string(b[:n]))
|
||||
}
|
||||
attrs = append(attrs,
|
||||
slog.String("sysname", toStr(uname.Sysname[:])),
|
||||
slog.String("nodename", toStr(uname.Nodename[:])),
|
||||
slog.String("release", toStr(uname.Release[:])),
|
||||
slog.String("version", toStr(uname.Version[:])),
|
||||
slog.String("machine", toStr(uname.Machine[:])),
|
||||
)
|
||||
}
|
||||
case "windows":
|
||||
osver := "unknown"
|
||||
if v, ok := os.LookupEnv("OS"); ok {
|
||||
osver = v
|
||||
}
|
||||
attrs = append(attrs, slog.String("os_version", osver))
|
||||
default:
|
||||
attrs = append(attrs, slog.String("info", "unknown OS details"))
|
||||
}
|
||||
return attrs
|
||||
}
|
||||
|
||||
func trim(s string) string {
|
||||
for len(s) > 0 && (s[len(s)-1] == '\n' || s[len(s)-1] == '\r' || s[len(s)-1] == ' ') {
|
||||
s = s[:len(s)-1]
|
||||
|
||||
34
src/internal/log/os_others.go
Normal file
34
src/internal/log/os_others.go
Normal file
@ -0,0 +1,34 @@
|
||||
//go:build !unix
|
||||
|
||||
package log
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func GetOSInfo() (attrs []any) {
|
||||
|
||||
attrs = append(attrs,
|
||||
slog.String("GOOS", runtime.GOOS),
|
||||
slog.String("GOARCH", runtime.GOARCH),
|
||||
slog.String("Go Version", runtime.Version()),
|
||||
)
|
||||
|
||||
if hostname, err := os.Hostname(); err == nil {
|
||||
attrs = append(attrs, slog.String("hostname", hostname))
|
||||
}
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
osver := "unknown"
|
||||
if v, ok := os.LookupEnv("OS"); ok {
|
||||
osver = v
|
||||
}
|
||||
attrs = append(attrs, slog.String("os_version", osver))
|
||||
default:
|
||||
attrs = append(attrs, slog.String("info", "unknown OS details"))
|
||||
}
|
||||
return attrs
|
||||
}
|
||||
51
src/internal/log/os_unix.go
Normal file
51
src/internal/log/os_unix.go
Normal file
@ -0,0 +1,51 @@
|
||||
//go:build unix
|
||||
|
||||
package log
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func GetOSInfo() (attrs []any) {
|
||||
|
||||
attrs = append(attrs,
|
||||
slog.String("GOOS", runtime.GOOS),
|
||||
slog.String("GOARCH", runtime.GOARCH),
|
||||
slog.String("Go Version", runtime.Version()),
|
||||
)
|
||||
|
||||
if hostname, err := os.Hostname(); err == nil {
|
||||
attrs = append(attrs, slog.String("hostname", hostname))
|
||||
}
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "linux", "darwin", "freebsd", "openbsd", "netbsd":
|
||||
var uname unix.Utsname
|
||||
if err := unix.Uname(&uname); err == nil {
|
||||
toStr := func(b []byte) string {
|
||||
n := 0
|
||||
for ; n < len(b); n++ {
|
||||
if b[n] == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return strings.TrimSpace(string(b[:n]))
|
||||
}
|
||||
attrs = append(attrs,
|
||||
slog.String("sysname", toStr(uname.Sysname[:])),
|
||||
slog.String("nodename", toStr(uname.Nodename[:])),
|
||||
slog.String("release", toStr(uname.Release[:])),
|
||||
slog.String("version", toStr(uname.Version[:])),
|
||||
slog.String("machine", toStr(uname.Machine[:])),
|
||||
)
|
||||
}
|
||||
default:
|
||||
attrs = append(attrs, slog.String("info", "unknown OS details"))
|
||||
}
|
||||
return attrs
|
||||
}
|
||||
@ -16,7 +16,7 @@ import (
|
||||
"github.com/sunbk201/ua3f/internal/statistics"
|
||||
)
|
||||
|
||||
const version = "1.8.5"
|
||||
const version = "1.8.6"
|
||||
|
||||
func main() {
|
||||
cfg, showVer := config.Parse()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user