mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 21:24:10 +00:00
refactor: remove IR and RU regional geofile datasets to v1.8.1.0
This commit is contained in:
parent
bb86dee8f6
commit
6e04e6d247
15 changed files with 38 additions and 78 deletions
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
|
|
@ -158,14 +158,6 @@ jobs:
|
||||||
https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat &
|
https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat &
|
||||||
curl -fL -sS --retry 3 -o geosite.dat \
|
curl -fL -sS --retry 3 -o geosite.dat \
|
||||||
https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat &
|
https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat &
|
||||||
curl -fL -sS --retry 3 -o geoip_IR.dat \
|
|
||||||
https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat &
|
|
||||||
curl -fL -sS --retry 3 -o geosite_IR.dat \
|
|
||||||
https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat &
|
|
||||||
curl -fL -sS --retry 3 -o geoip_RU.dat \
|
|
||||||
https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geoip.dat &
|
|
||||||
curl -fL -sS --retry 3 -o geosite_RU.dat \
|
|
||||||
https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geosite.dat &
|
|
||||||
FAILED=0
|
FAILED=0
|
||||||
for job in $(jobs -p); do wait "$job" || FAILED=1; done
|
for job in $(jobs -p); do wait "$job" || FAILED=1; done
|
||||||
if [ "$FAILED" -eq 1 ]; then
|
if [ "$FAILED" -eq 1 ]; then
|
||||||
|
|
@ -336,10 +328,6 @@ jobs:
|
||||||
# Remove-Item geoip.dat, geosite.dat -ErrorAction SilentlyContinue
|
# Remove-Item geoip.dat, geosite.dat -ErrorAction SilentlyContinue
|
||||||
# Invoke-WebRequest -Uri "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" -OutFile "geoip.dat"
|
# Invoke-WebRequest -Uri "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" -OutFile "geoip.dat"
|
||||||
# Invoke-WebRequest -Uri "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat" -OutFile "geosite.dat"
|
# Invoke-WebRequest -Uri "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat" -OutFile "geosite.dat"
|
||||||
# Invoke-WebRequest -Uri "https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat" -OutFile "geoip_IR.dat"
|
|
||||||
# Invoke-WebRequest -Uri "https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat" -OutFile "geosite_IR.dat"
|
|
||||||
# Invoke-WebRequest -Uri "https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geoip.dat" -OutFile "geoip_RU.dat"
|
|
||||||
# Invoke-WebRequest -Uri "https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geosite.dat" -OutFile "geosite_RU.dat"
|
|
||||||
# Rename-Item xray.exe xray-windows-amd64.exe
|
# Rename-Item xray.exe xray-windows-amd64.exe
|
||||||
# cd ..
|
# cd ..
|
||||||
# Copy-Item -Path ..\windows_files\* -Destination . -Recurse
|
# Copy-Item -Path ..\windows_files\* -Destination . -Recurse
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,4 @@ rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat
|
||||||
mv xray "xray-linux-${FNAME}"
|
mv xray "xray-linux-${FNAME}"
|
||||||
curl -sfLRO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
|
curl -sfLRO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
|
||||||
curl -sfLRO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
|
curl -sfLRO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
|
||||||
curl -sfLRo geoip_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
|
|
||||||
curl -sfLRo geosite_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
|
|
||||||
curl -sfLRo geoip_RU.dat https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geoip.dat
|
|
||||||
curl -sfLRo geosite_RU.dat https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geosite.dat
|
|
||||||
cd ../../
|
cd ../../
|
||||||
|
|
@ -36,9 +36,6 @@ bash <(curl -Ls https://raw.githubusercontent.com/Sora39831/3x-ui/master/install
|
||||||
|
|
||||||
## الاعتراف
|
## الاعتراف
|
||||||
|
|
||||||
- [Iran v2ray rules](https://github.com/chocolate4u/Iran-v2ray-rules) (الترخيص: **GPL-3.0**): _قواعد توجيه v2ray/xray و v2ray/xray-clients المحسنة مع النطاقات الإيرانية المدمجة وتركيز على الأمان وحظر الإعلانات._
|
|
||||||
- [Russia v2ray rules](https://github.com/runetfreedom/russia-v2ray-rules-dat) (الترخيص: **GPL-3.0**): _يحتوي هذا المستودع على قواعد توجيه V2Ray محدثة تلقائيًا بناءً على بيانات النطاقات والعناوين المحظورة في روسيا._
|
|
||||||
|
|
||||||
## دعم المشروع
|
## دعم المشروع
|
||||||
|
|
||||||
**إذا كان هذا المشروع مفيدًا لك، فقد ترغب في إعطائه**:star2:
|
**إذا كان هذا المشروع مفيدًا لك، فقد ترغب في إعطائه**:star2:
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,6 @@ Para documentación completa, visita la [Wiki del proyecto](https://github.com/S
|
||||||
|
|
||||||
## Reconocimientos
|
## Reconocimientos
|
||||||
|
|
||||||
- [Iran v2ray rules](https://github.com/chocolate4u/Iran-v2ray-rules) (Licencia: **GPL-3.0**): _Reglas de enrutamiento mejoradas para v2ray/xray y v2ray/xray-clients con dominios iraníes incorporados y un enfoque en seguridad y bloqueo de anuncios._
|
|
||||||
- [Russia v2ray rules](https://github.com/runetfreedom/russia-v2ray-rules-dat) (Licencia: **GPL-3.0**): _Este repositorio contiene reglas de enrutamiento V2Ray actualizadas automáticamente basadas en datos de dominios y direcciones bloqueadas en Rusia._
|
|
||||||
|
|
||||||
## Apoyar el Proyecto
|
## Apoyar el Proyecto
|
||||||
|
|
||||||
**Si este proyecto te es útil, puedes darle una**:star2:
|
**Si este proyecto te es útil, puedes darle una**:star2:
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,6 @@ bash <(curl -Ls https://raw.githubusercontent.com/Sora39831/3x-ui/master/install
|
||||||
|
|
||||||
## قدردانی
|
## قدردانی
|
||||||
|
|
||||||
- [Iran v2ray rules](https://github.com/chocolate4u/Iran-v2ray-rules) (مجوز: **GPL-3.0**): _قوانین مسیریابی بهبود یافته v2ray/xray و v2ray/xray-clients با دامنههای ایرانی داخلی و تمرکز بر امنیت و مسدود کردن تبلیغات._
|
|
||||||
- [Russia v2ray rules](https://github.com/runetfreedom/russia-v2ray-rules-dat) (مجوز: **GPL-3.0**): _این مخزن شامل قوانین مسیریابی V2Ray بهروزرسانی شده خودکار بر اساس دادههای دامنهها و آدرسهای مسدود شده در روسیه است._
|
|
||||||
|
|
||||||
## پشتیبانی از پروژه
|
## پشتیبانی از پروژه
|
||||||
|
|
||||||
**اگر این پروژه برای شما مفید است، میتوانید به آن یک**:star2: بدهید
|
**اگر این پروژه برای شما مفید است، میتوانید به آن یک**:star2: بدهید
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,6 @@ Production builds embed files from `web/public/assets` and `web/public/assets-ma
|
||||||
|
|
||||||
## Acknowledgment
|
## Acknowledgment
|
||||||
|
|
||||||
- [Iran v2ray rules](https://github.com/chocolate4u/Iran-v2ray-rules) (License: **GPL-3.0**): _Enhanced v2ray/xray and v2ray/xray-clients routing rules with built-in Iranian domains and a focus on security and adblocking._
|
|
||||||
- [Russia v2ray rules](https://github.com/runetfreedom/russia-v2ray-rules-dat) (License: **GPL-3.0**): _This repository contains automatically updated V2Ray routing rules based on data on blocked domains and addresses in Russia._
|
|
||||||
|
|
||||||
## Support project
|
## Support project
|
||||||
|
|
||||||
**If this project is helpful to you, you may wish to give it a**:star2:
|
**If this project is helpful to you, you may wish to give it a**:star2:
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,6 @@ bash <(curl -Ls https://raw.githubusercontent.com/Sora39831/3x-ui/master/install
|
||||||
|
|
||||||
## Благодарности
|
## Благодарности
|
||||||
|
|
||||||
- [Iran v2ray rules](https://github.com/chocolate4u/Iran-v2ray-rules) (Лицензия: **GPL-3.0**): _Улучшенные правила маршрутизации для v2ray/xray и v2ray/xray-clients со встроенными иранскими доменами и фокусом на безопасность и блокировку рекламы._
|
|
||||||
- [Russia v2ray rules](https://github.com/runetfreedom/russia-v2ray-rules-dat) (Лицензия: **GPL-3.0**): _Этот репозиторий содержит автоматически обновляемые правила маршрутизации V2Ray на основе данных о заблокированных доменах и адресах в России._
|
|
||||||
|
|
||||||
## Поддержка проекта
|
## Поддержка проекта
|
||||||
|
|
||||||
**Если этот проект полезен для вас, вы можете поставить ему**:star2:
|
**Если этот проект полезен для вас, вы можете поставить ему**:star2:
|
||||||
|
|
|
||||||
|
|
@ -44,9 +44,6 @@ bash <(curl -Ls https://raw.githubusercontent.com/Sora39831/3x-ui/master/install
|
||||||
|
|
||||||
## 致谢
|
## 致谢
|
||||||
|
|
||||||
- [Iran v2ray rules](https://github.com/chocolate4u/Iran-v2ray-rules) (许可证: **GPL-3.0**): _增强的 v2ray/xray 和 v2ray/xray-clients 路由规则,内置伊朗域名,专注于安全性和广告拦截。_
|
|
||||||
- [Russia v2ray rules](https://github.com/runetfreedom/russia-v2ray-rules-dat) (许可证: **GPL-3.0**): _此仓库包含基于俄罗斯被阻止域名和地址数据自动更新的 V2Ray 路由规则。_
|
|
||||||
|
|
||||||
## 支持项目
|
## 支持项目
|
||||||
|
|
||||||
**如果这个项目对您有帮助,您可以给它一个**:star2:
|
**如果这个项目对您有帮助,您可以给它一个**:star2:
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
v1.8.0.9
|
v1.8.1.0
|
||||||
|
|
|
||||||
34
docs/Tasktracking/2026-04-27-remove-ir-ru-geofiles.md
Normal file
34
docs/Tasktracking/2026-04-27-remove-ir-ru-geofiles.md
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
# Task Record
|
||||||
|
|
||||||
|
Date: 2026-04-27
|
||||||
|
Related Module: web/service, web/html, x-ui.sh, .github, DockerInit, README
|
||||||
|
Change Type: Refactor
|
||||||
|
|
||||||
|
## Background
|
||||||
|
IR and RU regional geofile datasets (geoip_IR.dat, geosite_IR.dat, geoip_RU.dat, geosite_RU.dat from chocolate4u/Iran-v2ray-rules and runetfreedom/russia-v2ray-rules-dat) were removed from the project. Only the main Loyalsoldier/v2ray-rules-dat dataset (geoip.dat, geosite.dat) remains.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
- `web/service/server.go`: Removed 4 IR/RU entries from `geofileAllowlist`, keeping only `geoip.dat` and `geosite.dat`
|
||||||
|
- `web/html/index.html`: Removed IR/RU file names from the Geofiles UI file list
|
||||||
|
- `web/service/server_test.go`: Removed IR/RU file names from `TestIsValidGeofileName_Valid`
|
||||||
|
- `web/html/xray.html`: Removed all `ext:geoip_IR.dat`, `ext:geosite_IR.dat`, `ext:geosite_RU.dat` routing rule presets from IPsOptions, DomainsOptions, and BlockDomainsOptions. Kept `regexp:` entries for .ir, .ru, .su, .рф domains which do not depend on the .dat files.
|
||||||
|
- `x-ui.sh`: Removed IR and RU cases from `update_geofiles()`, `update_all_geofiles()`, and `update_geo()` menu
|
||||||
|
- `.github/workflows/release.yml`: Removed IR/RU download steps from build pipeline
|
||||||
|
- `DockerInit.sh`: Removed IR/RU download lines
|
||||||
|
- `README.md` / `README.zh_CN.md` / `README.ru_RU.md` / `README.fa_IR.md` / `README.es_ES.md` / `README.ar_EG.md`: Removed Iran/Russia v2ray rules acknowledgment lines
|
||||||
|
|
||||||
|
## Impact
|
||||||
|
- Geofile allowlist reduced from 6 to 2 files
|
||||||
|
- Geofile update/sync now only downloads geoip.dat and geosite.dat
|
||||||
|
- Routing rule UI no longer offers ext: prefixed IR/RU options
|
||||||
|
- Shell install script and CI no longer download IR/RU files
|
||||||
|
- No database schema changes, no API endpoint changes
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
- `gofmt -l -w .` passed with no changes
|
||||||
|
- `go vet ./...` passed with no errors
|
||||||
|
- All IR/RU references confirmed removed from 12 files
|
||||||
|
|
||||||
|
## Risks And Follow-Up
|
||||||
|
- Users with existing Xray routing rules referencing `ext:geoip_IR.dat`, `ext:geosite_IR.dat`, or `ext:geosite_RU.dat` will need to update their configurations
|
||||||
|
- Existing .dat files on disk are not automatically deleted; users may manually remove them from the bin/ directory
|
||||||
|
|
@ -330,7 +330,7 @@
|
||||||
<a-collapse-panel key="2" header='Geofiles'>
|
<a-collapse-panel key="2" header='Geofiles'>
|
||||||
<a-list class="ant-version-list w-100" bordered>
|
<a-list class="ant-version-list w-100" bordered>
|
||||||
<a-list-item class="ant-version-list-item"
|
<a-list-item class="ant-version-list-item"
|
||||||
v-for="file, index in ['geosite.dat', 'geoip.dat', 'geosite_IR.dat', 'geoip_IR.dat', 'geosite_RU.dat', 'geoip_RU.dat']">
|
v-for="file, index in ['geosite.dat', 'geoip.dat']">
|
||||||
<a-tag :color="index % 2 == 0 ? 'purple' : 'green'">[[ file ]]</a-tag>
|
<a-tag :color="index % 2 == 0 ? 'purple' : 'green'">[[ file ]]</a-tag>
|
||||||
<a-icon type="reload" @click="updateGeofile(file)" class="mr-8" />
|
<a-icon type="reload" @click="updateGeofile(file)" class="mr-8" />
|
||||||
</a-list-item>
|
</a-list-item>
|
||||||
|
|
|
||||||
|
|
@ -325,9 +325,7 @@
|
||||||
},
|
},
|
||||||
IPsOptions: [
|
IPsOptions: [
|
||||||
{ label: 'Private IPs', value: 'geoip:private' },
|
{ label: 'Private IPs', value: 'geoip:private' },
|
||||||
{ label: '🇮🇷 Iran', value: 'ext:geoip_IR.dat:ir' },
|
|
||||||
{ label: '🇨🇳 China', value: 'geoip:cn' },
|
{ label: '🇨🇳 China', value: 'geoip:cn' },
|
||||||
{ label: '🇷🇺 Russia', value: 'ext:geoip_RU.dat:ru' },
|
|
||||||
{ label: '🇻🇳 Vietnam', value: 'geoip:vn' },
|
{ label: '🇻🇳 Vietnam', value: 'geoip:vn' },
|
||||||
{ label: '🇪🇸 Spain', value: 'geoip:es' },
|
{ label: '🇪🇸 Spain', value: 'geoip:es' },
|
||||||
{ label: '🇮🇩 Indonesia', value: 'geoip:id' },
|
{ label: '🇮🇩 Indonesia', value: 'geoip:id' },
|
||||||
|
|
@ -336,12 +334,10 @@
|
||||||
{ label: '🇧🇷 Brazil', value: 'geoip:br' },
|
{ label: '🇧🇷 Brazil', value: 'geoip:br' },
|
||||||
],
|
],
|
||||||
DomainsOptions: [
|
DomainsOptions: [
|
||||||
{ label: '🇮🇷 Iran', value: 'ext:geosite_IR.dat:ir' },
|
|
||||||
{ label: '🇮🇷 .ir', value: 'regexp:.*\\.ir$' },
|
{ label: '🇮🇷 .ir', value: 'regexp:.*\\.ir$' },
|
||||||
{ label: '🇮🇷 .ایران', value: 'regexp:.*\\.xn--mgba3a4f16a$' },
|
{ label: '🇮🇷 .ایران', value: 'regexp:.*\\.xn--mgba3a4f16a$' },
|
||||||
{ label: '🇨🇳 China', value: 'geosite:cn' },
|
{ label: '🇨🇳 China', value: 'geosite:cn' },
|
||||||
{ label: '🇨🇳 .cn', value: 'regexp:.*\\.cn$' },
|
{ label: '🇨🇳 .cn', value: 'regexp:.*\\.cn$' },
|
||||||
{ label: '🇷🇺 Russia', value: 'ext:geosite_RU.dat:ru-available-only-inside' },
|
|
||||||
{ label: '🇷🇺 .ru', value: 'regexp:.*\\.ru$' },
|
{ label: '🇷🇺 .ru', value: 'regexp:.*\\.ru$' },
|
||||||
{ label: '🇷🇺 .su', value: 'regexp:.*\\.su$' },
|
{ label: '🇷🇺 .su', value: 'regexp:.*\\.su$' },
|
||||||
{ label: '🇷🇺 .рф', value: 'regexp:.*\\.xn--p1ai$' },
|
{ label: '🇷🇺 .рф', value: 'regexp:.*\\.xn--p1ai$' },
|
||||||
|
|
@ -349,18 +345,11 @@
|
||||||
],
|
],
|
||||||
BlockDomainsOptions: [
|
BlockDomainsOptions: [
|
||||||
{ label: 'Ads All', value: 'geosite:category-ads-all' },
|
{ label: 'Ads All', value: 'geosite:category-ads-all' },
|
||||||
{ label: 'Ads IR 🇮🇷', value: 'ext:geosite_IR.dat:category-ads-all' },
|
|
||||||
{ label: 'Ads RU 🇷🇺', value: 'ext:geosite_RU.dat:category-ads-all' },
|
|
||||||
{ label: 'Malware 🇮🇷', value: 'ext:geosite_IR.dat:malware' },
|
|
||||||
{ label: 'Phishing 🇮🇷', value: 'ext:geosite_IR.dat:phishing' },
|
|
||||||
{ label: 'Cryptominers 🇮🇷', value: 'ext:geosite_IR.dat:cryptominers' },
|
|
||||||
{ label: 'Adult +18', value: 'geosite:category-porn' },
|
{ label: 'Adult +18', value: 'geosite:category-porn' },
|
||||||
{ label: '🇮🇷 Iran', value: 'ext:geosite_IR.dat:ir' },
|
|
||||||
{ label: '🇮🇷 .ir', value: 'regexp:.*\\.ir$' },
|
{ label: '🇮🇷 .ir', value: 'regexp:.*\\.ir$' },
|
||||||
{ label: '🇮🇷 .ایران', value: 'regexp:.*\\.xn--mgba3a4f16a$' },
|
{ label: '🇮🇷 .ایران', value: 'regexp:.*\\.xn--mgba3a4f16a$' },
|
||||||
{ label: '🇨🇳 China', value: 'geosite:cn' },
|
{ label: '🇨🇳 China', value: 'geosite:cn' },
|
||||||
{ label: '🇨🇳 .cn', value: 'regexp:.*\\.cn$' },
|
{ label: '🇨🇳 .cn', value: 'regexp:.*\\.cn$' },
|
||||||
{ label: '🇷🇺 Russia', value: 'ext:geosite_RU.dat:ru-available-only-inside' },
|
|
||||||
{ label: '🇷🇺 .ru', value: 'regexp:.*\\.ru$' },
|
{ label: '🇷🇺 .ru', value: 'regexp:.*\\.ru$' },
|
||||||
{ label: '🇷🇺 .su', value: 'regexp:.*\\.su$' },
|
{ label: '🇷🇺 .su', value: 'regexp:.*\\.su$' },
|
||||||
{ label: '🇷🇺 .рф', value: 'regexp:.*\\.xn--p1ai$' },
|
{ label: '🇷🇺 .рф', value: 'regexp:.*\\.xn--p1ai$' },
|
||||||
|
|
|
||||||
|
|
@ -1071,10 +1071,6 @@ func (s *ServerService) UpdateGeofile(fileName string) error {
|
||||||
geofileAllowlist := map[string]geofileEntry{
|
geofileAllowlist := map[string]geofileEntry{
|
||||||
"geoip.dat": {"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat", "geoip.dat"},
|
"geoip.dat": {"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat", "geoip.dat"},
|
||||||
"geosite.dat": {"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat", "geosite.dat"},
|
"geosite.dat": {"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat", "geosite.dat"},
|
||||||
"geoip_IR.dat": {"https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat", "geoip_IR.dat"},
|
|
||||||
"geosite_IR.dat": {"https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat", "geosite_IR.dat"},
|
|
||||||
"geoip_RU.dat": {"https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geoip.dat", "geoip_RU.dat"},
|
|
||||||
"geosite_RU.dat": {"https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geosite.dat", "geosite_RU.dat"},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Strict allowlist check to avoid writing uncontrolled files
|
// Strict allowlist check to avoid writing uncontrolled files
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,6 @@ func TestIsValidGeofileName_Valid(t *testing.T) {
|
||||||
valid := []string{
|
valid := []string{
|
||||||
"geoip.dat",
|
"geoip.dat",
|
||||||
"geosite.dat",
|
"geosite.dat",
|
||||||
"geoip_IR.dat",
|
|
||||||
"geoip_RU.dat",
|
|
||||||
"geosite_IR.dat",
|
|
||||||
"custom-file_v2.dat",
|
"custom-file_v2.dat",
|
||||||
}
|
}
|
||||||
for _, name := range valid {
|
for _, name := range valid {
|
||||||
|
|
|
||||||
22
x-ui.sh
22
x-ui.sh
|
|
@ -1078,15 +1078,11 @@ delete_ports() {
|
||||||
|
|
||||||
update_all_geofiles() {
|
update_all_geofiles() {
|
||||||
update_geofiles "main"
|
update_geofiles "main"
|
||||||
update_geofiles "IR"
|
|
||||||
update_geofiles "RU"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update_geofiles() {
|
update_geofiles() {
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
"main") dat_files=(geoip geosite); dat_source="Loyalsoldier/v2ray-rules-dat";;
|
"main") dat_files=(geoip geosite); dat_source="Loyalsoldier/v2ray-rules-dat";;
|
||||||
"IR") dat_files=(geoip_IR geosite_IR); dat_source="chocolate4u/Iran-v2ray-rules" ;;
|
|
||||||
"RU") dat_files=(geoip_RU geosite_RU); dat_source="runetfreedom/russia-v2ray-rules-dat";;
|
|
||||||
esac
|
esac
|
||||||
for dat in "${dat_files[@]}"; do
|
for dat in "${dat_files[@]}"; do
|
||||||
# 移除后缀获取远程文件名(例如 geoip_IR -> geoip)
|
# 移除后缀获取远程文件名(例如 geoip_IR -> geoip)
|
||||||
|
|
@ -1098,9 +1094,6 @@ update_geofiles() {
|
||||||
|
|
||||||
update_geo() {
|
update_geo() {
|
||||||
echo -e "${green}\t1.${plain} Loyalsoldier (geoip.dat, geosite.dat)"
|
echo -e "${green}\t1.${plain} Loyalsoldier (geoip.dat, geosite.dat)"
|
||||||
echo -e "${green}\t2.${plain} chocolate4u (geoip_IR.dat, geosite_IR.dat)"
|
|
||||||
echo -e "${green}\t3.${plain} runetfreedom (geoip_RU.dat, geosite_RU.dat)"
|
|
||||||
echo -e "${green}\t4.${plain} 全部更新"
|
|
||||||
echo -e "${green}\t0.${plain} 返回主菜单"
|
echo -e "${green}\t0.${plain} 返回主菜单"
|
||||||
read -rp "请选择:" choice
|
read -rp "请选择:" choice
|
||||||
|
|
||||||
|
|
@ -1113,21 +1106,6 @@ update_geo() {
|
||||||
echo -e "${green}Loyalsoldier 数据集更新成功!${plain}"
|
echo -e "${green}Loyalsoldier 数据集更新成功!${plain}"
|
||||||
restart
|
restart
|
||||||
;;
|
;;
|
||||||
2)
|
|
||||||
update_geofiles "IR"
|
|
||||||
echo -e "${green}chocolate4u 数据集更新成功!${plain}"
|
|
||||||
restart
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
update_geofiles "RU"
|
|
||||||
echo -e "${green}runetfreedom 数据集更新成功!${plain}"
|
|
||||||
restart
|
|
||||||
;;
|
|
||||||
4)
|
|
||||||
update_all_geofiles
|
|
||||||
echo -e "${green}所有 geo 文件更新成功!${plain}"
|
|
||||||
restart
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo -e "${red}无效选项,请选择有效数字。${plain}\n"
|
echo -e "${red}无效选项,请选择有效数字。${plain}\n"
|
||||||
update_geo
|
update_geo
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue