We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8d92cac + bac4974 commit fa5ced4Copy full SHA for fa5ced4
.gitignore
@@ -2,6 +2,7 @@
2
.idea/
3
anylink-deploy
4
anylink-deploy.tar.gz
5
+anylink-deploy-*
6
anylink
7
anylink.db
8
README.md
@@ -26,7 +26,7 @@ AnyLink 基于 [ietf-openconnect](https://tools.ietf.org/html/draft-mavrogiannop
26
AnyLink 使用 TLS/DTLS 进行数据加密,因此需要 RSA 或 ECC 证书,可以通过 Let's Encrypt 和 TrustAsia 申请免费的 SSL 证书。
27
28
AnyLink 服务端仅在 CentOS 7、CentOS 8、Ubuntu 18.04、Ubuntu 20.04 测试通过,如需要安装在其他系统,需要服务端支持 tun/tap
29
-功能、ip 设置命令。
+功能、ip 设置命令、iptables命令。
30
31
## Screenshot
32
@@ -74,18 +74,22 @@ AnyLink 服务端仅在 CentOS 7、CentOS 8、Ubuntu 18.04、Ubuntu 20.04 测试
74
75
### 自行编译安装
76
77
-> 需要提前安装好 golang >= 1.20 和 nodejs = 16.x 和 yarn >= v1.22.x
+> 需要提前安装好 docker
78
79
```shell
80
git clone https://github.com/bjdgyc/anylink.git
81
82
-# 编译参考软件版本
+# docker编译 参考软件版本(不需要安装)
83
# go 1.20.12
84
# node v16.20.2
85
# yarn 1.22.19
86
87
88
cd anylink
89
+
90
+# 编译前端
91
+bash build_web.sh
92
+# 编译 anylink-deploy 发布文件
93
bash build.sh
94
95
# 注意使用root权限运行
build.sh
@@ -7,15 +7,22 @@ ver=$(cat version)
echo $ver
9
#前端编译 仅需要执行一次
10
-bash ./build_web.sh
+#bash ./build_web.sh
11
12
-cd $cpath/server
+bash build_docker.sh
13
14
-go build -v -o anylink
+deploy="anylink-deploy-$ver"
15
+docker container rm $deploy
16
+docker container create --name $deploy bjdgyc/anylink:$ver
17
+rm -rf anylink-deploy anylink-deploy.tar.gz
18
+docker cp -a $deploy:/app ./anylink-deploy
19
+tar zcf ${deploy}.tar.gz anylink-deploy
20
-./anylink -v
21
22
+./anylink-deploy/anylink -v
23
-echo "anylink 编译完成,目录: $cpath/server/anylink"
24
25
+echo "anylink 编译完成,目录: anylink-deploy"
+ls -lh anylink-deploy
build_docker.sh
@@ -11,8 +11,9 @@ echo $ver
#bash ./build_web.sh
# docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 本地不生成镜像
-docker build -t bjdgyc/anylink:latest --no-cache --progress=plain --platform linux/amd64 \
- --build-arg CN="yes" --build-arg appVer=$ver --build-arg commitId=$(git rev-parse HEAD) -f docker/Dockerfile .
+docker build -t bjdgyc/anylink:latest --no-cache --progress=plain \
+ --build-arg CN="yes" --build-arg appVer=$ver --build-arg commitId=$(git rev-parse HEAD) \
+ -f docker/Dockerfile .
echo "docker tag latest $ver"
docker tag bjdgyc/anylink:latest bjdgyc/anylink:$ver
doc/question.md
@@ -10,6 +10,10 @@
> 请使用手机安装 freeotp ,然后扫描otp二维码,生成的数字即是动态码
+### 用户策略问题
+> 只要有用户策略,组策略就不生效,相当于覆盖了组策略的配置
### 远程桌面连接
> 本软件已经支持远程桌面里面连接anyconnect。
server/admin/api_user.go
@@ -17,6 +17,7 @@ import (
"github.com/bjdgyc/anylink/dbdata"
"github.com/bjdgyc/anylink/sessdata"
"github.com/skip2/go-qrcode"
+ mail "github.com/xhit/go-simple-mail/v2"
)
func UserList(w http.ResponseWriter, r *http.Request) {
@@ -272,5 +273,13 @@ func userAccountMail(user *dbdata.User) error {
272
273
return err
274
}
275
// fmt.Println(w.String())
- return SendMail(base.Cfg.Issuer+"平台通知", user.Email, w.String())
276
+ imgData, _ := userOtpQr(user.Id, false)
277
+ attach := &mail.File{
278
+ MimeType: "image/png",
279
+ Name: "userOtpQr.png",
280
+ Data: []byte(imgData),
281
+ Inline: true,
282
+ }
283
284
+ return SendMail(base.Cfg.Issuer, user.Email, w.String(), attach)
285
server/admin/common.go
@@ -43,7 +43,7 @@ func GetJwtData(jwtToken string) (map[string]interface{}, error) {
43
return claims, nil
44
45
46
-func SendMail(subject, to, htmlBody string) error {
+func SendMail(subject, to, htmlBody string, attach *mail.File) error {
47
48
dataSmtp := &dbdata.SettingSmtp{}
49
err := dbdata.SettingGet(dataSmtp)
@@ -102,6 +102,10 @@ func SendMail(subject, to, htmlBody string) error {
102
AddTo(to).
103
SetSubject(subject)
104
105
+ if attach != nil {
106
+ email.Attach(attach)
107
108
109
email.SetBody(mail.TextHTML, htmlBody)
110
111
// Call Send and pass the client
server/base/config.go
@@ -55,9 +55,9 @@ var configs = []config{
55
{Typ: cfgInt, Name: "max_client", Usage: "最大用户连接", ValInt: 200},
56
{Typ: cfgInt, Name: "max_user_client", Usage: "最大单用户连接", ValInt: 3},
57
{Typ: cfgInt, Name: "cstp_keepalive", Usage: "keepalive时间(秒)", ValInt: 3},
58
- {Typ: cfgInt, Name: "cstp_dpd", Usage: "死链接检测时间(秒)", ValInt: 10},
+ {Typ: cfgInt, Name: "cstp_dpd", Usage: "死链接检测时间(秒)", ValInt: 20},
59
{Typ: cfgInt, Name: "mobile_keepalive", Usage: "移动端keepalive接检测时间(秒)", ValInt: 4},
60
- {Typ: cfgInt, Name: "mobile_dpd", Usage: "移动端死链接检测时间(秒)", ValInt: 15},
+ {Typ: cfgInt, Name: "mobile_dpd", Usage: "移动端死链接检测时间(秒)", ValInt: 60},
61
{Typ: cfgInt, Name: "mtu", Usage: "最大传输单元MTU", ValInt: 1460},
62
{Typ: cfgInt, Name: "idle_timeout", Usage: "空闲链接超时时间(秒)-超时后断开链接,0关闭此功能", ValInt: 0},
63
{Typ: cfgInt, Name: "session_timeout", Usage: "session过期时间(秒)-用于断线重连,0永不过期", ValInt: 3600},
server/conf/server-sample.toml
@@ -12,9 +12,15 @@ cert_key = "./conf/vpn_cert.key"
files_path = "./conf/files"
profile = "./conf/profile.xml"
#profile name(用于区分不同服务端的配置)
-#客户端存放位置 C:\ProgramData\Cisco\Cisco Secure Client\VPN\Profile
+#客户端存放位置
+#Windows 10
+#%ProgramData%Cisco\Cisco AnyConnect Secure Mobility Client\Profile
+#Mac Os X
+#/opt/cisco/anyconnect/profile
+#Linux
profile_name = "anylink"
-#日志目录,为空写入标准输出
+#日志目录,默认为空写入标准输出
#log_path = "./log"
log_path = ""
log_level = "debug"
@@ -66,9 +72,9 @@ default_group = "one"
66
72
67
73
#客户端失效检测时间(秒) dpd > keepalive
68
cstp_keepalive = 3
69
-cstp_dpd = 10
+cstp_dpd = 20
70
mobile_keepalive = 4
71
-mobile_dpd = 15
+mobile_dpd = 60
# 根据实际情况修改
#cstp_keepalive = 20
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"
+#log_path = "./log"
#系统名称
0 commit comments