[PR #3748] [CLOSED] Add x-ui-updategeo.timer and .service files #5518

Closed
opened 2026-10-31 20:47:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/3748
Author: @nebulosa2007
Created: 2/4/2026
Status: ❌ Closed

Base: main ← Head: updatetimer


📝 Commits (3)

  • 5d1ae6b feat: add scheduled geofile update system with systemd timer and service
  • 5b18d1b feat: add optional x-ui-updategeo.timer and .service files
  • d8cb65e Merge branch 'MHSanaei:main' into updatetimer

📊 Changes

5 files changed (+140 additions, -105 deletions)

View changed files

📝 .github/workflows/release.yml (+4 -0)
📝 install.sh (+65 -39)
📝 update.sh (+45 -66)
➕ x-ui-updategeo.service (+11 -0)
➕ x-ui-updategeo.timer (+15 -0)

📄 Description

What is the pull request?

  • Refactoring/fix: removed some obsolete code — checking for the existing of the x-ui.service file — will never be true even for legacy versions.
  • Refactoring: for the Alpine x-ui.rc file, loading starts right away with ipv4, like for other service files.
  • New: Added timer and systemd service files for loading the dat files:
 [Timer]
AccuracySec=5min              
# For delay activation by up to 5 minutes to batch timer executions efficiently.
OnBootSec=5min                
# Runs the timer 5 minutes after system boot
OnCalendar=*-*-* 02,14:00:00 UTC  
# Schedules the timer to trigger every day at 02:00 and 14:00 UTC. (see below)
FixedRandomDelay=true         
# Applies the randomized delay deterministically.
RandomizedDelaySec=10min      
# Adds a random delay of up to 10 minutes to the scheduled activation time (useful to avoid simultaneous triggers on multiple hosts).
Persistent=true               
# Ensures missed runs (e.g., if the system was off) are triggered immediately after boot.

Unit=x-ui-updategeo.service   
# Specifies which service unit to start when the timer fires.

It is set to run service at 02:00 and 14:00 UTC:

  1. Loyalsoldier (geoip.dat, geosite.dat) - updates at 10PM UTC
  2. chocolate4u (geoip_IR.dat, geosite_IR.dat) - updates at 04:40 UTC
  3. runetfreedom (geoip_RU.dat, geosite_RU.dat) - updates at 03:30, 09:30, 15:30, and 21:30 UTC

This is a compromise to receive updates twice a day.

After installing the files, only a message on how to activate the timer will be displayed.
It works for version 2.8.8 and later. I have been testing this timer for a couple of weeks already.

Which part of the application is affected by the change?

  • Frontend
  • Backend

Type of Changes

  • Bug fix
  • New feature
  • Refactoring
  • Other

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/3748 **Author:** [@nebulosa2007](https://github.com/nebulosa2007) **Created:** 2/4/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `updatetimer` --- ### 📝 Commits (3) - [`5d1ae6b`](https://github.com/MHSanaei/3x-ui/commit/5d1ae6be16f4cde2e55f322f4364fe63ecb1e9bf) feat: add scheduled geofile update system with systemd timer and service - [`5b18d1b`](https://github.com/MHSanaei/3x-ui/commit/5b18d1b018ebe7c29175f17ed9fdf70e4c798e2e) feat: add optional x-ui-updategeo.timer and .service files - [`d8cb65e`](https://github.com/MHSanaei/3x-ui/commit/d8cb65e2b5744bc6ef9423410e16ca95126a0082) Merge branch 'MHSanaei:main' into updatetimer ### 📊 Changes **5 files changed** (+140 additions, -105 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/release.yml` (+4 -0) 📝 `install.sh` (+65 -39) 📝 `update.sh` (+45 -66) ➕ `x-ui-updategeo.service` (+11 -0) ➕ `x-ui-updategeo.timer` (+15 -0) </details> ### 📄 Description ## What is the pull request? - Refactoring/fix: removed some obsolete code — checking for the existing of the `x-ui.service` file — will never be true [even for legacy versions](https://github.com/nebulosa2007/3x-ui/blob/d8fb09faaeeebe34b57f1c26aa1ab8b529327989/x-ui.sh#L169). - Refactoring: for the Alpine `x-ui.rc` file, loading starts right away with ipv4, like for other service files. - New: Added timer and systemd service files for loading the `dat` files: ``` [Timer] AccuracySec=5min # For delay activation by up to 5 minutes to batch timer executions efficiently. OnBootSec=5min # Runs the timer 5 minutes after system boot OnCalendar=*-*-* 02,14:00:00 UTC # Schedules the timer to trigger every day at 02:00 and 14:00 UTC. (see below) FixedRandomDelay=true # Applies the randomized delay deterministically. RandomizedDelaySec=10min # Adds a random delay of up to 10 minutes to the scheduled activation time (useful to avoid simultaneous triggers on multiple hosts). Persistent=true # Ensures missed runs (e.g., if the system was off) are triggered immediately after boot. Unit=x-ui-updategeo.service # Specifies which service unit to start when the timer fires. ``` It is set to run service at 02:00 and 14:00 UTC: 1. Loyalsoldier (geoip.dat, geosite.dat) - [updates at 10PM UTC ](https://github.com/Loyalsoldier/v2ray-rules-dat/blob/b74d235f909125256d8b6d3bfbb8cf55872b8f10/.github/workflows/run.yml#L5) 2. chocolate4u (geoip_IR.dat, geosite_IR.dat) - [updates at 04:40 UTC](https://github.com/Chocolate4U/Iran-v2ray-rules/blob/676695ea3b4c95d5cf48a7c4e2e718bac5b8a099/.github/workflows/release.yml#L12) 3. runetfreedom (geoip_RU.dat, geosite_RU.dat) - [updates at 03:30, 09:30, 15:30, and 21:30 UTC](https://github.com/runetfreedom/russia-v2ray-rules-dat/blob/bc6ee7f63025745b338d9b2391f2f4615b13cfb5/.github/workflows/build.yml#L5C5-L5C33) This is a compromise to receive updates twice a day. After installing the files, only a message on how to activate the timer will be displayed. It works for version 2.8.8 and later. I have been testing this timer for a couple of weeks already. ## Which part of the application is affected by the change? - [ ] Frontend - [x] Backend ## Type of Changes - [ ] Bug fix - [x] New feature - [x] Refactoring - [ ] Other --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:47:32 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5518
No description provided.