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

[feature] Base setup for WHOIS model #1032 #1033 #1037 #1045

Open DragnEmperor opened this issue 7 months ago • 0 comments

Checklist

  • [x] I have read the OpenWISP Contributing Guidelines.
  • [x] I have manually tested the changes proposed in this pull request.
  • [x] I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • [x] I have updated the documentation.

Reference to Existing Issue

Closes #1032 Closes #1033 Closes #1037 Closes #1045

Description of Changes

Added a new model to store WHOIS details for a device with the required fields. Implemented a new celery task to fetch WHOIS details using the geoip2 web service. Using an external library instead of the wrapper class provided by django because the wrapper class is designed to work with local databases and also is not currently designed to work with ASN databases. In order to trigger the task whenever last_ip changes, using existing logic of _changed_fields to track the changes.

Steps to obtain GeoIP creds

  1. Create Maxmind account using the following link: https://www.maxmind.com/en/geolite2/signup?utm_source=kb&utm_medium=kb-link&utm_campaign=kb-create-account

  2. Go to Manage License Keys image

  3. Generate a New license Key. Name it whatever you like image

  4. Copy the Account Id and License Key and Paste it in the environment variables: GEOIP_ACCOUNT_ID and GEOIP_LICENSE_KEY.

DragnEmperor avatar May 23 '25 19:05 DragnEmperor