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