diff --git a/.codecov.yml b/.codecov.yml index 13c2af4..9e7b84c 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,5 +1,6 @@ ignore: - - "screenshot" - - "web" - - "server/conf" - - "server/files" \ No newline at end of file + - "^doc" + - "^home" + - "^web" + - "^server/conf" + - "^server/files" diff --git a/.gitignore b/.gitignore index 5943ded..1741e89 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .idea/ anylink-deploy anylink-deploy.tar.gz +anylink-deploy-* anylink anylink.db dist diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..d977efe --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,74 @@ +version: 1 + +dist: dist + +before: + hooks: + - pwd + +builds: + - id: "build" + dir: ./server + hooks: + pre: + - cmd: go mod tidy + dir: ./server + output: true + - cmd: go generate + dir: ./server + output: true + # {{- if eq .Arch "amd64" }}CC=x86_64-linux-gnu-gcc CXX=x86_64-linux-gnu-g++{{- end }} + env: + - CGO_ENABLED=1 + - >- + {{- if eq .Os "linux" }} + {{- if eq .Arch "amd64" }}CC=x86_64-linux-musl-gcc{{- end }} + + {{- if eq .Arch "arm64" }}CC=aarch64-linux-gnu-gcc{{- end }} + {{- end }} + {{- if eq .Os "darwin" }} + {{- if eq .Arch "amd64"}}CC=o64-clang{{- end }} + {{- if eq .Arch "arm64"}}CC=oa64-clang{{- end }} + {{- end }} + {{- if eq .Os "windows" }} + {{- if eq .Arch "amd64"}}CC=x86_64-w64-mingw32-gcc{{- end }} + {{- if eq .Arch "arm64"}}CC=aarch64-linux-gnu-gcc{{- end }} + {{- end }} + goos: + - linux + #- darwin + #- windows + goarch: + - amd64 + #- arm64 + goamd64: + - v1 + command: build + flags: + - -trimpath + - -tags osusergo,netgo,sqlite_omit_load_extension + ldflags: + - -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=dcross + +archives: + - id: "archive1" + format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" diff --git a/README.md b/README.md index 0e7b90b..5cc73cc 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,10 @@ [![Go](https://github.com/cherts/anylink/workflows/Go/badge.svg?branch=main)](https://github.com/cherts/anylink/actions) [![PkgGoDev](https://pkg.go.dev/badge/github.com/cherts/anylink)](https://pkg.go.dev/github.com/cherts/anylink) [![Go Report Card](https://goreportcard.com/badge/github.com/cherts/anylink)](https://goreportcard.com/report/github.com/cherts/anylink) -[![codecov](https://codecov.io/gh/cherts/anylink/branch/master/graph/badge.svg?token=JTFLIIIBQ0)](https://codecov.io/gh/cherts/anylink) +[![codecov](https://codecov.io/gh/cherts/anylink/graph/badge.svg?token=JTFLIIIBQ0)](https://codecov.io/gh/cherts/anylink) ![GitHub release](https://img.shields.io/github/v/release/cherts/anylink) -![GitHub downloads)](https://img.shields.io/github/downloads/cherts/anylink/total) +![GitHub downloads total)](https://img.shields.io/github/downloads/cherts/anylink/total) +![GitHub Downloads (all assets, latest release)](https://img.shields.io/github/downloads/cherts/anylink/latest/total) [![Docker pulls)](https://img.shields.io/docker/pulls/cherts/anylink.svg)](https://hub.docker.com/r/cherts/anylink) ![LICENSE](https://img.shields.io/github/license/cherts/anylink) @@ -22,7 +23,7 @@ Protocol development, and draws on the development ideas of [ocserv](http://ocse AnyLink uses TLS/DTLS for data encryption, so an RSA or ECC certificate is required. You can apply for a free SSL certificate through Let's Encrypt and TrustAsia. -The AnyLink server is only tested on CentOS 7, CentOS 8, Ubuntu 18.04, Ubuntu 20.04 and Ubuntu 22.04. If it needs to be installed on other systems, the server needs to support the tun/tap function and ip setting command. +The AnyLink server is only tested on CentOS 7, CentOS 8, Ubuntu 18.04, Ubuntu 20.04 and Ubuntu 22.04. If it needs to be installed on other systems, the server needs to support the tun/tap function and ip setting command, iptables command. ## Screenshot @@ -50,17 +51,20 @@ The AnyLink server is only tested on CentOS 7, CentOS 8, Ubuntu 18.04, Ubuntu 20 ### Compile and install by yourself -> Golang >= 1.19 and nodejs >= 16.x and yarn >= v1.22.x need to be installed in advance. +> Docker needs to be installed in advance ```shell git clone https://github.com/cherts/anylink.git -# Compile reference software version +# docker compilation reference software version (no installation required) # go 1.22 # node v16.20.2 # yarn 1.22.19 cd anylink +# Compile front-end +bash build_web.sh +# Compile anylink-deploy release files bash build.sh # Make sure to run with root privileges @@ -82,10 +86,11 @@ sudo ./anylink - [x] Compatible with AnyConnect - [x] Compatible with OpenConnect - [x] Nat access mode based on tun device -- [x] Tap device based bridge access mode +- [x] Bridged access mode based on tun device - [x] Bridged access mode based on macvtap device - [x] Support [proxy protocol v1&v2](http://www.haproxy.org/download/2.2/doc/proxy-protocol.txt) protocol - [x] User group support +- [x] User group policy support - [x] Multi-user support - [x] User policy support - [x] TOTP token support @@ -93,10 +98,15 @@ sudo ./anylink - [x] Traffic rate limit - [x] Backend management interface - [x] Access rights management +- [x] User activity audit function - [x] IP access audit function - [x] Domain name dynamic split tunnel (domain name routing function) - [x] radius authentication support - [x] LDAP authentication support +- [x] Automatically disconnect when idle link times out +- [x] Traffic compression function +- [x] Automatic release of egress IP +- [x] Support configuration differentiation of multiple services - [ ] Bridge access mode based on ipvtap device ## Config @@ -118,6 +128,8 @@ sudo ./anylink ``` > Database configuration example +> +> Database table structure is automatically generated, no need to manually import (please grant DDL permission) | db_type | db_source | |----------|--------------------------------------------------------| @@ -140,6 +152,16 @@ sudo ./anylink ## Setting +### Dependency settings + +> Server-side dependency installation: +> +> centos: yum install iptables iproute +> +> ubuntu: apt-get install iptables iproute2 + +### link_mode setting + > One of the following parameters must be set To select the network mode, you need to configure the `link_mode` parameter, such as `link_mode="tun"`, `link_mode="macvtap"`, `link_mode="tap"(not recommended)` and other parameters. @@ -154,6 +176,7 @@ mode, please confirm that the virtual machine's network card is enabled in promi 1. Enable server forwarding ```shell +# The new version supports automatic setting of IP forwarding # file: /etc/sysctl.conf net.ipv4.ip_forward = 1 @@ -202,18 +225,50 @@ Next hop: 10.1.2.10 3. Just connect using the AnyConnect client -### macvtap settings +#### Bridge settings -1. Setup profile +1. Set up the configuration file > macvtap setting is relatively simple, you only need to configure the corresponding parameters. +> +> Network requirements: The network needs to support ARP transmission, and ordinary intranet IP can be announced through ARP. +> +> Network restrictions: cannot be used in cloud environment, cannot be used in network card mac plus white environment, cannot be used in 802.1x certified network +> > The following parameters can be viewed by executing `ip a` +1.1 arp_proxy + ``` + +# file: /etc/sysctl.conf +net.ipv4.conf.all.proxy_arp = 1 + +#Execute the following command +sysctl -w net.ipv4.conf.all.proxy_arp=1 + +Configuration file modification: + # First turn off the nat forwarding function iptables_nat = false -# The master network card needs to turn on promiscuous mode + +link_mode = "tun" +#Internal network main network card name +ipv4_master = "eth0" +#The following network segments need to be set the same as the ipv4_master network card +ipv4_cidr = "10.1.2.0/24" +ipv4_gateway = "10.1.2.99" +ipv4_start = "10.1.2.100" +ipv4_end = "10.1.2.200" + +``` + +1.2 macvtap + +``` + +# Command line execution master network card needs to turn on promiscuous mode ip link set dev eth0 promisc on #=====================# @@ -223,10 +278,9 @@ ip link set dev eth0 promisc on iptables_nat = false link_mode = "macvtap" - -# Internal network main network card name +#Internal network main network card name ipv4_master = "eth0" -# The following network segments need to be set the same as the ipv4_master network card +#The following network segments need to be set the same as the ipv4_master network card ipv4_cidr = "10.1.2.0/24" ipv4_gateway = "10.1.2.1" ipv4_start = "10.1.2.100" @@ -365,6 +419,13 @@ Please go to [question address](doc/question.md) for detailed information Telegram: @cherts +## Support Client + +- [AnyConnect Secure Client](https://www.cisco.com/) (Can be downloaded through group files: Windows/macOS/Linux/Android/iOS) +- [OpenConnect](https://gitlab.com/openconnect/openconnect) (Windows/macOS/Linux) +- [Mikata AnyLink Secure Client](https://github.com/tlslink/anylink-client) (Windows/macOS/Linux) +- [Third-party client download address](https://cisco.yangpin.link) (Windows/macOS/Linux/Android/iOS) + ## Contribution Welcome to submit PRs and Issues, and thank you for contributing to AnyLink. diff --git a/build.sh b/build.sh index b3037a0..4fc751d 100644 --- a/build.sh +++ b/build.sh @@ -1,58 +1,19 @@ #!/bin/bash -set -x -function RETVAL() { - rt=$1 - if [ $rt != 0 ]; then - echo $rt - exit 1 - fi -} - +#Current directory cpath=$(pwd) ver=$(cat version) -echo "Current version $ver" - -echo "Compile frontend project..." -cd $cpath/web - -#npx browserslist@latest --update-db -yarn install --registry=https://registry.npmmirror.com -yarn run build -RETVAL $? - -echo "Compile binaries..." -cd $cpath/server -rm -rf ui -cp -rf $cpath/web/ui . - -# -tags osusergo,netgo,sqlite_omit_load_extension -flags="-v -trimpath" - -# -extldflags '-static' -ldflags="-s -w -X main.appVer=$ver -X main.commitId=$(git rev-parse HEAD) -X main.date=$(date -Iseconds)" - -export GOPROXY=https://goproxy.io -go mod tidy -go build -o anylink $flags -ldflags "$ldflags" - -cd $cpath - -exit 0 - -echo "Build deployment files..." -deploy="anylink-deploy" -rm -rf $deploy ${deploy}.tar.gz -mkdir $deploy -mkdir $deploy/log -cp -r server/anylink $deploy -cp -r server/bridge-init.sh $deploy -cp -r server/conf $deploy -cp -r systemd $deploy -cp -r LICENSE $deploy -cp -r home $deploy -tar zcvf ${deploy}.tar.gz $deploy - -# Make sure to run with root privileges -#cd anylink-deploy -#sudo ./anylink --conf="conf/server.toml" +echo $ver +#Front-end compilation only needs to be executed once +#bash ./build_web.sh +bash build_docker.sh + +deploy="anylink-deploy-$ver" +docker container rm $deploy +docker container create --name $deploy cherts/anylink:$ver +rm -rf anylink-deploy anylink-deploy.tar.gz +docker cp -a $deploy:/app ./anylink-deploy +tar zcf ${deploy}.tar.gz anylink-deploy +./anylink-deploy/anylink -v +echo "anylink compilation completed, directory: anylink-deploy" +ls -lh anylink-deploy diff --git a/build_docker.sh b/build_docker.sh index b17d893..efd8023 100644 --- a/build_docker.sh +++ b/build_docker.sh @@ -6,11 +6,14 @@ echo "Current version: $ver" #docker login -u cherts echo "Docker build..." -docker build -t cherts/anylink:latest --progress=plain --build-arg appVer=$ver \ - --build-arg commitId=$(git rev-parse HEAD) -f docker/Dockerfile . +docker build -t cherts/anylink:latest --no-cache --progress=plain \ + --build-arg appVer=$ver --build-arg commitId=$(git rev-parse HEAD) \ + -f docker/Dockerfile . echo "Docker tag latest $ver" docker tag cherts/anylink:latest cherts/anylink:$ver #echo "Docker push..." #docker push cherts/anylink + +exit 0 diff --git a/build_test.sh b/build_test.sh new file mode 100644 index 0000000..6435711 --- /dev/null +++ b/build_test.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +#github action release.sh + +set -x +function RETVAL() { + rt=$1 + if [ $rt != 0 ]; then + echo $rt + exit 1 + fi +} + +#Current directory +cpath=$(pwd) + +ver=$(cat version) +echo $ver + +#Front-end compilation only needs to be executed once +#bash ./build_web.sh + +echo "Copy binary file" + +# -tags osusergo,netgo,sqlite_omit_load_extension +flags="-trimpath" +ldflags="-s -w -extldflags '-static' -X main.appVer=$ver -X main.commitId=$(git rev-parse HEAD) -X main.buildDate=$(date --iso-8601=seconds)" +#github action +gopath=/go + +dockercmd=$( + cat < Please use your mobile phone to install freeotp, and then scan the otp QR code. The generated number is the dynamic code. -### remote Desktop connection +### User policy issues + +> As long as there is a user policy, the group policy will not take effect, which is equivalent to overwriting the configuration of the group policy. + +### Remote Desktop connection > This software already supports anyconnect connection in remote desktop. diff --git a/docker/init_build.sh b/docker/init_build.sh index edcd8d8..89229ec 100644 --- a/docker/init_build.sh +++ b/docker/init_build.sh @@ -20,7 +20,7 @@ go mod tidy echo "start build" -ldflags="-s -w -X main.appVer=$appVer -X main.commitId=$commitId -X main.buildDate=$(date -Iseconds) -extldflags '-static' " +ldflags="-s -w -X main.appVer=$appVer -X main.commitId=$commitId -X main.buildDate=$(date -Iseconds) -extldflags \"-static\" " export CGO_ENABLED=1 go build -v -o anylink -trimpath -ldflags "$ldflags" diff --git a/index_template/Custom home page 2.html b/index_template/Custom home page 2.html new file mode 100644 index 0000000..fd59e5a --- /dev/null +++ b/index_template/Custom home page 2.html @@ -0,0 +1,165 @@ + + + + + + Client download + + + + + +
+
+

Please select the platform to download

+

Windows system

+ Win X86_64 + Win ARM64 + +

Mobile terminal

+ Android + iPhone + +

MacOS system

+ Mac Intel + Mac ARM64 + +

TOTP mobile client

+ Android + iPhone +
+
+ + + + diff --git a/release.sh b/release.sh index 511449f..16f2f33 100644 --- a/release.sh +++ b/release.sh @@ -11,39 +11,36 @@ function RETVAL() { fi } -# Current directory +#Current directory cpath=$(pwd) ver=$(cat version) -echo "Current version $ver" +echo "Current version: $ver" rm -rf artifact-dist mkdir artifact-dist function archive() { arch=$1 - #echo "Build deployment files $arch" arch_name=${arch//\//-} echo $arch_name - deploy="anylink-$ver-$arch_name" docker container rm $deploy docker container create --platform $arch --name $deploy cherts/anylink:$ver rm -rf anylink-deploy docker cp -a $deploy:/app ./anylink-deploy - ls -lh anylink-deploy - tar zcf ${deploy}.tar.gz anylink-deploy mv ${deploy}.tar.gz artifact-dist/ } -echo "Copy binary file..." +echo "Copy binary file" + archive "linux/amd64" archive "linux/arm64" ls -lh artifact-dist -# Make sure to run with root privileges +#Make sure to run with root privileges #cd anylink-deploy #sudo ./anylink --conf="conf/server.toml" diff --git a/release_test.sh b/release_test.sh deleted file mode 100644 index 5198f1c..0000000 --- a/release_test.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -#github action release.sh - -set -x -function RETVAL() { - rt=$1 - if [ $rt != 0 ]; then - echo $rt - exit 1 - fi -} - -cpath=$(pwd) - -ver=$(cat version) -echo "Current version: $ver" - -echo "Copy binary file" -cd $cpath/server -# -tags osusergo,netgo,sqlite_omit_load_extension -flags="-trimpath" -ldflags="-s -w -extldflags '-static' -X main.appVer=$ver -X main.commitId=$(git rev-parse HEAD) -X main.buildDate=$(date --iso-8601=seconds)" -#github action -gopath=/go - -dockercmd=$( - cat < keepalive -cstp_keepalive = 5 -cstp_dpd = 12 -mobile_keepalive = 10 -mobile_dpd = 22 +cstp_keepalive = 3 +cstp_dpd = 20 +mobile_keepalive = 4 +mobile_dpd = 60 + +# Modify according to actual situation +#cstp_keepalive = 20 +#cstp_dpd = 30 +#mobile_keepalive = 40 +#mobile_dpd = 60 # Set maximum transmission unit mtu = 1460 @@ -74,10 +87,10 @@ default_domain = "example.com" #default_domain = "example.com abc.example.com" # Idle link timeout (seconds) - disconnect the link after timeout, 0 turns off this function -idle_timeout = 1800 +idle_timeout = 0 # Session expiration time, used for disconnection and reconnection, 0 will never expire session_timeout = 3600 -auth_timeout = 0 +#auth_timeout = 0 audit_interval = 600 show_sql = false @@ -92,3 +105,6 @@ no_compress_limit = 256 # Client displays detailed error information (be careful to enable online environment) display_error = false + +#Exclude export ip routing (export ip is not encrypted for transmission) +exclude_export_ip = true diff --git a/server/conf/server.toml b/server/conf/server.toml index dc4af58..b4d5398 100644 --- a/server/conf/server.toml +++ b/server/conf/server.toml @@ -10,6 +10,9 @@ db_source = "./conf/anylink.db" cert_file = "./conf/vpn_cert.pem" cert_key = "./conf/vpn_cert.key" files_path = "./conf/files" + +# Log directory, default is empty and writes to standard output +#log_path = "./log" # Log level log_level = "debug" @@ -29,7 +32,7 @@ jwt_secret = "abcdef.0123456789.abcdef" # Service listening address server_addr = ":443" # Enable DTLS -server_dtls = true +server_dtls = false # UDP listening address (any port) server_dtls_addr = ":443" # Admin service listening address @@ -43,6 +46,7 @@ max_user_client = 3 # Virtual network type [tun macvtap] link_mode = "tun" # IP address pool assigned by the client +# The docker environment generally defaults to eth0. In other cases, fill in the information based on the actual network card information. ipv4_master = "eth0" ipv4_cidr = "192.168.90.0/24" ipv4_gateway = "192.168.90.1" diff --git a/server/dbdata/db.go b/server/dbdata/db.go index 3ca513d..0cf83e8 100644 --- a/server/dbdata/db.go +++ b/server/dbdata/db.go @@ -1,6 +1,7 @@ package dbdata import ( + "net/http" "time" "github.com/cherts/anylink/base" @@ -121,6 +122,7 @@ func addInitData() error { other := &SettingOther{ LinkAddr: "vpn.xxx.com", Banner: "You have connected to the company network, please use it in accordance with company regulations.\nPlease do not perform non-work downloading and video activities!", + Homecode: http.StatusOK, Homeindex: "AnyLink is an enterprise-level remote office sslvpn software that can support multiple people using it online at the same time.", AccountMail: accountMail, } @@ -142,7 +144,7 @@ func addInitData() error { } g1 := Group{ - Name: "ops", + Name: "all", AllowLan: true, ClientDns: []ValData{{Val: "114.114.114.114"}}, RouteInclude: []ValData{{Val: All}}, @@ -153,6 +155,18 @@ func addInitData() error { return err } + g2 := Group{ + Name: "ops", + AllowLan: true, + ClientDns: []ValData{{Val: "114.114.114.114"}}, + RouteInclude: []ValData{{Val: "10.0.0.0/8"}}, + Status: 1, + } + err = SetGroup(&g2) + if err != nil { + return err + } + return nil } @@ -169,10 +183,13 @@ const accountMail = `

Hello, {{.Issuer}}:

PIN code: {{.PinCode}}
User OTP code (please save it):
- + userOtpQr

Instructions for use: diff --git a/server/dbdata/setting.go b/server/dbdata/setting.go index 690930b..5c3f559 100644 --- a/server/dbdata/setting.go +++ b/server/dbdata/setting.go @@ -29,6 +29,7 @@ type SettingAuditLog struct { type SettingOther struct { LinkAddr string `json:"link_addr"` Banner string `json:"banner"` + Homecode int `json:"homecode"` Homeindex string `json:"homeindex"` AccountMail string `json:"account_mail"` } diff --git a/server/dbdata/user_act_log.go b/server/dbdata/user_act_log.go index daa1cd5..eadbf2b 100644 --- a/server/dbdata/user_act_log.go +++ b/server/dbdata/user_act_log.go @@ -12,17 +12,18 @@ import ( ) const ( - UserAuthFail = 0 // Authentication failed - UserAuthSuccess = 1 // Authentication successful - UserConnected = 2 // Connection successful - UserLogout = 3 // User logout - UserLogoutLose = 0 // User disconnected - UserLogoutBanner = 1 // Cancel user banner pop-up window - UserLogoutClient = 2 // User actively logs out - UserLogoutTimeout = 3 // User logs out after timeout - UserLogoutAdmin = 4 // The account was kicked offline by the administrator - UserLogoutExpire = 5 // The account expired and was kicked offline. - UserIdleTimeout = 6 // User idle link timeout + UserAuthFail = 0 // Authentication failed + UserAuthSuccess = 1 // Authentication successful + UserConnected = 2 // Connection successful + UserLogout = 3 // User logout + UserLogoutLose = 0 // User disconnected + UserLogoutBanner = 1 // Cancel user banner pop-up window + UserLogoutClient = 2 // User actively logs out + UserLogoutTimeout = 3 // User logs out after timeout + UserLogoutAdmin = 4 // The account was kicked offline by the administrator + UserLogoutExpire = 5 // The account expired and was kicked offline. + UserIdleTimeout = 6 // User idle link timeout + UserLogoutOneAdmin = 7 // The account was offlined by the administrator with one click ) type UserActLogProcess struct { @@ -57,13 +58,14 @@ var ( 3: "AnyLink", }, InfoOps: []string{ // Information - UserLogoutLose: "User disconnected", - UserLogoutBanner: "User cancels pop-up window/logout initiated by client", - UserLogoutClient: "User/client actively disconnects", - UserLogoutTimeout: "Session expired and was kicked offline", - UserLogoutAdmin: "The account was kicked offline by the administrator", - UserLogoutExpire: "The account expired and was kicked offline.", - UserIdleTimeout: "User idle link timeout", + UserLogoutLose: "User disconnected", + UserLogoutBanner: "User cancels pop-up window/logout initiated by client", + UserLogoutClient: "User/client actively disconnects", + UserLogoutTimeout: "Session expired and was kicked offline", + UserLogoutAdmin: "The account was kicked offline by the administrator", + UserLogoutExpire: "The account expired and was kicked offline.", + UserIdleTimeout: "User idle link timeout", + UserLogoutOneAdmin: "The account was offline by the administrator with one click", }, } ) @@ -126,6 +128,9 @@ func (ua *UserActLogProcess) GetStatusOpsWithTag() interface{} { } func (ua *UserActLogProcess) GetInfoOpsById(id uint8) string { + if int(id) >= len(ua.InfoOps) { + return "Unknown message type" + } return ua.InfoOps[id] } @@ -139,7 +144,7 @@ func (ua *UserActLogProcess) ParseUserAgent(userAgent string) (os_idx, client_id os_idx = 0 if strings.Contains(userAgent, "windows") { os_idx = 1 - } else if strings.Contains(userAgent, "mac os") || strings.Contains(userAgent, "darwin_i386") { + } else if strings.Contains(userAgent, "mac os") || strings.Contains(userAgent, "darwin_i386") || strings.Contains(userAgent, "darwin_amd64") || strings.Contains(userAgent, "darwin_arm64") { os_idx = 2 } else if strings.Contains(userAgent, "darwin_arm") || strings.Contains(userAgent, "apple") { os_idx = 5 diff --git a/server/go.mod b/server/go.mod index 726804e..7545e80 100644 --- a/server/go.mod +++ b/server/go.mod @@ -1,14 +1,14 @@ module github.com/cherts/anylink -go 1.20 +go 1.22 require ( github.com/arl/statsviz v0.6.0 github.com/deckarep/golang-set v1.8.0 - github.com/go-acme/lego/v4 v4.15.0 + github.com/go-acme/lego/v4 v4.16.1 github.com/go-co-op/gocron v1.37.0 github.com/go-ldap/ldap v3.0.3+incompatible - github.com/go-sql-driver/mysql v1.7.1 + github.com/go-sql-driver/mysql v1.8.1 github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a github.com/golang-jwt/jwt/v4 v4.5.0 github.com/google/gopacket v1.1.19 @@ -29,25 +29,26 @@ require ( github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/xhit/go-simple-mail/v2 v2.16.0 github.com/xlzd/gotp v0.1.0 github.com/xuri/excelize/v2 v2.8.1 - go.uber.org/atomic v1.11.0 - golang.org/x/crypto v0.20.0 - golang.org/x/net v0.21.0 + golang.org/x/crypto v0.21.0 + golang.org/x/net v0.23.0 golang.org/x/text v0.14.0 golang.org/x/time v0.5.0 layeh.com/radius v0.0.0-20231213012653-1006025d24f8 - xorm.io/xorm v1.3.8 + xorm.io/xorm v1.3.9 ) require ( - github.com/aliyun/alibaba-cloud-sdk-go v1.62.686 // indirect - github.com/cenkalti/backoff/v4 v4.2.1 // indirect - github.com/cloudflare/cloudflare-go v0.89.0 // indirect + filippo.io/edwards25519 v1.1.0 // indirect + github.com/aliyun/alibaba-cloud-sdk-go v1.62.712 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cloudflare/cloudflare-go v0.92.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/go-jose/go-jose/v3 v3.0.2 // indirect + github.com/go-jose/go-jose/v3 v3.0.3 // indirect + github.com/go-jose/go-jose/v4 v4.0.1 // indirect github.com/go-test/deep v1.1.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.6.0 // indirect @@ -56,19 +57,20 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/miekg/dns v1.1.58 // indirect github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/pion/transport/v2 v2.2.4 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.866 // indirect - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.866 // indirect + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.892 // indirect + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.892 // indirect github.com/toorop/go-dkim v0.0.0-20240103092955-90b7d1423f92 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect + go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect + golang.org/x/mod v0.16.0 // indirect + golang.org/x/tools v0.19.0 // indirect ) require ( @@ -98,8 +100,8 @@ require ( github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 // indirect - github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 // indirect - golang.org/x/sys v0.17.0 // indirect + github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect + golang.org/x/sys v0.18.0 // indirect gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/server/go.sum b/server/go.sum index f70fe75..7f84784 100644 --- a/server/go.sum +++ b/server/go.sum @@ -1,21 +1,25 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s= gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/aliyun/alibaba-cloud-sdk-go v1.62.664 h1:6cNj+hrRbQiMDV5PLO7iYY2GfMtjRhuqsM9t1+UhJok= -github.com/aliyun/alibaba-cloud-sdk-go v1.62.664/go.mod h1:CJJYa1ZMxjlN/NbXEwmejEnBkhi0DV+Yb3B2lxf+74o= -github.com/aliyun/alibaba-cloud-sdk-go v1.62.686 h1:LJxJU70aG9RvXVrtnRrUmKldS4Fir/1tNvZsUJSqBGk= -github.com/aliyun/alibaba-cloud-sdk-go v1.62.686/go.mod h1:CJJYa1ZMxjlN/NbXEwmejEnBkhi0DV+Yb3B2lxf+74o= +github.com/aliyun/alibaba-cloud-sdk-go v1.62.690 h1:9ChlXyXZxVeHXPlsUqquutxxmrEGhNmfQiOW/YKIbq8= +github.com/aliyun/alibaba-cloud-sdk-go v1.62.690/go.mod h1:CJJYa1ZMxjlN/NbXEwmejEnBkhi0DV+Yb3B2lxf+74o= +github.com/aliyun/alibaba-cloud-sdk-go v1.62.712 h1:lM7JnA9dEdDFH9XOgRNQMDTQnOjlLkDTNA7c0aWTQ30= +github.com/aliyun/alibaba-cloud-sdk-go v1.62.712/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= github.com/arl/statsviz v0.6.0 h1:jbW1QJkEYQkufd//4NDYRSNBpwJNrdzPahF7ZmoGdyE= github.com/arl/statsviz v0.6.0/go.mod h1:0toboo+YGSUXDaS4g1D5TVS4dXs7S7YYT5J/qnW2h8s= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cloudflare/cloudflare-go v0.86.0 h1:jEKN5VHNYNYtfDL2lUFLTRo+nOVNPFxpXTstVx0rqHI= -github.com/cloudflare/cloudflare-go v0.86.0/go.mod h1:wYW/5UP02TUfBToa/yKbQHV+r6h1NnJ1Je7XjuGM4Jw= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cloudflare/cloudflare-go v0.89.0 h1:3zoVntC8xmUR/weFEcNE1RizdW4LRZdQnJ/AN8DDa1U= github.com/cloudflare/cloudflare-go v0.89.0/go.mod h1:eyuehb1i6BNRc+ZwaTZAiRHeE+4jbKvHAns19oGeakg= +github.com/cloudflare/cloudflare-go v0.92.0 h1:ltJvGvqZ4G6Fm2hHOYZ5RWpJQcrM0oDrsjjZydZhFJQ= +github.com/cloudflare/cloudflare-go v0.92.0/go.mod h1:nUqvBUUDRxNzsDSQjbqUNWHEIYAoUlgRmcAzMKlFdKs= github.com/coreos/go-iptables v0.7.0 h1:XWM3V+MPRr5/q51NuWSgU0fqMad64Zyxs8ZUoMsamr8= github.com/coreos/go-iptables v0.7.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -27,32 +31,37 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8Yc github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= +github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/go-acme/lego/v4 v4.14.2 h1:/D/jqRgLi8Cbk33sLGtu2pX2jEg3bGJWHyV8kFuUHGM= -github.com/go-acme/lego/v4 v4.14.2/go.mod h1:kBXxbeTg0x9AgaOYjPSwIeJy3Y33zTz+tMD16O4MO6c= github.com/go-acme/lego/v4 v4.15.0 h1:A7MHEU3b+TDFqhC/HmzMJnzPbyeaYvMZQBbqgvbThhU= github.com/go-acme/lego/v4 v4.15.0/go.mod h1:eeGhjW4zWT7Ccqa3sY7ayEqFLCAICx+mXgkMHKIkLxg= +github.com/go-acme/lego/v4 v4.16.1 h1:JxZ93s4KG0jL27rZ30UsIgxap6VGzKuREsSkkyzeoCQ= +github.com/go-acme/lego/v4 v4.16.1/go.mod h1:AVvwdPned/IWpD/ihHhMsKnveF7HHYAz/CmtXi7OZoE= github.com/go-co-op/gocron v1.37.0 h1:ZYDJGtQ4OMhTLKOKMIch+/CY70Brbb1dGdooLEhh7b0= github.com/go-co-op/gocron v1.37.0/go.mod h1:3L/n6BkO7ABj+TrfSVXLRzsP26zmikL4ISkLQ0O8iNY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= -github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= -github.com/go-jose/go-jose/v3 v3.0.2 h1:2Edjn8Nrb44UvTdp84KU0bBPs1cO7noRCybtS3eJEUQ= -github.com/go-jose/go-jose/v3 v3.0.2/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= +github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= +github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= +github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U= +github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= github.com/go-ldap/ldap v3.0.3+incompatible h1:HTeSZO8hWMS1Rgb2Ziku6b8a7qRIZZMHjsvuZyatzwk= github.com/go-ldap/ldap v3.0.3+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= -github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= -github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-sql-driver/mysql v1.8.0 h1:UtktXaU2Nb64z/pLiGIxY4431SJ4/dR5cjMmlVHgnT4= +github.com/go-sql-driver/mysql v1.8.0/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a h1:RYfmiM0zluBJOiPDJseKLEN4BapJ42uSi9SZBQ2YyiA= @@ -67,7 +76,6 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= @@ -78,8 +86,6 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= @@ -92,6 +98,7 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -112,10 +119,12 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -127,9 +136,9 @@ github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= -github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= @@ -156,13 +165,12 @@ github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HD github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/pion/dtls/v2 v2.2.9 h1:K+D/aVf9/REahQvqk6G5JavdrD8W1PWDKC11UlwN7ts= -github.com/pion/dtls/v2 v2.2.9/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pion/dtls/v2 v2.2.10 h1:u2Axk+FyIR1VFTPurktB+1zoEPGIW3bmyj3LEFrXjAA= github.com/pion/dtls/v2 v2.2.10/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= -github.com/pion/transport/v2 v2.2.1/go.mod h1:cXXWavvCnFF6McHTft3DWS9iic2Mftcz1Aq29pGcU5g= github.com/pion/transport/v2 v2.2.4 h1:41JJK6DZQYSeVLxILA2+F4ZkKb4Xd/tFJZRFZQ9QAlo= github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= github.com/pires/go-proxyproto v0.7.0 h1:IukmRewDQFWC7kfnb66CSomk2q/seBuilHBYFwyq0Hs= @@ -174,6 +182,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM= github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk= github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= @@ -184,6 +193,7 @@ github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzG github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= @@ -212,28 +222,29 @@ github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMV github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.846 h1:5/fC1P4bzGmlHWmzgRgZ/pybS3er4dxpqa/yquF+YOQ= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.846/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.866 h1:qVui3jFr+antCKDYJOIVoNcNYwOVairHkWHKROztuac= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.866/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.846 h1:X3gwCrnd5FeCnk0cqIm7lfK5684zYrwRhhzlzHcjMVk= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.846/go.mod h1:jHNnw3sqFpKGHLTewQ9x4pjiaB6Rn91RXKLWuFE9Bgg= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.866 h1:OZ/s4dJPNhmXHeSFoHMSytTbcJbAfedCn23QQBZvZ44= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.866/go.mod h1:aQbyLbrhV/HT9DUkRwZblKaIgVW3cLLJW7foWUwlAaA= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.873 h1:VdQ+lQ98CFwbmfQj02iMVWWzdwnKubuICIa2QhzQBJI= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.873/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.892 h1:VMTCH/08bZvQiJD0LJms/TuVDqKtcg9JExYNIwwX2ws= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.892/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.873 h1:qawAviStyrk6b2bHvRvKxmiiL8Cu6KujtzAHktLqdFI= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.873/go.mod h1:wqyJy+a/L53zH8pRDNOF+7t9iZhSPANmYSuUfvVp9NE= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.892 h1:SIEkbUn47ifWcwB3OnwTgRP6ZFpSMYpaIihAluNutX8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.892/go.mod h1:QbIvyWbKddSjeggznAfxSW+nB9fiucqMkdYvAhKZlaw= github.com/tklauser/go-sysconf v0.3.13 h1:GBUpcahXSpR2xN01jhkNAbTLRk2Yzgggk8IM08lq3r4= github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0= github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= @@ -249,19 +260,15 @@ github.com/xhit/go-simple-mail/v2 v2.16.0 h1:ouGy/Ww4kuaqu2E2UrDw7SvLaziWTB60ICL github.com/xhit/go-simple-mail/v2 v2.16.0/go.mod h1:b7P5ygho6SYE+VIqpxA6QkYfv4teeyG4MKqB3utRu98= github.com/xlzd/gotp v0.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po= github.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8qg= -github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 h1:Chd9DkqERQQuHpXjR/HSV1jLZA6uaoiwwH3vSuF3IW0= github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= -github.com/xuri/excelize/v2 v2.8.0 h1:Vd4Qy809fupgp1v7X+nCS/MioeQmYVVzi495UCTqB7U= -github.com/xuri/excelize/v2 v2.8.0/go.mod h1:6iA2edBTKxKbZAa7X5bDhcCg51xdOn1Ar5sfoXRGrQg= github.com/xuri/excelize/v2 v2.8.1 h1:pZLMEwK8ep+CLIUWpWmvW8IWE/yxqG0I1xcN6cVMGuQ= github.com/xuri/excelize/v2 v2.8.1/go.mod h1:oli1E4C3Pa5RXg1TBXn4ENCXDV5JUMlBluUhG7c+CEE= -github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 h1:qhbILQo1K3mphbwKh1vNm4oGezE1eF9fQWmNiIpSfI4= github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= +github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 h1:hPVCafDV85blFTabnqKgNhDCkJX25eik94Si9cTER4A= +github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= -github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -271,60 +278,55 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= -golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= -golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= +golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.11.0 h1:ds2RoQvBvYTiJkwpSFDwCcDFNX7DqjL2WsUgTNk0Ooo= -golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8= golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4= +golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -336,18 +338,16 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= @@ -372,10 +372,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -402,6 +400,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= @@ -409,19 +408,29 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= layeh.com/radius v0.0.0-20231213012653-1006025d24f8 h1:orYXpi6BJZdvgytfHH4ybOe4wHnLbbS71Cmd8mWdZjs= layeh.com/radius v0.0.0-20231213012653-1006025d24f8/go.mod h1:QRf+8aRqXc019kHkpcs/CTgyWXFzf+bxlsyuo2nAl1o= lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= modernc.org/libc v1.22.2 h1:4U7v51GyhlWqQmwCHj28Rdq2Yzwk55ovjFrdPjs8Hb0= +modernc.org/libc v1.22.2/go.mod h1:uvQavJ1pZ0hIoC/jfqNoMLURIMhKzINIWypNM17puug= modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/memory v1.4.0 h1:crykUfNSnMAXaOJnnxcSzbUGMqkLWjklJKkBK2nwZwk= +modernc.org/memory v1.4.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sqlite v1.20.4 h1:J8+m2trkN+KKoE7jglyHYYYiaq5xmz2HoHJIiBlRzbE= +modernc.org/sqlite v1.20.4/go.mod h1:zKcGyrICaxNTMEHSr1HQ2GUraP0j+845GYw37+EyT6A= modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= xorm.io/builder v0.3.13 h1:a3jmiVVL19psGeXx8GIurTp7p0IIgqeDmwhcR6BAOAo= xorm.io/builder v0.3.13/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE= -xorm.io/xorm v1.3.7 h1:mLceAGu0b87r9pD4qXyxGHxifOXIIrAdVcA6k95/osw= -xorm.io/xorm v1.3.7/go.mod h1:LsCCffeeYp63ssk0pKumP6l96WZcHix7ChpurcLNuMw= xorm.io/xorm v1.3.8 h1:CJmplmWqfSRpLWSPMmqz+so8toBp3m7ehuRehIWedZo= xorm.io/xorm v1.3.8/go.mod h1:LsCCffeeYp63ssk0pKumP6l96WZcHix7ChpurcLNuMw= +xorm.io/xorm v1.3.9 h1:TUovzS0ko+IQ1XnNLfs5dqK1cJl1H5uHpWbWqAQ04nU= +xorm.io/xorm v1.3.9/go.mod h1:LsCCffeeYp63ssk0pKumP6l96WZcHix7ChpurcLNuMw= diff --git a/server/handler/dtls.go b/server/handler/dtls.go index 4b815bf..14766a5 100644 --- a/server/handler/dtls.go +++ b/server/handler/dtls.go @@ -32,8 +32,10 @@ func startDtls() { logf := logging.NewDefaultLoggerFactory() logf.Writer = base.GetBaseLw() - // logf.DefaultLogLevel = logging.LogLevelTrace logf.DefaultLogLevel = logging.LogLevelInfo + if base.GetLogLevel() == base.LogLevelTrace { + // logf.DefaultLogLevel = logging.LogLevelTrace + } // https://github.com/pion/dtls/pull/369 sessStore := &sessionStore{} diff --git a/server/handler/link_auth.go b/server/handler/link_auth.go index e139f0e..51b614d 100644 --- a/server/handler/link_auth.go +++ b/server/handler/link_auth.go @@ -46,10 +46,11 @@ func LinkAuth(w http.ResponseWriter, r *http.Request) { cr := ClientRequest{} err = xml.Unmarshal(body, &cr) if err != nil { + base.Error(err) w.WriteHeader(http.StatusBadRequest) return } - // fmt.Printf("%+v \n", cr) + base.Trace(fmt.Sprintf("%+v \n", cr)) // setCommonHeader(w) if cr.Type == "logout" { // Exit and delete session information @@ -137,10 +138,10 @@ func LinkAuth(w http.ResponseWriter, r *http.Request) { other := &dbdata.SettingOther{} _ = dbdata.SettingGet(other) rd := RequestData{SessionId: sess.Sid, SessionToken: sess.Sid + "@" + sess.Token, - Banner: other.Banner, ProfileHash: profileHash} + Banner: other.Banner, ProfileName: base.Cfg.ProfileName, ProfileHash: profileHash} w.WriteHeader(http.StatusOK) tplRequest(tpl_complete, w, rd) - base.Debug("login", cr.Auth.Username, userAgent) + base.Info("login", cr.Auth.Username, userAgent) } const ( @@ -175,6 +176,7 @@ type RequestData struct { SessionId string SessionToken string Banner string + ProfileName string ProfileHash string } @@ -227,7 +229,7 @@ var auth_complete = ` - /profile.xml + /profile_{{.ProfileName}}.xml {{.ProfileHash}} diff --git a/server/handler/link_base.go b/server/handler/link_base.go index 629b4c1..794892a 100644 --- a/server/handler/link_base.go +++ b/server/handler/link_base.go @@ -2,8 +2,9 @@ package handler import ( "encoding/xml" - "log" "os/exec" + + "github.com/cherts/anylink/base" ) const BufferSize = 2048 @@ -46,7 +47,7 @@ func execCmd(cmdStrs []string) error { cmd := exec.Command("sh", "-c", cmdStr) b, err := cmd.CombinedOutput() if err != nil { - log.Println(string(b)) + base.Error(cmdStr, string(b)) return err } } diff --git a/server/handler/link_cstp.go b/server/handler/link_cstp.go index ce2cce5..f428792 100644 --- a/server/handler/link_cstp.go +++ b/server/handler/link_cstp.go @@ -25,9 +25,9 @@ func LinkCstp(conn net.Conn, bufRW *bufio.ReadWriter, cSess *sessdata.ConnSessio n int dataLen uint16 dead = time.Second * time.Duration(cSess.CstpDpd+5) - idle = time.Second * time.Duration(base.Cfg.IdleTimeout) + idle = int64(base.Cfg.IdleTimeout) checkIdle = base.Cfg.IdleTimeout > 0 - lastTime time.Time + lastTime int64 ) go cstpWrite(conn, bufRW, cSess) @@ -37,14 +37,14 @@ func LinkCstp(conn net.Conn, bufRW *bufio.ReadWriter, cSess *sessdata.ConnSessio // Set timeout limit err = conn.SetReadDeadline(utils.NowSec().Add(dead)) if err != nil { - base.Error("SetDeadline: ", cSess.Username, err) + base.Error("SetDeadline: ", cSess.Username, cSess.IpAddr, err) return } // hdata := make([]byte, BufferSize) pl := getPayload() n, err = bufRW.Read(pl.Data) if err != nil { - base.Error("read hdata: ", cSess.Username, err) + base.Warn("read hdata: ", cSess.Username, cSess.IpAddr, err) return } @@ -61,7 +61,7 @@ func LinkCstp(conn net.Conn, bufRW *bufio.ReadWriter, cSess *sessdata.ConnSessio // Determine timeout time if checkIdle { lastTime = cSess.LastDataTime.Load() - if lastTime.Before(utils.NowSec().Add(-idle)) { + if lastTime < (utils.NowSec().Unix() - idle) { base.Warn("IdleTimeout", cSess.Username, cSess.IpAddr, "lastTime", lastTime) sessdata.CloseSess(cSess.Sess.Token, dbdata.UserIdleTimeout) return @@ -69,13 +69,13 @@ func LinkCstp(conn net.Conn, bufRW *bufio.ReadWriter, cSess *sessdata.ConnSessio } case 0x05: // DISCONNECT cSess.UserLogoutCode = dbdata.UserLogoutClient - base.Debug("DISCONNECT", cSess.Username, cSess.IpAddr, conn.RemoteAddr()) + base.Info("DISCONNECT", cSess.Username, cSess.IpAddr, conn.RemoteAddr(), n, string(pl.Data[9:n])) sessdata.CloseSess(cSess.Sess.Token, dbdata.UserLogoutClient) return case 0x03: // DPD-REQ - base.Trace("recv LinkCstp DPD-REQ", cSess.Username, cSess.IpAddr, conn.RemoteAddr()) + base.Trace("recv LinkCstp DPD-REQ", cSess.Username, cSess.IpAddr, conn.RemoteAddr(), n, pl.Data[:n]) pl.PType = 0x04 - pl.Data = pl.Data[:n] + //pl.Data = pl.Data[:n] if payloadOutCstp(cSess, pl) { return } @@ -113,7 +113,7 @@ func LinkCstp(conn net.Conn, bufRW *bufio.ReadWriter, cSess *sessdata.ConnSessio return } // Only record the time when the correct data is returned - cSess.LastDataTime.Store(utils.NowSec()) + cSess.LastDataTime.Store(utils.NowSec().Unix()) } } } @@ -169,14 +169,14 @@ func cstpWrite(conn net.Conn, bufRW *bufio.ReadWriter, cSess *sessdata.ConnSessi binary.BigEndian.PutUint16(pl.Data[4:6], uint16(l)) } } else { - // pl.Data = append(pl.Data[:0], plHeader...) + pl.Data = append(pl.Data[:0], plHeader...) // Set header type pl.Data[6] = pl.PType } n, err = conn.Write(pl.Data) if err != nil { - base.Error("write err", cSess.Username, err) + base.Warn("write err", cSess.Username, cSess.IpAddr, err) return } diff --git a/server/handler/link_dtls.go b/server/handler/link_dtls.go index 552a1a7..93c6d01 100644 --- a/server/handler/link_dtls.go +++ b/server/handler/link_dtls.go @@ -36,14 +36,14 @@ func LinkDtls(conn net.Conn, cSess *sessdata.ConnSession) { for { err = conn.SetReadDeadline(utils.NowSec().Add(dead)) if err != nil { - base.Error("SetDeadline: ", cSess.Username, err) + base.Error("SetDeadline: ", cSess.Username, cSess.IpAddr, err) return } pl := getPayload() n, err = conn.Read(pl.Data) if err != nil { - base.Error("read hdata: ", cSess.Username, err) + base.Warn("read hdata: ", cSess.Username, cSess.IpAddr, err) return } @@ -59,11 +59,12 @@ func LinkDtls(conn net.Conn, cSess *sessdata.ConnSession) { base.Trace("recv LinkDtls Keepalive", cSess.Username, cSess.IpAddr, conn.RemoteAddr()) case 0x05: // DISCONNECT cSess.UserLogoutCode = dbdata.UserLogoutClient - base.Debug("DISCONNECT DTLS", cSess.Username, cSess.IpAddr, conn.RemoteAddr()) + base.Info("DISCONNECT DTLS", cSess.Username, cSess.IpAddr, conn.RemoteAddr()) return case 0x03: // DPD-REQ - base.Trace("recv LinkDtls DPD-REQ", cSess.Username, cSess.IpAddr, conn.RemoteAddr()) + base.Trace("recv LinkDtls DPD-REQ", cSess.Username, cSess.IpAddr, conn.RemoteAddr(), n) pl.PType = 0x04 + // Starting from zero, you can assign values directly pl.Data = pl.Data[:n] if payloadOutDtls(cSess, dSess, pl) { return @@ -95,7 +96,7 @@ func LinkDtls(conn net.Conn, cSess *sessdata.ConnSession) { return } // Only record the time when correct data is returned - cSess.LastDataTime.Store(utils.NowSec()) + cSess.LastDataTime.Store(utils.NowSec().Unix()) } } @@ -150,12 +151,15 @@ func dtlsWrite(conn net.Conn, dSess *sessdata.DtlsSession, cSess *sessdata.ConnS } } else { // Set header type - // pl.Data = append(pl.Data[:0], pl.PType) - pl.Data[0] = pl.PType + if pl.PType == 0x04 { + pl.Data[0] = pl.PType + } else { + pl.Data = append(pl.Data[:0], pl.PType) + } } n, err := conn.Write(pl.Data) if err != nil { - base.Error("write err", cSess.Username, err) + base.Warn("write err", cSess.Username, cSess.IpAddr, err) return } diff --git a/server/handler/link_home.go b/server/handler/link_home.go index 1a60534..46afa15 100644 --- a/server/handler/link_home.go +++ b/server/handler/link_home.go @@ -27,10 +27,16 @@ func LinkHome(w http.ResponseWriter, r *http.Request) { if err := dbdata.SettingGet(index); err != nil { return } - w.WriteHeader(http.StatusOK) - if index.Homeindex == "" { - index.Homeindex = "AnyLink is an enterprise-level remote office SSL VPN software that can support multiple people online at the same time." + + if index.Homecode > 0 { + w.WriteHeader(index.Homecode) + } else { + w.WriteHeader(http.StatusOK) } + + // if index.Homeindex == "" { + // index.Homeindex = "AnyLink is an enterprise-level remote office SSL VPN software that can support multiple people online at the same time." + // } fmt.Fprintln(w, index.Homeindex) } diff --git a/server/handler/link_tun.go b/server/handler/link_tun.go index 2eccdc0..d021194 100644 --- a/server/handler/link_tun.go +++ b/server/handler/link_tun.go @@ -4,12 +4,16 @@ import ( "fmt" "github.com/cherts/anylink/base" + "github.com/cherts/anylink/pkg/utils" "github.com/cherts/anylink/sessdata" "github.com/coreos/go-iptables/iptables" "github.com/songgao/water" ) func checkTun() { + //Test ip command + base.CheckModOrLoad("tun") + // Test tun cfg := water.Config{ DeviceType: water.TUN, @@ -21,16 +25,14 @@ func checkTun() { } defer ifce.Close() - // test ip command - base.CheckModOrLoad("tun") - cmdstr1 := fmt.Sprintf("ip link set dev %s up mtu %s multicast off", ifce.Name(), "1399") err = execCmd([]string{cmdstr1}) if err != nil { base.Fatal("testTun err: ", err) } // Enable server forwarding - if err := execCmd([]string{"sysctl -w net.ipv4.ip_forward=1"}); err != nil { + err = execCmd([]string{"sysctl -w net.ipv4.ip_forward=1"}) + if err != nil { base.Fatal(err) } if base.Cfg.IptablesNat { @@ -44,15 +46,28 @@ func checkTun() { // Fix rockyos nat not taking effect base.CheckModOrLoad("iptable_filter") base.CheckModOrLoad("iptable_nat") + // base.CheckModOrLoad("xt_comment") - natRule := []string{"-s", base.Cfg.Ipv4CIDR, "-o", base.Cfg.Ipv4Master, "-j", "MASQUERADE"} - forwardRule := []string{"-j", "ACCEPT"} - if natExists, _ := ipt.Exists("nat", "POSTROUTING", natRule...); !natExists { - ipt.Insert("nat", "POSTROUTING", 1, natRule...) + // add notes + natRule := []string{"-s", base.Cfg.Ipv4CIDR, "-o", base.Cfg.Ipv4Master, "-m", "comment", + "--comment", "AnyLink", "-j", "MASQUERADE"} + if base.InContainer { + natRule = []string{"-s", base.Cfg.Ipv4CIDR, "-o", base.Cfg.Ipv4Master, "-j", "MASQUERADE"} } - if forwardExists, _ := ipt.Exists("filter", "FORWARD", forwardRule...); !forwardExists { - ipt.Insert("filter", "FORWARD", 1, forwardRule...) + err = ipt.InsertUnique("nat", "POSTROUTING", 1, natRule...) + if err != nil { + base.Error(err) + } + // add notes + forwardRule := []string{"-m", "comment", "--comment", "AnyLink", "-j", "ACCEPT"} + if base.InContainer { + forwardRule = []string{"-j", "ACCEPT"} } + err = ipt.InsertUnique("filter", "FORWARD", 1, forwardRule...) + if err != nil { + base.Error(err) + } + base.Info(ipt.List("nat", "POSTROUTING")) base.Info(ipt.List("filter", "FORWARD")) } @@ -74,7 +89,8 @@ func LinkTun(cSess *sessdata.ConnSession) error { // View alias information through ip link show - cmdstr1 := fmt.Sprintf("ip link set dev %s up mtu %d multicast off alias %s.%s", ifce.Name(), cSess.Mtu, cSess.Group.Name, cSess.Username) + alias := utils.ParseName(cSess.Group.Name + "." + cSess.Username) + cmdstr1 := fmt.Sprintf("ip link set dev %s up mtu %d multicast off alias %s", ifce.Name(), cSess.Mtu, alias) cmdstr2 := fmt.Sprintf("ip addr add dev %s local %s peer %s/32", ifce.Name(), base.Cfg.Ipv4Gateway, cSess.IpAddr) err = execCmd([]string{cmdstr1, cmdstr2}) diff --git a/server/handler/link_tunnel.go b/server/handler/link_tunnel.go index 1d6ddd1..ed1b7d1 100644 --- a/server/handler/link_tunnel.go +++ b/server/handler/link_tunnel.go @@ -92,7 +92,7 @@ func LinkTunnel(w http.ResponseWriter, r *http.Request) { dtlsPort = ss[1] } - base.Debug(cSess.IpAddr, cSess.MacHw, sess.Username, mobile) + base.Info(sess.Username, cSess.IpAddr, cSess.MacHw, cSess.Client, mobile) // Detect cipher suites dtlsCiphersuite := checkDtls12Ciphersuite(r.Header.Get("X-Dtls12-Ciphersuite")) @@ -133,7 +133,7 @@ func LinkTunnel(w http.ResponseWriter, r *http.Request) { } // Allowed routes for _, v := range cSess.Group.RouteInclude { - if v.Val == dbdata.All { + if strings.ToLower(v.Val) == dbdata.All { continue } HttpAddHeader(w, "X-CSTP-Split-Include", v.IpMask) diff --git a/server/handler/link_vtap.go b/server/handler/link_vtap.go index 8a9c369..ae7894e 100644 --- a/server/handler/link_vtap.go +++ b/server/handler/link_vtap.go @@ -28,12 +28,13 @@ func (v *Vtap) Close() error { } func checkMacvtap() { + // Load macvtap + base.CheckModOrLoad("macvtap") + _setGateway() _checkTapIp(base.Cfg.Ipv4Master) ifName := "anylinkMacvtap" - // Load macvtap - base.CheckModOrLoad("macvtap") // Enable promiscuous mode for the primary network card cmdstr1 := fmt.Sprintf("ip link set dev %s promisc on", base.Cfg.Ipv4Master) @@ -55,8 +56,8 @@ func LinkMacvtap(cSess *sessdata.ConnSession) error { cSess.SetIfName(ifName) cmdstr1 := fmt.Sprintf("ip link add link %s name %s type macvtap mode bridge", base.Cfg.Ipv4Master, ifName) - cmdstr2 := fmt.Sprintf("ip link set dev %s up mtu %d address %s alias %s.%s", ifName, cSess.Mtu, - cSess.MacHw, cSess.Group.Name, cSess.Username) + alias := utils.ParseName(cSess.Group.Name + "." + cSess.Username) + cmdstr2 := fmt.Sprintf("ip link set dev %s up mtu %d address %s alias %s", ifName, cSess.Mtu, cSess.MacHw, alias) err := execCmd([]string{cmdstr1, cmdstr2}) if err != nil { diff --git a/server/handler/server.go b/server/handler/server.go index 3ad742e..a7f4abd 100644 --- a/server/handler/server.go +++ b/server/handler/server.go @@ -98,7 +98,7 @@ func initRoute() http.Handler { r.HandleFunc("/", LinkAuth).Methods(http.MethodPost) r.HandleFunc("/CSCOSSLC/tunnel", LinkTunnel).Methods(http.MethodConnect) r.HandleFunc("/otp_qr", LinkOtpQr).Methods(http.MethodGet) - r.HandleFunc("/profile.xml", func(w http.ResponseWriter, r *http.Request) { + r.HandleFunc(fmt.Sprintf("/profile_%s.xml", base.Cfg.ProfileName), func(w http.ResponseWriter, r *http.Request) { b, _ := os.ReadFile(base.Cfg.Profile) w.Write(b) }).Methods(http.MethodGet) diff --git a/server/handler/start.go b/server/handler/start.go index a31fb20..c9b3815 100644 --- a/server/handler/start.go +++ b/server/handler/start.go @@ -17,6 +17,12 @@ func Start() { sessdata.Start() cron.Start() + // Enable server forwarding + err := execCmd([]string{"sysctl -w net.ipv4.ip_forward=1"}) + if err != nil { + base.Fatal(err) + } + switch base.Cfg.LinkMode { case base.LinkModeTUN: checkTun() diff --git a/server/pkg/utils/util.go b/server/pkg/utils/util.go index 6bc06aa..30eb5f6 100644 --- a/server/pkg/utils/util.go +++ b/server/pkg/utils/util.go @@ -3,6 +3,7 @@ package utils import ( "fmt" "math/rand" + "strings" "sync/atomic" "time" ) @@ -91,3 +92,11 @@ func RandomRunes(length int) string { return string(bytes) } + +func ParseName(name string) string { + name = strings.ReplaceAll(name, " ", "-") + name = strings.ReplaceAll(name, "'", "-") + name = strings.ReplaceAll(name, "\"", "-") + name = strings.ReplaceAll(name, ";", "-") + return name +} diff --git a/server/sessdata/online.go b/server/sessdata/online.go index b6601ef..96a72ff 100644 --- a/server/sessdata/online.go +++ b/server/sessdata/online.go @@ -4,6 +4,7 @@ import ( "bytes" "net" "sort" + "strings" "time" "github.com/cherts/anylink/pkg/utils" @@ -42,33 +43,74 @@ func (o Onlines) Swap(i, j int) { } func OnlineSess() []Online { + return GetOnlineSess("", "", false) +} + +/** + * @Description: GetOnlineSess + * @param search_cate Category: user name, login group, MAC address, IP address, remote address + * @param search_text keyword, fuzzy search + * @param show_sleeper whether to display dormant users + * @return []Online + */ +func GetOnlineSess(search_cate string, search_text string, show_sleeper bool) []Online { var datas Onlines + if strings.TrimSpace(search_text) == "" { + search_cate = "" + } sessMux.Lock() + defer sessMux.Unlock() for _, v := range sessions { v.mux.Lock() - if v.IsActive { + cSess := v.CSess + if cSess == nil { + cSess = &ConnSession{} + } + // Select the string to compare + var compareText string + switch search_cate { + case "username": + compareText = v.Username + case "group": + compareText = v.Group + case "mac_addr": + compareText = v.MacAddr + case "ip": + if cSess != nil { + compareText = cSess.IpAddr.String() + } + case "remote_addr": + if cSess != nil { + compareText = cSess.RemoteAddr + } + } + if search_cate != "" && !strings.Contains(compareText, search_text) { + v.mux.Unlock() + continue + } + + if show_sleeper || v.IsActive { val := Online{ Token: v.Token, - Ip: v.CSess.IpAddr, + Ip: cSess.IpAddr, Username: v.Username, Group: v.Group, MacAddr: v.MacAddr, UniqueMac: v.UniqueMac, - RemoteAddr: v.CSess.RemoteAddr, - TunName: v.CSess.IfName, - Mtu: v.CSess.Mtu, - Client: v.CSess.Client, - BandwidthUp: utils.HumanByte(v.CSess.BandwidthUpPeriod.Load()) + "/s", - BandwidthDown: utils.HumanByte(v.CSess.BandwidthDownPeriod.Load()) + "/s", - BandwidthUpAll: utils.HumanByte(v.CSess.BandwidthUpAll.Load()), - BandwidthDownAll: utils.HumanByte(v.CSess.BandwidthDownAll.Load()), + RemoteAddr: cSess.RemoteAddr, + TunName: cSess.IfName, + Mtu: cSess.Mtu, + Client: cSess.Client, + BandwidthUp: utils.HumanByte(cSess.BandwidthUpPeriod.Load()) + "/s", + BandwidthDown: utils.HumanByte(cSess.BandwidthDownPeriod.Load()) + "/s", + BandwidthUpAll: utils.HumanByte(cSess.BandwidthUpAll.Load()), + BandwidthDownAll: utils.HumanByte(cSess.BandwidthDownAll.Load()), LastLogin: v.LastLogin, } datas = append(datas, val) } v.mux.Unlock() } - sessMux.Unlock() sort.Sort(&datas) return datas } diff --git a/server/sessdata/session.go b/server/sessdata/session.go index 09f8a0b..bf919d2 100644 --- a/server/sessdata/session.go +++ b/server/sessdata/session.go @@ -13,7 +13,6 @@ import ( "github.com/cherts/anylink/base" "github.com/cherts/anylink/dbdata" mapset "github.com/deckarep/golang-set" - atomic2 "go.uber.org/atomic" ) var ( @@ -41,15 +40,15 @@ type ConnSession struct { CstpDpd int Group *dbdata.Group Limit *LimitRater - BandwidthUp atomic2.Uint32 // Use upstream bandwidth Byte - BandwidthDown atomic2.Uint32 // Use downlink bandwidth Byte - BandwidthUpPeriod atomic2.Uint32 // The total amount of the previous period - BandwidthDownPeriod atomic2.Uint32 - BandwidthUpAll atomic2.Uint64 // Total amount of uplink bandwidth used - BandwidthDownAll atomic2.Uint64 // Total downlink bandwidth used + BandwidthUp atomic.Uint32 // Use upstream bandwidth Byte + BandwidthDown atomic.Uint32 // Use downlink bandwidth Byte + BandwidthUpPeriod atomic.Uint32 // The total amount of the previous period + BandwidthDownPeriod atomic.Uint32 + BandwidthUpAll atomic.Uint64 // Total amount of uplink bandwidth used + BandwidthDownAll atomic.Uint64 // Total downlink bandwidth used closeOnce sync.Once CloseChan chan struct{} - LastDataTime atomic2.Time // Last data transfer time + LastDataTime atomic.Int64 // Last data transfer time PayloadIn chan *Payload PayloadOutCstp chan *Payload // Cstp data PayloadOutDtls chan *Payload // Dtls data @@ -220,7 +219,7 @@ func (s *Session) NewConn() *ConnSession { PayloadOutDtls: make(chan *Payload, 64), dSess: &atomic.Value{}, } - cSess.LastDataTime.Store(time.Now()) + cSess.LastDataTime.Store(time.Now().Unix()) dSess := &DtlsSession{ isActive: -1, @@ -464,7 +463,7 @@ func CloseSess(token string, code ...uint8) { sess.CSess.Close() return } - AddUserActLogBySess(sess) + AddUserActLogBySess(sess, code...) } func CloseCSess(token string) { @@ -501,7 +500,7 @@ func AddUserActLog(cs *ConnSession) { dbdata.UserActLogIns.Add(ua, cs.UserAgent) } -func AddUserActLogBySess(sess *Session) { +func AddUserActLogBySess(sess *Session, code ...uint8) { ua := dbdata.UserActLog{ Username: sess.Username, GroupName: sess.Group, @@ -512,5 +511,8 @@ func AddUserActLogBySess(sess *Session) { Status: dbdata.UserLogout, } ua.Info = dbdata.UserActLogIns.GetInfoOpsById(dbdata.UserLogoutBanner) + if len(code) > 0 { + ua.Info = dbdata.UserActLogIns.GetInfoOpsById(code[0]) + } dbdata.UserActLogIns.Add(ua, sess.UserAgent) } diff --git a/version b/version index a8839f7..aa3545d 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.11.2 \ No newline at end of file +0.11.4 \ No newline at end of file diff --git a/web/src/layout/Layout.vue b/web/src/layout/Layout.vue index c931e5b..5ae6118 100644 --- a/web/src/layout/Layout.vue +++ b/web/src/layout/Layout.vue @@ -18,6 +18,14 @@ + +
+ + Powered by AnyLink (English version) + + Enterprise-level remote office system AGPL-3.0 (c) 2020-present +
+
@@ -36,6 +44,11 @@ export default { route_name: ['Home'], } }, + methods: { + goUrl(url) { + window.open(url, "_blank") + }, + }, watch: { route_path: function (val) { // var w = document.getElementById('layout-menu').clientWidth; @@ -60,4 +73,15 @@ export default { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04); } +.el-footer { + display: flex; + align-items: center; + justify-content: center; + text-align: center; + font-size: 12px; + line-height: 12px; + margin: 0 12px; + color: rgb(134, 144, 156); +} + diff --git a/web/src/pages/group/List.vue b/web/src/pages/group/List.vue index 8406f83..c7866c7 100644 --- a/web/src/pages/group/List.vue +++ b/web/src/pages/group/List.vue @@ -197,10 +197,14 @@ - - + + +
+ Note: Local network refers to: + The network where the PC running anyconnect client is located, that is, the local routing network segment. + After it is turned on, the data on the PC's local routing network segment will not be forwarded through the tunnel link. + At the same time, the anyconnect client needs to check the local network (Local Lan) switch for the function to take effect. +
@@ -377,7 +381,7 @@ -
Note: Domain name split tunneling only supports the desktop client of AnyConnect, not the mobile client.
+
Note: Domain name split tunneling only supports the Windows and MacOS desktop clients of AnyConnect, and does not support mobile clients.
diff --git a/web/src/pages/set/Other.vue b/web/src/pages/set/Other.vue index d11c1d9..941e659 100644 --- a/web/src/pages/set/Other.vue +++ b/web/src/pages/set/Other.vue @@ -3,11 +3,11 @@ + :model="dataSmtp" + ref="dataSmtp" + :rules="rules" + label-width="100px" + class="tab-one"> @@ -19,9 +19,9 @@ @@ -43,18 +43,18 @@ + :model="dataAuditLog" + ref="dataAuditLog" + :rules="rules" + label-width="100px" + class="tab-one"> Second

@@ -64,11 +64,11 @@ Days

@@ -78,16 +78,16 @@ @@ -99,22 +99,22 @@ + tab-position="left" + v-model="datacertManage" + @tab-click="handleClick"> + ref="customCert" + :model="customCert" + label-width="100px" + size="small" + class="tab-one"> + class="uploadCert" + :before-upload="beforeCertUpload" + :action="certUpload" + :limit="1"> Certificate file + + + + - + - + @@ -296,19 +304,19 @@ export default { authToken: "", }, }, - customCert: { cert: "", key: "" }, + customCert: {cert: "", key: ""}, dataOther: {}, rules: { - host: { required: true, message: "Please enter server address", trigger: "blur" }, + host: {required: true, message: "Please enter server address", trigger: "blur"}, port: [ - { required: true, message: "Please enter server port", trigger: "blur" }, + {required: true, message: "Please enter server port", trigger: "blur"}, { type: "number", message: "Please enter correct server port", trigger: ["blur", "change"], }, ], - issuer: { required: true, message: "Please enter system name", trigger: "blur" }, + issuer: {required: true, message: "Please enter system name", trigger: "blur"}, domain: { required: true, message: "Please enter the domain name for which you need to apply for a certificate", @@ -319,7 +327,7 @@ export default { message: "Please enter the email address for applying for the certificate", trigger: "blur", }, - name: { required: true, message: "Please select a domain name service provider", trigger: "blur" }, + name: {required: true, message: "Please select a domain name service provider", trigger: "blur"}, }, certUpload: "/set/other/customcert", dnsProvider: { diff --git a/web/src/pages/user/Online.vue b/web/src/pages/user/Online.vue index 63b74d4..a7ff7cb 100644 --- a/web/src/pages/user/Online.vue +++ b/web/src/pages/user/Online.vue @@ -1,6 +1,59 @@