Skip to content

Commit

Permalink
Update geo-support.mdx (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
benniekiss authored Sep 14, 2024
1 parent e7109cb commit 4079455
Showing 1 changed file with 8 additions and 35 deletions.
43 changes: 8 additions & 35 deletions src/pages/selfhosted/geo-support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,11 @@ After downloading, the management system prepares the databases for use. If the
## Updating the GeoLite2 Database

The GeoLite2 databases are updated twice a week to reflect changes in geolocation data. It's crucial to keep your
local GeoLite2 databases updated. You can achieve this manually through the script provided below.

Here are the steps to update the GeoLite2 databases:

### Step 1. Switch to the infrastructure files directory:
```bash
cd netbird/infrastructure_files/
```

### Step 2. Run the script to download the GeoLite2 databases:
```bash
./download-geolite2.sh
```
After successfully running the script, two database files (`geonames.db` and `GeoLite2-City.mmdb`) are created in the
`netbird/infrastructure_files/` directory.

### Step 3. The next step involves moving these files into our management service container.

Move the `geonames.db` database:
```bash
docker-compose cp geonames.db management:/var/lib/netbird/
```

Move the `GeoLite2-City.mmdb` database:
```bash
docker-compose cp GeoLite2-City.mmdb management:/var/lib/netbird/
```

4. To complete the process, restart the management service to ensure that it loads the updated databases:

```bash
docker-compose restart management
```
This completes the upgrade process. Your GeoLite2 databases are now up-to-date.
By following the guide above, your GeoLite2 databases should always be updated with the latest geolocation data.
local GeoLite2 databases updated. When the `management` service is started, the service will query the [Download URLs](#downloading-the-databases) to check
if the current database is outdated. If the database is outdated or does not exist, the files will be downloaded
and loaded automatically. Restarting the `management` service will trigger the update check.

This behavior can be disabled by passing the `--disable-geolite-update` flag to the `management` command. When
`--disable-geolite-update` is set, the service will download the geolite databases only if there is no file in the data directory. The database with the
most recent date will be loaded if more than one exists. If a database does not exist, it will be downloaded
and loaded, but it will not be updated on subsequent restarts of the `management` service.

0 comments on commit 4079455

Please sign in to comment.