deployment
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
2025-01-27 18:35:04 +01:00
parent f96da3f8d4
commit ff63d88c04
8 changed files with 130 additions and 23 deletions

View File

@ -1,8 +1,10 @@
from flask import Flask, session, g, render_template_string
from flask_session import Session
from flask_oidc import OpenIDConnect
from werkzeug.middleware.proxy_fix import ProxyFix
from loguru import logger
import redis
import json
import os
import plotly.express as px
import pandas as pd
@ -11,7 +13,7 @@ import sqlalchemy
try:
redis_url = os.environ['REDIS_URL']
client_secret = os.environ['CLIENT_SECRET']
oidc_client_secrets = os.environ['OIDC_CLIENT_SECRETS']
secret_key = os.environ['SECRET_KEY']
except KeyError as e:
logger.error(f"Required environment variable not set ({e})")
@ -23,20 +25,8 @@ app = Flask(__name__)
app.config.update({
'SECRET_KEY': secret_key,
'SESSION_TYPE': 'redis',
'SESSION_REDIS': redis.from_url('redis://172.23.1.111:6379/4'),
'OIDC_CLIENT_SECRETS': {
"web": {
"issuer": "https://auth2.hottis.de/realms/hottis",
"auth_uri": "https://auth2.hottis.de/ealms/hottis/protocol/openid-connect/auth",
"client_id": "mini_flask",
"client_secret": client_secret,
"redirect_uris": [
"http://localhost:8080/*"
],
"userinfo_uri": "https://auth2.hottis.de/realms/hottis/protocol/openid-connect/userinfo",
"token_uri": "https://auth2.hottis.de/realms/hottis/protocol/openid-connect/token"
}
},
'SESSION_REDIS': redis.from_url(redis_url),
'OIDC_CLIENT_SECRETS': json.loads(oidc_client_secrets),
'OIDC_SCOPES': 'openid email',
'OIDC_USER_INFO_ENABLED': True,
'SESSION_USE_SIGNER': True,
@ -95,3 +85,6 @@ def plot():
if __name__ == '__main__':
app.run(port=8080)
else:
exposed_app = ProxyFix(app, x_for=1, x_host=1)