Skip to content

Commit

Permalink
5.5.13 refactor codes, fix minor bugs, add log collection function fo…
Browse files Browse the repository at this point in the history
…r report issues.
  • Loading branch information
Michael-X-Net committed Aug 19, 2023
1 parent 19268f3 commit aea538f
Show file tree
Hide file tree
Showing 56 changed files with 449 additions and 170 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@


### 最新公告:
2023-08-15
* 新版 5.5.0, 提升连接性能
2023-08-19
* 新版 5.5.13, 重构代码,修复bug
* 5.1.0,内置ChatGPT
* 原来是4.x.x 老版本的,需要重新下载新版安装,不能应用内升级。

Expand Down
8 changes: 5 additions & 3 deletions code/default/gae_proxy/local/cert_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
current_path = os.path.dirname(os.path.abspath(__file__))
python_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir))
root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir))
data_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data', "gae_proxy"))
if not os.path.isdir(data_path):
data_path = current_path

if __name__ == "__main__":
noarch_lib = os.path.abspath( os.path.join(python_path, 'lib', 'noarch'))
Expand All @@ -37,6 +34,11 @@
darwin_lib = os.path.abspath( os.path.join(python_path, 'lib', 'darwin'))
sys.path.append(darwin_lib)

import env_info
data_path = os.path.abspath(os.path.join(env_info.data_path, "gae_proxy"))
if not os.path.isdir(data_path):
data_path = current_path

import utils
from xlog import getLogger
xlog = getLogger("gae_proxy")
Expand Down
6 changes: 4 additions & 2 deletions code/default/gae_proxy/local/check_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

current_path = os.path.dirname(os.path.abspath(__file__))
default_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir))
data_path = os.path.abspath(os.path.join(default_path, os.pardir, os.pardir, 'data'))
module_data_path = os.path.join(data_path, 'gae_proxy')

if __name__ == "__main__":
sys.path.append(default_path)
Expand All @@ -28,6 +26,10 @@
extra_lib = "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python"
sys.path.append(extra_lib)


import env_info

module_data_path = os.path.join(env_info.data_path, 'gae_proxy')
import xlog
logger = xlog.getLogger("gae_proxy")

Expand Down
11 changes: 4 additions & 7 deletions code/default/gae_proxy/local/config.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import os

from front_base.config import ConfigBase
import simple_http_client
import utils

import utils
import env_info
current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir))
data_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data'))
module_data_path = os.path.join(data_path, 'gae_proxy')

module_data_path = os.path.join(env_info.data_path, 'gae_proxy')


headers = {"connection": "close"}
# fqrouter = simple_http_client.request("GET", "http://127.0.0.1:2515/ping", headers=headers, timeout=0.5)
# mobile = fqrouter and "PONG" in fqrouter.text
# del headers, fqrouter


class Config(ConfigBase):
Expand Down
3 changes: 2 additions & 1 deletion code/default/gae_proxy/local/download_gae_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@


import simple_http_client
import env_info
from xlog import getLogger
xlog = getLogger("gae_proxy")

current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir))
top_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir))
data_path = os.path.abspath( os.path.join(top_path, 'data', 'gae_proxy'))
data_path = os.path.abspath( os.path.join(env_info.data_path, 'gae_proxy'))


def request(url, retry=0, timeout=30):
Expand Down
4 changes: 3 additions & 1 deletion code/default/gae_proxy/local/front.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir))
data_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data'))

import env_info
data_path = env_info.data_path
module_data_path = os.path.join(data_path, 'gae_proxy')

import xlog
Expand Down
5 changes: 3 additions & 2 deletions code/default/gae_proxy/local/ipv6_tunnel/common.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import os
import shlex
import subprocess
from .pteredor import teredo_prober

from .pteredor import teredo_prober
import env_info
import utils
from xlog import getLogger
xlog = getLogger("gae_proxy")

current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir, os.pardir))
data_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data', "gae_proxy"))
data_path = os.path.join(env_info.data_path, "gae_proxy")
if not os.path.isdir(data_path):
data_path = current_path

Expand Down
4 changes: 3 additions & 1 deletion code/default/gae_proxy/local/ipv6_tunnel/win10.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
import time
import socket
import platform

import env_info
from .common import *
from . import win32runas
from .pteredor import local_ip_startswith

current_path = os.path.dirname(os.path.abspath(__file__))
python_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir))
root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir))
data_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data', "gae_proxy"))
data_path = os.path.join(env_info.data_path, "gae_proxy")
if not os.path.isdir(data_path):
data_path = current_path

Expand Down
9 changes: 6 additions & 3 deletions code/default/gae_proxy/local/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@
current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir))
gae_proxy_path = os.path.join(root_path, "gae_proxy")
data_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data'))
data_gae_proxy_path = os.path.join(data_path, 'gae_proxy')
python_path = root_path

python_path = root_path
noarch_lib = os.path.abspath( os.path.join(python_path, 'lib', 'noarch'))
sys.path.append(noarch_lib)

import env_info
data_path = env_info.data_path
data_gae_proxy_path = os.path.join(data_path, 'gae_proxy')


if sys.platform == "win32":
win32_lib = os.path.abspath( os.path.join(python_path, 'lib', 'win32'))
sys.path.append(win32_lib)
Expand Down
4 changes: 2 additions & 2 deletions code/default/gae_proxy/local/web_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import env_info
import utils


import env_info
from xlog import getLogger
xlog = getLogger("gae_proxy")
from .config import config, direct_config
Expand All @@ -38,7 +38,7 @@

root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir))
top_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir))
data_path = os.path.abspath( os.path.join(top_path, 'data', 'gae_proxy'))
data_path = os.path.join(env_info.data_path, 'gae_proxy')
web_ui_path = os.path.join(current_path, os.path.pardir, "web_ui")


Expand Down
4 changes: 3 additions & 1 deletion code/default/launcher/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
current_path = os.path.dirname(os.path.abspath(__file__))
version_path = os.path.abspath(os.path.join(current_path, os.pardir))
root_path = os.path.abspath(os.path.join(version_path, os.pardir, os.pardir))
data_path = os.path.join(root_path, 'data')

import env_info
data_path = env_info.data_path
config_path = os.path.join(data_path, 'launcher', 'config.json')


Expand Down
4 changes: 2 additions & 2 deletions code/default/launcher/download_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import shutil

from update_from_github import request, xlog, hash_file_sum

import env_info
current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.join(current_path, os.pardir))
top_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir))
Expand Down Expand Up @@ -87,7 +87,7 @@ def download_unzip(url, extract_path):
if os.path.isdir(extract_path):
return True

data_root = os.path.join(top_path, 'data')
data_root = env_info.data_path
download_path = os.path.join(data_root, 'downloads')
if not os.path.isdir(download_path):
os.mkdir(download_path)
Expand Down
3 changes: 3 additions & 0 deletions code/default/launcher/lang/zh_CN/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ msgstr "CA 证书状态"
msgid "Download"
msgstr "下载"

msgid "Collect debug info"
msgstr "收集调试信息"

msgid "System Proxy"
msgstr "系统代理"

Expand Down
4 changes: 2 additions & 2 deletions code/default/launcher/module_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
if root_path not in sys.path:
sys.path.append(root_path)

data_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data'))
data_launcher_path = os.path.join(data_path, 'launcher')
import env_info
data_launcher_path = os.path.join(env_info.data_path, 'launcher')
running_file = os.path.join(data_launcher_path, "Running.Lck")


Expand Down
3 changes: 2 additions & 1 deletion code/default/launcher/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
except ImportError:
from urllib2 import build_opener, ProxyHandler

import env_info
from xlog import getLogger
xlog = getLogger("launcher")

Expand All @@ -25,7 +26,7 @@
opener = build_opener()

root_path = os.path.abspath(os.path.join(current_path, os.pardir))
download_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data', 'downloads'))
download_path = os.path.join(env_info.data_path, 'downloads')

xxnet_unzip_path = ""

Expand Down
7 changes: 5 additions & 2 deletions code/default/launcher/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
current_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(current_path)
default_path = os.path.abspath(os.path.join(current_path, os.path.pardir))
data_path = os.path.abspath(os.path.join(default_path, os.path.pardir, os.path.pardir, 'data'))
data_launcher_path = os.path.join(data_path, 'launcher')
noarch_lib = os.path.abspath(os.path.join(default_path, 'lib', 'noarch'))
sys.path.append(noarch_lib)

import env_info
data_path = env_info.data_path
data_launcher_path = os.path.join(data_path, 'launcher')


def create_data_path():
if not os.path.isdir(data_path):
Expand Down Expand Up @@ -60,6 +62,7 @@ def create_data_path():
xlog.info("start Version %s", current_version)
xlog.info("Python version: %s", sys.version)
xlog.info("System: %s|%s|%s", platform.system(), platform.version(), platform.architecture())
xlog.info("data path: %s", data_path)

from front_base import openssl_wrap
xlog.info("TLS implementation: %s", openssl_wrap.implementation)
Expand Down
4 changes: 2 additions & 2 deletions code/default/launcher/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import update_from_github
import sys_platform
import global_var

import env_info

update_url = "https://xxnet-update.appspot.com/update.json"

Expand All @@ -39,7 +39,7 @@

current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.join(current_path, os.pardir))
data_root = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data'))
data_root = env_info.data_path

should_create_desktop_shortcut = True

Expand Down
3 changes: 2 additions & 1 deletion code/default/launcher/update_from_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
root_path = os.path.abspath(os.path.join(current_path, os.pardir))
top_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir))
code_path = os.path.abspath(os.path.join(root_path, os.pardir))
data_root = os.path.join(top_path, 'data')
import env_info
data_root = env_info.data_path
python_path = root_path
noarch_lib = os.path.join(python_path, 'lib', 'noarch')
sys.path.append(noarch_lib)
Expand Down
Loading

0 comments on commit aea538f

Please sign in to comment.