Groups are great, unfortunately managing large domain lists with groups can be quite a tedious job when using the web interface.
I would like to get your opinion on how to improve it. I can either modify the existing command-line supported by pihole or develop a new tool (Clearly the best would be to improve the current command-line interface in pihole/list.sh, although right now I'm not sure how hard it'll be to manage multiple tables through bash & sqlite3).
What I'm thinking is something like along these lines:
Improve list operations (for -b, -w, --regex, --white-regex):
• Modify the output to print also the group ID and group name
• Add capability to filter the results:
◇ -gid <id>: print only domains that belong to the given group ID
◇ -gn <name>: print only domains that belong to the given group name
◇ --comment <name>: print only domains matching the given comment
Improve current way to add domains to gravity (apply to -b, -w, --regex, --white-regex):
• Allow to specify a group list when a new domain is added:
◇ -gid <id>[,<id>]...
◇ -gn <name>[,<name>]...
E.g.: pihole -b -gn default,myGroup,SecondGroup www.site.com www.site2.com
When no groups are specified, it'll behave just like now (add to default group)
• Allow to specify a comment to be added to the domains:
◇ --comment <name>
Improve remove domains functionality (apply to -b, -w, --regex, --white-regex):
• Allow to specify a group list where a domain is removed from:
◇ -gid <id>[,<id>]...
◇ -gn <name>[,<name>]...
• Allow to specify matching comment to for the domain to remove
◇ --comment <name> # Remove all the domains that match <comment>
Notes about the remove operations:
• when groups are specified, the domain is not removed, but only the association with the group is removed, unless a domain has no more associations with a group. In this case it'll be deleted.
Group management (details to be specified)
• Add a new command-line option to create groups
• Add a new command-line option to delete groups
• Add a new command-line option to set and remove clients to groups
• Add a new command-line option to set and remove domains to groups
What do you guys think?