from pathlib import Path
import shutil, zipfile, textwrap, os, base64, mimetypes
base = Path("/mnt/data/dropbear_maintenance_page")
assets = base / "assets"
assets.mkdir(parents=True, exist_ok=True)
# Copy uploaded logo if available
src_logo = Path("/mnt/data/1-01.jpg")
logo_name = "dropbear-logo.jpg"
if src_logo.exists():
shutil.copy(src_logo, assets / logo_name)
html = r'''
DropBear Servers | Maintenance
We’ll Be Right Back
DropBear Servers is currently undergoing maintenance and improvements.
We’re working hard to get everything back online as soon as possible.
Thanks for your patience.
'''
(base / "index.html").write_text(html, encoding="utf-8")
zip_path = Path("/mnt/data/dropbear_maintenance_page.zip")
if zip_path.exists():
zip_path.unlink()
with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED) as z:
z.write(base / "index.html", "index.html")
if (assets / logo_name).exists():
z.write(assets / logo_name, f"assets/{logo_name}")
print(f"Created: {zip_path}")
print(f"Files: {list(base.rglob('*'))}")