Duty-free, a Moonshine plugin for simple installation and configuration management of GeoIP
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
moonshine
spec
templates
README.md

README.md

Duty-free, a Moonshine plugin for GeoIP

Moonshine is a potent blend of Rails deployment and configuration management done right -- now get a taste of the spirits of the world by bringing a little GeoIP into your distillery.

This is a plugin for installing and managing the mod_geoip Apache module and the GeoIP C library it depends on. With GeoIP, Apache can handle requests with awareness of the client's locale, based on IP address. In addition to installing and enabling the libraries and module, it configures a cron job for regularly updating the GeoIP database.

Instructions

  • script/plugin install git://github.com/railsmachine/moonshine_geoip.git
  • Include the plugin and recipe(s) in your Moonshine manifest plugin :geoip recipe :geoip

Additional Configuration

The plugin defaults to installing the GeoIP C API and the 'GeoLite Country' database with a cron job to update it. Configuration options are available to also enable the +mod_geoip+ Apache module, use another available database, and specify license details if you're a GeoIP licensee. Set these options via the +configure+ method or moonshine.yml as usual:

:geoip:
  :apache_module: true
  :geo_database_url: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
  :user_id: Joebob
  :license_key: <your key>
  :product_ids: <your Product IDs for licensed databases>

-- or --

# In your manifests:
configure(:geoip => {:user_id => 'Joebob'})  # etc.

Refer to MaxMind for more on using your licensed products. As with all Moonshine plugins, you can also override the default templates included with this plugin to customize configuration. So to set things for the Apache module exactly how you want them:

$ cp vendor/plugins/moonshine_geoip/templates/geoip.conf app/manifests/templates
(hack)

Unless otherwise specified, all content copyright © 2014, Rails Machine, LLC