mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-09-28 16:15:17 +08:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9e0da33c6a | ||
|
3bb771971c | ||
|
dd83b330eb | ||
|
73d1edd62f |
10
README.md
10
README.md
@@ -124,6 +124,16 @@ sh bridge-init.sh
|
|||||||
|
|
||||||
相关软件下载: https://gitee.com/bjdgyc/anylink-soft
|
相关软件下载: https://gitee.com/bjdgyc/anylink-soft
|
||||||
|
|
||||||
|
## Discussion
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
添加QQ群: 567510628
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
|
||||||
|
欢迎提交 PR、Issues,感谢为AnyLink做出贡献
|
||||||
|
|
||||||
## Other Screenshot
|
## Other Screenshot
|
||||||
|
|
||||||

|

|
||||||
|
@@ -100,7 +100,11 @@ func UserSet(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// 发送邮件
|
// 发送邮件
|
||||||
if data.SendEmail {
|
if data.SendEmail {
|
||||||
userAccountMail(data)
|
err = userAccountMail(data)
|
||||||
|
if err != nil {
|
||||||
|
RespError(w, RespInternalErr, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RespSucess(w, nil)
|
RespSucess(w, nil)
|
||||||
@@ -171,6 +175,13 @@ func UserOffline(w http.ResponseWriter, r *http.Request) {
|
|||||||
RespSucess(w, nil)
|
RespSucess(w, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func UserReline(w http.ResponseWriter, r *http.Request) {
|
||||||
|
r.ParseForm()
|
||||||
|
token := r.FormValue("token")
|
||||||
|
sessdata.CloseCSess(token)
|
||||||
|
RespSucess(w, nil)
|
||||||
|
}
|
||||||
|
|
||||||
type userAccountMailData struct {
|
type userAccountMailData struct {
|
||||||
Issuer string
|
Issuer string
|
||||||
LinkAddr string
|
LinkAddr string
|
||||||
|
@@ -68,7 +68,9 @@ func SendMail(subject, to, htmlBody string) error {
|
|||||||
server.Port = dataSmtp.Port
|
server.Port = dataSmtp.Port
|
||||||
server.Username = dataSmtp.Username
|
server.Username = dataSmtp.Username
|
||||||
server.Password = dataSmtp.Password
|
server.Password = dataSmtp.Password
|
||||||
// server.Encryption = mail.EncryptionTLS
|
if dataSmtp.UseSSl {
|
||||||
|
server.Encryption = mail.EncryptionSSL
|
||||||
|
}
|
||||||
|
|
||||||
// Since v2.3.0 you can specified authentication type:
|
// Since v2.3.0 you can specified authentication type:
|
||||||
// - PLAIN (default)
|
// - PLAIN (default)
|
||||||
|
@@ -35,6 +35,7 @@ func StartAdmin() {
|
|||||||
r.HandleFunc("/user/del", UserDel)
|
r.HandleFunc("/user/del", UserDel)
|
||||||
r.HandleFunc("/user/online", UserOnline)
|
r.HandleFunc("/user/online", UserOnline)
|
||||||
r.HandleFunc("/user/offline", UserOffline)
|
r.HandleFunc("/user/offline", UserOffline)
|
||||||
|
r.HandleFunc("/user/reline", UserReline)
|
||||||
r.HandleFunc("/user/otp_qr", UserOtpQr)
|
r.HandleFunc("/user/otp_qr", UserOtpQr)
|
||||||
r.HandleFunc("/user/ip_map/list", UserIpMapList)
|
r.HandleFunc("/user/ip_map/list", UserIpMapList)
|
||||||
r.HandleFunc("/user/ip_map/detail", UserIpMapDetail)
|
r.HandleFunc("/user/ip_map/detail", UserIpMapDetail)
|
||||||
|
@@ -2,5 +2,5 @@ package base
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
APP_NAME = "AnyLink"
|
APP_NAME = "AnyLink"
|
||||||
APP_VER = "0.0.8"
|
APP_VER = "0.1.0"
|
||||||
)
|
)
|
||||||
|
@@ -18,13 +18,15 @@ type GroupLinkAcl struct {
|
|||||||
// 自上而下匹配 默认 allow * *
|
// 自上而下匹配 默认 allow * *
|
||||||
Action string `json:"action"` // allow、deny
|
Action string `json:"action"` // allow、deny
|
||||||
Val string `json:"val"`
|
Val string `json:"val"`
|
||||||
Port uint8 `json:"port"`
|
Port uint16 `json:"port"`
|
||||||
IpNet *net.IPNet `json:"ip_net"`
|
IpNet *net.IPNet `json:"ip_net"`
|
||||||
|
Note string `json:"note"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ValData struct {
|
type ValData struct {
|
||||||
Val string `json:"val"`
|
Val string `json:"val"`
|
||||||
IpMask string `json:"ip_mask"`
|
IpMask string `json:"ip_mask"`
|
||||||
|
Note string `json:"note"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Group struct {
|
type Group struct {
|
||||||
|
@@ -38,6 +38,7 @@ type SettingSmtp struct {
|
|||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
Password string `json:"password"`
|
Password string `json:"password"`
|
||||||
From string `json:"from"`
|
From string `json:"from"`
|
||||||
|
UseSSl bool `json:"use_ssl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SettingOther struct {
|
type SettingOther struct {
|
||||||
|
3
main.go
3
main.go
@@ -1,4 +1,7 @@
|
|||||||
// AnyLink 是一个企业级远程办公vpn软件,可以支持多人同时在线使用。
|
// AnyLink 是一个企业级远程办公vpn软件,可以支持多人同时在线使用。
|
||||||
|
|
||||||
|
// +build linux
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
BIN
screenshot/qq.png
Normal file
BIN
screenshot/qq.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
@@ -296,6 +296,17 @@ func CloseSess(token string) {
|
|||||||
sess.CSess.Close()
|
sess.CSess.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CloseCSess(token string) {
|
||||||
|
sessMux.Lock()
|
||||||
|
defer sessMux.Unlock()
|
||||||
|
sess, ok := sessions[token]
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
sess.CSess.Close()
|
||||||
|
}
|
||||||
|
|
||||||
func DelSessByStoken(stoken string) {
|
func DelSessByStoken(stoken string) {
|
||||||
stoken = strings.TrimSpace(stoken)
|
stoken = strings.TrimSpace(stoken)
|
||||||
sarr := strings.Split(stoken, "@")
|
sarr := strings.Split(stoken, "@")
|
||||||
|
Reference in New Issue
Block a user