added config option to shred log file on exit

master
Kevin Froman 2020-02-06 04:11:39 -06:00
parent 7c7e5de091
commit 2319ff8344
3 changed files with 11 additions and 3 deletions

View File

@ -36,6 +36,10 @@ try:
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
print('Onionr needs ' + str(e) + ' installed') print('Onionr needs ' + str(e) + ' installed')
# Import 3rd party libraries
from filenuke import nuke # noqa
# Onionr imports # Onionr imports
# For different Onionr related constants such as versions # For different Onionr related constants such as versions
@ -85,9 +89,12 @@ def onionr_main():
if ran_as_script: if ran_as_script:
onionr_main() onionr_main()
# Wipe Onionr data directory if security level calls for it
config.reload() config.reload()
# If the setting is there, shred log file on exit
if config.get('log.file.remove_on_exit', True):
nuke.clean(config.get_config_file())
# Cleanup standard out/err because Python refuses to do it itsself # Cleanup standard out/err because Python refuses to do it itsself
try: try:
sys.stderr.close() sys.stderr.close()

View File

@ -32,7 +32,8 @@
"output": true "output": true
}, },
"file": { "file": {
"output": true "output": true,
"remove_on_exit": true
}, },
"verbosity": "default" "verbosity": "default"
}, },