fix rdp replay data file re-location.

pull/32/head
Apex Liu 2017-04-16 14:39:17 +00:00
parent 4c47d82c68
commit 9bce1dbe1d
3 changed files with 10 additions and 2 deletions

View File

@ -63,7 +63,7 @@ bool TsEnv::init(bool load_config)
#else
m_etc_path = L"/etc/teleport";
conf_file = L"/etc/teleport/core.ini";
m_replay_path = L"/var/lib/teleport/data/replay";
m_replay_path = L"/var/lib/teleport/replay";
log_path = L"/var/log/teleport";
#endif
}

View File

@ -53,7 +53,8 @@ controllers = [
# add another path to static-path
# todo: 重放数据路径是动态从core服务的json-rpc接口获取的因此这里的数据获取方式需要改变
(r"/log/replay/(.*)", tornado.web.StaticFileHandler, {"path": os.path.join(cfg.data_path, 'replay')}),
#(r"/log/replay/(.*)", tornado.web.StaticFileHandler, {"path": os.path.join(cfg.data_path, 'replay')}),
(r"/log/replay/(.*)", record.ReplayStaticFileHandler, {"path": os.path.join(cfg.data_path, 'replay')}),
(r'/log/list', record.LogList),
(r'/log/record/(.*)/(.*)', record.RecordHandler),

View File

@ -9,6 +9,7 @@ from eom_app.app.configs import app_cfg
from eom_app.module import record
from eom_app.module import user
from .base import TPBaseAdminAuthHandler, TPBaseAdminAuthJsonHandler
import tornado.web
def get_free_space_bytes(folder):
@ -61,6 +62,12 @@ class RecordHandler(TPBaseAdminAuthHandler):
# # pass
# filename = os.path.join(cfg.core.replay_path, 'replay', 'rdp', '{}'.format(record_id), 'tp-rdp.tpr')
class ReplayStaticFileHandler(tornado.web.StaticFileHandler):
def initialize(self, path, default_filename=None):
super().initialize(path, default_filename)
self.root = app_cfg().core.replay_path
# self.default_filename = default_filename
class ComandLogHandler(TPBaseAdminAuthHandler):
def get(self, protocol, record_id):