mirror of https://github.com/bjdgyc/anylink.git
commit
ca4626879d
|
@ -31,8 +31,9 @@ WORKDIR /app
|
|||
COPY --from=builder_golang /anylink/server/anylink /app/
|
||||
COPY docker_entrypoint.sh /app/
|
||||
|
||||
COPY ./server/bridge-init.sh /app/
|
||||
COPY ./server/conf /app/conf
|
||||
COPY ./server/files /app/conf/files
|
||||
#COPY ./server/files /app/conf/files
|
||||
|
||||
|
||||
#TODO 本地打包时使用镜像
|
||||
|
|
|
@ -182,16 +182,16 @@ sh bridge-init.sh
|
|||
|
||||
## Systemd
|
||||
|
||||
添加 systemd 脚本
|
||||
1. 添加 anylink 程序
|
||||
|
||||
- anylink 程序目录放入 `/usr/local/anylink-deploy`
|
||||
|
||||
systemd 脚本放入:
|
||||
2. systemd/anylink.service 脚本放入:
|
||||
|
||||
- centos: `/usr/lib/systemd/system/`
|
||||
- ubuntu: `/lib/systemd/system/`
|
||||
|
||||
操作命令:
|
||||
3. 操作命令:
|
||||
|
||||
- 启动: `systemctl start anylink`
|
||||
- 停止: `systemctl stop anylink`
|
||||
|
|
|
@ -2,6 +2,6 @@ package base
|
|||
|
||||
const (
|
||||
APP_NAME = "AnyLink"
|
||||
// 添加macvtap支持
|
||||
APP_VER = "0.6.1"
|
||||
// 修复前端bug
|
||||
APP_VER = "0.6.2"
|
||||
)
|
||||
|
|
|
@ -55,7 +55,7 @@ var configs = []config{
|
|||
{Typ: cfgInt, Name: "mobile_dpd", Usage: "移动端死链接检测时间(秒)", ValInt: 60},
|
||||
{Typ: cfgInt, Name: "session_timeout", Usage: "session过期时间(秒)", ValInt: 3600},
|
||||
// {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{}
|
||||
|
|
|
@ -62,7 +62,7 @@ mobile_dpd = 50
|
|||
#session过期时间,用于断线重连,0永不过期
|
||||
session_timeout = 3600
|
||||
auth_timeout = 0
|
||||
|
||||
audit_interval = -1
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -100,15 +100,11 @@ func checkLinkAcl(group *dbdata.Group, pl *sessdata.Payload) bool {
|
|||
|
||||
// 访问日志审计
|
||||
func logAudit(cSess *sessdata.ConnSession, pl *sessdata.Payload) {
|
||||
if base.Cfg.AuditInterval <= 0 {
|
||||
if base.Cfg.AuditInterval < 0 {
|
||||
return
|
||||
}
|
||||
|
||||
ipSrc := waterutil.IPv4Source(pl.Data)
|
||||
ipDst := waterutil.IPv4Destination(pl.Data)
|
||||
ipPort := waterutil.IPv4DestinationPort(pl.Data)
|
||||
ipProto := waterutil.IPv4Protocol(pl.Data)
|
||||
|
||||
// 只统计 tcp和udp 的访问
|
||||
switch ipProto {
|
||||
case waterutil.TCP:
|
||||
|
@ -117,6 +113,10 @@ func logAudit(cSess *sessdata.ConnSession, pl *sessdata.Payload) {
|
|||
return
|
||||
}
|
||||
|
||||
ipSrc := waterutil.IPv4Source(pl.Data)
|
||||
ipDst := waterutil.IPv4Destination(pl.Data)
|
||||
ipPort := waterutil.IPv4DestinationPort(pl.Data)
|
||||
|
||||
b := getByte34()
|
||||
key := *b
|
||||
copy(key[:16], ipSrc)
|
||||
|
|
|
@ -186,10 +186,14 @@ func (s *Session) NewConn() *ConnSession {
|
|||
PayloadIn: make(chan *Payload, 64),
|
||||
PayloadOutCstp: make(chan *Payload, 64),
|
||||
PayloadOutDtls: make(chan *Payload, 64),
|
||||
IpAuditMap: make(map[string]int64, 512),
|
||||
dSess: &atomic.Value{},
|
||||
}
|
||||
|
||||
// ip 审计
|
||||
if base.Cfg.AuditInterval >= 0 {
|
||||
cSess.IpAuditMap = make(map[string]int64, 512)
|
||||
}
|
||||
|
||||
dSess := &DtlsSession{
|
||||
isActive: -1,
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
File diff suppressed because it is too large
Load Diff
|
@ -9,14 +9,12 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.21.1",
|
||||
"caniuse-lite": "^1.0.30001242",
|
||||
"chokidar": "^3.5.2",
|
||||
"core-js": "^3.6.5",
|
||||
"echarts": "^4.9.0",
|
||||
"element-ui": "^2.4.5",
|
||||
"vue": "^2.6.11",
|
||||
"vue-count-to": "^1.0.13",
|
||||
"vue-router": "^3.4.6"
|
||||
"vue-router": "^3.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
|
@ -26,7 +24,25 @@
|
|||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"vue-cli-plugin-element": "~1.0.1",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"path-parse": "1.0.7"
|
||||
}
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/essential",
|
||||
"eslint:recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint"
|
||||
},
|
||||
"rules": {}
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -118,8 +118,8 @@
|
|||
|
||||
<el-popconfirm
|
||||
style="margin-left: 10px"
|
||||
@onConfirm="handleDel(scope.row)"
|
||||
title="确定要删除用户吗?">
|
||||
@confirm="handleDel(scope.row)"
|
||||
title="确定要删除用户组吗?">
|
||||
<el-button
|
||||
slot="reference"
|
||||
size="mini"
|
||||
|
|
|
@ -52,13 +52,12 @@
|
|||
<template slot-scope="scope">
|
||||
<el-popconfirm
|
||||
class="m-left-10"
|
||||
@onConfirm="handleDel(scope.row)"
|
||||
@confirm="handleDel(scope.row)"
|
||||
title="确定要删除审计日志吗?">
|
||||
<el-button
|
||||
slot="reference"
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)">删除
|
||||
type="danger">删除
|
||||
</el-button>
|
||||
</el-popconfirm>
|
||||
|
||||
|
@ -85,7 +84,7 @@
|
|||
import axios from "axios";
|
||||
|
||||
export default {
|
||||
name: "IpMap",
|
||||
name: "Audit",
|
||||
components: {},
|
||||
mixins: [],
|
||||
created() {
|
||||
|
|
|
@ -76,13 +76,12 @@
|
|||
|
||||
<el-popconfirm
|
||||
class="m-left-10"
|
||||
@onConfirm="handleDel(scope.row)"
|
||||
@confirm="handleDel(scope.row)"
|
||||
title="确定要删除IP映射吗?">
|
||||
<el-button
|
||||
slot="reference"
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)">删除
|
||||
type="danger">删除
|
||||
</el-button>
|
||||
</el-popconfirm>
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@
|
|||
|
||||
<el-popconfirm
|
||||
class="m-left-10"
|
||||
@onConfirm="handleDel(scope.row)"
|
||||
@confirm="handleDel(scope.row)"
|
||||
title="确定要删除用户吗?">
|
||||
<el-button
|
||||
slot="reference"
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
|
||||
<el-popconfirm
|
||||
class="m-left-10"
|
||||
@onConfirm="handleOffline(scope.row)"
|
||||
@confirm="handleOffline(scope.row)"
|
||||
title="确定要下线用户吗?">
|
||||
<el-button
|
||||
slot="reference"
|
||||
|
|
Loading…
Reference in New Issue