Update config

This commit is contained in:
Andrea Mistrali 2024-07-04 13:57:59 +02:00
parent 454eae48a0
commit a98130756d
2 changed files with 13 additions and 5 deletions

View File

@ -54,14 +54,9 @@ def create_app(environment='development'):
app.logger.info("jinja2 custom filters loaded") app.logger.info("jinja2 custom filters loaded")
filters.init_app(app) filters.init_app(app)
app.config.update(
OIDC_REDIRECT_URI='http://localhost:5000/auth',
)
auth.init_app(app) auth.init_app(app)
# Error handlers. # Error handlers.
@app.errorhandler(HTTPException) @app.errorhandler(HTTPException)
def handle_http_error(exc): def handle_http_error(exc):
return render_template('error.html', error=exc), exc.code return render_template('error.html', error=exc), exc.code

View File

@ -13,6 +13,19 @@ class BaseConfig(object):
DEBUG_TB_ENABLED = False DEBUG_TB_ENABLED = False
WTF_CSRF_ENABLED = False WTF_CSRF_ENABLED = False
# All the followinf vars can be overriden
# in the environment, using `HSMAN_` prefix
SECRET_KEY = "secreto"
ADMIN_GROUPS = ["adminGroup"]
OIDC_CLIENT_ID = 'client-id'
OIDC_CLIENT_SECRET = 'client-secreto'
OIDC_URL = "https://myidp.example.com/auth"
OIDC_REDIRECT_URI = 'http://localhost:5000/auth'
# These are required by hsapi, should not be defined here
# HSAPI_SERVER = "https://headscale.example.com"
# HSAPI_API_TOKEN = 'hs-apikey'
@staticmethod @staticmethod
def configure(app): def configure(app):
# Implement this method to do further configuration on your app. # Implement this method to do further configuration on your app.