Qilan2 commited on
Commit
eabd496
·
verified ·
1 Parent(s): bd18166

Update server2.py

Browse files
Files changed (1) hide show
  1. server2.py +7 -7
server2.py CHANGED
@@ -1,5 +1,5 @@
1
  ini_content = {"username":"lixuhs875","key":"642ac670e3e0f7a237b53919592582c5"}
2
- frp_url = '47.237.156.222'
3
  ssh_port = '7074'
4
  ssh_url = '170.106.169.105'
5
  st_url = f'http://{frp_url}:7073'
@@ -7,9 +7,9 @@ huggingface_name = 'lixuhs875'
7
  huggingface_Data_name = 'qilan-st2'
8
 
9
  configs = [
10
- (f"""
11
  [common]
12
- server_addr = {frp_url}
13
  server_port = 7000
14
  [safghass434]
15
  type = tcp
@@ -27,9 +27,9 @@ configs = [
27
  local_port = 3000
28
  remote_port = 7075
29
  """, '/content/frp/frpc.ini'),
30
- ("""
31
  [common]
32
- server_addr = 119.8.118.149
33
  server_port = 7000
34
  token = qilan
35
  [kjashf2]
@@ -362,7 +362,7 @@ def copy_public_key_to_remote(host, port, user, password):
362
  generate_ssh_key()
363
  os.system('chmod 600 ~/.ssh/id_rsa')
364
  # 复制公钥到远程服务器
365
- copy_public_key_to_remote(frp_url, ssh_port, "root", "qilan")
366
 
367
 
368
 
@@ -643,7 +643,7 @@ def SillyTavern():
643
  if not os.path.exists(f'/{huggingface_Data_name}.zip'):
644
  print(f"文件 /{huggingface_Data_name}.zip 不存在,启用实时同步。")
645
  generate_ssh_key()
646
- copy_public_key_to_remote(frp_url, ssh_port, "root", "qilan")
647
  # subprocess.run(f"rsync -avz --port=7075 ljj@{frp_url}::qilan {data_folder}/", shell=True, check=True)
648
  subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{ssh_url}:{data_folder}/ {data_folder}/", shell=True, check=True, timeout=300)
649
  # sys.exit()
 
1
  ini_content = {"username":"lixuhs875","key":"642ac670e3e0f7a237b53919592582c5"}
2
+ frp_url = '119.8.118.149'
3
  ssh_port = '7074'
4
  ssh_url = '170.106.169.105'
5
  st_url = f'http://{frp_url}:7073'
 
7
  huggingface_Data_name = 'qilan-st2'
8
 
9
  configs = [
10
+ ("""
11
  [common]
12
+ server_addr = 47.237.156.222
13
  server_port = 7000
14
  [safghass434]
15
  type = tcp
 
27
  local_port = 3000
28
  remote_port = 7075
29
  """, '/content/frp/frpc.ini'),
30
+ (f"""
31
  [common]
32
+ server_addr = {frp_url}
33
  server_port = 7000
34
  token = qilan
35
  [kjashf2]
 
362
  generate_ssh_key()
363
  os.system('chmod 600 ~/.ssh/id_rsa')
364
  # 复制公钥到远程服务器
365
+ copy_public_key_to_remote(ssh_url, ssh_port, "root", "qilan")
366
 
367
 
368
 
 
643
  if not os.path.exists(f'/{huggingface_Data_name}.zip'):
644
  print(f"文件 /{huggingface_Data_name}.zip 不存在,启用实时同步。")
645
  generate_ssh_key()
646
+ copy_public_key_to_remote(ssh_url, ssh_port, "root", "qilan")
647
  # subprocess.run(f"rsync -avz --port=7075 ljj@{frp_url}::qilan {data_folder}/", shell=True, check=True)
648
  subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{ssh_url}:{data_folder}/ {data_folder}/", shell=True, check=True, timeout=300)
649
  # sys.exit()