Opera8 commited on
Commit
c4c70e3
·
verified ·
1 Parent(s): 28d6cc6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -6,7 +6,7 @@ from http.server import SimpleHTTPRequestHandler, HTTPServer
6
  # دریافت مسیر
7
  CURRENT_DIR = os.getcwd()
8
 
9
- # 1. ساخت سایت الکی
10
  html_content = """<!DOCTYPE html>
11
  <html>
12
  <head><title>System Status</title>
@@ -19,7 +19,7 @@ h1{color:#1a73e8;} .ok{color:#34a853;font-weight:bold;}</style></head>
19
  with open("index.html", "w") as f:
20
  f.write(html_content)
21
 
22
- # 2. تنظیمات Nginx (با آدرس‌های داینامیک و بدون نیاز به دسترسی روت)
23
  nginx_conf = f"""
24
  worker_processes 1;
25
  daemon off;
@@ -91,13 +91,13 @@ xray_config = """
91
  with open("config.json", "w") as f:
92
  f.write(xray_config)
93
 
94
- # 4. اجرای سرویس‌ها
95
  print(f"Working Directory: {CURRENT_DIR}")
96
 
97
- # اجرای Xray
98
  subprocess.Popen(["./xray", "-c", "config.json"])
99
 
100
- # اجرای Nginx با آدرس فایل کانفیگ دقیق
101
  nginx_config_path = os.path.join(CURRENT_DIR, "nginx.conf")
102
  print(f"Starting Nginx using config: {nginx_config_path}")
103
  subprocess.run(["nginx", "-c", nginx_config_path])
 
6
  # دریافت مسیر
7
  CURRENT_DIR = os.getcwd()
8
 
9
+ # 1. ساخت سای
10
  html_content = """<!DOCTYPE html>
11
  <html>
12
  <head><title>System Status</title>
 
19
  with open("index.html", "w") as f:
20
  f.write(html_content)
21
 
22
+ # 2. تنظیمات Ng
23
  nginx_conf = f"""
24
  worker_processes 1;
25
  daemon off;
 
91
  with open("config.json", "w") as f:
92
  f.write(xray_config)
93
 
94
+ # 4. اجرای سس‌ها
95
  print(f"Working Directory: {CURRENT_DIR}")
96
 
97
+ # اجرای ay
98
  subprocess.Popen(["./xray", "-c", "config.json"])
99
 
100
+ # اجرای Ng
101
  nginx_config_path = os.path.join(CURRENT_DIR, "nginx.conf")
102
  print(f"Starting Nginx using config: {nginx_config_path}")
103
  subprocess.run(["nginx", "-c", nginx_config_path])