Unverified Commit 74582ea9 authored by 老广's avatar 老广 Committed by GitHub

Merge pull request #191 from jumpserver/dev

Dev
parents 501877ce 2f893701
......@@ -17,4 +17,4 @@ VOLUME /opt/coco/data
RUN echo > config.yml
EXPOSE 2222
CMD python run_server.py
ENTRYPOINT ["./entrypoint.sh"]
......@@ -154,6 +154,8 @@ class Coco:
return True
def func():
if not os.path.isdir(replay_dir):
return
for d in os.listdir(replay_dir):
date_path = os.path.join(replay_dir, d)
for filename in os.listdir(date_path):
......
......@@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
#
import os
import subprocess
if os.environ.get('USE_EVENTLET', '1') == '1':
import eventlet
......@@ -17,13 +18,30 @@ import argparse
import time
import signal
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, BASE_DIR)
dirs = ('logs', 'keys')
for d in dirs:
d2 = os.path.join('data', d)
if not os.path.isdir(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:
from coco.conf import config
......
#!/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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment