Skip to content
Snippets Groups Projects
Commit ddcc8dfd authored by elijah's avatar elijah
Browse files

updated README

parent cc604eac
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ Menshen is a geolocation and gateway status service for LEAP VPN. ...@@ -6,7 +6,7 @@ Menshen is a geolocation and gateway status service for LEAP VPN.
In chinese folk religions, `menshen <https://en.wikipedia.org/wiki/Menshen>`_ In chinese folk religions, `menshen <https://en.wikipedia.org/wiki/Menshen>`_
are guardians of doors and gates. are guardians of doors and gates.
The geolocation service provides the remote ip (via X-Forwarded-For header, if The geolocation service provides the remote IP (via X-Forwarded-For header, if
present), country code, city, and geographical coordinates. Information is present), country code, city, and geographical coordinates. Information is
provided in plain text format, under ``/``, and in json, under ``/json``. provided in plain text format, under ``/``, and in json, under ``/json``.
...@@ -20,12 +20,15 @@ You can use ``geoipupdate`` to download MaxMind's City database:: ...@@ -20,12 +20,15 @@ You can use ``geoipupdate`` to download MaxMind's City database::
sudo apt install geoipupdate sudo apt install geoipupdate
sudo cp /usr/share/doc/geoipupdate/examples/GeoIP.conf.default /etc/GeoIP.conf sudo cp /usr/share/doc/geoipupdate/examples/GeoIP.conf.default /etc/GeoIP.conf
sudo sed -i 's/YOUR_ACCOUNT_ID_HERE/xxxxxx/' /etc/GeoIP.conf
sudo sed -i 's/YOUR_LICENSE_KEY_HERE/xxxxxx/' /etc/GeoIP.conf
sudo geoipupdate -v sudo geoipupdate -v
(note: this service now requires a license key) Note: downloading the city database requires a free license key.
Usage Usage
----------------------- -----------------------
-api <tld> -api <tld>
domain for the api. Default: black.riseup.net. It can be also set via MENSHEN_API env var. domain for the api. Default: black.riseup.net. It can be also set via MENSHEN_API env var.
-geodb <path> -geodb <path>
...@@ -39,3 +42,32 @@ Usage ...@@ -39,3 +42,32 @@ Usage
-server_key string -server_key string
path to the key file for TLS path to the key file for TLS
Running Locally
-----------------------
There are several options for running menshen locally for development.
As a container from the registry::
docker pull registry.0xacab.org/leap/menshen
docker run -p 9001:9001 -v /var/lib/GeoIP/:/var/lib/GeoIP/ -e "MENSHEN_API=https://api.example.org" registry.0xacab.org/leap/menshen
As a container built locally::
docker build -t menshen:latest .
docker run -p 9001:9001 -v /var/lib/GeoIP/:/var/lib/GeoIP/ -e "MENSHEN_API=https://api.example.org" menshen:latest
Run without container::
go build
./menshen -notls -api https://api.example.org
Fetch the results::
curl -H "X-Forwarded-For: 8.8.8.8" localhost:9001/json
See Also
-----------------------
<https://github.com/weaming/geoip>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment