Compare commits
1 Commits
d3c744e072
...
c5236c6fc4
Author | SHA1 | Date | |
---|---|---|---|
c5236c6fc4 |
11
fileHost.py
11
fileHost.py
|
@ -75,10 +75,6 @@ app.config["UPLOAD_URL"] = "https://steelbea.me/up/"
|
||||||
app.config["DB_NAME"] = "fileHost.db"
|
app.config["DB_NAME"] = "fileHost.db"
|
||||||
app.config["DB_LOCK"] = threading.Lock()
|
app.config["DB_LOCK"] = threading.Lock()
|
||||||
|
|
||||||
paranoid = Paranoid(app)
|
|
||||||
paranoid.redirect_view = 'login'
|
|
||||||
|
|
||||||
|
|
||||||
def db_execute(*args, **kwargs):
|
def db_execute(*args, **kwargs):
|
||||||
"""
|
"""
|
||||||
Opens a connection to the app's database and executes the SQL statements
|
Opens a connection to the app's database and executes the SQL statements
|
||||||
|
@ -117,7 +113,8 @@ def init():
|
||||||
"id INTEGER PRIMARY KEY,"
|
"id INTEGER PRIMARY KEY,"
|
||||||
"username TEXT,"
|
"username TEXT,"
|
||||||
"pw_hash TEXT,"
|
"pw_hash TEXT,"
|
||||||
"admin BOOL DEFAULT FALSE)")
|
"admin BOOL DEFAULT FALSE,"
|
||||||
|
"token)")
|
||||||
|
|
||||||
db_execute("CREATE TABLE uploads("
|
db_execute("CREATE TABLE uploads("
|
||||||
"filename TEXT,"
|
"filename TEXT,"
|
||||||
|
@ -130,6 +127,10 @@ def init():
|
||||||
t.start()
|
t.start()
|
||||||
app.config["CRON_THREAD"] = t
|
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"):
|
def add_user(username, password, admin="FALSE"):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user