requirements

This commit is contained in:
h z
2024-12-03 12:42:09 +00:00
parent e929f67f4e
commit 969f200753
5 changed files with 41 additions and 9 deletions

View File

@@ -1,4 +0,0 @@
FROM ubuntu:latest
LABEL authors="hzhang"
ENTRYPOINT ["top", "-b"]

View File

@@ -2,9 +2,10 @@
from flask import Blueprint, session, redirect, url_for, jsonify
from authlib.integrations.flask_client import OAuth
from contexts.RequestContext import RequestContext
from api import limiter
import env_provider
import logging
from api import limiter
logger = logging.getLogger(__name__)
auth_bp = Blueprint('auth', __name__, url_prefix='/api')

8
app.py
View File

@@ -27,8 +27,10 @@ def is_allowed_origin(origin):
"https://git.hangman-lab.top",
]
return origin in allowed_origins
db.create_all()
try:
db.create_all()
except Exception as e:
print("db not ready")
app = Flask(__name__)
app.secret_key = env_provider.SESSION_SECRET_KEY
CORS(app, resources={r"/api/*": {"origins": is_allowed_origin}})
@@ -45,5 +47,5 @@ def log_request():
if __name__ == '__main__':
logger.info("Starting app")
#logger.info("Starting app")
app.run(host='0.0.0.0', port=5000)

View File

@@ -1,6 +1,6 @@
#db/__init__.py
from contextlib import contextmanager
from models import Base
from db.models import Base
from sqlalchemy.orm import sessionmaker

View File

@@ -0,0 +1,33 @@
Authlib==1.3.2
blinker==1.9.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
click==8.1.7
cryptography==44.0.0
Deprecated==1.2.15
Flask==3.1.0
Flask-Cors==5.0.0
Flask-Limiter==3.9.2
Flask-SQLAlchemy==3.1.1
greenlet==3.1.1
idna==3.10
itsdangerous==2.2.0
Jinja2==3.1.4
limits==3.14.1
markdown-it-py==3.0.0
MarkupSafe==3.0.2
mdurl==0.1.2
ordered-set==4.1.0
packaging==24.2
pycparser==2.22
Pygments==2.18.0
PyMySQL==1.1.1
python-dotenv==1.0.1
requests==2.32.3
rich==13.9.4
SQLAlchemy==2.0.36
typing_extensions==4.12.2
urllib3==2.2.3
Werkzeug==3.1.3
wrapt==1.17.0