mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #3657] [CLOSED] Automatic geodat file updates in docker #5498
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5498
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/3657
Author: @mixa2130
Created: 1/9/2026
Status: ❌ Closed
Base:
main← Head:main📄 Description
Сontinuation of the PR#3592
What is the pull request?
Hi everyone!
The main goal of this pull request is to introduce a new killer feature to 3xui: automatic geodat file updates.
Why is this needed?
We live in challenging times, where many governments try to restrict internet freedom and monitor users’ online activity. For example, in Russia, Roskomnadzor blocks or throttles around 20 services every day. Xray is a great protocol, but it’s not completely immune to detection. One of the best ways to protect a VPN server is to minimize outgoing traffic — something 3xui already helps with a lot.
However, as I mentioned earlier, the list of blocked resources changes extremely quickly nowadays, and updating geodat files manually through the panel has become quite inconvenient. This pull request solves that problem by adding automated updates.
What this PR includes:
1. Cron container — downloads geodat files on a configurable schedule (via docker env), storing them in a shared volume.
2. Docker proxy — allows the cron container to restart the main 3xui container so the new geodat files are applied automatically.
3. Some additional refactoring that I believe will be useful.
Answers to frequently asked questions:
I updated the current geodat download logic. Previously, it used a simple
wget -O, which overwrote the existing file even if the source was unavailable or returned an empty response.Now it uses a safer method:
xray-tools.sh/safe_download_and_update, which updates the file only if the newly downloaded version is valid and not empty. This prevents accidental corruption of existing geodat files and makes the update process much more reliable.No problem. After the first launch, the user can simply disable the geodata_cron and docker_proxy containers. The existing geodat files will still be available through the shared volume, but they will no longer be updated automatically. Updates will occur again only if the containers are re-enabled or restarted.
No problem, just add them to shared volume
$PWD/geodata/and restart the3xui_appcontainerAbsolutely! It can only restart the container
Update
CRON_SCHEDULEand restart thegeodata_croncontainergeodata_cronreally works?Enter the
geodata_croncontainer and view/var/log/cron.log.I tested all the changes on both Debian and Ubuntu based VPS servers, and everything works correctly even with 1 vCore/1Gb resources
Which part of the application is affected by the change?
Type of Changes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.