diff --git a/docker-compose_production.yml b/docker-compose_production.yml index 2fd0755..e3ca510 100644 --- a/docker-compose_production.yml +++ b/docker-compose_production.yml @@ -4,6 +4,7 @@ services: nginx-proxy: image: nginxproxy/nginx-proxy container_name: nginx-proxy + restart: always ports: - 80:80 - 443:443 @@ -20,6 +21,7 @@ services: nginx-proxy-acme: image: nginxproxy/acme-companion container_name: nginx-proxy-acme + restart: always volumes: - ./volume/nginx-proxy/certs:/etc/nginx/certs - ./volume/nginx-proxy/vhost:/etc/nginx/vhost.d @@ -52,6 +54,8 @@ services: - ./volume/tubearchivist/data:/data env_file: - ./env/tubearchivist.env + environment: + - discord=gkWMk9Qupk expose: - "8080" networks: diff --git a/docker-compose_testing.yml b/docker-compose_testing.yml index d4347f6..fb183d5 100644 --- a/docker-compose_testing.yml +++ b/docker-compose_testing.yml @@ -18,6 +18,8 @@ services: - ./volume/tubearchivist/data:/data env_file: - ./env/tubearchivist.env + environment: + - discord=gkWMk9Qupk expose: - "8080" # backend postgres diff --git a/tubearchivist/web/templates/home.html b/tubearchivist/web/templates/home.html index 279d245..150324c 100644 --- a/tubearchivist/web/templates/home.html +++ b/tubearchivist/web/templates/home.html @@ -33,7 +33,7 @@
diff --git a/tubearchivist/web/views.py b/tubearchivist/web/views.py index c49957e..81c2075 100644 --- a/tubearchivist/web/views.py +++ b/tubearchivist/web/views.py @@ -3,7 +3,7 @@ from os import environ from apscheduler.schedulers.background import BackgroundScheduler -from flask import Flask, render_template, jsonify, request +from flask import Flask, render_template, jsonify, request, redirect from src.api_docker import run_docker_backup from src.webhook_docker import DockerHook from src.webhook_github import GithubBackup, GithubHook @@ -33,6 +33,13 @@ def home(): ) +@app.route("/discord") +def discord_redirect(): + """redirect to current discord invite link""" + invite = environ.get("discord") + return redirect(f"https://discord.gg/{invite}", code=302) + + @app.route("/api/release/