Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import subprocess
|
3 |
+
|
4 |
+
# =========================
|
5 |
+
# Install PufferPanel
|
6 |
+
# =========================
|
7 |
+
def install_pufferpanel():
|
8 |
+
if not os.path.exists("pufferpanel"):
|
9 |
+
# Download latest PufferPanel release
|
10 |
+
subprocess.run(
|
11 |
+
"wget https://github.com/PufferPanel/PufferPanel/releases/latest/download/pufferpanel-linux-amd64.tar.gz -O puffer.tar.gz",
|
12 |
+
shell=True,
|
13 |
+
check=True
|
14 |
+
)
|
15 |
+
subprocess.run("tar -xzf puffer.tar.gz -C .", shell=True, check=True)
|
16 |
+
subprocess.run("rm puffer.tar.gz", shell=True)
|
17 |
+
|
18 |
+
# Initialize PufferPanel
|
19 |
+
subprocess.run("./pufferpanel install --user admin --password admin123", shell=True, check=True)
|
20 |
+
|
21 |
+
install_pufferpanel()
|
22 |
+
|
23 |
+
# =========================
|
24 |
+
# Start Web Panel
|
25 |
+
# =========================
|
26 |
+
subprocess.run("./pufferpanel run", shell=True)
|