From 407945577474683555a17c6a722021feb6878e09 Mon Sep 17 00:00:00 2001 From: benniekiss <63211101+benniekiss@users.noreply.github.com> Date: Sat, 14 Sep 2024 07:22:33 -0400 Subject: [PATCH] Update geo-support.mdx (#224) --- src/pages/selfhosted/geo-support.mdx | 41 +++++----------------------- 1 file changed, 7 insertions(+), 34 deletions(-) diff --git a/src/pages/selfhosted/geo-support.mdx b/src/pages/selfhosted/geo-support.mdx index 4a324417..5979e769 100644 --- a/src/pages/selfhosted/geo-support.mdx +++ b/src/pages/selfhosted/geo-support.mdx @@ -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. +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. -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. \ No newline at end of file +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.