BBrother commited on
Commit
a112619
1 Parent(s): b0e524c

Update webui.py

Browse files
Files changed (1) hide show
  1. webui.py +13 -4
webui.py CHANGED
@@ -2,17 +2,26 @@ from __future__ import annotations
2
 
3
  import os
4
  import time
5
- import pycloudflared
6
- import pyngrok
7
 
8
  from modules import timer
9
  from modules import initialize_util
10
  from modules import initialize
11
  from pathlib import Path
12
 
13
- #ngrok穿透
14
  ngrok_use = False
15
- ngrokTokenFile='/root/main/Authtoken.txt' # 非必填 存放ngrokToken的文件的路径
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
  def ngrok_start(ngrokTokenFile: str, port: int, address_name: str, should_run: bool):
18
  if not should_run:
 
2
 
3
  import os
4
  import time
 
 
5
 
6
  from modules import timer
7
  from modules import initialize_util
8
  from modules import initialize
9
  from pathlib import Path
10
 
 
11
  ngrok_use = False
12
+
13
+ # 打开并执行txt文件
14
+ with open('/etc/main/StartBianLiang.txt', 'r') as file:
15
+ code = file.read()
16
+
17
+ # 去除每行开头和结尾的空格、空行等
18
+ cleaned_code = '\n'.join(line.strip() for line in code.splitlines() if line.strip())
19
+
20
+ # 执行干净的代码
21
+ exec(cleaned_code)
22
+
23
+ #ngrok穿透
24
+ ngrokTokenFile='/etc/main/Authtoken.txt' # 非必填 存放ngrokToken的文件的路径
25
 
26
  def ngrok_start(ngrokTokenFile: str, port: int, address_name: str, should_run: bool):
27
  if not should_run: