moved config to on file to load and to keep secret
This commit is contained in:
parent
faf75e6e98
commit
8192018e0c
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,4 +3,5 @@ sites
|
|||||||
static/css/uikit-rtl.css
|
static/css/uikit-rtl.css
|
||||||
static/css/uikit-rtl.min.css
|
static/css/uikit-rtl.min.css
|
||||||
static/css/uikit.css
|
static/css/uikit.css
|
||||||
static/css/uikit.min.css
|
static/css/uikit.min.css
|
||||||
|
instance/application.cfg.py
|
||||||
Binary file not shown.
@ -161,7 +161,8 @@ def uploadImage(recipe_id):
|
|||||||
def get_image(recipe_id):
|
def get_image(recipe_id):
|
||||||
site_name = session['selected_site']
|
site_name = session['selected_site']
|
||||||
picture_path = database_recipes.getPicturePath(site_name, (recipe_id,))
|
picture_path = database_recipes.getPicturePath(site_name, (recipe_id,))
|
||||||
return send_from_directory('static/pictures/recipes', picture_path)
|
path = f"{current_app.config['UPLOAD_FOLDER']}/recipes"
|
||||||
|
return send_from_directory(path, picture_path)
|
||||||
|
|
||||||
@recipes_api.route('/deleteRecipeItem', methods=["POST"])
|
@recipes_api.route('/deleteRecipeItem', methods=["POST"])
|
||||||
@access_api.login_required
|
@access_api.login_required
|
||||||
|
|||||||
@ -1,3 +1,18 @@
|
|||||||
VAPID_PUBLIC_KEY = "BIbaHOqZcTunzAeb9p1hCWBo1DeJN0NVf2WVNSrsLZ2e50vhBno5dJuRAB1NLNXIeeQYr_x-1fSifJBGfUKd6QM"
|
VAPID_PUBLIC_KEY = "BIbaHOqZcTunzAeb9p1hCWBo1DeJN0NVf2WVNSrsLZ2e50vhBno5dJuRAB1NLNXIeeQYr_x-1fSifJBGfUKd6QM"
|
||||||
VAPID_PRIVATE_KEY = "l2wLDKWJDMkytDSN8s9iu9Y3-5qrIMy_OreUC3vDHtI"
|
VAPID_PRIVATE_KEY = "l2wLDKWJDMkytDSN8s9iu9Y3-5qrIMy_OreUC3vDHtI"
|
||||||
VAPID_CLAIM_EMAIL = "jadowyne.ulve@outlook.com"
|
VAPID_CLAIM_EMAIL = "jadowyne.ulve@outlook.com"
|
||||||
|
|
||||||
|
APP_SECRET = "11gs22h2h1a4h6ah8e413a45"
|
||||||
|
|
||||||
|
UPLOAD_FOLDER = "E:/code/pantry-track/uploads"
|
||||||
|
FILES_FOLDER = "E:/code/pantry-track/files"
|
||||||
|
|
||||||
|
OAUTH_NAME = "authentik"
|
||||||
|
OAUTH_CLIENT_ID = "gh8rLyXC6hfI7W5mDX26OJFGHxmU0nMzeYl3B04G"
|
||||||
|
OAUTH_CLIENT_SECRET = "aRHyAkDDeU22s69Ig0o7f46Xn3HCnB8guZoMHuA23B7x1e2YL8FhAqZbu1f3naiaLyTLi9ICIiBc6dxOp5eIO4fEI9paL2NwKXmqYCRmzNzWAfwmcsIh2qTlQfAfsh6e"
|
||||||
|
OAUTH_ACCESS_TOKEN_URL = "https://auth.treehousefullofstars.com/application/o/token/"
|
||||||
|
OAUTH_AUTHORIZE_URL = "https://auth.treehousefullofstars.com/application/o/authorize/"
|
||||||
|
OAUTH_USERINFO_ENDPOINT = "https://auth.treehousefullofstars.com/application/o/userinfo/"
|
||||||
|
OAUTH_API_BASE_URL = "https://auth.treehousefullofstars.com/application/o/"
|
||||||
|
OAUTH_JWKS_URI = "https://auth.treehousefullofstars.com/application/o/pantry/jwks/"
|
||||||
|
OAUTH_CLIENT_KWARGS = {'scope': 'openid profile email'}
|
||||||
25
webserver.py
25
webserver.py
@ -18,27 +18,24 @@ from outh import oauth
|
|||||||
app = Flask(__name__, instance_relative_config=True)
|
app = Flask(__name__, instance_relative_config=True)
|
||||||
oauth.init_app(app)
|
oauth.init_app(app)
|
||||||
swagger = Swagger(app)
|
swagger = Swagger(app)
|
||||||
UPLOAD_FOLDER = 'static/pictures'
|
|
||||||
FILES_FOLDER = 'static/files'
|
|
||||||
app.config.from_pyfile('application.cfg.py')
|
app.config.from_pyfile('application.cfg.py')
|
||||||
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
|
|
||||||
app.config['FILES_FOLDER'] = FILES_FOLDER
|
|
||||||
|
|
||||||
|
print(app.config['UPLOAD_FOLDER'])
|
||||||
oauth.register(
|
oauth.register(
|
||||||
name='authentik',
|
name=app.config['OAUTH_NAME'],
|
||||||
client_id='gh8rLyXC6hfI7W5mDX26OJFGHxmU0nMzeYl3B04G',
|
client_id=app.config['OAUTH_CLIENT_ID'],
|
||||||
client_secret='aRHyAkDDeU22s69Ig0o7f46Xn3HCnB8guZoMHuA23B7x1e2YL8FhAqZbu1f3naiaLyTLi9ICIiBc6dxOp5eIO4fEI9paL2NwKXmqYCRmzNzWAfwmcsIh2qTlQfAfsh6e',
|
client_secret=app.config['OAUTH_CLIENT_SECRET'],
|
||||||
access_token_url="https://auth.treehousefullofstars.com/application/o/token/",
|
access_token_url=app.config['OAUTH_ACCESS_TOKEN_URL'],
|
||||||
authorize_url="https://auth.treehousefullofstars.com/application/o/authorize/",
|
authorize_url=app.config['OAUTH_AUTHORIZE_URL'],
|
||||||
userinfo_endpoint="https://auth.treehousefullofstars.com/application/o/userinfo/",
|
userinfo_endpoint=app.config['OAUTH_USERINFO_ENDPOINT'],
|
||||||
api_base_url="https://auth.treehousefullofstars.com/application/o/",
|
api_base_url=app.config['OAUTH_API_BASE_URL'],
|
||||||
jwks_uri="https://auth.treehousefullofstars.com/application/o/pantry/jwks/",
|
jwks_uri=app.config['OAUTH_JWKS_URI'],
|
||||||
client_kwargs={'scope': 'openid profile email'},
|
client_kwargs=app.config['OAUTH_CLIENT_KWARGS'],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
assets = Environment(app)
|
assets = Environment(app)
|
||||||
app.secret_key = '11gs22h2h1a4h6ah8e413a45'
|
app.secret_key = app.config['APP_SECRET']
|
||||||
app.register_blueprint(access_api.access_api, url_prefix="/access")
|
app.register_blueprint(access_api.access_api, url_prefix="/access")
|
||||||
app.register_blueprint(administration_api.admin_api, url_prefix='/administration')
|
app.register_blueprint(administration_api.admin_api, url_prefix='/administration')
|
||||||
app.register_blueprint(items_API.items_api, url_prefix='/items')
|
app.register_blueprint(items_API.items_api, url_prefix='/items')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user