FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

PresideCMS Extension: IP Geolocation API

v1.3.4 Public

Preside IP Geolocation APIs Extension

Preside extension to allow application developers to get all geolocation information about an IP address in a number of different formats.

Mainly developed for use with the https://extreme-ip-lookup.com/ IP Geolocation service but can be adapted to another provider.

Simply configure the API settings and that should be all you need. Examples are given in the CMS Admin Settings form.

IMPORTANT NOTE

The https://extreme-ip-lookup.com/ IP Geolocation service now requires an API key so please register an account there first before configuring.

There is still a free plan but the calls will be rejected if not made with a valid API key which can simply be added in the CMS Admin settings.

IPv4 and IPv6 Support

The initial service provider Extreme IP Lookup does not currently support IPv6 address format lookups therefore the extension was extended to include an additional service https://ipwhois.io/ which provides the same level of accuracy but acts as a backup if the visitors IP address format is not IPv4.

Installation

Install the extension to your application via either of the methods detailed below (Git submodule / CommandBox + ForgeBox)

Git Submodule method

From the root of your application, type the following command:

git submodule add https://github.com/nodoherty/preside-ext-ip-geolocation-apis.git application/extensions/preside-ext-ip-geolocation-apis

CommandBox (box.json) method

From the root of your application type the following command:

box install preside-ext-ip-geolocation-apis

From the Preside CMS developer console (using the back tick ` key) reload the application: reload all

Enabling the extension

Once the files are installed, enable the extension by reloading the application:

reload all --force

Usage

See the included handler ipGeolocation.cfc for examples of calling directly via ColdFusion server code or via AJAX

You can use the text method to see debug output for the API calls, simply update your IP Address in the URL below: ?event=ipGeolocation.proxyGetIp&test_ip_address=78.155.228.144

Dependencies (0)


Dev Dependencies (0)


Changelog

1.3.4

  • Adding debug output for the test method proxyGetIp()

1.3.3

  • Fixing bug with getting the API key - removed incorrect Val()
  • Adding the ability to pass a test IP address in the URL using parameter test_ip_address
  • Adding check for the existence of a leading "/" in the endpoint URL, adding if missing
  • Adding API Key parameter "key=" to the URL for the extreme IP lookup service as per their updated docs - https://extreme-ip-lookup.com/
  • Updated README with notes on the new requirement for the API key

1.3.2 & 1.3.1

  • Adding cache lookups for the IPv6 addresses to the rules engine expressions
  • Bumping the version numbers

1.3.0

  • Adding new service for IPv6 support
  • Adding caching to help with remain within 3rd party API rate limits
  • Changelog added

1.2.7

  • Fixing typo and updating instructions + bumping version numbers

1.2.5

  • Updating extension to allow for smaller HTTP call timeout values

 

$ box install preside-ext-ip-geolocation-apis

No collaborators yet.
   
  • {{ getFullDate("Nov 04 2021 11:11 AM GMT") }}
  • {{ getFullDate("Nov 04 2021 11:11 AM GMT") }}
  • 1,756
  • 2,263
  • 2,935