mirror of https://github.com/tp4a/teleport
准备在Linux平台上进行打包测试。
parent
461c8d2dad
commit
f56277fc30
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from core import colorconsole as cc
|
from core import colorconsole as cc
|
||||||
from core import utils
|
from core import utils
|
||||||
from core.context import *
|
|
||||||
from core.ver import *
|
from core.ver import *
|
||||||
|
from core.context import *
|
||||||
from core.env import env
|
from core.env import env
|
||||||
|
|
||||||
ctx = BuildContext()
|
ctx = BuildContext()
|
||||||
|
@ -46,9 +46,9 @@ class BuilderWin(BuilderBase):
|
||||||
# utils.ensure_file_exists(out_file)
|
# utils.ensure_file_exists(out_file)
|
||||||
|
|
||||||
def build_installer(self):
|
def build_installer(self):
|
||||||
cc.i('build assist package for website...')
|
cc.i('build assist installer...')
|
||||||
|
|
||||||
name = 'teleport-assist-{}'.format(VER_TELEPORT_ASSIST)
|
name = 'teleport-assist-{}'.format(VER_TP_ASSIST)
|
||||||
|
|
||||||
out_path = os.path.join(env.root_path, 'out', 'installer')
|
out_path = os.path.join(env.root_path, 'out', 'installer')
|
||||||
utils.makedirs(out_path)
|
utils.makedirs(out_path)
|
||||||
|
@ -69,21 +69,14 @@ class BuilderWin(BuilderBase):
|
||||||
|
|
||||||
if os.path.exists(tmp_app_path):
|
if os.path.exists(tmp_app_path):
|
||||||
utils.remove(tmp_app_path)
|
utils.remove(tmp_app_path)
|
||||||
# if os.path.exists(tmp_cfg_path):
|
|
||||||
# utils.remove(tmp_cfg_path)
|
|
||||||
|
|
||||||
utils.makedirs(tmp_app_path)
|
utils.makedirs(tmp_app_path)
|
||||||
utils.makedirs(tmp_cfg_path)
|
utils.makedirs(tmp_cfg_path)
|
||||||
|
|
||||||
utils.copy_file(os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path), tmp_app_path, 'tp_assist.exe')
|
utils.copy_file(os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path), tmp_app_path, 'tp_assist.exe')
|
||||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'ssh.ini')
|
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist_win', 'cfg'), tmp_cfg_path, ('tp-assist.default.json', 'tp-assist.json'))
|
||||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'scp.ini')
|
|
||||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'telnet.ini')
|
|
||||||
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'ssh.ini')
|
|
||||||
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'scp.ini')
|
|
||||||
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'telnet.ini')
|
|
||||||
|
|
||||||
utils.copy_ex(os.path.join(env.root_path, 'client', 'tp_assist'), tmp_app_path, 'site')
|
utils.copy_ex(os.path.join(env.root_path, 'client', 'tp_assist_win'), tmp_app_path, 'site')
|
||||||
|
|
||||||
utils.makedirs(os.path.join(tmp_app_path, 'tools', 'putty'))
|
utils.makedirs(os.path.join(tmp_app_path, 'tools', 'putty'))
|
||||||
utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'putty'), os.path.join(tmp_app_path, 'tools', 'putty'), 'putty.exe')
|
utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'putty'), os.path.join(tmp_app_path, 'tools', 'putty'), 'putty.exe')
|
||||||
|
|
|
@ -10,6 +10,8 @@ from core.context import *
|
||||||
from core.ver import *
|
from core.ver import *
|
||||||
|
|
||||||
ctx = BuildContext()
|
ctx = BuildContext()
|
||||||
|
with_rdp = os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp'))
|
||||||
|
with_telnet = os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'telnet'))
|
||||||
|
|
||||||
|
|
||||||
# COMMON_MODULES = ['paste', 'pyasn1', 'pymemcache', 'pymysql', 'rsa', 'tornado', 'six.py']
|
# COMMON_MODULES = ['paste', 'pyasn1', 'pymemcache', 'pymysql', 'rsa', 'tornado', 'six.py']
|
||||||
|
@ -47,7 +49,7 @@ class BuilderBase:
|
||||||
class BuilderWin(BuilderBase):
|
class BuilderWin(BuilderBase):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.name = 'teleport-server-windows-{}-{}'.format(ctx.bits_path, VER_TP_WEB_SERVER)
|
self.name = 'teleport-server-windows-{}-{}'.format(ctx.bits_path, VER_TP_SERVER)
|
||||||
self._final_file = os.path.join(env.root_path, 'out', 'installer', '{}.zip'.format(self.name))
|
self._final_file = os.path.join(env.root_path, 'out', 'installer', '{}.zip'.format(self.name))
|
||||||
|
|
||||||
self.dist_path = os.path.join(env.root_path, 'dist', 'server')
|
self.dist_path = os.path.join(env.root_path, 'dist', 'server')
|
||||||
|
@ -73,7 +75,8 @@ class BuilderWin(BuilderBase):
|
||||||
utils.copy_ex(out_path, bin_path, 'tp_web.exe')
|
utils.copy_ex(out_path, bin_path, 'tp_web.exe')
|
||||||
utils.copy_ex(out_path, bin_path, 'tp_core.exe')
|
utils.copy_ex(out_path, bin_path, 'tp_core.exe')
|
||||||
utils.copy_ex(out_path, bin_path, 'tpssh.dll')
|
utils.copy_ex(out_path, bin_path, 'tpssh.dll')
|
||||||
utils.copy_ex(out_path, bin_path, 'tprdp.dll')
|
if with_rdp:
|
||||||
|
utils.copy_ex(out_path, bin_path, 'tprdp.dll')
|
||||||
|
|
||||||
utils.copy_ex(os.path.join(env.root_path, 'out', 'pysrt'), bin_path, (ctx.dist_path, 'pysrt'))
|
utils.copy_ex(os.path.join(env.root_path, 'out', 'pysrt'), bin_path, (ctx.dist_path, 'pysrt'))
|
||||||
|
|
||||||
|
@ -92,7 +95,7 @@ class BuilderWin(BuilderBase):
|
||||||
class BuilderLinux(BuilderBase):
|
class BuilderLinux(BuilderBase):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.name = 'teleport-server-linux-{}-{}'.format(ctx.bits_path, VER_TP_WEB_SERVER)
|
self.name = 'teleport-server-linux-{}-{}'.format(ctx.bits_path, VER_TP_SERVER)
|
||||||
self._final_file = os.path.join(env.root_path, 'out', 'installer', '{}.tar.gz'.format(self.name))
|
self._final_file = os.path.join(env.root_path, 'out', 'installer', '{}.tar.gz'.format(self.name))
|
||||||
|
|
||||||
self.dist_path = os.path.join(env.root_path, 'dist', 'server')
|
self.dist_path = os.path.join(env.root_path, 'dist', 'server')
|
||||||
|
@ -129,7 +132,8 @@ class BuilderLinux(BuilderBase):
|
||||||
utils.copy_ex(out_path, bin_path, 'tp_web')
|
utils.copy_ex(out_path, bin_path, 'tp_web')
|
||||||
utils.copy_ex(out_path, bin_path, 'tp_core')
|
utils.copy_ex(out_path, bin_path, 'tp_core')
|
||||||
utils.copy_ex(out_path, bin_path, 'libtpssh.so')
|
utils.copy_ex(out_path, bin_path, 'libtpssh.so')
|
||||||
utils.copy_ex(out_path, bin_path, 'libtprdp.so')
|
if with_rdp:
|
||||||
|
utils.copy_ex(out_path, bin_path, 'libtprdp.so')
|
||||||
|
|
||||||
utils.copy_ex(os.path.join(env.root_path, 'out', 'pysrt'), bin_path, (ctx.dist_path, 'pysrt'))
|
utils.copy_ex(os.path.join(env.root_path, 'out', 'pysrt'), bin_path, (ctx.dist_path, 'pysrt'))
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# import codecs
|
|
||||||
# import shutil
|
|
||||||
# import time
|
|
||||||
from core import colorconsole as cc
|
from core import colorconsole as cc
|
||||||
from core import utils
|
from core import utils
|
||||||
from core.context import *
|
from core.context import *
|
||||||
from core.env import env
|
from core.env import env
|
||||||
|
|
||||||
ctx = BuildContext()
|
ctx = BuildContext()
|
||||||
|
with_rdp = os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp'))
|
||||||
|
with_telnet = os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'telnet'))
|
||||||
|
|
||||||
|
|
||||||
class BuilderBase:
|
class BuilderBase:
|
||||||
|
@ -52,7 +51,7 @@ class BuilderWin(BuilderBase):
|
||||||
utils.msvc_build(sln_file, 'tpssh', ctx.target_path, ctx.bits_path, False)
|
utils.msvc_build(sln_file, 'tpssh', ctx.target_path, ctx.bits_path, False)
|
||||||
utils.ensure_file_exists(out_file)
|
utils.ensure_file_exists(out_file)
|
||||||
|
|
||||||
if os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'ssh', 'tpssh.vs2015.sln')):
|
if with_rdp:
|
||||||
cc.n('build RDP protocol ...')
|
cc.n('build RDP protocol ...')
|
||||||
sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp', 'tprdp.vs2015.sln')
|
sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp', 'tprdp.vs2015.sln')
|
||||||
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tprdp.dll')
|
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tprdp.dll')
|
||||||
|
@ -70,8 +69,11 @@ class BuilderLinux(BuilderBase):
|
||||||
cc.n('build server app (tp_core/libtpssh/tp_web)...')
|
cc.n('build server app (tp_core/libtpssh/tp_web)...')
|
||||||
|
|
||||||
out_path = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, 'bin')
|
out_path = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, 'bin')
|
||||||
out_files = [os.path.join(out_path, 'tp_core'), os.path.join(out_path, 'libtpssh.so'),
|
out_files = [os.path.join(out_path, 'tp_core'), os.path.join(out_path, 'tp_web')]
|
||||||
os.path.join(out_path, 'tp_web')]
|
out_files.extend(os.path.join(out_path, 'libtpssh.so'))
|
||||||
|
if with_rdp:
|
||||||
|
out_files.extend(os.path.join(out_path, 'libtprdp.so'))
|
||||||
|
# out_files.extend(os.path.join(out_path, 'libtptelnet.so'))
|
||||||
|
|
||||||
for f in out_files:
|
for f in out_files:
|
||||||
if os.path.exists(f):
|
if os.path.exists(f):
|
||||||
|
@ -95,8 +97,11 @@ class BuilderMacOS(BuilderBase):
|
||||||
cc.n('build server app (tp_core/libtpssh/tp_web)...')
|
cc.n('build server app (tp_core/libtpssh/tp_web)...')
|
||||||
|
|
||||||
out_path = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, 'bin')
|
out_path = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, 'bin')
|
||||||
out_files = [os.path.join(out_path, 'tp_core'), os.path.join(out_path, 'libtpssh.so'),
|
out_files = [os.path.join(out_path, 'tp_core'), os.path.join(out_path, 'tp_web')]
|
||||||
os.path.join(out_path, 'tp_web')]
|
out_files.extend(os.path.join(out_path, 'libtpssh.so'))
|
||||||
|
if with_rdp:
|
||||||
|
out_files.extend(os.path.join(out_path, 'libtprdp.so'))
|
||||||
|
# out_files.extend(os.path.join(out_path, 'libtptelnet.so'))
|
||||||
|
|
||||||
for f in out_files:
|
for f in out_files:
|
||||||
if os.path.exists(f):
|
if os.path.exists(f):
|
||||||
|
|
|
@ -23,4 +23,7 @@ ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
|
||||||
add_subdirectory(tp_core/core)
|
add_subdirectory(tp_core/core)
|
||||||
add_subdirectory(tp_core/protocol/ssh)
|
add_subdirectory(tp_core/protocol/ssh)
|
||||||
#add_subdirectory(tp_core/protocol/rdp)
|
|
||||||
|
IF (EXISTS tp_core/protocol/rdp)
|
||||||
|
add_subdirectory(tp_core/protocol/rdp)
|
||||||
|
ENDIF (EXISTS tp_core/protocol/rdp)
|
||||||
|
|
|
@ -810,7 +810,11 @@ int SshSession::_on_server_channel_data(ssh_session session, ssh_channel channel
|
||||||
else
|
else
|
||||||
auth_mode = "unknown";
|
auth_mode = "unknown";
|
||||||
|
|
||||||
|
#ifdef EX_OS_WIN32
|
||||||
|
int w = min(cp->win_width, 128);
|
||||||
|
#else
|
||||||
int w = std::min(cp->win_width, 128);
|
int w = std::min(cp->win_width, 128);
|
||||||
|
#endif
|
||||||
ex_astr line(w, '=');
|
ex_astr line(w, '=');
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
|
|
Loading…
Reference in New Issue