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
680816ab
Commit
680816ab
authored
Feb 25, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of bitbucket.org:jumpserver/coco into dev
parents
39bb800b
2536cf8c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
recorder.py
coco/recorder.py
+10
-1
No files found.
coco/recorder.py
View file @
680816ab
...
...
@@ -243,6 +243,15 @@ class S3ReplayRecorder(ServerReplayRecorder):
def
__init__
(
self
,
app
):
super
()
.
__init__
(
app
)
self
.
bucket
=
app
.
config
[
"REPLAY_STORAGE"
]
.
get
(
"BUCKET"
,
"jumpserver"
)
self
.
REGION
=
app
.
config
[
"REPLAY_STORAGE"
]
.
get
(
"REGION"
,
None
)
self
.
ACCESS_KEY
=
app
.
config
[
"REPLAY_STORAGE"
]
.
get
(
"ACCESS_KEY"
,
None
)
self
.
SECRET_KEY
=
app
.
config
[
"REPLAY_STORAGE"
]
.
get
(
"SECRET_KEY"
,
None
)
if
self
.
ACCESS_KEY
and
self
.
REGION
and
self
.
SECRET_KEY
:
self
.
s3
=
boto3
.
client
(
's3'
,
region_name
=
self
.
REGION
,
aws_access_key_id
=
self
.
ACCESS_KEY
,
aws_secret_access_key
=
self
.
SECRET_KEY
)
else
:
self
.
s3
=
boto3
.
client
(
's3'
)
def
push_to_server
(
self
,
session_id
):
...
...
@@ -250,7 +259,7 @@ class S3ReplayRecorder(ServerReplayRecorder):
self
.
s3
.
upload_file
(
os
.
path
.
join
(
self
.
app
.
config
[
'LOG_DIR'
],
session_id
+
'.replay.gz'
),
self
.
bucket
,
time
.
strftime
(
'
%
Y-
%
m-
%
d'
,
time
.
localtime
(
self
.
app
.
config
.
get
(
"NAME"
,
"coco"
)
+
time
.
strftime
(
'
%
Y-
%
m-
%
d'
,
time
.
localtime
(
self
.
starttime
))
+
'/'
+
session_id
+
'.replay.gz'
)
except
:
return
self
.
app
.
service
.
push_session_replay
(
...
...
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