mirror of
https://github.com/ION606/static-site-hosting.git
synced 2026-05-14 22:16:54 +00:00
fixed a goofy issue
This commit is contained in:
@@ -5,3 +5,4 @@ __pycache__
|
|||||||
nohup.out
|
nohup.out
|
||||||
app.pid
|
app.pid
|
||||||
*.log
|
*.log
|
||||||
|
.env
|
||||||
|
|||||||
+2
-2
@@ -20,8 +20,8 @@ class Config:
|
|||||||
SECRET_KEY = get_secret_key()
|
SECRET_KEY = get_secret_key()
|
||||||
SQLALCHEMY_DATABASE_URI = "sqlite:////app/instance/db.sqlite"
|
SQLALCHEMY_DATABASE_URI = "sqlite:////app/instance/db.sqlite"
|
||||||
UPLOAD_FOLDER = "/app/sites"
|
UPLOAD_FOLDER = "/app/sites"
|
||||||
SERVER_NAME = "tinysite.cloud"
|
SERVER_NAME = os.environ.get("SERVER_NAME", "tinysite.cloud")
|
||||||
SESSION_COOKIE_DOMAIN = ".tinysite.cloud"
|
SESSION_COOKIE_DOMAIN = "." + SERVER_NAME
|
||||||
SESSION_COOKIE_NAME = "tinysite_session"
|
SESSION_COOKIE_NAME = "tinysite_session"
|
||||||
SESSION_COOKIE_HTTPONLY = True
|
SESSION_COOKIE_HTTPONLY = True
|
||||||
SESSION_COOKIE_SECURE = True
|
SESSION_COOKIE_SECURE = True
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ def handle_upload(current_user, site_name, subdomain, files):
|
|||||||
flash("Invalid subdomain format", "error")
|
flash("Invalid subdomain format", "error")
|
||||||
return redirect(url_for("main.dashboard"))
|
return redirect(url_for("main.dashboard"))
|
||||||
|
|
||||||
|
# Check for reserved subdomains
|
||||||
|
if subdomain in Config.RESERVED_SUBDOMAINS:
|
||||||
|
flash(f"The subdomain '{subdomain}' is reserved", "error")
|
||||||
|
return redirect(url_for("main.dashboard"))
|
||||||
|
|
||||||
if not site_name or not subdomain:
|
if not site_name or not subdomain:
|
||||||
flash("Name and subdomain required", "error")
|
flash("Name and subdomain required", "error")
|
||||||
return redirect(url_for("main.dashboard"))
|
return redirect(url_for("main.dashboard"))
|
||||||
|
|||||||
+13
-14
@@ -1,19 +1,18 @@
|
|||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "5121:5121"
|
- "5121:5121"
|
||||||
networks:
|
networks:
|
||||||
- static
|
- static
|
||||||
volumes:
|
volumes:
|
||||||
- instance:/app/instance
|
- instance:/app/instance
|
||||||
- sites:/app/sites
|
- sites:/app/sites
|
||||||
environment:
|
env_file: .env
|
||||||
- FLASK_ENV=production
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
static:
|
static:
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
instance:
|
instance:
|
||||||
sites:
|
sites:
|
||||||
|
|||||||
Reference in New Issue
Block a user