feat: Add HNS.ID domains using ETH signing
All checks were successful
Build Docker / Build Docker (push) Successful in 3m47s

This commit is contained in:
2024-06-14 15:32:04 +10:00
parent 0bc07e491e
commit 7ea097f916
5 changed files with 289 additions and 84 deletions

View File

@@ -3,7 +3,10 @@ from flask import Flask
from .models import db
from .oauth2 import config_oauth
from .routes import bp
from datetime import timedelta
import dotenv
dotenv.load_dotenv()
def create_app(config=None):
app = Flask(__name__)
@@ -15,18 +18,26 @@ def create_app(config=None):
if 'WEBSITE_CONF' in os.environ:
app.config.from_envvar('WEBSITE_CONF')
# Set the secret key to a key from the ENV
app.secret_key = os.getenv("FLASK_SECRET_KEY", os.urandom(24).hex())
# Set the session to be permanent
app.config["SESSION_PERMANENT"] = True
# Set it to 6 months
app.config["PERMANENT_SESSION_LIFETIME"] = timedelta(days=180)
# load app specified configuration
if config is not None:
if isinstance(config, dict):
app.config.update(config)
elif config.endswith('.py'):
app.config.from_pyfile(config)
setup_app(app)
return app
def setup_app(app):
def setup_app(app: Flask):
db.init_app(app)
# Create tables if they do not exist already