diff --git a/src/__init__.py b/src/__init__.py index cb673a50..4835a610 100755 --- a/src/__init__.py +++ b/src/__init__.py @@ -36,6 +36,10 @@ try: except ModuleNotFoundError as e: print('Onionr needs ' + str(e) + ' installed') +# Import 3rd party libraries + +from filenuke import nuke # noqa + # Onionr imports # For different Onionr related constants such as versions @@ -85,9 +89,12 @@ def onionr_main(): if ran_as_script: onionr_main() - # Wipe Onionr data directory if security level calls for it 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 try: sys.stderr.close() diff --git a/src/onionrcommands/parser/arguments.py b/src/onionrcommands/parser/arguments.py index e8fc50b5..eba3add1 100644 --- a/src/onionrcommands/parser/arguments.py +++ b/src/onionrcommands/parser/arguments.py @@ -60,7 +60,7 @@ def get_arguments() -> dict: ('addhtml', 'add-html'): filecommands.add_html, ('addsite', 'add-site', 'update-site', 'updatesite'): sitecreator.create_multipage_site, - ('listsites', 'list-sites'): print_site_list, + ('listsites', 'list-sites'): print_site_list, ('addfile', 'add-file'): filecommands.add_file, ('get-file', 'getfile'): filecommands.get_file, ('export-block', 'exportblock'): exportblocks.export_block, diff --git a/static-data/default_config.json b/static-data/default_config.json index f2e30bd7..d4f131fe 100755 --- a/static-data/default_config.json +++ b/static-data/default_config.json @@ -32,7 +32,8 @@ "output": true }, "file": { - "output": true + "output": true, + "remove_on_exit": true }, "verbosity": "default" },