Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
koko
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
koko
Commits
657fbc18
Commit
657fbc18
authored
Aug 29, 2019
by
Eric_Lee
Committed by
Eric
Aug 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复关闭seesion的bug和移除无效的配置 (#80)
parent
b8654e70
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
16 deletions
+7
-16
config_example.yml
cmd/config_example.yml
+2
-14
sessmanager.go
pkg/proxy/sessmanager.go
+5
-2
No files found.
cmd/config_example.yml
View file @
657fbc18
...
...
@@ -30,27 +30,15 @@ BOOTSTRAP_TOKEN: <PleasgeChangeSameWithJumpserver>
# 设置日志级别 [DEBUG, INFO, WARN, ERROR, FATAL, CRITICAL]
# LOG_LEVEL: INFO
# 日志存放的目录
# LOG_DIR: logs
# SSH白名单
# ALLOW_SSH_USER: all
# SSH黑名单, 如果用户同时在白名单和黑名单,黑名单优先生效
# BLOCK_SSH_USER:
# -
# 和Jumpserver 保持心跳时间间隔
# 和Jumpserver 保持心跳时间间隔 (seconds)
# HEARTBEAT_INTERVAL: 5
# Admin的名字,出问题会提示给用户
# ADMINS: ''
# SSH连接超时时间 (default 15 seconds)
# SSH_TIMEOUT: 15
# 语言 [en,zh]
# LANG
UAGE_CODE
: zh
# LANG: zh
# SFTP的根目录, 可选 /tmp, Home其他自定义目录
# SFTP_ROOT: /tmp
...
...
pkg/proxy/sessmanager.go
View file @
657fbc18
...
...
@@ -17,19 +17,22 @@ var lock = new(sync.RWMutex)
func
HandleSessionTask
(
task
model
.
TerminalTask
)
{
switch
task
.
Name
{
case
"kill_session"
:
KillSession
(
task
.
Args
)
if
ok
:=
KillSession
(
task
.
Args
);
ok
{
service
.
FinishTask
(
task
.
ID
)
}
default
:
}
}
func
KillSession
(
sessionID
string
)
{
func
KillSession
(
sessionID
string
)
bool
{
lock
.
RLock
()
defer
lock
.
RUnlock
()
if
sw
,
ok
:=
sessionMap
[
sessionID
];
ok
{
sw
.
Terminate
()
return
true
}
return
false
}
func
GetAliveSessions
()
[]
string
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment