[PR #3971] [MERGED] Fix geosite:ru rule (Normalization to RU vs lowercase ru) #5571

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/3971
Author: @Troodi
Created: 3/26/2026
Status: ✅ Merged
Merged: 4/19/2026
Merged by: @MHSanaei

Base: main ← Head: fix


📝 Commits (3)

  • d9f3a03 Fix geosite:ru rule (Normalization to RU vs lowercase ru)
  • 45ef05a Merge branch 'main' into fix
  • 3b05799 fix

📊 Changes

3 files changed (+75 additions, -1 deletions)

View changed files

📝 go.mod (+1 -1)
📝 web/service/server.go (+56 -0)
📝 web/web.go (+18 -0)

📄 Description

What is the pull request?

Fixes a bug where Xray-core fails to start when a geosite:ru routing rule is added. The root cause is a case-sensitivity mismatch: Xray internally normalizes 2-letter country codes to uppercase (RU), but the lookup in geosite.dat is case-sensitive and the file stores tags in lowercase (ru). This results in a code not found in geosite.dat: RU error even though the configuration is correct.

Which part of the application is affected by the change?

  • Frontend
  • Backend

Type of Changes

  • Bug fix
  • New feature
  • Refactoring
  • Other

Steps

Before (Xray fails to start):
Failed to start: main: failed to load config files: [bin/config.json] >
infra/conf: failed to build routing configuration >
infra/conf: invalid field rule >
infra/conf: failed to parse domain rule: geosite:ru >
infra/conf: failed to load geosite: RU >
infra/conf: code not found in geosite.dat: RU

After: Xray starts successfully with geosite:ru routing rules.


🔄 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/3971 **Author:** [@Troodi](https://github.com/Troodi) **Created:** 3/26/2026 **Status:** ✅ Merged **Merged:** 4/19/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix` --- ### 📝 Commits (3) - [`d9f3a03`](https://github.com/MHSanaei/3x-ui/commit/d9f3a030f878f7524162f02eafe7f1aab0c83415) Fix geosite:ru rule (Normalization to RU vs lowercase ru) - [`45ef05a`](https://github.com/MHSanaei/3x-ui/commit/45ef05a52306dce8dea6b77891eb38ada6d9ee86) Merge branch 'main' into fix - [`3b05799`](https://github.com/MHSanaei/3x-ui/commit/3b057992799ecae1c6053e3a5ed3c83d2a7cb4cb) fix ### 📊 Changes **3 files changed** (+75 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `go.mod` (+1 -1) 📝 `web/service/server.go` (+56 -0) 📝 `web/web.go` (+18 -0) </details> ### 📄 Description ## What is the pull request? Fixes a bug where Xray-core fails to start when a `geosite:ru` routing rule is added. The root cause is a case-sensitivity mismatch: Xray internally normalizes 2-letter country codes to uppercase (`RU`), but the lookup in `geosite.dat` is case-sensitive and the file stores tags in lowercase (`ru`). This results in a `code not found in geosite.dat: RU` error even though the configuration is correct. ## Which part of the application is affected by the change? - [ ] Frontend - [x] Backend ## Type of Changes - [x] Bug fix - [ ] New feature - [ ] Refactoring - [ ] Other ## Steps **Before (Xray fails to start):** Failed to start: main: failed to load config files: [bin/config.json] > infra/conf: failed to build routing configuration > infra/conf: invalid field rule > infra/conf: failed to parse domain rule: geosite:ru > infra/conf: failed to load geosite: RU > infra/conf: code not found in geosite.dat: RU **After:** Xray starts successfully with `geosite:ru` routing rules. --- <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:53 +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#5571
No description provided.