mirror of
https://github.com/fosrl/docs-v2.git
synced 2026-02-19 03:16:47 +00:00
fix: #49 This PR adds a warning to the top of the Native GeoBlock article to a new dedicated community guide how to remove the legacy method of geoblocking
70 lines
2.5 KiB
Plaintext
70 lines
2.5 KiB
Plaintext
---
|
|
title: "Enable Geo-blocking"
|
|
description: "Configuration requirements to enable geoblocking in Pangolin"
|
|
---
|
|
|
|
<Warning>
|
|
If you previously enabled the Traefik GeoBlock plugin (PascalMinder), remove that plugin and its middleware config before enabling native geoblocking in Pangolin. Running both can cause unexpected blocks or startup errors. See [Remove the GeoBlock plugin](/self-host/community-guides/remove-geoblock-plugin).
|
|
</Warning>
|
|
|
|
To enable geoblocking in Pangolin Community you must download and place the Maxmind geoip database into the `config/` directory and update the config file. This can be done for free.
|
|
|
|
<Tip>
|
|
Remember to keep the GeoIP database updated regularly, as IP-to-country mappings can change over time. You can just repeat the download and extraction steps periodically to ensure your database is current.
|
|
</Tip>
|
|
|
|
<Tip>
|
|
It is possible to automate this process with a Docker container from Maxmind themself.
|
|
Have a look at this [Community guide](/self-host/community-guides/geolite2automation) on how to implement this!
|
|
</Tip>
|
|
|
|
You can use the installer to download and place the database for you, just grab the latest installer:
|
|
|
|
```bash
|
|
curl -fsSL https://static.pangolin.net/get-installer.sh | bash
|
|
```
|
|
Then run the installer again:
|
|
|
|
```bash
|
|
./installer
|
|
```
|
|
|
|
### Manual Installation Steps
|
|
|
|
<Steps>
|
|
<Step title="Download and extract the GeoIP database">
|
|
Download and extract the GeoLite2 Country database using the following commands:
|
|
|
|
```bash
|
|
# Download the GeoLite2 Country database
|
|
curl -L -o GeoLite2-Country.tar.gz https://github.com/GitSquared/node-geolite2-redist/raw/refs/heads/master/redist/GeoLite2-Country.tar.gz
|
|
|
|
# Extract the database
|
|
tar -xzf GeoLite2-Country.tar.gz
|
|
|
|
# Move the .mmdb file to the config directory
|
|
mv GeoLite2-Country_*/GeoLite2-Country.mmdb config/
|
|
|
|
# Clean up the downloaded files
|
|
rm -rf GeoLite2-Country.tar.gz GeoLite2-Country_*
|
|
```
|
|
</Step>
|
|
<Step title="Update the Pangolin config file">
|
|
Update your Pangolin configuration to point to the new GeoIP database file. Edit your `config/config.yml` file to include the following entry:
|
|
|
|
```yaml
|
|
server:
|
|
maxmind_db_path: "./config/GeoLite2-Country.mmdb"
|
|
```
|
|
</Step>
|
|
<Step title="Restart Pangolin">
|
|
Restart your Pangolin instance to apply the changes:
|
|
|
|
```bash
|
|
docker compose restart pangolin
|
|
```
|
|
</Step>
|
|
</Steps>
|
|
|
|
Alternatively, you can create an account at [Maxmind](https://www.maxmind.com/en/geolite2/signup) to get a license key and download the database directly from them.
|