Compare commits

..

1 Commits

Author SHA1 Message Date
c5236c6fc4 added Flask-paranoid module to secure cookies better 2018-06-05 17:19:59 -04:00

View File

@ -75,10 +75,6 @@ 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
@ -117,7 +113,8 @@ def init():
"id INTEGER PRIMARY KEY,"
"username TEXT,"
"pw_hash TEXT,"
"admin BOOL DEFAULT FALSE)")
"admin BOOL DEFAULT FALSE,"
"token)")
db_execute("CREATE TABLE uploads("
"filename TEXT,"
@ -130,6 +127,10 @@ 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"):
"""