def main(): # change path to launcher global __file__ __file__ = os.path.abspath(__file__) if os.path.islink(__file__): __file__ = getattr(os, "readlink", lambda x: x)(__file__) os.chdir(os.path.dirname(os.path.abspath(__file__))) web_control.confirm_xxnet_exit() setup_win_python.check_setup() module_init.start_all_auto() web_control.start() if has_desktop and config.get(["modules", "launcher", "popup_webui"], 1) == 1: webbrowser.open("http://127.0.0.1:8085/") update.start() if config.get(["modules", "launcher", "show_systray"], 1): sys_tray.serve_forever() else: while True: time.sleep(100) module_init.stop_all() sys.exit()
def main(): # change path to launcher global __file__ __file__ = os.path.abspath(__file__) if os.path.islink(__file__): __file__ = getattr(os, 'readlink', lambda x: x)(__file__) os.chdir(os.path.dirname(os.path.abspath(__file__))) launcher_log.info("start XX-Net %s", update_from_github.current_version()) web_control.confirm_xxnet_exit() setup_win_python.check_setup() module_init.start_all_auto() web_control.start() if has_desktop and config.get(["modules", "launcher", "popup_webui"], 1) == 1: host_port = config.get(["modules", "launcher", "control_port"], 8085) webbrowser.open("http://127.0.0.1:%s/" % host_port) update.start() if config.get(["modules", "launcher", "show_systray"], 1): sys_tray.serve_forever() else: while True: time.sleep(100) module_init.stop_all() sys.exit()
def main(): # change path to launcher global __file__ __file__ = os.path.abspath(__file__) if os.path.islink(__file__): __file__ = getattr(os, 'readlink', lambda x: x)(__file__) os.chdir(os.path.dirname(os.path.abspath(__file__))) web_control.confirm_xxnet_exit() setup_win_python.check_setup() module_init.start_all_auto() web_control.start() #config.load() if config.get(["modules", "launcher", "popup_webui"], 1) == 1: webbrowser.open("http://127.0.0.1:8085/") update.start() sys_tray.serve_forever() module_init.stop_all() sys.exit()
def main(): # change path to launcher global __file__ __file__ = os.path.abspath(__file__) if os.path.islink(__file__): __file__ = getattr(os, 'readlink', lambda x: x)(__file__) os.chdir(os.path.dirname(os.path.abspath(__file__))) if sys.platform == "win32" and config.get(["show_compat_suggest"], 1): import win_compat_suggest win_compat_suggest.main() current_version = update_from_github.current_version() xlog.info("start XX-Net %s", current_version) web_control.confirm_xxnet_not_running() setup_win_python.check_setup() import post_update post_update.check() allow_remote = 0 if len(sys.argv) > 1: for s in sys.argv[1:]: xlog.info("command args:%s", s) if s == "-allow_remote": allow_remote = 1 module_init.xargs["allow_remote"] = 1 if os.path.isfile(running_file): restart_from_except = True else: restart_from_except = False module_init.start_all_auto() web_control.start(allow_remote) if has_desktop and config.get(["modules", "launcher", "popup_webui"], 1) == 1 and not restart_from_except: host_port = config.get(["modules", "launcher", "control_port"], 8085) import webbrowser webbrowser.open("http://localhost:%s/" % host_port) if has_desktop : import webbrowser webbrowser.open("https://www.bannedbook.org/bnews/fq/?utm_source=XX-Net") update.start() download_modules.start_download() update_from_github.cleanup() if config.get(["modules", "launcher", "show_systray"], 1): sys_tray.serve_forever() else: while True: time.sleep(1)
def main(): # change path to launcher global __file__ __file__ = os.path.abspath(__file__) if os.path.islink(__file__): __file__ = getattr(os, 'readlink', lambda x: x)(__file__) os.chdir(os.path.dirname(os.path.abspath(__file__))) current_version = update_from_github.current_version() xlog.info("start XX-Net %s", current_version) web_control.confirm_xxnet_exit() setup_win_python.check_setup() last_run_version = config.get(["modules", "launcher", "last_run_version"], "0.0.0") if last_run_version != current_version: import post_update post_update.run(last_run_version) config.set(["modules", "launcher", "last_run_version"], current_version) config.save() allow_remote = 0 if len(sys.argv) > 1: for s in sys.argv[1:]: xlog.info("command args:%s", s) if s == "-allow_remote": allow_remote = 1 module_init.xargs["allow_remote"] = 1 module_init.start_all_auto() web_control.start(allow_remote) if has_desktop and config.get(["modules", "launcher", "popup_webui"], 1) == 1: host_port = config.get(["modules", "launcher", "control_port"], 8085) import webbrowser webbrowser.open("http://127.0.0.1:%s/" % host_port) update.start() update_from_github.delete_to_save_disk() if config.get(["modules", "launcher", "show_systray"], 1): sys_tray.serve_forever() else: while True: time.sleep(100) module_init.stop_all() sys.exit()
def main(): # change path to launcher global __file__ __file__ = os.path.abspath(__file__) if os.path.islink(__file__): __file__ = getattr(os, 'readlink', lambda x: x)(__file__) os.chdir(os.path.dirname(os.path.abspath(__file__))) if sys.platform == "win32" and config.get(["show_compat_suggest"], 1): import win_compat_suggest win_compat_suggest.main() current_version = update_from_github.current_version() xlog.info("start XX-Net %s", current_version) web_control.confirm_xxnet_not_running() setup_win_python.check_setup() import post_update post_update.check() allow_remote = 0 if len(sys.argv) > 1: for s in sys.argv[1:]: xlog.info("command args:%s", s) if s == "-allow_remote": allow_remote = 1 module_init.xargs["allow_remote"] = 1 module_init.start_all_auto() web_control.start(allow_remote) if has_desktop and config.get(["modules", "launcher", "popup_webui"], 1) == 1: host_port = config.get(["modules", "launcher", "control_port"], 8085) import webbrowser webbrowser.open("http://localhost:%s/" % host_port) update.start() update_from_github.cleanup() if config.get(["modules", "launcher", "show_systray"], 1): sys_tray.serve_forever() else: while True: time.sleep(1)
def main(): # change path to launcher global __file__ __file__ = os.path.abspath(__file__) if os.path.islink(__file__): __file__ = getattr(os, 'readlink', lambda x: x)(__file__) os.chdir(os.path.dirname(os.path.abspath(__file__))) current_version = update_from_github.current_version() xlog.info("start XX-Net %s", current_version) web_control.confirm_xxnet_not_running() setup_win_python.check_setup() import post_update post_update.check() allow_remote = 0 if len(sys.argv) > 1: for s in sys.argv[1:]: xlog.info("command args:%s", s) if s == "-allow_remote": allow_remote = 1 module_init.xargs["allow_remote"] = 1 module_init.start_all_auto() web_control.start(allow_remote) if has_desktop and config.get(["modules", "launcher", "popup_webui"], 1) == 1: host_port = config.get(["modules", "launcher", "control_port"], 8085) import webbrowser webbrowser.open("http://localhost:%s/" % host_port) update.start() update_from_github.cleanup() if config.get(["modules", "launcher", "show_systray"], 1): threading.Thread(target=sys_tray.serve_forever).start() while True: time.sleep(1)
def main(): # change path to launcher global __file__ __file__ = os.path.abspath(__file__) if os.path.islink(__file__): __file__ = getattr(os, 'readlink', lambda x: x)(__file__) os.chdir(os.path.dirname(os.path.abspath(__file__))) module_init.start_all_auto() web_control.start() webbrowser.open("http://127.0.0.1:8085/") update.start() sys_tray.serve_forever() module_init.stop_all() sys.exit()
def main(): # change path to launcher global __file__ __file__ = os.path.abspath(__file__) if os.path.islink(__file__): __file__ = getattr(os, 'readlink', lambda x: x)(__file__) os.chdir(os.path.dirname(os.path.abspath(__file__))) if sys.platform == "win32": import win_compat_suggest if config.show_compat_suggest: win_compat_suggest.main() ports_resolve_solution = win_compat_suggest.Win10PortReserveSolution() if not ports_resolve_solution.check_and_resolve(): return web_control.confirm_xxnet_not_running() import post_update post_update.check() allow_remote = 0 no_mess_system = 0 if len(sys.argv) > 1: for s in sys.argv[1:]: xlog.info("command args:%s", s) if s == "-allow_remote": allow_remote = 1 elif s == "-no_mess_system": no_mess_system = 1 if allow_remote or config.allow_remote_connect: xlog.info("start with allow remote connect.") module_init.xargs["allow_remote"] = 1 if os.getenv("NOT_MESS_SYSTEM", "0") != "0" or no_mess_system or config.no_mess_system: xlog.info("start with no_mess_system, no CA will be imported to system.") module_init.xargs["no_mess_system"] = 1 if os.path.isfile(running_file): restart_from_except = True else: restart_from_except = False module_init.start_all_auto() web_control.start(allow_remote) if has_desktop and config.popup_webui == 1 and not restart_from_except: host_port = config.control_port import webbrowser webbrowser.open("http://localhost:%s/" % host_port) update.start() if has_desktop: download_modules.start_download() update_from_github.cleanup() if config.show_systray: sys_platform.show_systray() else: while True: time.sleep(1)
def update(): upd.start(__version__) sig() sys.exit(0)
def check_update(): import update update.start()