Sanity checks, single user mode, easier seq uids, fix comma EOL bug, status page, seq reporting, seq uid purging,
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# Check if all the files needed by kjv-api (to write to) are also owned by the user running it.
|
||||
# if this is not the same, writing to data/seq.db (and other undesirable behavior) is inevitable
|
||||
# and will save a lot of headache in the future.
|
||||
|
||||
#Additionally, proper CHMOD value is 664 for the database
|
||||
from os import stat, getuid
|
||||
|
||||
def check_sanity():
|
||||
dependancies = ['data/seq.db']
|
||||
current_uid = getuid()
|
||||
for dependancy in dependancies:
|
||||
if stat(dependancy).st_uid != current_uid:
|
||||
raise PermissionError(dependancy)
|
||||
Reference in New Issue
Block a user