Added to requirements and fixed logging

This commit is contained in:
maximstewart 2021-02-05 00:29:23 -06:00
parent d4fbe2d27d
commit 9537943fa5
6 changed files with 26 additions and 13 deletions

View File

@ -1,3 +1,4 @@
eventlet==0.30.1
Flask==1.1.1
flask-oidc==1.4.0
Flask-Login==0.5.0

View File

@ -13,7 +13,7 @@ from flask_login import current_user, login_user, logout_user, LoginManager
# Apoplication imports
from core.utils import Logger
# Configs and 'init'
@ -47,6 +47,7 @@ app.config.update({
oidc = OpenIDConnect(app)
login_manager = LoginManager(app)
bcrypt = Bcrypt(app)
logger = Logger().get_logger()
def oidc_loggedin():

View File

@ -6,9 +6,12 @@ import os, logging
class Logger:
def __init__(self):
pass
self.logger = self.create_logger("flask_app")
def get_logger(self, loggerName = "NO_LOGGER_NAME_PASSED", createFile = True):
def get_logger(self):
return self.logger
def create_logger(self, loggerName = "NO_LOGGER_NAME_PASSED", createFile = True):
"""
Create a new logging object and return it.
:note:

12
src/linux-start.sh Normal file → Executable file
View File

@ -7,7 +7,6 @@
function main() {
SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"
cd "${SCRIPTPATH}"
echo "Working Dir: " $(pwd)
source "../venv/bin/activate"
@ -20,11 +19,10 @@ function main() {
# Note can replace 127.0.0.1 with 0.0.0.0 to make it 'network/internet' accessable...
# Note: NEED -k eventlet for this to work! I spent too many hours on this...
# <module>:<app> IE <file>:<flask app variable>
gunicorn wsgi:app -p app.pid \
-b $ADDR:$PORT \
-k eventlet \
-w $WORKER_COUNT \
--timeout $TIMEOUT \
--log-level $LOG_LEVEL
gunicorn wsgi:app -p app.pid -b $ADDR:$PORT \
-k eventlet \
-w $WORKER_COUNT \
--timeout $TIMEOUT \
--log-level $LOG_LEVEL
}
main $@;

View File

@ -7,9 +7,18 @@
function main() {
SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"
cd "${SCRIPTPATH}"
echo "Working Dir: " $(pwd)
source "../venv/bin/activate"
gunicorn --bind unix:/tmp/app.sock wsgi:app -p app.pid
LOG_LEVEL=debug
WORKER_COUNT=1
TIMEOUT=120
# <module>:<app> IE <file>:<flask app variable>
gunicorn wsgi:app -p app.pid -b unix:/tmp/app.sock \
-k eventlet \
-w $WORKER_COUNT \
--timeout $TIMEOUT \
--log-level $LOG_LEVEL
}
main $@;

View File

@ -1,3 +1,4 @@
eventlet==0.30.1
Flask==1.1.1
flask-oidc==1.4.0
Flask-Login==0.5.0
@ -7,4 +8,4 @@ Flask-WTF==0.14.3
waitress==1.4.3
SQLAlchemy==1.3.11
Werkzeug==0.16.0
WTForms==2.2.1
WTForms==2.2.1