Techbitforge commited on
Commit
a6e80fa
·
verified ·
1 Parent(s): 0bc1700

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -9,14 +9,13 @@ import gradio as gr
9
  # ================================
10
  def install_pufferpanel():
11
  if not os.path.exists("pufferpanel"):
12
- # Download latest release
13
  subprocess.run(
14
- "wget https://github.com/PufferPanel/PufferPanel/releases/latest/download/pufferpanel-linux-amd64.tar.gz -O puffer.tar.gz",
15
- shell=True,
16
- check=True
17
  )
18
  subprocess.run("tar -xzf puffer.tar.gz -C .", shell=True, check=True)
19
- subprocess.run("rm puffer.tar.gz", shell=True)
20
 
21
  # Configure PufferPanel to run on port 8080
22
  config = {
@@ -38,21 +37,22 @@ def run_pufferpanel():
38
  # Ensure installation
39
  install_pufferpanel()
40
 
41
- # Start PufferPanel in background
42
  threading.Thread(target=run_pufferpanel, daemon=True).start()
43
 
44
  # ================================
45
- # Gradio App (Wrapper UI)
46
  # ================================
47
  def launch_info():
48
  return """
49
- # ✅ PufferPanel is running inside this Hugging Face Space
 
 
50
 
51
- Use the embedded dashboard below.
52
  **Login Credentials:**
53
  - **User:** `admin`
54
  - **Pass:** `admin123`
55
- """
56
 
57
  with gr.Blocks(title="PufferPanel on Hugging Face") as demo:
58
  gr.Markdown(launch_info)
@@ -65,5 +65,4 @@ with gr.Blocks(title="PufferPanel on Hugging Face") as demo:
65
  )
66
 
67
  if __name__ == "__main__":
68
- demo.launch(server_name="0.0.0.0", server_port=7860)
69
-
 
9
  # ================================
10
  def install_pufferpanel():
11
  if not os.path.exists("pufferpanel"):
12
+ # Download PufferPanel v2.7.1 (latest stable release)
13
  subprocess.run(
14
+ "wget https://github.com/PufferPanel/PufferPanel/releases/download/v2.7.1/pufferpanel-linux-amd64.tar.gz -O puffer.tar.gz",
15
+ shell=True, check=True
 
16
  )
17
  subprocess.run("tar -xzf puffer.tar.gz -C .", shell=True, check=True)
18
+ subprocess.run("rm puffer.tar.gz", shell=True, check=True)
19
 
20
  # Configure PufferPanel to run on port 8080
21
  config = {
 
37
  # Ensure installation
38
  install_pufferpanel()
39
 
40
+ # Start PufferPanel in background thread
41
  threading.Thread(target=run_pufferpanel, daemon=True).start()
42
 
43
  # ================================
44
+ # Gradio Wrapper App
45
  # ================================
46
  def launch_info():
47
  return """
48
+ # ✅ PufferPanel is running inside Hugging Face
49
+
50
+ Use the embedded panel below.
51
 
 
52
  **Login Credentials:**
53
  - **User:** `admin`
54
  - **Pass:** `admin123`
55
+ """
56
 
57
  with gr.Blocks(title="PufferPanel on Hugging Face") as demo:
58
  gr.Markdown(launch_info)
 
65
  )
66
 
67
  if __name__ == "__main__":
68
+ demo.launch(server_name="0.0.0.0", server_port=7860)