import { TierId } from "@/types/shared"; import { IFormat, FormatId, FormatGroup } from "@/types/formats"; // Имя общего файла Xray с подсетями всех уровней const GEOIP_FILE = "geoip.dat"; // Имя общего файла Xray с доменами всех уровней const GEOSITE_FILE = "geosite.dat"; /** * Реестр форматов. Порядок задаёт порядок на сайте и в README */ export const FormatsContract: readonly IFormat[] = [ { id: FormatId.AMNEZIA, group: FormatGroup.AMNEZIA, title: "AmneziaVPN", description: "Список подсетей для site-based split tunneling. Импорт: Настройки подключения, Split Tunneling, Import", shared: false, file: (tier: TierId) => `${tier}.amnezia.json`, contentType: "application/json", ipv6: false, domains: false, }, { id: FormatId.AMNEZIA_DOMAINS, group: FormatGroup.AMNEZIA, title: "AmneziaVPN с доменами", description: "Те же подсети плюс домены с адресами. Десктопный клиент 5.x ре-резолвит домены при каждом подключении", shared: false, file: (tier: TierId) => `${tier}.amnezia-domains.json`, contentType: "application/json", ipv6: false, domains: true, }, { id: FormatId.WIREGUARD, group: FormatGroup.WIREGUARD, title: "AllowedIPs", description: "Строка AllowedIPs с российскими подсетями: через туннель идут только они", shared: false, file: (tier: TierId) => `${tier}.wireguard.txt`, contentType: "text/plain", ipv6: true, domains: false, }, { id: FormatId.WIREGUARD_INVERTED, group: FormatGroup.WIREGUARD, title: "AllowedIPs инвертированный", description: "Весь интернет минус российские подсети: через туннель идёт всё, кроме России", shared: false, file: (tier: TierId) => `${tier}.wireguard-inverted.txt`, contentType: "text/plain", ipv6: true, domains: false, }, { id: FormatId.SINGBOX_SRS, group: FormatGroup.SINGBOX, title: "sing-box rule-set", description: "Бинарный rule-set для sing-box, Hiddify, NekoBox, Karing, Throne, Podkop", shared: false, file: (tier: TierId) => `${tier}.singbox.srs`, contentType: "application/octet-stream", ipv6: true, domains: true, tool: "sing-box", }, { id: FormatId.SINGBOX_JSON, group: FormatGroup.SINGBOX, title: "sing-box source", description: "Исходный JSON rule-set версии 1 с ip_cidr и domain_suffix", shared: false, file: (tier: TierId) => `${tier}.singbox.json`, contentType: "application/json", ipv6: true, domains: true, }, { id: FormatId.GEOIP, group: FormatGroup.XRAY, title: "geoip.dat", description: "Файл для Xray, v2rayN, v2rayNG, Happ, Streisand с тегами ru-lite, ru-standard, ru-full", shared: true, file: () => GEOIP_FILE, contentType: "application/octet-stream", ipv6: true, domains: false, }, { id: FormatId.GEOSITE, group: FormatGroup.XRAY, title: "geosite.dat", description: "Домены для Xray с тегами ru-lite и ru-standard", shared: true, file: () => GEOSITE_FILE, contentType: "application/octet-stream", ipv6: false, domains: true, }, { id: FormatId.V2RAYN, group: FormatGroup.XRAY, title: "v2rayN правила", description: "Набор правил маршрутизации для импорта в v2rayN и v2rayNG из буфера обмена", shared: false, file: (tier: TierId) => `${tier}.v2rayn.json`, contentType: "application/json", ipv6: true, domains: true, }, { id: FormatId.HAPP, group: FormatGroup.XRAY, title: "Happ routing", description: "Профиль маршрутизации Happ с DirectIp и DirectSites", shared: false, file: (tier: TierId) => `${tier}.happ.json`, contentType: "application/json", ipv6: true, domains: true, }, { id: FormatId.MIHOMO_MRS, group: FormatGroup.CLASH, title: "Mihomo .mrs", description: "Бинарный rule-provider с behavior ipcidr для Mihomo, Clash Verge, FlClash", shared: false, file: (tier: TierId) => `${tier}.mihomo.mrs`, contentType: "application/octet-stream", ipv6: true, domains: false, tool: "mihomo", }, { id: FormatId.MIHOMO_YAML, group: FormatGroup.CLASH, title: "Clash ipcidr", description: "YAML rule-provider с behavior ipcidr, понимает любой Clash", shared: false, file: (tier: TierId) => `${tier}.mihomo.yaml`, contentType: "text/yaml", ipv6: true, domains: false, }, { id: FormatId.CLASH_CLASSICAL, group: FormatGroup.CLASH, title: "Clash classical", description: "YAML rule-provider с behavior classical: IP-CIDR, IP-CIDR6 и DOMAIN-SUFFIX", shared: false, file: (tier: TierId) => `${tier}.clash.yaml`, contentType: "text/yaml", ipv6: true, domains: true, }, { id: FormatId.SURGE, group: FormatGroup.SURGE, title: "Surge / Shadowrocket / Loon", description: "Текстовый rule-set: IP-CIDR, IP-CIDR6, DOMAIN-SUFFIX", shared: false, file: (tier: TierId) => `${tier}.surge.list`, contentType: "text/plain", ipv6: true, domains: true, }, { id: FormatId.QUANTUMULTX, group: FormatGroup.QUANTUMULTX, title: "Quantumult X", description: "Фильтр для filter_remote с политикой direct", shared: false, file: (tier: TierId) => `${tier}.quantumultx.list`, contentType: "text/plain", ipv6: true, domains: true, }, { id: FormatId.MIKROTIK, group: FormatGroup.MIKROTIK, title: "MikroTik IPv4", description: "Скрипт .rsc с address-list для RouterOS", shared: false, file: (tier: TierId) => `${tier}.mikrotik.rsc`, contentType: "text/plain", ipv6: false, domains: false, }, { id: FormatId.MIKROTIK_IPV6, group: FormatGroup.MIKROTIK, title: "MikroTik IPv6", description: "Скрипт .rsc с ipv6 address-list для RouterOS", shared: false, file: (tier: TierId) => `${tier}.mikrotik-ipv6.rsc`, contentType: "text/plain", ipv6: true, domains: false, }, { id: FormatId.KEENETIC_BAT, group: FormatGroup.KEENETIC, title: "Keenetic маршруты", description: "Файл .bat для импорта в раздел Маршрутизация, интерфейс выбирается при загрузке", shared: false, file: (tier: TierId) => `${tier}.keenetic.bat`, contentType: "text/plain", ipv6: false, domains: false, }, { id: FormatId.KEENETIC_CLI, group: FormatGroup.KEENETIC, title: "Keenetic CLI", description: "Команды ip route для консоли KeeneticOS", shared: false, file: (tier: TierId) => `${tier}.keenetic-cli.txt`, contentType: "text/plain", ipv6: false, domains: false, }, { id: FormatId.OPENWRT_NFT, group: FormatGroup.OPENWRT, title: "OpenWrt nftables", description: "Набор элементов для nft set в fw4", shared: false, file: (tier: TierId) => `${tier}.openwrt.nft`, contentType: "text/plain", ipv6: true, domains: false, }, { id: FormatId.DNSMASQ, group: FormatGroup.OPENWRT, title: "dnsmasq nftset", description: "Строки nftset для доменной маршрутизации в dnsmasq-full", shared: false, file: (tier: TierId) => `${tier}.dnsmasq.conf`, contentType: "text/plain", ipv6: false, domains: true, }, { id: FormatId.WINDOWS_BAT, group: FormatGroup.DESKTOP, title: "Windows route", description: "Скрипт route add для запуска от администратора", shared: false, file: (tier: TierId) => `${tier}.windows.bat`, contentType: "text/plain", ipv6: false, domains: false, }, { id: FormatId.LINUX_SH, group: FormatGroup.DESKTOP, title: "Linux ip route", description: "Скрипт с ip -batch для Linux", shared: false, file: (tier: TierId) => `${tier}.linux.sh`, contentType: "text/x-shellscript", ipv6: true, domains: false, }, { id: FormatId.MACOS_SH, group: FormatGroup.DESKTOP, title: "macOS route", description: "Скрипт route add для macOS", shared: false, file: (tier: TierId) => `${tier}.macos.sh`, contentType: "text/x-shellscript", ipv6: true, domains: false, }, { id: FormatId.IPV4, group: FormatGroup.TEXT, title: "IPv4 CIDR", description: "Подсети IPv4 по строке, универсальный формат", shared: false, file: (tier: TierId) => `${tier}.ipv4.txt`, contentType: "text/plain", ipv6: false, domains: false, }, { id: FormatId.IPV6, group: FormatGroup.TEXT, title: "IPv6 CIDR", description: "Подсети IPv6 по строке", shared: false, file: (tier: TierId) => `${tier}.ipv6.txt`, contentType: "text/plain", ipv6: true, domains: false, }, { id: FormatId.DOMAINS, group: FormatGroup.TEXT, title: "Домены", description: "Домены по строке для DNS-маршрутизации", shared: false, file: (tier: TierId) => `${tier}.domains.txt`, contentType: "text/plain", ipv6: false, domains: true, }, ] as const; /** * Имя файла манифеста */ export const MANIFEST_FILE = "manifest.json"; /** * Имя файла контрольных сумм */ export const CHECKSUMS_FILE = "SHA256SUMS";