start dynamic structure in settings

This commit is contained in:
lelo 2025-03-25 20:54:49 +00:00
parent e7e042f3c7
commit 5b4390b6b7
4 changed files with 18 additions and 13 deletions

3
.gitignore vendored
View File

@ -2,4 +2,5 @@
/filecache
/__pycache__
/access_log.db
/folder_config.json
/folder_config.json
/.env

4
app.py
View File

@ -377,7 +377,9 @@ def handle_request_initial_data():
@app.route('/<path:path>')
@auth.require_secret
def index(path):
return render_template("app.html")
title_short = os.environ.get('TITLE_SHORT', 'Default Title')
title_long = os.environ.get('TITLE_LONG', 'Default Title')
return render_template("app.html", title_short=title_short, title_long=title_long)
if __name__ == '__main__':
socketio.run(app, debug=True, host='0.0.0.0')

View File

@ -1,7 +1,7 @@
services:
flask-app:
image: python:3.11-slim
container_name: bethaus-app
container_name: "${CONTAINER_NAME}"
restart: always
working_dir: /app
volumes:
@ -17,25 +17,27 @@ services:
environment:
- FLASK_APP=app.py
- FLASK_ENV=production
- TITLE_SHORT=${TITLE_SHORT}
- TITLE_LONG=${TITLE_LONG}
networks:
- traefik
labels:
- "traefik.enable=true"
# HTTP router (port 80), redirecting to HTTPS
- "traefik.http.routers.bethaus-app.rule=Host(`app.bethaus-speyer.de`)"
- "traefik.http.routers.bethaus-app.entrypoints=web"
- "traefik.http.routers.bethaus-app.middlewares=redirect-to-https"
- "traefik.http.routers.${CONTAINER_NAME}.rule=${HOST_RULE}"
- "traefik.http.routers.${CONTAINER_NAME}.entrypoints=web"
- "traefik.http.routers.${CONTAINER_NAME}.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# HTTPS router (TLS via Let's Encrypt)
- "traefik.http.routers.bethaus-app-secure.rule=Host(`app.bethaus-speyer.de`)"
- "traefik.http.routers.bethaus-app-secure.entrypoints=websecure"
- "traefik.http.routers.bethaus-app-secure.tls=true"
- "traefik.http.routers.bethaus-app-secure.tls.certresolver=myresolver"
- "traefik.http.routers.${CONTAINER_NAME}-secure.rule=${HOST_RULE}"
- "traefik.http.routers.${CONTAINER_NAME}-secure.entrypoints=websecure"
- "traefik.http.routers.${CONTAINER_NAME}-secure.tls=true"
- "traefik.http.routers.${CONTAINER_NAME}-secure.tls.certresolver=myresolver"
# Internal port
- "traefik.http.services.bethaus-app.loadbalancer.server.port=5000"
- "traefik.http.services.${CONTAINER_NAME}.loadbalancer.server.port=5000"
# Production-ready Gunicorn command with eventlet
command: >

View File

@ -8,7 +8,7 @@
<meta property="og:image" content="https://app.bethaus-speyer.de/static/icons/logo-200x200.png" />
<meta property="og:url" content="https://app.bethaus-speyer.de" />
<title>Gottesdienste</title>
<title>{{ title_short }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="description" content="... uns aber, die wir gerettet werden, ist es eine Gotteskraft.">
<meta name="author" content="Bethaus Speyer">
@ -38,7 +38,7 @@
<a href="#">
<img src="/static/logoW.png" alt="Logo" class="logo">
</a>
<h1>Gottesdienste Speyer und Schwegenheim</h1>
<h1>{{ title_long }}</h1>
</header>
<div class="wrapper">
<div class="container">