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
74582ea9
Unverified
Commit
74582ea9
authored
Feb 22, 2019
by
老广
Committed by
GitHub
Feb 22, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #191 from jumpserver/dev
Dev
parents
501877ce
2f893701
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
2 deletions
+39
-2
Dockerfile
Dockerfile
+1
-1
app.py
coco/app.py
+2
-0
cocod
cocod
+19
-1
entrypoint.sh
entrypoint.sh
+17
-0
No files found.
Dockerfile
View file @
74582ea9
...
@@ -17,4 +17,4 @@ VOLUME /opt/coco/data
...
@@ -17,4 +17,4 @@ VOLUME /opt/coco/data
RUN
echo
>
config.yml
RUN
echo
>
config.yml
EXPOSE
2222
EXPOSE
2222
CMD
python run_server.py
ENTRYPOINT
["./entrypoint.sh"]
coco/app.py
View file @
74582ea9
...
@@ -154,6 +154,8 @@ class Coco:
...
@@ -154,6 +154,8 @@ class Coco:
return
True
return
True
def
func
():
def
func
():
if
not
os
.
path
.
isdir
(
replay_dir
):
return
for
d
in
os
.
listdir
(
replay_dir
):
for
d
in
os
.
listdir
(
replay_dir
):
date_path
=
os
.
path
.
join
(
replay_dir
,
d
)
date_path
=
os
.
path
.
join
(
replay_dir
,
d
)
for
filename
in
os
.
listdir
(
date_path
):
for
filename
in
os
.
listdir
(
date_path
):
...
...
cocod
View file @
74582ea9
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
#
import
os
import
os
import
subprocess
if
os
.
environ
.
get
(
'USE_EVENTLET'
,
'1'
)
==
'1'
:
if
os
.
environ
.
get
(
'USE_EVENTLET'
,
'1'
)
==
'1'
:
import
eventlet
import
eventlet
...
@@ -17,13 +18,30 @@ import argparse
...
@@ -17,13 +18,30 @@ import argparse
import
time
import
time
import
signal
import
signal
BASE_DIR
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
sys
.
path
.
insert
(
0
,
BASE_DIR
)
dirs
=
(
'logs'
,
'keys'
)
dirs
=
(
'logs'
,
'keys'
)
for
d
in
dirs
:
for
d
in
dirs
:
d2
=
os
.
path
.
join
(
'data'
,
d
)
d2
=
os
.
path
.
join
(
'data'
,
d
)
if
not
os
.
path
.
isdir
(
d2
):
if
not
os
.
path
.
isdir
(
d2
):
os
.
makedirs
(
d2
)
os
.
makedirs
(
d2
)
from
coco
import
Coco
try
:
from
coco
import
Coco
except
ImportError
as
e
:
print
(
"Import error: {}"
.
format
(
e
))
print
(
"Sys path: {}"
.
format
(
sys
.
path
))
print
(
"Python is: "
)
print
(
subprocess
.
call
(
'which python'
,
shell
=
True
))
try
:
import
coco
print
(
"Coco is: {}"
.
format
(
coco
))
print
(
"Coco dir: {}"
.
format
(
os
.
listdir
(
"coco"
)))
except
:
pass
raise
try
:
try
:
from
coco.conf
import
config
from
coco.conf
import
config
...
...
entrypoint.sh
0 → 100755
View file @
74582ea9
#!/bin/bash
function
cleanup
()
{
local
pids
=
`
jobs
-p
`
if
[[
"
${
pids
}
"
!=
""
]]
;
then
kill
${
pids
}
>
/dev/null 2>/dev/null
fi
}
trap
cleanup EXIT
if
[[
"
$1
"
==
"bash"
]]
;
then
bash
else
python cocod start
fi
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