[PR #5357] [CLOSED] Restore the Custom Geo Manager #5855

Closed
opened 2026-11-02 04:04:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5357
Author: @mixa2130
Created: 6/15/2026
Status: ❌ Closed

Base: main ← Head: main


📝 Commits (4)

  • 38a7a43 feat(custom-geo): restore Custom Geo manager with cron
  • b931f51 fix(custom-geo): repair three CI failures from feat commit
  • d759240 Merge branch 'develop' into main
  • 4151214 Merge branch 'main' into main

📊 Changes

36 files changed (+2837 additions, -780 deletions)

View changed files

📝 Dockerfile (+1 -1)
📝 frontend/package-lock.json (+0 -30)
📝 frontend/public/openapi.json (+392 -0)
📝 frontend/src/generated/examples.ts (+2 -0)
📝 frontend/src/generated/schemas.ts (+10 -0)
📝 frontend/src/generated/types.ts (+2 -0)
📝 frontend/src/generated/zod.ts (+2 -0)
📝 frontend/src/pages/api-docs/endpoints.ts (+74 -0)
➕ frontend/src/pages/index/CustomGeoFormModal.tsx (+114 -0)
➕ frontend/src/pages/index/CustomGeoSection.css (+77 -0)
➕ frontend/src/pages/index/CustomGeoSection.tsx (+339 -0)
📝 frontend/src/pages/index/VersionModal.tsx (+6 -0)
📝 frontend/src/schemas/xray.ts (+22 -0)
📝 internal/database/db.go (+1 -0)
📝 internal/database/migrate_data.go (+1 -0)
📝 internal/database/model/model.go (+12 -0)
📝 internal/web/controller/api.go (+7 -3)
📝 internal/web/controller/api_docs_test.go (+2 -0)
➕ internal/web/controller/custom_geo.go (+205 -0)
📝 internal/web/entity/entity.go (+3 -0)

...and 16 more files

📄 Description

Summary

Restores the Custom Geo Manager as a new tab in the Xray Updates modal, allowing users
to define custom geoip/geosite sources with user-supplied URLs and aliases. Adds
cron-based auto-update scheduling for all custom sources. Also fixes three CI failures
that were introduced in the same commit (missing i18n keys, undocumented API routes,
stale generated files).

Why

The Custom Geo Manager was previously removed, which eliminated the ability to use
user-defined geodata files referenced in routing rules as ext:geoip_alias.dat:tag.
Users who rely on custom IP/domain lists for routing had no way to manage them from the
panel.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

How was this tested?

Backend:

  • go test ./... — all 27 packages pass, including TestAPIRoutesDocumented which
    verifies all 9 new /panel/api/custom-geo/* routes are documented
  • Verified CustomGeoResource model auto-migrates cleanly on first boot

Frontend:

  • npm run lint && npm run typecheck && npm run build pass
  • npm test — 540 tests pass, including InboundFormModal snapshot tests that were
    previously broken by missing i18n keys
  • git diff --exit-code -- frontend/src/generated frontend/public/openapi.json — no diff
    after npm run gen

Manual:

  1. Open the panel → Xray Updates modal → Custom Geo tab

  2. Add a new resource (type: geoip, alias: roscomvpn, URL: https://github.com/hydraponique/roscomvpn-geoip/releases/latest/download/geoip.dat)

  3. Click save — file fetches successfully

  4. Set a cron schedule (e.g. 0 3 * * *) — verified it persists across panel restarts
    without requiring a restart

  5. Delete a resource — file is removed from disk

  6. Click Update All — all custom resources update in one shot

  7. Reference the alias in a routing rule as ext:geoip_mylist.dat:tag

Screenshots / recordings

image image

Breaking changes

None. The feature adds a new database table (custom_geo_resources) via auto-migration.
No existing schema is modified.


🔄 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/5357 **Author:** [@mixa2130](https://github.com/mixa2130) **Created:** 6/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (4) - [`38a7a43`](https://github.com/MHSanaei/3x-ui/commit/38a7a43f74dc52e02eb4d69c494c220764b324a3) feat(custom-geo): restore Custom Geo manager with cron - [`b931f51`](https://github.com/MHSanaei/3x-ui/commit/b931f512db16f1bb585329891af75f2daa7a6e0f) fix(custom-geo): repair three CI failures from feat commit - [`d759240`](https://github.com/MHSanaei/3x-ui/commit/d7592403b2fc303635ee9efd5f64fc31cc0ec19c) Merge branch 'develop' into main - [`4151214`](https://github.com/MHSanaei/3x-ui/commit/4151214f128fa32edf4227c9a8e3ea45cfd1cbda) Merge branch 'main' into main ### 📊 Changes **36 files changed** (+2837 additions, -780 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+1 -1) 📝 `frontend/package-lock.json` (+0 -30) 📝 `frontend/public/openapi.json` (+392 -0) 📝 `frontend/src/generated/examples.ts` (+2 -0) 📝 `frontend/src/generated/schemas.ts` (+10 -0) 📝 `frontend/src/generated/types.ts` (+2 -0) 📝 `frontend/src/generated/zod.ts` (+2 -0) 📝 `frontend/src/pages/api-docs/endpoints.ts` (+74 -0) ➕ `frontend/src/pages/index/CustomGeoFormModal.tsx` (+114 -0) ➕ `frontend/src/pages/index/CustomGeoSection.css` (+77 -0) ➕ `frontend/src/pages/index/CustomGeoSection.tsx` (+339 -0) 📝 `frontend/src/pages/index/VersionModal.tsx` (+6 -0) 📝 `frontend/src/schemas/xray.ts` (+22 -0) 📝 `internal/database/db.go` (+1 -0) 📝 `internal/database/migrate_data.go` (+1 -0) 📝 `internal/database/model/model.go` (+12 -0) 📝 `internal/web/controller/api.go` (+7 -3) 📝 `internal/web/controller/api_docs_test.go` (+2 -0) ➕ `internal/web/controller/custom_geo.go` (+205 -0) 📝 `internal/web/entity/entity.go` (+3 -0) _...and 16 more files_ </details> ### 📄 Description Summary Restores the Custom Geo Manager as a new tab in the Xray Updates modal, allowing users to define custom geoip/geosite sources with user-supplied URLs and aliases. Adds cron-based auto-update scheduling for all custom sources. Also fixes three CI failures that were introduced in the same commit (missing i18n keys, undocumented API routes, stale generated files). Why The Custom Geo Manager was previously removed, which eliminated the ability to use user-defined geodata files referenced in routing rules as ext:geoip_alias.dat:tag. Users who rely on custom IP/domain lists for routing had no way to manage them from the panel. Type of change - [ ] Bug fix - [x] New feature - [ ] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other Areas affected - [x] Frontend (UI / panel pages) - [x] Backend (API endpoints, login, settings) - [ ] Xray config generation - [ ] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [x] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [ ] Telegram bot How was this tested? Backend: - go test ./... — all 27 packages pass, including TestAPIRoutesDocumented which verifies all 9 new /panel/api/custom-geo/* routes are documented - Verified CustomGeoResource model auto-migrates cleanly on first boot Frontend: - npm run lint && npm run typecheck && npm run build pass - npm test — 540 tests pass, including InboundFormModal snapshot tests that were previously broken by missing i18n keys - git diff --exit-code -- frontend/src/generated frontend/public/openapi.json — no diff after npm run gen Manual: 1. Open the panel → Xray Updates modal → Custom Geo tab 2. Add a new resource (type: geoip, alias: `roscomvpn`, URL: `https://github.com/hydraponique/roscomvpn-geoip/releases/latest/download/geoip.dat`) 3. Click save — file fetches successfully 4. Set a cron schedule (e.g. 0 3 * * *) — verified it persists across panel restarts without requiring a restart 5. Delete a resource — file is removed from disk 6. Click Update All — all custom resources update in one shot 8. Reference the alias in a routing rule as ext:geoip_mylist.dat:tag Screenshots / recordings <img width="527" height="716" alt="image" src="https://github.com/user-attachments/assets/9f1d825e-5a90-4114-aefb-af52edeb52c6" /> <img width="858" height="813" alt="image" src="https://github.com/user-attachments/assets/f64a59b9-271f-494e-aab9-2a6228158c05" /> Breaking changes None. The feature adds a new database table (custom_geo_resources) via auto-migration. No existing schema is modified. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:04:33 +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#5855
No description provided.