Spaces:
Paused
Paused
Update app.py
Browse files
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. تنظیمات
|
| 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 |
-
# اجرای
|
| 98 |
subprocess.Popen(["./xray", "-c", "config.json"])
|
| 99 |
|
| 100 |
-
# اجرای
|
| 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])
|