Merge pull request #57 from bjdgyc/dev

修复前端bug
This commit is contained in:
bjdgyc 2021-08-26 15:43:02 +08:00 committed by GitHub
commit ca4626879d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 27637 additions and 40 deletions

View File

@ -31,8 +31,9 @@ WORKDIR /app
COPY --from=builder_golang /anylink/server/anylink /app/ COPY --from=builder_golang /anylink/server/anylink /app/
COPY docker_entrypoint.sh /app/ COPY docker_entrypoint.sh /app/
COPY ./server/bridge-init.sh /app/
COPY ./server/conf /app/conf COPY ./server/conf /app/conf
COPY ./server/files /app/conf/files #COPY ./server/files /app/conf/files
#TODO 本地打包时使用镜像 #TODO 本地打包时使用镜像

View File

@ -182,20 +182,20 @@ sh bridge-init.sh
## Systemd ## Systemd
添加 systemd 脚本 1. 添加 anylink 程序
- anylink 程序目录放入 `/usr/local/anylink-deploy` - anylink 程序目录放入 `/usr/local/anylink-deploy`
systemd 脚本放入: 2. systemd/anylink.service 脚本放入:
- centos: `/usr/lib/systemd/system/` - centos: `/usr/lib/systemd/system/`
- ubuntu: `/lib/systemd/system/` - ubuntu: `/lib/systemd/system/`
操作命令: 3. 操作命令:
- 启动: `systemctl start anylink` - 启动: `systemctl start anylink`
- 停止: `systemctl stop anylink` - 停止: `systemctl stop anylink`
- 开机自启: `systemctl enable anylink` - 开机自启: `systemctl enable anylink`
## Docker ## Docker

View File

@ -2,6 +2,6 @@ package base
const ( const (
APP_NAME = "AnyLink" APP_NAME = "AnyLink"
// 添加macvtap支持 // 修复前端bug
APP_VER = "0.6.1" APP_VER = "0.6.2"
) )

View File

@ -55,7 +55,7 @@ var configs = []config{
{Typ: cfgInt, Name: "mobile_dpd", Usage: "移动端死链接检测时间(秒)", ValInt: 60}, {Typ: cfgInt, Name: "mobile_dpd", Usage: "移动端死链接检测时间(秒)", ValInt: 60},
{Typ: cfgInt, Name: "session_timeout", Usage: "session过期时间(秒)", ValInt: 3600}, {Typ: cfgInt, Name: "session_timeout", Usage: "session过期时间(秒)", ValInt: 3600},
// {Typ: cfgInt, Name: "auth_timeout", Usage: "auth_timeout", ValInt: 0}, // {Typ: cfgInt, Name: "auth_timeout", Usage: "auth_timeout", ValInt: 0},
{Typ: cfgInt, Name: "audit_interval", Usage: "审计去重间隔(秒),0关闭", ValInt: 0}, {Typ: cfgInt, Name: "audit_interval", Usage: "审计去重间隔(秒),-1关闭", ValInt: -1},
} }
var envs = map[string]string{} var envs = map[string]string{}

View File

@ -62,7 +62,7 @@ mobile_dpd = 50
#session过期时间用于断线重连0永不过期 #session过期时间用于断线重连0永不过期
session_timeout = 3600 session_timeout = 3600
auth_timeout = 0 auth_timeout = 0
audit_interval = -1

View File

@ -100,15 +100,11 @@ func checkLinkAcl(group *dbdata.Group, pl *sessdata.Payload) bool {
// 访问日志审计 // 访问日志审计
func logAudit(cSess *sessdata.ConnSession, pl *sessdata.Payload) { func logAudit(cSess *sessdata.ConnSession, pl *sessdata.Payload) {
if base.Cfg.AuditInterval <= 0 { if base.Cfg.AuditInterval < 0 {
return return
} }
ipSrc := waterutil.IPv4Source(pl.Data)
ipDst := waterutil.IPv4Destination(pl.Data)
ipPort := waterutil.IPv4DestinationPort(pl.Data)
ipProto := waterutil.IPv4Protocol(pl.Data) ipProto := waterutil.IPv4Protocol(pl.Data)
// 只统计 tcp和udp 的访问 // 只统计 tcp和udp 的访问
switch ipProto { switch ipProto {
case waterutil.TCP: case waterutil.TCP:
@ -117,6 +113,10 @@ func logAudit(cSess *sessdata.ConnSession, pl *sessdata.Payload) {
return return
} }
ipSrc := waterutil.IPv4Source(pl.Data)
ipDst := waterutil.IPv4Destination(pl.Data)
ipPort := waterutil.IPv4DestinationPort(pl.Data)
b := getByte34() b := getByte34()
key := *b key := *b
copy(key[:16], ipSrc) copy(key[:16], ipSrc)

View File

@ -186,10 +186,14 @@ func (s *Session) NewConn() *ConnSession {
PayloadIn: make(chan *Payload, 64), PayloadIn: make(chan *Payload, 64),
PayloadOutCstp: make(chan *Payload, 64), PayloadOutCstp: make(chan *Payload, 64),
PayloadOutDtls: make(chan *Payload, 64), PayloadOutDtls: make(chan *Payload, 64),
IpAuditMap: make(map[string]int64, 512),
dSess: &atomic.Value{}, dSess: &atomic.Value{},
} }
// ip 审计
if base.Cfg.AuditInterval >= 0 {
cSess.IpAuditMap = make(map[string]int64, 512)
}
dSess := &DtlsSession{ dSess := &DtlsSession{
isActive: -1, isActive: -1,
} }

View File

@ -1,3 +0,0 @@
> 1%
last 2 versions
not dead

27581
web/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -9,14 +9,12 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"caniuse-lite": "^1.0.30001242",
"chokidar": "^3.5.2",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"echarts": "^4.9.0", "echarts": "^4.9.0",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-count-to": "^1.0.13", "vue-count-to": "^1.0.13",
"vue-router": "^3.4.6" "vue-router": "^3.5.2"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",
@ -26,7 +24,25 @@
"eslint": "^6.7.2", "eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^6.2.2",
"vue-cli-plugin-element": "~1.0.1", "vue-cli-plugin-element": "~1.0.1",
"vue-template-compiler": "^2.6.11", "vue-template-compiler": "^2.6.11"
"path-parse": "1.0.7" },
} "eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
} }

View File

@ -118,8 +118,8 @@
<el-popconfirm <el-popconfirm
style="margin-left: 10px" style="margin-left: 10px"
@onConfirm="handleDel(scope.row)" @confirm="handleDel(scope.row)"
title="确定要删除用户吗?"> title="确定要删除用户吗?">
<el-button <el-button
slot="reference" slot="reference"
size="mini" size="mini"

View File

@ -52,13 +52,12 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-popconfirm <el-popconfirm
class="m-left-10" class="m-left-10"
@onConfirm="handleDel(scope.row)" @confirm="handleDel(scope.row)"
title="确定要删除审计日志吗?"> title="确定要删除审计日志吗?">
<el-button <el-button
slot="reference" slot="reference"
size="mini" size="mini"
type="danger" type="danger">删除
@click="handleDelete(scope.row)">删除
</el-button> </el-button>
</el-popconfirm> </el-popconfirm>
@ -85,7 +84,7 @@
import axios from "axios"; import axios from "axios";
export default { export default {
name: "IpMap", name: "Audit",
components: {}, components: {},
mixins: [], mixins: [],
created() { created() {

View File

@ -76,13 +76,12 @@
<el-popconfirm <el-popconfirm
class="m-left-10" class="m-left-10"
@onConfirm="handleDel(scope.row)" @confirm="handleDel(scope.row)"
title="确定要删除IP映射吗"> title="确定要删除IP映射吗">
<el-button <el-button
slot="reference" slot="reference"
size="mini" size="mini"
type="danger" type="danger">删除
@click="handleDelete(scope.row)">删除
</el-button> </el-button>
</el-popconfirm> </el-popconfirm>

View File

@ -120,7 +120,7 @@
<el-popconfirm <el-popconfirm
class="m-left-10" class="m-left-10"
@onConfirm="handleDel(scope.row)" @confirm="handleDel(scope.row)"
title="确定要删除用户吗?"> title="确定要删除用户吗?">
<el-button <el-button
slot="reference" slot="reference"

View File

@ -95,7 +95,7 @@
<el-popconfirm <el-popconfirm
class="m-left-10" class="m-left-10"
@onConfirm="handleOffline(scope.row)" @confirm="handleOffline(scope.row)"
title="确定要下线用户吗?"> title="确定要下线用户吗?">
<el-button <el-button
slot="reference" slot="reference"