Spaces:
Runtime error
Runtime error
nifty-coder commited on
Commit ·
bc51fb8
1
Parent(s): 27aa949
Added custom domain
Browse files
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
emoji: 🎵
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: pink
|
|
|
|
| 1 |
---
|
| 2 |
+
title: NiftyDAW API
|
| 3 |
emoji: 🎵
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: pink
|
main.py
CHANGED
|
@@ -37,10 +37,8 @@ default_origins = [
|
|
| 37 |
"http://localhost:8080",
|
| 38 |
"https://aimusicapp-a2b65.web.app",
|
| 39 |
"https://aimusicapp-a2b65.firebaseapp.com",
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
# "SplitSonic.ai",
|
| 43 |
-
# "www.SplitSonic.ai"
|
| 44 |
]
|
| 45 |
allowed_origins_env = os.environ.get('ALLOWED_ORIGINS')
|
| 46 |
allowed_origins = [o.strip() for o in allowed_origins_env.split(',') if o.strip()] if allowed_origins_env else default_origins
|
|
@@ -65,7 +63,7 @@ def options_handler(request: Request):
|
|
| 65 |
|
| 66 |
@app.get("/")
|
| 67 |
def health_check():
|
| 68 |
-
return {"status": "healthy", "message": "
|
| 69 |
|
| 70 |
# --- Utility Functions ---
|
| 71 |
def find_ffmpeg() -> str:
|
|
@@ -234,9 +232,9 @@ def send_activation_email(email: str, token: str, origin: str):
|
|
| 234 |
'api_key': SMTP2GO_API_KEY,
|
| 235 |
'sender': SMTP2GO_SENDER,
|
| 236 |
'to': [email],
|
| 237 |
-
'subject': 'Activate your
|
| 238 |
'html_body': f"""
|
| 239 |
-
<h1>Welcome to
|
| 240 |
<p>Please click the link below to activate your account. This link is valid for 15 minutes.</p>
|
| 241 |
<a href="{activation_url}" style="display: inline-block; padding: 10px 20px; background-color: #007bff; color: white; text-decoration: none; border-radius: 5px;">Activate Account</a>
|
| 242 |
<p>If the button doesn't work, copy and paste this link into your browser:</p>
|
|
@@ -827,8 +825,6 @@ async def process_upload(
|
|
| 827 |
logger.error(f"Upload processing error (tmpdir: {tmpdir}):\n{error_details}")
|
| 828 |
raise HTTPException(status_code=500, detail=str(e))
|
| 829 |
|
| 830 |
-
|
| 831 |
-
|
| 832 |
@app.post("/upload/extracted")
|
| 833 |
def process_upload_extracted(file: UploadFile = File(...), tos_agreed: bool = Form(...)):
|
| 834 |
if not tos_agreed:
|
|
|
|
| 37 |
"http://localhost:8080",
|
| 38 |
"https://aimusicapp-a2b65.web.app",
|
| 39 |
"https://aimusicapp-a2b65.firebaseapp.com",
|
| 40 |
+
"https://niftydaw.com",
|
| 41 |
+
"https://www.niftydaw.com",
|
|
|
|
|
|
|
| 42 |
]
|
| 43 |
allowed_origins_env = os.environ.get('ALLOWED_ORIGINS')
|
| 44 |
allowed_origins = [o.strip() for o in allowed_origins_env.split(',') if o.strip()] if allowed_origins_env else default_origins
|
|
|
|
| 63 |
|
| 64 |
@app.get("/")
|
| 65 |
def health_check():
|
| 66 |
+
return {"status": "healthy", "message": "NiftyDAW Backend is running!"}
|
| 67 |
|
| 68 |
# --- Utility Functions ---
|
| 69 |
def find_ffmpeg() -> str:
|
|
|
|
| 232 |
'api_key': SMTP2GO_API_KEY,
|
| 233 |
'sender': SMTP2GO_SENDER,
|
| 234 |
'to': [email],
|
| 235 |
+
'subject': 'Activate your NiftyDAW account',
|
| 236 |
'html_body': f"""
|
| 237 |
+
<h1>Welcome to NiftyDAW!</h1>
|
| 238 |
<p>Please click the link below to activate your account. This link is valid for 15 minutes.</p>
|
| 239 |
<a href="{activation_url}" style="display: inline-block; padding: 10px 20px; background-color: #007bff; color: white; text-decoration: none; border-radius: 5px;">Activate Account</a>
|
| 240 |
<p>If the button doesn't work, copy and paste this link into your browser:</p>
|
|
|
|
| 825 |
logger.error(f"Upload processing error (tmpdir: {tmpdir}):\n{error_details}")
|
| 826 |
raise HTTPException(status_code=500, detail=str(e))
|
| 827 |
|
|
|
|
|
|
|
| 828 |
@app.post("/upload/extracted")
|
| 829 |
def process_upload_extracted(file: UploadFile = File(...), tos_agreed: bool = Form(...)):
|
| 830 |
if not tos_agreed:
|