openwisp-controller icon indicating copy to clipboard operation
openwisp-controller copied to clipboard

[feature] Add Whois model and basic functionality

Open DragnEmperor opened this issue 7 months ago • 1 comments

This involves:

  • Creating WHOIS model with required fields. The fields which are being stored right now are : Organization name, Country, ASN, Timezone, Address, CIDR, Device, last_ip (of device).
  • Setting up Maxmind account and database/service for geoip2

DragnEmperor avatar May 14 '25 02:05 DragnEmperor

As per discussion, we can modify the WhoIs model by creating relation using Device.last_ip - Whois.ip_address:

Benefit:

  • Multiple devices can use the same Whois record - fewer API calls.

For deleting orphan records on device deletion, we can use the idea proposed by @pandafy with a slight modification:

  • Whenever a device is deleted, check if that ip is not used by other devices or if the data is outdated (X days threshold). If any of the above is True then delete. If both turns out false then do not delete.
  • The other devices linked to it will then automatically trigger the lookup again for new details

DragnEmperor avatar May 27 '25 17:05 DragnEmperor