Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
menshen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leap
menshen
Commits
99e9999e
Commit
99e9999e
authored
3 years ago
by
micah
Browse files
Options
Downloads
Plain Diff
Merge branch 'readme' into 'master'
updated README See merge request
!12
parents
cc604eac
ddcc8dfd
No related branches found
No related tags found
1 merge request
!12
updated README
Pipeline
#79123
passed
3 years ago
Stage: build
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.rst
+35
-3
35 additions, 3 deletions
README.rst
with
35 additions
and
3 deletions
README.rst
+
35
−
3
View file @
99e9999e
...
...
@@ -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>`_
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
provided in plain text format, under ``/``, and in json, under ``/json``.
...
...
@@ -20,14 +20,17 @@ You can use ``geoipupdate`` to download MaxMind's City database::
sudo apt install geoipupdate
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
(n
ote:
this service now
requires a license key
)
N
ote:
downloading the city database
requires a
free
license key
.
Usage
-----------------------
-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>
path to the GeoLite2-City database (default is "/var/lib/GeoIP/GeoLite2-City.mmdb")
-port <port>
...
...
@@ -39,3 +42,32 @@ Usage
-server_key string
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>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment