Compare commits
1 Commits
c5236c6fc4
...
d3c744e072
Author | SHA1 | Date | |
---|---|---|---|
d3c744e072 |
11
fileHost.py
11
fileHost.py
|
@ -75,6 +75,10 @@ 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
|
||||||
|
@ -113,8 +117,7 @@ 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,"
|
||||||
|
@ -127,10 +130,6 @@ 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