mirror of https://github.com/MISP/misp-dashboard
chg: [README] updated README with the new clean script
parent
00043d6763
commit
9905a82a79
10
README.md
10
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
|
||||
|
|
8
clean.py
8
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)
|
||||
|
|
Loading…
Reference in New Issue