added encryption to uploadkeys and added a key generator
This commit is contained in:
@ -11,6 +11,7 @@ defaults = {
|
||||
"SAVELOG_CHMOD": "0o644",
|
||||
"UPLOADKEYS_CHMOD": "0o400",
|
||||
"SAVELOG_KEYPREFIX": 4,
|
||||
"ENCKEY_PATH": "secret.key"
|
||||
}
|
||||
|
||||
deftypes = {
|
||||
@ -21,6 +22,7 @@ deftypes = {
|
||||
"SAVELOG_CHMOD": int,
|
||||
"UPLOADKEYS_CHMOD": int,
|
||||
"SAVELOG_KEYPREFIX": int,
|
||||
"ENCKEY_PATH": str,
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +56,7 @@ if "ALLOWED_EXTENSIONS" in checksettings:
|
||||
for e in settings.ALLOWED_EXTENSIONS:
|
||||
if not e.startswith("."):
|
||||
invalid_exts.append(e)
|
||||
|
||||
|
||||
if len(invalid_exts) > 0:
|
||||
print("[!] The following extensions listed in ALLOWED_EXTENSIONS are invalid:")
|
||||
for e in invalid_exts:
|
||||
@ -99,6 +101,15 @@ if "SAVELOG" in checksettings:
|
||||
print("[*] SAVELOG was interpreted to be {0}".format(settings.SAVELOG))
|
||||
print("[*] If this is not the intended filename, please fix it.")
|
||||
|
||||
# Check if ENCKEY_PATH exists
|
||||
enckey_exists = True
|
||||
if "UPLOAD_FOLDER" in checksettings:
|
||||
if not os.path.isfile(settings.ENCKEY_PATH):
|
||||
enckey_exists = False
|
||||
print("[!] The path set in ENCKEY_PATH ('{0}') doesn't exist!".format(settings.ENCKEY_PATH))
|
||||
else:
|
||||
print("[" + u"\u2713" + "] ENCKEY_PATH exists!")
|
||||
|
||||
|
||||
# Show summary
|
||||
print()
|
||||
|
Reference in New Issue
Block a user