Code Monkey home page Code Monkey logo

geo-ip-plugin's Introduction

Mibew Geo IP plugin

Provides Geo IP information for other plugins.

Requires either GMP (GNU Multiple Precision) or BC Math (BCMath Arbitrary Precision Mathematics) PHP extension.

Installation

  1. Get the archive with the plugin sources. You can download it from the official site or build the plugin from sources.

  2. Untar/unzip the plugin's archive.

  3. Put files of the plugins to the <Mibew root>/plugins folder.

  4. Obtain a copy of MaxMind's GeoIP2 City datatbase. You can use a free one from here http://dev.maxmind.com/geoip/geoip2/geolite2/.

  5. Rename the database file to GeoIP.mmdb and put it into <Mibew root>/plugins/Mibew/Mibew/Plugin/GeoIp/db directory.

  6. (optional) Add plugins configs to "plugins" structure in "<Mibew root>/configs/config.yml". If the "plugins" stucture looks like plugins: [] it will become:

    plugins:
        "Mibew:GeoIp": # Plugin's configurations are described below
            database_path: "/usr/local/share/GeoIP/GeoIP2-City.mmdb"
  7. Navigate to "<Mibew Base URL>/operator/plugin" page and enable the plugin.

Plugin's configurations

The plugin can be configured with values in "<Mibew root>/configs/config.yml" file.

config.database_path

Type: String

Default: <Plugin dir>/db/GeoIP.mmdb

Specify location of the GeoIP database. This value is optional and can be skipped.

Build from sources

There are several actions one should do before use the latest version of the plugin from the repository:

  1. Obtain a copy of the repository using git clone, download button, or another way.
  2. Install node.js and npm.
  3. Install Gulp.
  4. Install npm dependencies using npm install.
  5. Run Gulp to build the sources using gulp default.

Finally .tar.gz and .zip archives of the ready-to-use Plugin will be available in release directory.

License

Apache License 2.0

geo-ip-plugin's People

Contributors

faf avatar justblackbird avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

geo-ip-plugin's Issues

Unable to install on Mibew 3.2.1- Application stopped

OS: Ubuntu 16.04 LTS, Mibew 3.2.1 GeoIP 1.0.2
Environment: PHP 7.0.32-0ubuntu0.16.04.1 PDO/7.0.32-0ubuntu0.16.04.1 pdo_mysql/7.0.32-0ubuntu0.16.04.1 gd/7.0.32-0ubuntu0.16.04.1 curl/7.0.32-0ubuntu0.16.04.1 mbstring/7.0.32-0ubuntu0.16.04.1

On installing the plugin, /index.php/operator/plugin produces the following error:
PHP message: PHP Warning: Application stopped because of uncaught exception vierbergenlars\SemVer\SemVerException "Invalid Version: 7.0.32-0ubuntu0.16.04.1 [[7.0.32-0ubuntu0.16.04.1]]

Error on installing plugin!

Error on installing plugin! State says "not initialized"
That is not my problem but problem of thousand of users.
Just search around for phrase "Mibew not initialized".
And replies for it is like reply from 15years old's.

Hidden dependency through GeoIP2

Just a note to people running into the same problem as I did:

Problem: after installing the geo-ip and the OSM plugin into Mibew, nothing happens after clicking the IP of a user. There are no error messages inside the webserver's error.log and no javascript errors in the browser.

Solution: check manually if the GeoIP2 library works, e.g. by running a small test script from the plugins/Mibew/Mibew/Plugin/GeoIp directory:

<?php
require_once("vendor/autoload.php");
use GeoIp2\Database\Reader as GeoIpReader;
$reader = new GeoIpReader("db/GeoIP.mmdb");

In my case, I got the error:

PHP Fatal error: Uncaught RuntimeException: The gmp or bcmath extension must be installed to read this database. in /var/www/html/mibew/plugins/Mibew/Mibew/Plugin/GeoIp/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php:259

After installing php-bcmath, everything worked as expected. Maybe this could be mentioned in the README or some other place.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.