Update server.py
Browse files
server.py
CHANGED
|
@@ -36,11 +36,7 @@ app.add_middleware(
|
|
| 36 |
# Configuration
|
| 37 |
# =============================================================================
|
| 38 |
# Use a more secure default if no token provided
|
| 39 |
-
SECRET_TOKEN = os.getenv("API_TOKEN")
|
| 40 |
-
if not SECRET_TOKEN:
|
| 41 |
-
import secrets
|
| 42 |
-
SECRET_TOKEN = secrets.token_urlsafe(32)
|
| 43 |
-
print(f"⚠️ No API_TOKEN found in env. Generated temporary token: {SECRET_TOKEN}")
|
| 44 |
|
| 45 |
WORK_DIR = Path(os.getenv("WORK_DIR", "/tmp/remote-shell")).resolve()
|
| 46 |
WORK_DIR.mkdir(parents=True, exist_ok=True)
|
|
@@ -555,10 +551,6 @@ async def kill_process_by_pid(
|
|
| 555 |
# =============================================================================
|
| 556 |
static_dir = Path(__file__).parent / "static"
|
| 557 |
|
| 558 |
-
@app.get("/")
|
| 559 |
-
async def root():
|
| 560 |
-
return HTMLResponse("<h1>Server is running!</h1>")
|
| 561 |
-
|
| 562 |
|
| 563 |
@app.get("/health")
|
| 564 |
async def health(token: str = Depends(verify_token)):
|
|
|
|
| 36 |
# Configuration
|
| 37 |
# =============================================================================
|
| 38 |
# Use a more secure default if no token provided
|
| 39 |
+
SECRET_TOKEN = os.getenv("API_TOKEN", "shell")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
WORK_DIR = Path(os.getenv("WORK_DIR", "/tmp/remote-shell")).resolve()
|
| 42 |
WORK_DIR.mkdir(parents=True, exist_ok=True)
|
|
|
|
| 551 |
# =============================================================================
|
| 552 |
static_dir = Path(__file__).parent / "static"
|
| 553 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 554 |
|
| 555 |
@app.get("/health")
|
| 556 |
async def health(token: str = Depends(verify_token)):
|