Skip to content

Commit

Permalink
fix rdp replay data file re-location.
Browse files Browse the repository at this point in the history
  • Loading branch information
apexliu committed Apr 16, 2017
1 parent 4c47d82 commit 9bce1db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/tp_core/core/ts_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion server/www/teleport/app/eom_app/controller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
# 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),
Expand Down
7 changes: 7 additions & 0 deletions server/www/teleport/app/eom_app/controller/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
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):
Expand Down Expand Up @@ -61,6 +62,12 @@ def get(self, protocol, record_id):
# # 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):
Expand Down

0 comments on commit 9bce1db

Please sign in to comment.