refactor: replace custom geo manager with Xray-core native geodata auto-update

Remove the panel-side custom geo download feature (service, controller,
/panel/api/custom-geo/* endpoints, CustomGeoResource model, UI tab) in
favor of Xray-core's native geodata section
(https://xtls.github.io/config/geodata.html).

- pass the top-level "geodata" key through xray.Config so it survives
  the template round-trip into the generated config
- add a Geodata Auto-Update section to the Xray Updates modal that
  edits geodata (cron schedule, download outbound, asset list) in the
  config template and restarts Xray on save
- previously downloaded geo files in the bin folder keep working in
  ext: routing rules; the orphaned custom_geo_resources table is left
  in place so existing source URLs stay recoverable
This commit is contained in:
MHSanaei
2026-06-10 18:27:12 +02:00
parent 4002be4ade
commit 3092326d9e
43 changed files with 416 additions and 2875 deletions
+13 -42
View File
@@ -219,48 +219,19 @@
"geofilesUpdateDialogDesc": "Це оновить усі геофайли.",
"geofilesUpdateAll": "Оновити все",
"geofileUpdatePopover": "Геофайл успішно оновлено",
"customGeoTitle": "Користувацькі GeoSite / GeoIP",
"customGeoAdd": "Додати",
"customGeoType": "Тип",
"customGeoAlias": "Псевдонім",
"customGeoUrl": "URL",
"customGeoEnabled": "Увімкнено",
"customGeoLastUpdated": "Оновлено",
"customGeoExtColumn": "Маршрутизація (ext:…)",
"customGeoToastUpdateAll": "Усі користувацькі джерела оновлено",
"customGeoActions": "Дії",
"customGeoEdit": "Змінити",
"customGeoDelete": "Видалити",
"customGeoDownload": "Оновити зараз",
"customGeoModalAdd": "Додати користувацький geo",
"customGeoModalEdit": "Змінити користувацький geo",
"customGeoModalSave": "Зберегти",
"customGeoDeleteConfirm": "Видалити це джерело geo?",
"customGeoRoutingHint": "У правилах маршрутизації використовуйте значення як ext:файл.dat:тег (замініть тег).",
"customGeoInvalidId": "Некоректний ідентифікатор ресурсу",
"customGeoAliasesError": "Не вдалося завантажити псевдоніми geo",
"customGeoValidationAlias": "Псевдонім: лише a-z, цифри, - і _",
"customGeoValidationUrl": "URL має починатися з http:// або https://",
"customGeoAliasPlaceholder": "a-z 0-9 _ -",
"customGeoAliasLabelSuffix": " (власний)",
"customGeoToastList": "Список користувацьких geo",
"customGeoToastAdd": "Додати користувацький geo",
"customGeoToastUpdate": "Оновити користувацький geo",
"customGeoToastDelete": "Користувацький geofile «{{ .fileName }}» видалено",
"customGeoToastDownload": "Geofile «{{ .fileName }}» оновлено",
"customGeoErrInvalidType": "Тип має бути geosite або geoip",
"customGeoErrAliasRequired": "Потрібен псевдонім",
"customGeoErrAliasPattern": "Псевдонім містить недопустимі символи",
"customGeoErrAliasReserved": "Цей псевдонім зарезервовано",
"customGeoErrUrlRequired": "Потрібен URL",
"customGeoErrInvalidUrl": "Некоректний URL",
"customGeoErrUrlScheme": "URL має використовувати http або https",
"customGeoErrUrlHost": "Некоректний хост URL",
"customGeoErrDuplicateAlias": "Цей псевдонім уже використовується для цього типу",
"customGeoErrNotFound": "Джерело geo не знайдено",
"customGeoErrDownload": "Помилка завантаження",
"customGeoErrUpdateAllIncomplete": "Не вдалося оновити один або кілька користувацьких джерел",
"customGeoEmpty": "Користувацьких джерел geo поки немає — натисніть «Додати», щоб створити",
"geodataTitle": "Автооновлення Geodata",
"geodataHint": "Xray завантажує ці файли за розкладом і перезавантажує їх без перезапуску. URL мають бути HTTPS. Файл має вже існувати в теці bin, щоб Xray міг його оновлювати.",
"geodataCron": "Розклад (cron)",
"geodataOutbound": "Завантажувати через outbound (необов’язково)",
"geodataFile": "Ім’я файлу",
"geodataAddFile": "Додати файл",
"geodataSaveRestart": "Зберегти та перезапустити Xray",
"geodataConfirmTitle": "Зберегти налаштування geodata?",
"geodataConfirmContent": "Шаблон конфігурації Xray буде оновлено, а Xray перезапущено.",
"geodataInvalidUrl": "Для кожного файлу потрібен HTTPS URL.",
"geodataInvalidFile": "Ім’я файлу має бути простим, напр. geosite_custom.dat (без шляхів).",
"geodataInvalidCron": "Cron має містити 5 полів, напр. 0 4 * * *",
"geodataEmpty": "Файли не налаштовано. У правилах маршрутизації файли вказуються як ext:geosite_custom.dat:category.",
"dontRefresh": "Інсталяція триває, будь ласка, не оновлюйте цю сторінку",
"logs": "Логи",
"config": "Конфігурація",