add discord invite redirect

This commit is contained in:
simon 2022-12-03 09:28:13 +07:00
parent 1c01f062ec
commit c7591d6cc2
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
4 changed files with 15 additions and 2 deletions

View File

@ -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:

View File

@ -18,6 +18,8 @@ services:
- ./volume/tubearchivist/data:/data
env_file:
- ./env/tubearchivist.env
environment:
- discord=gkWMk9Qupk
expose:
- "8080"
# backend postgres

View File

@ -33,7 +33,7 @@
</a>
</div>
<div class="social-item">
<a href="https://discord.gg/AFwz8nE7BK" target="_blank">
<a href="/discord" target="_blank">
<img src="/static/img/logo-discord.png" alt="discord-logo">
</a>
</div>

View File

@ -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/<release_id>/")
def release(release_id):
"""api release"""