@@ -40,23 +40,36 @@ def mask_x_tunnel_password(fp):
4040 return dat_str
4141
4242
43+ def get_launcher_port ():
44+ launcher_config_fn = os .path .join (data_path , "launcher" , "config.json" )
45+ try :
46+ with open (launcher_config_fn , "r" ) as fd :
47+ info = json .load (fd )
48+ return info .get ("control_port" , 8085 )
49+ except Exception as e :
50+ xlog .exception ("get_launcher_port except:%r" , e )
51+ return 8085
52+
53+
4354def collect_debug_and_log ():
55+ port = get_launcher_port ()
56+
4457 # collect debug info and save to folders
4558 debug_infos = {
46- "system_info" : "http://127.0.0.1:8085 /debug" ,
47- "gae_info" : "http://127.0.0.1:8085 /module/gae_proxy/control/debug" ,
48- "gae_log" : "http://127.0.0.1:8085 /module/gae_proxy/control/log?cmd=get_new&last_no=1" ,
49- "xtunnel_info" : "http://127.0.0.1:8085 /module/x_tunnel/control/debug" ,
50- "xtunnel_status" : "http://127.0.0.1:8085 /module/x_tunnel/control/status" ,
51- "cloudflare_info" : "http://127.0.0.1:8085 /module/x_tunnel/control/cloudflare_front/debug" ,
52- "tls_info" : "http://127.0.0.1:8085 /module/x_tunnel/control/tls_relay_front/debug" ,
53- "seley_info" : "http://127.0.0.1:8085 /module/x_tunnel/control/seley_front/debug" ,
54- "cloudflare_log" : "http://127.0.0.1:8085 /module/x_tunnel/control/cloudflare_front/log?cmd=get_new&last_no=1" ,
55- "tls_log" : "http://127.0.0.1:8085 /module/x_tunnel/control/tls_relay_front/log?cmd=get_new&last_no=1" ,
56- "seley_log" : "http://127.0.0.1:8085 /module/x_tunnel/control/seley_front/log?cmd=get_new&last_no=1" ,
57- "xtunnel_log" : "http://127.0.0.1:8085 /module/x_tunnel/control/log?cmd=get_new&last_no=1" ,
58- "smartroute_log" : "http://127.0.0.1:8085 /module/smart_router/control/log?cmd=get_new&last_no=1" ,
59- "launcher_log" : "http://127.0.0.1:8085 /log?cmd=get_new&last_no=1"
59+ "system_info" : f "http://127.0.0.1:{ port } /debug" ,
60+ "gae_info" : f "http://127.0.0.1:{ port } /module/gae_proxy/control/debug" ,
61+ "gae_log" : f "http://127.0.0.1:{ port } /module/gae_proxy/control/log?cmd=get_new&last_no=1" ,
62+ "xtunnel_info" : f "http://127.0.0.1:{ port } /module/x_tunnel/control/debug" ,
63+ "xtunnel_status" : f "http://127.0.0.1:{ port } /module/x_tunnel/control/status" ,
64+ "cloudflare_info" : f "http://127.0.0.1:{ port } /module/x_tunnel/control/cloudflare_front/debug" ,
65+ "tls_info" : f "http://127.0.0.1:{ port } /module/x_tunnel/control/tls_relay_front/debug" ,
66+ "seley_info" : f "http://127.0.0.1:{ port } /module/x_tunnel/control/seley_front/debug" ,
67+ "cloudflare_log" : f "http://127.0.0.1:{ port } /module/x_tunnel/control/cloudflare_front/log?cmd=get_new&last_no=1" ,
68+ "tls_log" : f "http://127.0.0.1:{ port } /module/x_tunnel/control/tls_relay_front/log?cmd=get_new&last_no=1" ,
69+ "seley_log" : f "http://127.0.0.1:{ port } /module/x_tunnel/control/seley_front/log?cmd=get_new&last_no=1" ,
70+ "xtunnel_log" : f "http://127.0.0.1:{ port } /module/x_tunnel/control/log?cmd=get_new&last_no=1" ,
71+ "smartroute_log" : f "http://127.0.0.1:{ port } /module/smart_router/control/log?cmd=get_new&last_no=1" ,
72+ "launcher_log" : f "http://127.0.0.1:{ port } /log?cmd=get_new&last_no=1"
6073 }
6174
6275 download_path = os .path .join (env_info .data_path , "downloads" )
@@ -110,7 +123,7 @@ def list_files():
110123 return other_files + log_files_list
111124
112125
113- def pack_logs (max_size = 4 * 1024 * 1024 ):
126+ def pack_logs (max_size = 10 * 1024 * 1024 ):
114127 content_size = 0
115128
116129 collect_debug_and_log ()
0 commit comments