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": "Ini akan memperbarui semua berkas.",
"geofilesUpdateAll": "Perbarui semua",
"geofileUpdatePopover": "Geofile berhasil diperbarui",
"customGeoTitle": "GeoSite / GeoIP kustom",
"customGeoAdd": "Tambah",
"customGeoType": "Jenis",
"customGeoAlias": "Alias",
"customGeoUrl": "URL",
"customGeoEnabled": "Aktif",
"customGeoLastUpdated": "Terakhir diperbarui",
"customGeoExtColumn": "Routing (ext:…)",
"customGeoToastUpdateAll": "Semua sumber kustom telah diperbarui",
"customGeoActions": "Aksi",
"customGeoEdit": "Edit",
"customGeoDelete": "Hapus",
"customGeoDownload": "Perbarui sekarang",
"customGeoModalAdd": "Tambah geo kustom",
"customGeoModalEdit": "Edit geo kustom",
"customGeoModalSave": "Simpan",
"customGeoDeleteConfirm": "Hapus sumber geo kustom ini?",
"customGeoRoutingHint": "Pada aturan routing gunakan kolom nilai sebagai ext:file.dat:tag (ganti tag).",
"customGeoInvalidId": "ID sumber tidak valid",
"customGeoAliasesError": "Gagal memuat alias geo kustom",
"customGeoValidationAlias": "Alias hanya huruf kecil, angka, - dan _",
"customGeoValidationUrl": "URL harus diawali http:// atau https://",
"customGeoAliasPlaceholder": "a-z 0-9 _ -",
"customGeoAliasLabelSuffix": " (kustom)",
"customGeoToastList": "Daftar geo kustom",
"customGeoToastAdd": "Tambah geo kustom",
"customGeoToastUpdate": "Perbarui geo kustom",
"customGeoToastDelete": "Geofile kustom “{{ .fileName }}” dihapus",
"customGeoToastDownload": "Geofile “{{ .fileName }}” diperbarui",
"customGeoErrInvalidType": "Jenis harus geosite atau geoip",
"customGeoErrAliasRequired": "Alias wajib diisi",
"customGeoErrAliasPattern": "Alias berisi karakter yang tidak diizinkan",
"customGeoErrAliasReserved": "Alias ini dicadangkan",
"customGeoErrUrlRequired": "URL wajib diisi",
"customGeoErrInvalidUrl": "URL tidak valid",
"customGeoErrUrlScheme": "URL harus memakai http atau https",
"customGeoErrUrlHost": "Host URL tidak valid",
"customGeoErrDuplicateAlias": "Alias ini sudah dipakai untuk jenis ini",
"customGeoErrNotFound": "Sumber geo kustom tidak ditemukan",
"customGeoErrDownload": "Unduh gagal",
"customGeoErrUpdateAllIncomplete": "Satu atau lebih sumber geo kustom gagal diperbarui",
"customGeoEmpty": "Belum ada sumber geo kustom — klik Tambah untuk membuatnya",
"geodataTitle": "Pembaruan Otomatis Geodata",
"geodataHint": "Xray mengunduh berkas ini sesuai jadwal dan memuat ulang tanpa restart. URL harus HTTPS. Setiap berkas harus sudah ada di folder bin agar Xray dapat memperbaruinya.",
"geodataCron": "Jadwal (cron)",
"geodataOutbound": "Unduh melalui outbound (opsional)",
"geodataFile": "Nama berkas",
"geodataAddFile": "Tambah berkas",
"geodataSaveRestart": "Simpan & Mulai Ulang Xray",
"geodataConfirmTitle": "Simpan pengaturan geodata?",
"geodataConfirmContent": "Templat konfigurasi Xray akan diperbarui dan Xray akan dimulai ulang.",
"geodataInvalidUrl": "Setiap berkas memerlukan URL HTTPS.",
"geodataInvalidFile": "Nama berkas harus berupa nama sederhana, mis. geosite_custom.dat (tanpa path).",
"geodataInvalidCron": "Cron harus terdiri dari 5 bagian, mis. 0 4 * * *",
"geodataEmpty": "Belum ada berkas yang dikonfigurasi. Pada aturan routing, rujuk berkas sebagai ext:geosite_custom.dat:category.",
"dontRefresh": "Instalasi sedang berlangsung, harap jangan menyegarkan halaman ini",
"logs": "Log",
"config": "Konfigurasi",