diff --git a/.emergent/emergent.yml b/.emergent/emergent.yml index 919b550..869d7b4 100644 --- a/.emergent/emergent.yml +++ b/.emergent/emergent.yml @@ -1,3 +1,5 @@ { - "env_image_name": "fastapi_react_mongo_shadcn_base_image_cloud_arm:release-03032026-1" + "env_image_name": "fastapi_react_mongo_shadcn_base_image_cloud_arm:release-03032026-1", + "job_id": "9e069d60-3427-465f-91df-8499645b62a7", + "created_at": "2026-05-06T03:53:16.075091+00:00Z" } diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..1c1f57c --- /dev/null +++ b/.gitconfig @@ -0,0 +1,3 @@ +[user] + email = github@emergent.sh + name = emergent-agent-e1 diff --git a/.gitignore b/.gitignore index 32bc1b7..ba3b64b 100644 --- a/.gitignore +++ b/.gitignore @@ -77,4 +77,12 @@ agenthub/agents/youtube/db .cache/ # Mobile development -android-sdk/ \ No newline at end of file +android-sdk/ -e +# Environment and credential files +.env +.env.* +*.env +credentials.json +*.pem +*.key +.credentials diff --git a/backend/routes/download_routes.py b/backend/routes/download_routes.py new file mode 100644 index 0000000..25a913b --- /dev/null +++ b/backend/routes/download_routes.py @@ -0,0 +1,75 @@ +from fastapi import APIRouter, HTTPException +from fastapi.responses import FileResponse +from pathlib import Path +import os + +router = APIRouter(prefix="/api/download", tags=["Downloads"]) + +# Package directory +PACKAGE_DIR = Path("/app/cpanel_deployment") + +@router.get("/package/{format}") +async def download_package(format: str): + """ + Download the cPanel deployment package + Formats: tar.gz or zip + """ + # Find the package file + if format == "tar.gz": + pattern = "epic-travel-cpanel-*.tar.gz" + elif format == "zip": + pattern = "epic-travel-cpanel-*.zip" + else: + raise HTTPException(status_code=400, detail="Invalid format. Use 'tar.gz' or 'zip'") + + # Find the latest package + import glob + files = glob.glob(str(PACKAGE_DIR / pattern)) + + if not files: + raise HTTPException(status_code=404, detail="Package not found") + + # Get the most recent file + latest_file = max(files, key=os.path.getctime) + file_path = Path(latest_file) + + if not file_path.exists(): + raise HTTPException(status_code=404, detail="Package file not found") + + # Determine media type + media_type = "application/gzip" if format == "tar.gz" else "application/zip" + + return FileResponse( + path=str(file_path), + media_type=media_type, + filename=file_path.name, + headers={ + "Content-Disposition": f"attachment; filename={file_path.name}" + } + ) + +@router.get("/list") +async def list_packages(): + """ + List available deployment packages + """ + import glob + + packages = [] + + # Find all package files + for pattern in ["*.tar.gz", "*.zip"]: + files = glob.glob(str(PACKAGE_DIR / pattern)) + for file_path in files: + file_stat = os.stat(file_path) + packages.append({ + "filename": Path(file_path).name, + "size": f"{file_stat.st_size / 1024:.0f} KB", + "format": "tar.gz" if file_path.endswith(".tar.gz") else "zip", + "download_url": f"/api/download/package/{'tar.gz' if file_path.endswith('.tar.gz') else 'zip'}" + }) + + return { + "packages": packages, + "total": len(packages) + } diff --git a/backend/server.py b/backend/server.py index 78518c8..969e672 100644 --- a/backend/server.py +++ b/backend/server.py @@ -9,7 +9,7 @@ from auth import hash_password from datetime import datetime # Import route modules -from routes import auth_routes, destination_routes, special_routes, other_routes +from routes import auth_routes, destination_routes, special_routes, other_routes, download_routes ROOT_DIR = Path(__file__).parent load_dotenv(ROOT_DIR / '.env') @@ -33,6 +33,7 @@ app.include_router(auth_routes.router) app.include_router(destination_routes.router) app.include_router(special_routes.router) app.include_router(other_routes.router) +app.include_router(download_routes.router) # Health check endpoint @app.get("/api")