diff --git a/README.md b/README.md index 2f0bf13..2b8d078 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,16 @@ Happy hacking ;) ## Restart from scratch To restart from scratch and empty all data from your dashboard you can use the [FLUSHDB](https://redis.io/commands/flushdb) or [FLUSHALL](https://redis.io/commands/flushall) command on your redis instance on port `6250`. +Or use the dedicated cleaning script ``clean.py`` +```usage: clean.py [-h] [-b] + +Clean data stored in the redis server specified in the configuration file + +optional arguments: + -h, --help show this help message and exit + -b, --brutal Perfom a FLUSHALL on the redis database. If not set, will use + a soft method to delete only keys used by MISP-Dashboard. +``` # zmq_subscriber options diff --git a/clean.py b/clean.py index cc00f89..e8838d4 100755 --- a/clean.py +++ b/clean.py @@ -25,11 +25,11 @@ def clean(brutal=False): if brutal: print(RED+'Brutal mode'+DEFAULT+' selected') - print('Cleaning data...') + print('[%s:%s] Cleaning data...' % (host, port)) cleanBrutal(servers[0]) else: print(GREEN+'Soft mode'+DEFAULT+' selected') - print('Cleaning data...') + print('[%s:%s] Cleaning data...' % (host, port)) cleanSoft(servers) @@ -77,8 +77,8 @@ def cleanSoft(servers): serv.delete(*tuple(key_to_del)) if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument("-b", "--brutal", help="Brutal mode: basic FLUSHALL", default=False, action="store_true") + parser = argparse.ArgumentParser(description='Clean data stored in the redis server specified in the configuration file') + parser.add_argument("-b", "--brutal", default=False, action="store_true", help="Perfom a FLUSHALL on the redis database. If not set, will use a soft method to delete only keys used by MISP-Dashboard.") args = parser.parse_args() clean(args.brutal) print(GREEN+'Done.'+DEFAULT)