mirror of
https://git.wownero.com/wownero/YellWOWPages.git
synced 2024-08-15 01:03:25 +00:00
redis required, move keycloak include
This commit is contained in:
parent
5bd305e684
commit
8960768a52
2 changed files with 5 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
||||||
peewee
|
peewee
|
||||||
quart
|
quart
|
||||||
Quart-Keycloak
|
Quart-Keycloak
|
||||||
uvicorn
|
uvicorn
|
||||||
|
redis
|
|
@ -25,6 +25,8 @@ async def _setup_database(app: Quart):
|
||||||
|
|
||||||
|
|
||||||
async def _setup_openid(app: Quart):
|
async def _setup_openid(app: Quart):
|
||||||
|
global keycloak
|
||||||
|
keycloak = Keycloak(app, **settings.OPENID_CFG)
|
||||||
from yellow.auth import handle_user_login
|
from yellow.auth import handle_user_login
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,16 +52,13 @@ async def _setup_error_handlers(app: Quart):
|
||||||
|
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
global app, keycloak
|
global app
|
||||||
app = Quart(__name__)
|
app = Quart(__name__)
|
||||||
if settings.X_FORWARDED:
|
if settings.X_FORWARDED:
|
||||||
app.asgi_app = ProxyHeadersMiddleware(app.asgi_app, trusted_hosts=["127.0.0.1", "10.1.0.1"])
|
app.asgi_app = ProxyHeadersMiddleware(app.asgi_app, trusted_hosts=["127.0.0.1", "10.1.0.1"])
|
||||||
|
|
||||||
app.logger.setLevel(logging.INFO)
|
app.logger.setLevel(logging.INFO)
|
||||||
app.secret_key = settings.APP_SECRET
|
app.secret_key = settings.APP_SECRET
|
||||||
Session(app)
|
|
||||||
|
|
||||||
keycloak = Keycloak(app, **settings.OPENID_CFG)
|
|
||||||
|
|
||||||
@app.context_processor
|
@app.context_processor
|
||||||
def template_variables():
|
def template_variables():
|
||||||
|
|
Loading…
Reference in a new issue