add kubernetes stuff

This commit is contained in:
2020-11-27 04:18:09 +01:00
parent 5c44768812
commit a194b60077
3 changed files with 72 additions and 1 deletions

View File

@ -5,9 +5,10 @@ import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
from healthcheck import HealthCheck
from flask_cors import CORS
from utils.config import SENTRY_DSN, RELEASE_ID, RELEASEMODE, POSTGRES_DB, PORT, POSTGRES_HOSTNAME, POSTGRES_PASSWORD, \
POSTGRES_USERNAME, DEBUG, SECRET_KEY
POSTGRES_USERNAME, DEBUG, SECRET_KEY, ALLOWED_ORIGINS
from utils import db, ma, health_database_status, security, user_datastore
from views import ItemView, LoginView, ProfileView, RegisterView, UploadView
@ -41,6 +42,7 @@ health = HealthCheck()
db.init_app(app)
ma.init_app(app)
security.init_app(app, user_datastore)
CORS(app, origins=ALLOWED_ORIGINS)
formatter = logging.Formatter(
fmt="%(asctime)s - %(levelname)s - %(module)s - %(message)s"

View File

@ -25,3 +25,4 @@ POSTGRES_PASSWORD = os.getenv("POSTGRES_PASSWORD", "webshop")
POSTGRES_DB = os.getenv("POSTGRES_DB", "webshop")
SECRET_KEY = os.getenv("SECRET_KEY")
ALLOWED_ORIGINS = os.environ.get('ALLOWED_ORIGINS', '*')