Improve ips/domains view to also include properties of domains/ips respectively
At the moment bbrf ips pulls a list of all documents of the type "ip" that belong to a program. However, the CouchDB currently stores IPs in two ways:
- As individual documents, e.g. a document with identifier
1.1.1.1and typeip; - As properties of a domain, e.g. a document with identifier
one.example.comand typedomainthat has property:"ips":["1.1.1.1"]
BBRF does not enforce any kind of synchronization between these representations of IP addresses, which means there is a possibility that an IP may exist as a property of a domain, but not as a unique document in the database (and vice-versa).
It may be a useful addition to ensure both types of IP addresses get returned when running the bbrf ips command, to make abstraction of the way IPs are stored in the database. This would allow you to run e.g.:
bbrf domain add one.example.com:1.1.1.1
bbrf ips # includes 1.1.1.1
# whereas at the moment, this requires `bbrf ip add 1.1.1.1` first
The same would apply for bbrf domains.
Will keep this issue open while I contemplate the impact of this change further. Input welcome!