-
Notifications
You must be signed in to change notification settings - Fork 0
2.3 Storage
Gurdeep Singh (Guru) edited this page Aug 12, 2024
·
1 revision
As we use sleekDB, all database is written in JSON format in the root directory of your composer installation under main folder firewalldata/
Under firewalldata folder, there are folders created when you will instantiate the class:
- backup : for storing backup of filters
- db : the folders inside the db folder are controlled by sleekDB and the list is as follows:
- firewall_config : stores the firewall configuration data
- firewall_filters : main storage of firewall filters that an administrator will add
- firewall_filters_default : default storage of firewall filters that the system will add
- firewall_filters_ip2location : storage to store ip2location lookups, either from API or the BIN file
- firewall_geo_countries : storage to store geo countries data
- firewall_geo_states : storage to store geo states data
- firewall_geo_cities : storage to store geo cities data
- geodata : folder stores the downloaded json file from geodata repository
- indexes : folder stores mapping of IP address to filters
- ip2locationdata : folder stores the downloaded BIN files from the ip2location website.
- As the files written are in json format or text. You can just copy them and save somewhere as a backup. To restore, just copy the whole structure and the firewall will read them correctly.
- I have also included 2 classes in the Base class to take backup and restore the filters to CSV format. So, if in case the filters you have grown exponentially, you can just put them in an CSV file and import them. Please see importFilters() and exportFilters() methods in the Base class.