Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
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
coco
Commits
634a514f
Commit
634a514f
authored
Jan 02, 2018
by
liuzheng712
Committed by
liuzheng
Jan 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of bitbucket.org:jumpserver/coco into dev
parents
d5bfe97b
4ae7b664
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
9 deletions
+8
-9
Dockerfile
Dockerfile
+1
-1
recorder.py
coco/recorder.py
+2
-3
session.py
coco/session.py
+4
-4
conf_docker.py
conf_docker.py
+1
-1
No files found.
Dockerfile
View file @
634a514f
FROM
jumpserver/python:v3
FROM
registry.fit2cloud.com/
jumpserver/python:v3
MAINTAINER
Jumpserver Team <ibuler@qq.com>
COPY
. /opt/coco
...
...
coco/recorder.py
View file @
634a514f
...
...
@@ -174,11 +174,10 @@ class ServerCommandRecorder(CommandRecorder, metaclass=Singleton):
thread
.
start
()
def
session_start
(
self
,
session_id
):
p
rint
(
"When session {} start exec"
.
format
(
session_id
))
p
ass
def
session_end
(
self
,
session_id
):
self
.
stop_evt
.
set
()
print
(
"When session {} end start"
.
format
(
session_id
))
pass
def
__del__
(
self
):
print
(
"{} has been gc"
.
format
(
self
))
...
...
coco/session.py
View file @
634a514f
...
...
@@ -21,7 +21,7 @@ class Session:
self
.
_sharers
=
[]
# Join to the session, read and write
self
.
replaying
=
True
self
.
date_created
=
datetime
.
datetime
.
now
()
self
.
date_
finishe
d
=
None
self
.
date_
en
d
=
None
self
.
stop_evt
=
threading
.
Event
()
self
.
sel
=
selectors
.
DefaultSelector
()
self
.
_command_recorder
=
command_recorder
...
...
@@ -160,7 +160,7 @@ class Session:
logger
.
info
(
"Close the session: {} "
.
format
(
self
.
id
))
self
.
stop_evt
.
set
()
self
.
post_bridge
()
self
.
date_
finishe
d
=
datetime
.
datetime
.
now
()
self
.
date_
en
d
=
datetime
.
datetime
.
now
()
self
.
server
.
close
()
def
to_json
(
self
):
...
...
@@ -172,7 +172,7 @@ class Session:
"login_from"
:
"ST"
,
"is_finished"
:
True
if
self
.
stop_evt
.
is_set
()
else
False
,
"date_start"
:
self
.
date_created
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
),
"date_
finished"
:
self
.
date_finished
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
self
.
date_finishe
d
else
None
"date_
end"
:
self
.
date_end
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
self
.
date_en
d
else
None
}
def
__str__
(
self
):
...
...
@@ -182,4 +182,4 @@ class Session:
return
self
.
id
def
__del__
(
self
):
logger
.
info
(
"Session {} object has been GC"
)
logger
.
info
(
"Session {} object has been GC"
.
format
(
self
.
id
)
)
conf_docker.py
View file @
634a514f
...
...
@@ -15,7 +15,7 @@ class Config:
# APP_NAME = "localhost"
# Jumpserver项目的url, api请求注册会使用
CORE_HOST
=
os
.
environ
.
get
(
"CORE_HOST"
)
or
'http://
jumpserver
:8080'
CORE_HOST
=
os
.
environ
.
get
(
"CORE_HOST"
)
or
'http://
core
:8080'
# 启动时绑定的ip, 默认 0.0.0.0
# BIND_HOST = '0.0.0.0'
...
...
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