Compare commits

..

1 Commits

Author SHA1 Message Date
d3c744e072 added Flask-paranoid module to secure cookies better 2018-06-05 17:26:42 -04:00

View File

@ -75,6 +75,10 @@ app.config["UPLOAD_URL"] = "https://steelbea.me/up/"
app.config["DB_NAME"] = "fileHost.db"
app.config["DB_LOCK"] = threading.Lock()
paranoid = Paranoid(app)
paranoid.redirect_view = 'login'
def db_execute(*args, **kwargs):
"""
Opens a connection to the app's database and executes the SQL statements
@ -113,8 +117,7 @@ def init():
"id INTEGER PRIMARY KEY,"
"username TEXT,"
"pw_hash TEXT,"
"admin BOOL DEFAULT FALSE,"
"token)")
"admin BOOL DEFAULT FALSE)")
db_execute("CREATE TABLE uploads("
"filename TEXT,"
@ -127,10 +130,6 @@ def init():
t.start()
app.config["CRON_THREAD"] = t
# init paranoid
app.config["paranoid"] = Paranoid(app)
app.config["paranoid"].redirect_view = 'login'
def add_user(username, password, admin="FALSE"):
"""