Remove UPLOADKEYS_CHMOD option due to keygen.py

Since keygen.py is run as root, uploadkeys is owned by root. This causes
issues when imgupload.py tries to chmod the uploadkeys file since it
doesn't have permissions to chmod it.
Solution: remove UPLOADKEYS_CHMOD option
This commit is contained in:
BBaoVanC 2020-08-31 21:14:09 -05:00
parent 7ccaafc6c6
commit a5a22b7c88
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
3 changed files with 0 additions and 4 deletions

View File

@ -9,7 +9,6 @@ defaults = {
"ROOTURL": "https://img.bbaovanc.com/", "ROOTURL": "https://img.bbaovanc.com/",
"SAVELOG": "savelog.log", "SAVELOG": "savelog.log",
"SAVELOG_CHMOD": "0o644", "SAVELOG_CHMOD": "0o644",
"UPLOADKEYS_CHMOD": "0o400",
"SAVELOG_KEYPREFIX": 4, "SAVELOG_KEYPREFIX": 4,
"ENCKEY_PATH": "secret.key" "ENCKEY_PATH": "secret.key"
} }
@ -20,7 +19,6 @@ deftypes = {
"ROOTURL": str, "ROOTURL": str,
"SAVELOG": str, "SAVELOG": str,
"SAVELOG_CHMOD": int, "SAVELOG_CHMOD": int,
"UPLOADKEYS_CHMOD": int,
"SAVELOG_KEYPREFIX": int, "SAVELOG_KEYPREFIX": int,
"ENCKEY_PATH": str, "ENCKEY_PATH": str,
} }

View File

@ -46,7 +46,6 @@ def upload():
if request.method == "POST": # sanity check: make sure it's a POST request if request.method == "POST": # sanity check: make sure it's a POST request
print("Request method was POST!") print("Request method was POST!")
os.chmod("uploadkeys", settings.UPLOADKEYS_CHMOD)
with open(settings.ENCKEY_PATH,"rb") as enckey: # load encryption key with open(settings.ENCKEY_PATH,"rb") as enckey: # load encryption key
key = enckey.read() key = enckey.read()
f = Fernet(key) f = Fernet(key)

View File

@ -3,6 +3,5 @@ ALLOWED_EXTENSIONS = [".png", ".jpg", ".jpeg", ".svg", ".bmp", ".gif", ".ico",
ROOTURL = "https://example.com/" ROOTURL = "https://example.com/"
SAVELOG = "savelog.log" SAVELOG = "savelog.log"
SAVELOG_CHMOD = 0o644 SAVELOG_CHMOD = 0o644
UPLOADKEYS_CHMOD = 0o600
SAVELOG_KEYPREFIX = 4 SAVELOG_KEYPREFIX = 4
ENCKEY_PATH = "secret.key" ENCKEY_PATH = "secret.key"