Update On Fri Mar 13 19:57:40 CET 2026

This commit is contained in:
github-action[bot]
2026-03-13 19:57:41 +01:00
parent cd52e83f3e
commit 2ee70e21ee
248 changed files with 6897 additions and 31728 deletions
+1
View File
@@ -1297,3 +1297,4 @@ Update On Mon Mar 9 20:06:07 CET 2026
Update On Tue Mar 10 20:01:59 CET 2026
Update On Wed Mar 11 20:15:43 CET 2026
Update On Thu Mar 12 20:05:20 CET 2026
Update On Fri Mar 13 19:57:31 CET 2026
+2 -2
View File
@@ -33,8 +33,8 @@ var (
)
var defaultHeader = http.Header{
"content-type": []string{"application/grpc"},
"user-agent": []string{"grpc-go/1.36.0"},
"Content-Type": []string{"application/grpc"},
"User-Agent": []string{"grpc-go/1.36.0"},
}
type DialFn = func(ctx context.Context, network, addr string) (net.Conn, error)
+2 -1
View File
@@ -3,5 +3,6 @@
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
],
"files.eol": "\n"
"files.eol": "\n",
"js/ts.tsdk.path": "node_modules\\typescript\\lib"
}
+41 -17
View File
@@ -281,7 +281,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-parse 0.2.7",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstream"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d"
dependencies = [
"anstyle",
"anstyle-parse 1.0.0",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
@@ -291,9 +306,9 @@ dependencies = [
[[package]]
name = "anstyle"
version = "1.0.11"
version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd"
checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78"
[[package]]
name = "anstyle-parse"
@@ -304,6 +319,15 @@ dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-parse"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.1.4"
@@ -355,7 +379,7 @@ dependencies = [
"objc2-foundation 0.3.2",
"parking_lot",
"percent-encoding",
"windows-sys 0.60.2",
"windows-sys 0.59.0",
"wl-clipboard-rs",
"x11rb",
]
@@ -1479,9 +1503,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.60"
version = "4.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a"
checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351"
dependencies = [
"clap_builder",
"clap_derive",
@@ -1489,11 +1513,11 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.60"
version = "4.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876"
checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f"
dependencies = [
"anstream",
"anstream 1.0.0",
"anstyle",
"clap_lex",
"strsim",
@@ -1501,9 +1525,9 @@ dependencies = [
[[package]]
name = "clap_derive"
version = "4.5.55"
version = "4.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5"
checksum = "1110bd8a634a1ab8cb04345d8d878267d57c3cf1b38d91b71af6686408bbca6a"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -2769,7 +2793,7 @@ version = "0.11.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f"
dependencies = [
"anstream",
"anstream 0.6.20",
"anstyle",
"env_filter",
"log",
@@ -2842,7 +2866,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
dependencies = [
"libc",
"windows-sys 0.60.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -4865,7 +4889,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
dependencies = [
"cfg-if",
"windows-targets 0.53.3",
"windows-targets 0.48.5",
]
[[package]]
@@ -7255,7 +7279,7 @@ dependencies = [
"once_cell",
"socket2",
"tracing",
"windows-sys 0.60.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -10207,9 +10231,9 @@ dependencies = [
[[package]]
name = "tracing-subscriber"
version = "0.3.22"
version = "0.3.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e"
checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319"
dependencies = [
"matchers",
"nu-ansi-term",
+5 -7
View File
@@ -441,14 +441,12 @@ pub trait AppWindow {
manager
.generate_label(base_label, config.singleton)
.unwrap_or_else(|| {
// Singleton window already exists - try to show it
// Singleton window already exists - try to focus it
if let Some(window) = app_handle.get_webview_window(base_label) {
tracing::debug!("{} window is already opened, try to show it", base_label);
if OPEN_WINDOWS_COUNTER.load(Ordering::Acquire) == 0 {
trace_err!(window.unminimize(), "set win unminimize");
trace_err!(window.show(), "set win visible");
trace_err!(window.set_focus(), "set win focus");
}
tracing::debug!("{} window is already opened, try to focus it", base_label);
trace_err!(window.unminimize(), "set win unminimize");
trace_err!(window.show(), "set win visible");
trace_err!(window.set_focus(), "set win focus");
}
// Return early indicator - we'll handle this below
String::new()
@@ -187,6 +187,7 @@
"logs_search_placeholder": "Search logs (time, type, or message)...",
"logs_empty_message": "No logs recorded",
"logs_action_clear_log": "Clear Logs",
"rules_list_all_proxies": "All Groups",
"editor_before_close_message": "You have not saved the edited content, are you sure you want to close the editor?",
"editor_validate_error_message": "Please fix the error before saving content",
"editor_read_only_chip": "Read Only",
@@ -187,6 +187,7 @@
"logs_search_placeholder": "Поиск журналов (время, тип или сообщение)...",
"logs_empty_message": "Нет записей в журналах",
"logs_action_clear_log": "Очистить журналы",
"rules_list_all_proxies": "Все группы",
"editor_before_close_message": "Вы не сохранили измененное содержимое, вы уверены, что хотите закрыть редактор?",
"editor_validate_error_message": "Пожалуйста, исправьте ошибки перед сохранением содержимого",
"editor_read_only_chip": "Только для чтения",
@@ -202,4 +203,4 @@
"common_open": "Открыть",
"common_cut": "Вырезать",
"common_paste": "Вставить"
}
}
@@ -187,6 +187,7 @@
"logs_search_placeholder": "通过时间、类型或消息等等搜索日志",
"logs_empty_message": "没有任何日志记录",
"logs_action_clear_log": "清空日志",
"rules_list_all_proxies": "所有分组",
"editor_before_close_message": "你尚未保存编辑的内容,确定要关闭编辑器吗?",
"editor_validate_error_message": "请修复错误后再保存内容",
"editor_read_only_chip": "只读",
@@ -187,6 +187,7 @@
"logs_search_placeholder": "透過時間、類型或訊息等等搜尋日誌",
"logs_empty_message": "沒有任何日誌記錄",
"logs_action_clear_log": "清空日誌",
"rules_list_all_proxies": "所有分組",
"editor_before_close_message": "你尚未儲存編輯的內容,確定要關閉編輯器嗎?",
"editor_validate_error_message": "請修正錯誤後再儲存內容",
"editor_read_only_chip": "只讀",
@@ -17,7 +17,7 @@
"@dnd-kit/utilities": "3.2.2",
"@emotion/styled": "11.14.1",
"@hookform/resolvers": "5.2.2",
"@inlang/paraglide-js": "2.14.0",
"@inlang/paraglide-js": "2.15.0",
"@juggle/resize-observer": "3.4.0",
"@material/material-color-utilities": "0.4.0",
"@mui/icons-material": "7.3.9",
@@ -30,7 +30,7 @@
"@radix-ui/react-use-controllable-state": "1.2.2",
"@tailwindcss/postcss": "4.2.1",
"@tanstack/react-table": "8.21.3",
"@tanstack/react-virtual": "3.13.21",
"@tanstack/react-virtual": "3.13.22",
"@tanstack/router-zod-adapter": "1.81.5",
"@tauri-apps/api": "2.10.1",
"@types/json-schema": "7.0.15",
@@ -42,7 +42,7 @@
"country-code-emoji": "2.3.0",
"country-emoji": "1.5.6",
"dayjs": "1.11.20",
"framer-motion": "12.35.2",
"framer-motion": "12.36.0",
"i18next": "25.8.18",
"jotai": "2.18.1",
"json-schema": "0.4.0",
@@ -87,13 +87,13 @@
"@types/react-dom": "19.2.3",
"@types/validator": "13.15.10",
"@vitejs/plugin-legacy": "7.2.1",
"@vitejs/plugin-react": "5.1.4",
"@vitejs/plugin-react-swc": "4.2.3",
"@vitejs/plugin-react": "5.2.0",
"@vitejs/plugin-react-swc": "4.3.0",
"change-case": "5.4.4",
"clsx": "2.1.1",
"core-js": "3.48.0",
"filesize": "11.0.13",
"meta-json-schema": "1.19.20",
"meta-json-schema": "1.19.21",
"monaco-yaml": "5.4.1",
"nanoid": "5.1.6",
"sass-embedded": "1.98.0",
@@ -0,0 +1,26 @@
import { ComponentProps, useMemo } from 'react'
import { useServerPort } from '@nyanpasu/interface'
import { LazyImage } from '@nyanpasu/ui'
export default function Image({
icon,
...porps
}: Omit<ComponentProps<typeof LazyImage>, 'src'> & {
icon: string
}) {
const serverPort = useServerPort()
const src = icon.trim().startsWith('<svg')
? `data:image/svg+xml;base64,${btoa(icon)}`
: icon
const cachedUrl = useMemo(() => {
if (!src.startsWith('http')) {
return src
}
return `http://localhost:${serverPort}/cache/icon?url=${btoa(src)}`
}, [src, serverPort])
return <LazyImage src={cachedUrl} {...porps} />
}
@@ -1,3 +1,4 @@
import MenuOpenRounded from '~icons/material-symbols/menu-open-rounded'
import { motion } from 'framer-motion'
import { merge } from 'lodash-es'
import {
@@ -8,6 +9,7 @@ import {
} from 'react'
import { cn } from '@nyanpasu/ui'
import { useControllableState } from '@radix-ui/react-use-controllable-state'
import { Button } from './button'
const DEFAULT_SIDEBAR_WIDTH = {
open: 280,
@@ -58,6 +60,7 @@ export function SidebarProvider({
}
export function Sidebar({
className,
animate,
transition,
width = DEFAULT_SIDEBAR_WIDTH,
@@ -71,22 +74,36 @@ export function Sidebar({
const { open } = useSidebar()
return (
<motion.aside
initial={false}
animate={merge(
{
width: open ? width.open : width.closed,
},
animate,
)}
transition={{
type: 'spring',
stiffness: 300,
damping: 30,
...transition,
}}
{...props}
/>
<>
<div
className="h-full md:hidden"
data-slot="sidebar-placeholder"
style={{
width: width.closed,
}}
/>
<motion.aside
className={cn(
'bg-mixed-background absolute h-full md:static',
className,
)}
initial={false}
animate={merge(
{
width: open ? width.open : width.closed,
},
animate,
)}
transition={{
type: 'spring',
stiffness: 300,
damping: 30,
...transition,
}}
{...props}
/>
</>
)
}
@@ -100,6 +117,7 @@ export function SidebarLabelItem({
return (
<motion.span
data-open={String(open)}
className={cn('overflow-hidden whitespace-nowrap', className)}
initial={false}
animate={merge(
@@ -117,3 +135,17 @@ export function SidebarLabelItem({
/>
)
}
export const SidebarToggleButton = () => {
const { open, setOpen } = useSidebar()
return (
<Button
className="flex size-12 min-w-0 items-center gap-2 rounded-2xl px-3 text-left"
variant="raised"
onClick={() => setOpen(!open)}
>
<MenuOpenRounded className="size-6 shrink-0" />
</Button>
)
}
@@ -7,3 +7,12 @@ export default function useIsMobile() {
return isMobile
}
export function useIsMobileOrTablet() {
const breakpoint = useBreakpoint()
const isMobileOrTablet =
breakpoint === 'sm' || breakpoint === 'xs' || breakpoint === 'md'
return isMobileOrTablet
}
@@ -1,4 +1,3 @@
import MenuOpenRounded from '~icons/material-symbols/menu-open-rounded'
import { ComponentProps, PropsWithChildren } from 'react'
import { z } from 'zod'
import { Button } from '@/components/ui/button'
@@ -6,6 +5,7 @@ import {
Sidebar,
SidebarLabelItem,
SidebarProvider,
SidebarToggleButton,
useSidebar,
} from '@/components/ui/slider-sidebar'
import {
@@ -13,6 +13,7 @@ import {
TooltipContent,
TooltipTrigger,
} from '@/components/ui/tooltip'
import { useIsMobileOrTablet } from '@/hooks/use-is-moblie'
import { cn } from '@nyanpasu/ui'
import { createFileRoute, Link, Outlet } from '@tanstack/react-router'
import { LogLevel } from './_modules/consts'
@@ -35,20 +36,6 @@ const SidebarContent = ({ className, ...props }: ComponentProps<'div'>) => {
return <div className={cn('p-2', className)} {...props} />
}
const SidebarToggleButton = () => {
const { open, setOpen } = useSidebar()
return (
<Button
className="flex size-12 min-w-0 items-center gap-2 rounded-2xl px-3 text-left"
variant="raised"
onClick={() => setOpen(!open)}
>
<MenuOpenRounded className="size-6 shrink-0" />
</Button>
)
}
const LogLevelButton = ({
level: inputLevel,
children,
@@ -57,10 +44,18 @@ const LogLevelButton = ({
const Icon = inputLevel ? LogLevelIcon[inputLevel] : () => '📋'
const { open } = useSidebar()
const { open, setOpen } = useSidebar()
const isMobileOrTablet = useIsMobileOrTablet()
const handleClick = () => {
if (isMobileOrTablet) {
setOpen(false)
}
}
return (
<Tooltip>
<Tooltip open={open ? false : undefined}>
<TooltipTrigger asChild>
<Button
variant="fab"
@@ -74,6 +69,7 @@ const LogLevelButton = ({
'data-[active=false]:hover:shadow-none',
'data-[active=false]:hover:bg-surface-variant/30',
)}
onClick={handleClick}
asChild
>
<Link
@@ -93,11 +89,9 @@ const LogLevelButton = ({
</Button>
</TooltipTrigger>
{!open && (
<TooltipContent side="right">
<p className="capitalize">{children}</p>
</TooltipContent>
)}
<TooltipContent side="right">
<p className="capitalize">{children}</p>
</TooltipContent>
</Tooltip>
)
}
@@ -107,10 +101,10 @@ function RouteComponent() {
<SidebarProvider defaultOpen={false}>
<div
className={cn(
'divide-outline-variant flex h-full min-h-0 w-full divide-x overflow-hidden',
'divide-outline-variant relative flex h-full min-h-0 w-full divide-x overflow-hidden',
)}
>
<Sidebar className="divide-outline-variant flex flex-col divide-y">
<Sidebar className="divide-outline-variant z-10 flex flex-col divide-y">
<SidebarContent className="flex flex-1 flex-col gap-2">
<LogLevelButton>All</LogLevelButton>
@@ -1,33 +1,9 @@
import { useMemo } from 'react'
import { Button } from '@/components/ui/button'
import { useClashProxies, useServerPort } from '@nyanpasu/interface'
import { cn, LazyImage } from '@nyanpasu/ui'
import Image from '@/components/ui/image'
import { useClashProxies } from '@nyanpasu/interface'
import { cn } from '@nyanpasu/ui'
import { Link, useLocation } from '@tanstack/react-router'
const ProxyGroupIconRender = ({ icon }: { icon: string }) => {
const serverPort = useServerPort()
const src = icon.trim().startsWith('<svg')
? `data:image/svg+xml;base64,${btoa(icon)}`
: icon
const cachedUrl = useMemo(() => {
if (!src.startsWith('http')) {
return src
}
return `http://localhost:${serverPort}/cache/icon?url=${btoa(src)}`
}, [src, serverPort])
return (
<LazyImage
className="size-8"
loadingClassName="rounded-full"
src={cachedUrl}
/>
)
}
export default function ProxiesNavigate() {
const {
proxies: { data: proxies },
@@ -64,7 +40,11 @@ export default function ProxiesNavigate() {
<div className="flex items-center gap-2.5">
{group.icon && (
<div className="size-8">
<ProxyGroupIconRender icon={group.icon} />
<Image
icon={group.icon}
className="size-8"
loadingClassName="rounded-full"
/>
</div>
)}
@@ -1,6 +1,6 @@
import { useMemo, useState } from 'react'
import HighlightText from '@/components/ui/highlight-text'
import { useScrollArea } from '@/components/ui/scroll-area'
import { ScrollArea, useScrollArea } from '@/components/ui/scroll-area'
import { useClashRules } from '@nyanpasu/interface'
import { cn } from '@nyanpasu/ui'
import { createFileRoute } from '@tanstack/react-router'
@@ -11,33 +11,40 @@ import {
useReactTable,
} from '@tanstack/react-table'
import { useVirtualizer } from '@tanstack/react-virtual'
import { Route as IndexRoute } from './route'
export const Route = createFileRoute('/(main)/main/rules/')({
component: RouteComponent,
})
function RouteComponent() {
const Viewer = ({ search }: { search: string }) => {
const { data } = useClashRules()
const { proxy } = IndexRoute.useSearch()
const { viewportRef } = useScrollArea()
const [search, setSearch] = useState('')
const filteredRules = useMemo(() => {
if (!data?.rules || !search.trim()) {
return data?.rules ?? []
const rules = data?.rules ?? []
const proxyFilteredRules = proxy
? rules.filter((rule) => rule.proxy === proxy)
: rules
if (!search.trim()) {
return proxyFilteredRules
}
const searchLower = search.toLowerCase()
return data.rules.filter((rule) => {
return proxyFilteredRules.filter((rule) => {
return (
rule.type?.toLowerCase().includes(searchLower) ||
rule.payload?.toLowerCase().includes(searchLower) ||
rule.proxy?.toLowerCase().includes(searchLower)
)
})
}, [data?.rules, search])
}, [data?.rules, proxy, search])
const rowVirtualizer = useVirtualizer({
count: filteredRules.length,
@@ -97,88 +104,77 @@ function RouteComponent() {
const { rows } = table.getRowModel()
return (
<>
<div
className="bg-mixed-background sticky top-0 z-10"
data-slot="rules-search"
<div
className="mx-auto max-w-7xl px-8"
data-slot="rules-virtual-container"
style={{ height: `${rowVirtualizer.getTotalSize()}px` }}
>
<table
className="w-full min-w-208 table-fixed"
data-slot="rules-virtual-table"
>
<div className="mx-auto max-w-7xl p-4" data-slot="rules-search-input">
<input
type="text"
className={cn(
'bg-surface-variant dark:bg-surface-variant/30',
'h-10 w-full rounded-full px-4 pr-10 text-sm outline-none',
)}
data-slot="rules-search-input-field"
placeholder="Search rules (type, payload, or proxy)..."
value={search}
onChange={(e) => setSearch(e.target.value)}
/>
</div>
</div>
<colgroup>
<col className="w-20" />
<col className="w-40" />
<col />
<col className="w-40" />
</colgroup>
<div
className="mx-auto max-w-7xl px-8"
data-slot="rules-virtual-container"
style={{ height: `${rowVirtualizer.getTotalSize()}px` }}
>
<table className="w-full table-fixed" data-slot="rules-virtual-table">
<colgroup>
<col className="w-20" />
<col className="w-40" />
<col />
<col className="w-40" />
</colgroup>
<tbody className="select-text" data-slot="rules-virtual-tbody">
{virtualItems.map((virtualRow, index) => {
const row = rows[virtualRow.index]
<thead className="h-10" data-slot="rules-virtual-thead">
{table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id} data-slot="rules-virtual-tr">
{headerGroup.headers.map(
({ id, colSpan, isPlaceholder, column, getContext }) => (
<th key={id} data-slot="rules-virtual-th" colSpan={colSpan}>
{isPlaceholder ? null : (
<div
className={cn(
'text-left align-middle font-bold select-none',
)}
>
{flexRender(column.columnDef.header, getContext())}
</div>
)}
</th>
),
)}
const offset = virtualRow.start - index * virtualRow.size
return (
<tr
key={row.id}
data-index={virtualRow.index}
data-slot="rules-virtual-tr"
style={{
height: `${virtualRow.size}px`,
transform: `translateY(${offset}px)`,
}}
>
{row.getVisibleCells().map(({ column, id, getContext }) => (
<td key={id} data-slot="rules-virtual-td">
{flexRender(column.columnDef.cell, getContext())}
</td>
))}
</tr>
))}
</thead>
<tbody className="select-text" data-slot="rules-virtual-tbody">
{virtualItems.map((virtualRow, index) => {
const row = rows[virtualRow.index]
const offset = virtualRow.start - index * virtualRow.size
return (
<tr
key={row.id}
data-index={virtualRow.index}
data-slot="rules-virtual-tr"
style={{
height: `${virtualRow.size}px`,
transform: `translateY(${offset}px)`,
}}
>
{row.getVisibleCells().map(({ column, id, getContext }) => (
<td key={id} data-slot="rules-virtual-td">
{flexRender(column.columnDef.cell, getContext())}
</td>
))}
</tr>
)
})}
</tbody>
</table>
</div>
</>
)
})}
</tbody>
</table>
</div>
)
}
function RouteComponent() {
const [search, setSearch] = useState('')
return (
<div className="divide-outline-variant flex h-full min-h-0 flex-1 flex-col divide-y overflow-hidden">
<ScrollArea className="min-h-0 flex-1" scrollbars="both" type="hover">
<Viewer search={search} />
</ScrollArea>
<div
className="bg-mixed-background flex h-16 shrink-0 items-center px-4"
data-slot="rules-search"
>
<input
type="text"
className={cn(
'bg-surface-variant dark:bg-surface-variant/30',
'h-10 w-full rounded-full px-4 pr-10 text-sm outline-none',
)}
data-slot="rules-search-input-field"
placeholder="Search rules (type, payload, or proxy)..."
value={search}
onChange={(e) => setSearch(e.target.value)}
/>
</div>
</div>
)
}
@@ -1,14 +1,167 @@
import { AppContentScrollArea } from '@/components/ui/scroll-area'
import { createFileRoute, Outlet } from '@tanstack/react-router'
import ListRounded from '~icons/material-symbols/lists-rounded'
import { ComponentProps, PropsWithChildren, ReactNode, useMemo } from 'react'
import z from 'zod'
import { Button } from '@/components/ui/button'
import Image from '@/components/ui/image'
import { ScrollArea } from '@/components/ui/scroll-area'
import {
Sidebar,
SidebarLabelItem,
SidebarProvider,
SidebarToggleButton,
useSidebar,
} from '@/components/ui/slider-sidebar'
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from '@/components/ui/tooltip'
import { useIsMobileOrTablet } from '@/hooks/use-is-moblie'
import { m } from '@/paraglide/messages'
import { useClashProxies, useClashRules } from '@nyanpasu/interface'
import { cn } from '@nyanpasu/ui'
import { createFileRoute, Link, Outlet } from '@tanstack/react-router'
export const Route = createFileRoute('/(main)/main/rules')({
component: RouteComponent,
validateSearch: z.object({
proxy: z.string().optional().nullable(),
}),
})
const SidebarContent = ({ className, ...props }: ComponentProps<'div'>) => {
return <div className={cn('p-2', className)} {...props} />
}
const ProxyIcon = ({ item }: { item?: string }) => {
const {
proxies: { data: proxies },
} = useClashProxies()
const icon = useMemo(() => {
const proxyInfo = proxies?.groups.find((p) => p.name === item)
return proxyInfo?.icon
}, [item, proxies])
return icon ? (
<Image className="size-6" loadingClassName="rounded-full" icon={icon} />
) : (
<div
className={cn(
'bg-surface text-secondary grid size-6 place-content-center rounded-full text-[10px]',
)}
>
{item?.toLocaleUpperCase().slice(0, 2)}
</div>
)
}
const Item = ({
item,
children,
icon,
}: PropsWithChildren<{
item?: string
icon?: ReactNode
}>) => {
const { proxy } = Route.useSearch()
const { open, setOpen } = useSidebar()
const isMobileOrTablet = useIsMobileOrTablet()
const handleClick = () => {
if (isMobileOrTablet) {
setOpen(false)
}
}
return (
<Tooltip open={open ? false : undefined}>
<TooltipTrigger asChild>
<Button
variant="fab"
data-active={String(item === proxy)}
className={cn(
'h-12 min-w-0 px-3',
'flex items-center gap-2',
'data-[active=true]:bg-surface-variant/50',
'data-[active=false]:bg-transparent',
'data-[active=false]:shadow-none',
'data-[active=false]:hover:shadow-none',
'data-[active=false]:hover:bg-surface-variant/30',
)}
onClick={handleClick}
asChild
>
<Link
to="."
search={{
proxy: item,
}}
>
<div className="text-md grid size-6 shrink-0 place-content-center">
{icon}
</div>
<SidebarLabelItem>{children}</SidebarLabelItem>
</Link>
</Button>
</TooltipTrigger>
<TooltipContent side="right">
<p>{children}</p>
</TooltipContent>
</Tooltip>
)
}
const ProxySelector = () => {
const { data } = useClashRules()
const allProxy = useMemo(() => {
const proxies =
data?.rules
.map((rule) => rule.proxy)
.filter((proxy): proxy is string => !!proxy) ?? []
return [...new Set(proxies)]
}, [data])
return (
<SidebarContent className="flex flex-col gap-2">
<Item icon={<ListRounded />}>{m.rules_list_all_proxies()}</Item>
{allProxy.map((item) => (
<Item key={item} item={item} icon={<ProxyIcon item={item} />}>
{item}
</Item>
))}
</SidebarContent>
)
}
function RouteComponent() {
return (
<AppContentScrollArea>
<Outlet />
</AppContentScrollArea>
<SidebarProvider defaultOpen={false}>
<div
className={cn(
'divide-outline-variant relative flex h-full min-h-0 w-full divide-x overflow-hidden',
)}
>
<Sidebar className="divide-outline-variant z-10 flex h-full min-h-0 flex-col divide-y">
<ScrollArea className="min-h-0 w-full flex-1 [&>div>div]:block!">
<ProxySelector />
</ScrollArea>
<SidebarContent className="flex h-16 justify-end">
<SidebarToggleButton />
</SidebarContent>
</Sidebar>
<Outlet />
</div>
</SidebarProvider>
)
}
@@ -56,8 +56,8 @@ export function SettingsTitle({
className={cn(
'group sticky top-0 z-10',
'bg-mixed-background',
'flex items-center gap-6',
'h-16 px-6',
'flex items-center gap-4',
'h-16 px-4 md:px-6',
className,
)}
data-show-title={showTopTitle}
@@ -17,7 +17,7 @@ function RouteComponent() {
return (
<AppContentScrollArea
className={cn('bg-surface z-50 w-full')}
className={cn('bg-surface z-50 w-full [&>div>div]:block!')}
data-slot="settings-sidebar-scroll-area"
>
<SettingsNavigate />
+2 -2
View File
@@ -20,10 +20,10 @@
"@tauri-apps/api": "2.10.1",
"@types/d3": "7.4.3",
"@types/react": "19.2.14",
"@vitejs/plugin-react": "5.1.4",
"@vitejs/plugin-react": "5.2.0",
"ahooks": "3.9.6",
"d3": "7.9.0",
"framer-motion": "12.35.2",
"framer-motion": "12.36.0",
"react": "19.2.4",
"react-dom": "19.2.4",
"react-error-boundary": "6.0.0",
+1 -1
View File
@@ -71,7 +71,7 @@
"knip": "5.86.0",
"lint-staged": "16.3.3",
"npm-run-all2": "8.0.4",
"oxlint": "1.54.0",
"oxlint": "1.55.0",
"postcss": "8.5.8",
"postcss-html": "1.8.1",
"postcss-import": "16.1.1",
+145 -145
View File
@@ -68,8 +68,8 @@ importers:
specifier: 8.0.4
version: 8.0.4
oxlint:
specifier: 1.54.0
version: 1.54.0
specifier: 1.55.0
version: 1.55.0
postcss:
specifier: 8.5.8
version: 8.5.8
@@ -183,8 +183,8 @@ importers:
specifier: 5.2.2
version: 5.2.2(react-hook-form@7.71.2(react@19.2.4))
'@inlang/paraglide-js':
specifier: 2.14.0
version: 2.14.0(babel-plugin-macros@3.1.0)
specifier: 2.15.0
version: 2.15.0(babel-plugin-macros@3.1.0)
'@juggle/resize-observer':
specifier: 3.4.0
version: 3.4.0
@@ -222,8 +222,8 @@ importers:
specifier: 8.21.3
version: 8.21.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
'@tanstack/react-virtual':
specifier: 3.13.21
version: 3.13.21(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
specifier: 3.13.22
version: 3.13.22(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
'@tanstack/router-zod-adapter':
specifier: 1.81.5
version: 1.81.5(@tanstack/react-router@1.166.7(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(zod@4.3.6)
@@ -258,8 +258,8 @@ importers:
specifier: 1.11.20
version: 1.11.20
framer-motion:
specifier: 12.35.2
version: 12.35.2(@emotion/is-prop-valid@1.3.0)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
specifier: 12.36.0
version: 12.36.0(@emotion/is-prop-valid@1.3.0)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
i18next:
specifier: 25.8.18
version: 25.8.18(typescript@5.9.3)
@@ -388,11 +388,11 @@ importers:
specifier: 7.2.1
version: 7.2.1(terser@5.36.0)(vite@7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2))
'@vitejs/plugin-react':
specifier: 5.1.4
version: 5.1.4(vite@7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2))
specifier: 5.2.0
version: 5.2.0(vite@7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2))
'@vitejs/plugin-react-swc':
specifier: 4.2.3
version: 4.2.3(vite@7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2))
specifier: 4.3.0
version: 4.3.0(vite@7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2))
change-case:
specifier: 5.4.4
version: 5.4.4
@@ -406,8 +406,8 @@ importers:
specifier: 11.0.13
version: 11.0.13
meta-json-schema:
specifier: 1.19.20
version: 1.19.20
specifier: 1.19.21
version: 1.19.21
monaco-yaml:
specifier: 5.4.1
version: 5.4.1(monaco-editor@0.55.1)
@@ -478,8 +478,8 @@ importers:
specifier: 19.2.14
version: 19.2.14
'@vitejs/plugin-react':
specifier: 5.1.4
version: 5.1.4(vite@7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2))
specifier: 5.2.0
version: 5.2.0(vite@7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2))
ahooks:
specifier: 3.9.6
version: 3.9.6(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
@@ -487,8 +487,8 @@ importers:
specifier: 7.9.0
version: 7.9.0
framer-motion:
specifier: 12.35.2
version: 12.35.2(@emotion/is-prop-valid@1.3.0)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
specifier: 12.36.0
version: 12.36.0(@emotion/is-prop-valid@1.3.0)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
react:
specifier: 19.2.4
version: 19.2.4
@@ -600,8 +600,8 @@ importers:
specifier: 2.26.22
version: 2.26.22
undici:
specifier: 7.23.0
version: 7.23.0
specifier: 7.24.0
version: 7.24.0
yargs:
specifier: 18.0.0
version: 18.0.0
@@ -1713,15 +1713,15 @@ packages:
'@iconify/utils@3.1.0':
resolution: {integrity: sha512-Zlzem1ZXhI1iHeeERabLNzBHdOa4VhQbqAcOQaMKuTuyZCpwKbC2R4Dd0Zo3g9EAc+Y4fiarO8HIHRAth7+skw==}
'@inlang/paraglide-js@2.14.0':
resolution: {integrity: sha512-6Tno8RvEhnALdgueWNQACiEm3YM6hAfbxnYB+JWML9p5s1O4t0DOqgU9YD8fwpixOnZbU6cJRkvt4v9acXDioA==}
'@inlang/paraglide-js@2.15.0':
resolution: {integrity: sha512-2ZOa9nssVn4tjkKskqb88KP5A7cTIjo8AiM9xnPvH+vBhRIRenO+ftAbVOHhHcHjcFxy2QFcOfBAH/Cw1LIsUg==}
hasBin: true
'@inlang/recommend-sherlock@0.2.1':
resolution: {integrity: sha512-ckv8HvHy/iTqaVAEKrr+gnl+p3XFNwe5D2+6w6wJk2ORV2XkcRkKOJ/XsTUJbPSiyi4PI+p+T3bqbmNx/rDUlg==}
'@inlang/sdk@2.7.0':
resolution: {integrity: sha512-yJNBD0o8i29TTJqWX5uDRHxnalDGcsUDctxepzFXsUfkzqGWfiFBxODdxvReqvM2CuKAAOo/kib/F1UcgdYFNQ==}
'@inlang/sdk@2.8.0':
resolution: {integrity: sha512-w1jysvUDTMgCaONklIgOJAp9dUDl0UhLbsdqfWEwY/GIqoc9IwpuHsrP3pzC+h3DfOpkMMDnDkTpPv8kIZ98iA==}
engines: {node: '>=18.0.0'}
'@isaacs/fs-minipass@4.0.1':
@@ -2438,124 +2438,124 @@ packages:
cpu: [x64]
os: [win32]
'@oxlint/binding-android-arm-eabi@1.54.0':
resolution: {integrity: sha512-khWlVXUa4CPvp4eXnj7/TUNeyiarwvTEmZggylPIPUCSWgPqUBFGElIBa9xKNCQt4pb+WSGArCNEAy22ekQQxg==}
'@oxlint/binding-android-arm-eabi@1.55.0':
resolution: {integrity: sha512-NhvgAhncTSOhRahQSCnkK/4YIGPjTmhPurQQ2dwt2IvwCMTvZRW5vF2K10UBOxFve4GZDMw6LtXZdC2qeuYIVQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [android]
'@oxlint/binding-android-arm64@1.54.0':
resolution: {integrity: sha512-p3qEVSDVmyducpI9ORTJNbaMyXfICidDXGaf3WwyDyiXPExyZdfc6UsPepGPxImlfFJs5kxOCPqP4ut12Ed9pg==}
'@oxlint/binding-android-arm64@1.55.0':
resolution: {integrity: sha512-P9iWRh+Ugqhg+D7rkc7boHX8o3H2h7YPcZHQIgvVBgnua5tk4LR2L+IBlreZs58/95cd2x3/004p5VsQM9z4SA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [android]
'@oxlint/binding-darwin-arm64@1.54.0':
resolution: {integrity: sha512-tUQ+vn/AL2P2Rz6cl3gsFA+4pMBFMRR0e6AVePoezV9iGTSMZUXIf0YWHq203bwNDXcY04vSXDqPB6E1b9WULA==}
'@oxlint/binding-darwin-arm64@1.55.0':
resolution: {integrity: sha512-esakkJIt7WFAhT30P/Qzn96ehFpzdZ1mNuzpOb8SCW7lI4oB8VsyQnkSHREM671jfpuBb/o2ppzBCx5l0jpgMA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [darwin]
'@oxlint/binding-darwin-x64@1.54.0':
resolution: {integrity: sha512-9tzH/OLGZCzVGEXW0D3I0OrQOOWciHYWV9mcxjqqQE6f1DMOXT23mWj5/OQtqhW3E1VfHf0uf2MzMbM2gboPlA==}
'@oxlint/binding-darwin-x64@1.55.0':
resolution: {integrity: sha512-xDMFRCCAEK9fOH6As2z8ELsC+VDGSFRHwIKVSilw+xhgLwTDFu37rtmRbmUlx8rRGS6cWKQPTc47AVxAZEVVPQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [darwin]
'@oxlint/binding-freebsd-x64@1.54.0':
resolution: {integrity: sha512-XelGa+x7vC9epF5JzXWHaQtdxqcL5R+H2WcEkr+JDkfmY3dAXVLa+51qW3+MWt7CZanakaOyhraLzdM32pWFfg==}
'@oxlint/binding-freebsd-x64@1.55.0':
resolution: {integrity: sha512-mYZqnwUD7ALCRxGenyLd1uuG+rHCL+OTT6S8FcAbVm/ZT2AZMGjvibp3F6k1SKOb2aeqFATmwRykrE41Q0GWVw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [freebsd]
'@oxlint/binding-linux-arm-gnueabihf@1.54.0':
resolution: {integrity: sha512-t5FubAU899vMF+6rBtxDewkwSAeFn8OUCKb/+jJ1XqPU0FTR+RffnTfXafVE8WXw39eN4pzUK3rkxUWlcsFuaw==}
'@oxlint/binding-linux-arm-gnueabihf@1.55.0':
resolution: {integrity: sha512-LcX6RYcF9vL9ESGwJW3yyIZ/d/ouzdOKXxCdey1q0XJOW1asrHsIg5MmyKdEBR4plQx+shvYeQne7AzW5f3T1w==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
'@oxlint/binding-linux-arm-musleabihf@1.54.0':
resolution: {integrity: sha512-Du6cwkoMRi9DAgITzQpzS1QaEqE+5BP3Tfgr1yPy3C034n6IHISCwf4KMB+wojg8FE/kYvrJDibT0ENdcR3jUg==}
'@oxlint/binding-linux-arm-musleabihf@1.55.0':
resolution: {integrity: sha512-C+8GS1rPtK+dI7mJFkqoRBkDuqbrNihnyYQsJPS9ez+8zF9JzfvU19lawqt4l/Y23o5uQswE/DORa8aiXUih3w==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
'@oxlint/binding-linux-arm64-gnu@1.54.0':
resolution: {integrity: sha512-R4PjJ1lfghsVBuAegW79jkvUWbN8P4F28KaKbM72dW6ZWTYMg6M0pkTilXFZ+q/mb8f0MEyR1rO16useoa6KTA==}
'@oxlint/binding-linux-arm64-gnu@1.55.0':
resolution: {integrity: sha512-ErLE4XbmcCopA4/CIDiH6J1IAaDOMnf/KSx/aFObs4/OjAAM3sFKWGZ57pNOMxhhyBdcmcXwYymph9GwcpcqgQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@oxlint/binding-linux-arm64-musl@1.54.0':
resolution: {integrity: sha512-WBNFe1foIFg6ipgzjzJfDLn7C5nZpLr/UHlnlT7GI3scCD2xpJiJTGMTTpJqA8p0Q1l2NsEnAOj9PtreF0Tkzg==}
'@oxlint/binding-linux-arm64-musl@1.55.0':
resolution: {integrity: sha512-/kp65avi6zZfqEng56TTuhiy3P/3pgklKIdf38yvYeJ9/PgEeRA2A2AqKAKbZBNAqUzrzHhz9jF6j/PZvhJzTQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [musl]
'@oxlint/binding-linux-ppc64-gnu@1.54.0':
resolution: {integrity: sha512-M+UAW76rZHHiYKKy4e7Te5MNikANiFhYWl0qYF1MTIhQczYIqWVDQ+SX0SzW8ipOB/oK3+enOvlvJuhMoA968Q==}
'@oxlint/binding-linux-ppc64-gnu@1.55.0':
resolution: {integrity: sha512-A6pTdXwcEEwL/nmz0eUJ6WxmxcoIS+97GbH96gikAyre3s5deC7sts38ZVVowjS2QQFuSWkpA4ZmQC0jZSNvJQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@oxlint/binding-linux-riscv64-gnu@1.54.0':
resolution: {integrity: sha512-sGassljr8TR5F1WCqOaacrp3mYi107MnjkqlSXOMHACps7U2bL4v7M3RY7P7NMcGkNhzRHF3VO5+XyPWhTVM6w==}
'@oxlint/binding-linux-riscv64-gnu@1.55.0':
resolution: {integrity: sha512-clj0lnIN+V52G9tdtZl0LbdTSurnZ1NZj92Je5X4lC7gP5jiCSW+Y/oiDiSauBAD4wrHt2S7nN3pA0zfKYK/6Q==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@oxlint/binding-linux-riscv64-musl@1.54.0':
resolution: {integrity: sha512-mW5Z6XTO8QWtlUjlf6yjntarjnbrmGVSK/V6XYy2rjH8xUfv9pn9G1vO92DBBBi0eUwnVpcOY3hMkP851WZNWg==}
'@oxlint/binding-linux-riscv64-musl@1.55.0':
resolution: {integrity: sha512-NNu08pllN5x/O94/sgR3DA8lbrGBnTHsINZZR0hcav1sj79ksTiKKm1mRzvZvacwQ0hUnGinFo+JO75ok2PxYg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
libc: [musl]
'@oxlint/binding-linux-s390x-gnu@1.54.0':
resolution: {integrity: sha512-nfPmEGW9BfWEUD0PVXGaYa2RS4wVblofNih1gsyUoLSWSyliNisIWd7F+QXrDSL5SJ78BPZjDW6FainV8qRiTg==}
'@oxlint/binding-linux-s390x-gnu@1.55.0':
resolution: {integrity: sha512-BvfQz3PRlWZRoEZ17dZCqgQsMRdpzGZomJkVATwCIGhHVVeHJMQdmdXPSjcT1DCNUrOjXnVyj1RGDj5+/Je2+Q==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@oxlint/binding-linux-x64-gnu@1.54.0':
resolution: {integrity: sha512-gybxMQx4NN1T+pa8TLwgVS4u9H9Hxwm7Sl0qvnQJF2WRhNN1oTOCzkmmCBbW/29DYLeV99WU76zh7srCamK9yw==}
'@oxlint/binding-linux-x64-gnu@1.55.0':
resolution: {integrity: sha512-ngSOoFCSBMKVQd24H8zkbcBNc7EHhjnF1sv3mC9NNXQ/4rRjI/4Dj9+9XoDZeFEkF1SX1COSBXF1b2Pr9rqdEw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [glibc]
'@oxlint/binding-linux-x64-musl@1.54.0':
resolution: {integrity: sha512-EAXMh2w3pzSj/aiB67kXzcHIoKxAywC1i1IgxA1sLY7iffEaZowDTOJgirY7WxeR/WiiKwak89gPeh9wUdLnIw==}
'@oxlint/binding-linux-x64-musl@1.55.0':
resolution: {integrity: sha512-BDpP7W8GlaG7BR6QjGZAleYzxoyKc/D24spZIF2mB3XsfALQJJT/OBmP8YpeTb1rveFSBHzl8T7l0aqwkWNdGA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [musl]
'@oxlint/binding-openharmony-arm64@1.54.0':
resolution: {integrity: sha512-Ih7CfITkbw86+LjgV5gDwNmNQlvz7X+51gdeLLUDwuA/9lojDxCmRQEzeMl44KStQlwzCuNIcgGMae0MllV5ww==}
'@oxlint/binding-openharmony-arm64@1.55.0':
resolution: {integrity: sha512-PS6GFvmde/pc3fCA2Srt51glr8Lcxhpf6WIBFfLphndjRrD34NEcses4TSxQrEcxYo6qVywGfylM0ZhSCF2gGA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [openharmony]
'@oxlint/binding-win32-arm64-msvc@1.54.0':
resolution: {integrity: sha512-qGQ8KIEfdgwwJd09Nc0d5hzlHQAM0EMoshMzHG/nNlMAHXrY7RFyat6VbzjflifAFb7LPAw+Yw9AB8cfzR7L8g==}
'@oxlint/binding-win32-arm64-msvc@1.55.0':
resolution: {integrity: sha512-P6JcLJGs/q1UOvDLzN8otd9JsH4tsuuPDv+p7aHqHM3PrKmYdmUvkNj4K327PTd35AYcznOCN+l4ZOaq76QzSw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [win32]
'@oxlint/binding-win32-ia32-msvc@1.54.0':
resolution: {integrity: sha512-GXos7N5oZIcIE8hlXgtUkI+y3frIqwiztx9p4+ZrpNgASbnIsxxy8bgLJqXE2SGCAdmtjBO1mdKhGTtVrb1jbg==}
'@oxlint/binding-win32-ia32-msvc@1.55.0':
resolution: {integrity: sha512-gzkk4zE2zsE+WmRxFOiAZHpCpUNDFytEakqNXoNHW+PnYEOTPKDdW6nrzgSeTbGKVPXNAKQnRnMgrh7+n3Xueg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ia32]
os: [win32]
'@oxlint/binding-win32-x64-msvc@1.54.0':
resolution: {integrity: sha512-DVxSELcI72lmcODuVpO8uXkwuYPiA0hKMhBwNa8fO4+sIVxFvxugf/z6qrL+4PM8RjGWjdl8O/QqzuRWj9b5bA==}
'@oxlint/binding-win32-x64-msvc@1.55.0':
resolution: {integrity: sha512-ZFALNow2/og75gvYzNP7qe+rREQ5xunktwA+lgykoozHZ6hw9bqg4fn5j2UvG4gIn1FXqrZHkOAXuPf5+GOYTQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [win32]
@@ -3388,12 +3388,12 @@ packages:
'@radix-ui/rect@1.1.1':
resolution: {integrity: sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==}
'@rolldown/pluginutils@1.0.0-rc.2':
resolution: {integrity: sha512-izyXV/v+cHiRfozX62W9htOAvwMo4/bXKDrQ+vom1L1qRuexPock/7VZDAhnpHCLNejd3NJ6hiab+tO0D44Rgw==}
'@rolldown/pluginutils@1.0.0-rc.3':
resolution: {integrity: sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==}
'@rolldown/pluginutils@1.0.0-rc.7':
resolution: {integrity: sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA==}
'@rollup/pluginutils@4.2.1':
resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==}
engines: {node: '>= 8.0.0'}
@@ -3889,8 +3889,8 @@ packages:
react: '>=16.8'
react-dom: '>=16.8'
'@tanstack/react-virtual@3.13.21':
resolution: {integrity: sha512-SYXFrmrbPgXBvf+HsOsKhFgqSe4M6B29VHOsX9Jih9TlNkNkDWx0hWMiMLUghMEzyUz772ndzdEeCEBx+3GIZw==}
'@tanstack/react-virtual@3.13.22':
resolution: {integrity: sha512-EaOrBBJLi3M0bTMQRjGkxLXRw7Gizwntoy5E2Q2UnSbML7Mo2a1P/Hfkw5tw9FLzK62bj34Jl6VNbQfRV6eJcA==}
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
@@ -3958,8 +3958,8 @@ packages:
resolution: {integrity: sha512-ldZXEhOBb8Is7xLs01fR3YEc3DERiz5silj8tnGkFZytt1abEvl/GhUmCE0PMLaMPTa3Jk4HbKmRlHmu+gCftg==}
engines: {node: '>=12'}
'@tanstack/virtual-core@3.13.21':
resolution: {integrity: sha512-ww+fmLHyCbPSf7JNbWZP3g7wl6SdNo3ah5Aiw+0e9FDErkVHLKprYUrwTm7dF646FtEkN/KkAKPYezxpmvOjxw==}
'@tanstack/virtual-core@3.13.22':
resolution: {integrity: sha512-isuUGKsc5TAPDoHSbWTbl1SCil54zOS2MiWz/9GCWHPUQOvNTQx8qJEWC7UWR0lShhbK0Lmkcf0SZYxvch7G3g==}
'@tanstack/virtual-core@3.13.9':
resolution: {integrity: sha512-3jztt0jpaoJO5TARe2WIHC1UQC3VMLAFUW5mmMo0yrkwtDB2AQP0+sh10BVUpWrnvHjSLvzFizydtEGLCJKFoQ==}
@@ -4467,17 +4467,17 @@ packages:
terser: ^5.16.0
vite: ^7.0.0
'@vitejs/plugin-react-swc@4.2.3':
resolution: {integrity: sha512-QIluDil2prhY1gdA3GGwxZzTAmLdi8cQ2CcuMW4PB/Wu4e/1pzqrwhYWVd09LInCRlDUidQjd0B70QWbjWtLxA==}
'@vitejs/plugin-react-swc@4.3.0':
resolution: {integrity: sha512-mOkXCII839dHyAt/gpoSlm28JIVDwhZ6tnG6wJxUy2bmOx7UaPjvOyIDf3SFv5s7Eo7HVaq6kRcu6YMEzt5Z7w==}
engines: {node: ^20.19.0 || >=22.12.0}
peerDependencies:
vite: ^4 || ^5 || ^6 || ^7
vite: ^4 || ^5 || ^6 || ^7 || ^8
'@vitejs/plugin-react@5.1.4':
resolution: {integrity: sha512-VIcFLdRi/VYRU8OL/puL7QXMYafHmqOnwTZY50U1JPlCNj30PxCMx65c494b1K9be9hX83KVt0+gTEwTWLqToA==}
'@vitejs/plugin-react@5.2.0':
resolution: {integrity: sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==}
engines: {node: ^20.19.0 || >=22.12.0}
peerDependencies:
vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0
vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0
'@volar/language-core@2.4.11':
resolution: {integrity: sha512-lN2C1+ByfW9/JRPpqScuZt/4OrUUse57GLI6TbLgTIqBVemdl1wNcZ1qYGEo2+Gw8coYLgCy7SuKqn6IrQcQgg==}
@@ -5476,8 +5476,8 @@ packages:
fraction.js@5.3.4:
resolution: {integrity: sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==}
framer-motion@12.35.2:
resolution: {integrity: sha512-dhfuEMaNo0hc+AEqyHiIfiJRNb9U9UQutE9FoKm5pjf7CMitp9xPEF1iWZihR1q86LBmo6EJ7S8cN8QXEy49AA==}
framer-motion@12.36.0:
resolution: {integrity: sha512-4PqYHAT7gev0ke0wos+PyrcFxI0HScjm3asgU8nSYa8YzJFuwgIvdj3/s3ZaxLq0bUSboIn19A2WS/MHwLCvfw==}
peerDependencies:
'@emotion/is-prop-valid': '*'
react: ^18.0.0 || ^19.0.0
@@ -6182,8 +6182,8 @@ packages:
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
engines: {node: '>= 8'}
meta-json-schema@1.19.20:
resolution: {integrity: sha512-9jnByDumPpxyIZL/uB1XPa7HzLSNXYXn9pz88MqWYnfEMVBuoOfhiPkGAUeaa57vdlFjqPGPlukioYWq174BZg==}
meta-json-schema@1.19.21:
resolution: {integrity: sha512-PkEdW1H+C0HNt+Bw5qAfBHkXgN0ZXB1g5YBhzCRzUNdLnWWe59lMgXRri85IizRRRVe8bVLffDMNbPb+4wrU3Q==}
engines: {node: '>=18', pnpm: '>=9'}
micromark-core-commonmark@2.0.1:
@@ -6320,11 +6320,11 @@ packages:
peerDependencies:
monaco-editor: '>=0.36'
motion-dom@12.35.2:
resolution: {integrity: sha512-pWXFMTwvGDbx1Fe9YL5HZebv2NhvGBzRtiNUv58aoK7+XrsuaydQ0JGRKK2r+bTKlwgSWwWxHbP5249Qr/BNpg==}
motion-dom@12.36.0:
resolution: {integrity: sha512-Ep1pq8P88rGJ75om8lTCA13zqd7ywPGwCqwuWwin6BKc0hMLkVfcS6qKlRqEo2+t0DwoUcgGJfXwaiFn4AOcQA==}
motion-utils@12.29.2:
resolution: {integrity: sha512-G3kc34H2cX2gI63RqU+cZq+zWRRPSsNIOjpdl9TN4AQwC4sgwYPl/Q/Obf/d53nOm569T0fYK+tcoSV50BWx8A==}
motion-utils@12.36.0:
resolution: {integrity: sha512-eHWisygbiwVvf6PZ1vhaHCLamvkSbPIeAYxWUuL3a2PD/TROgE7FvfHWTIH4vMl798QLfMw15nRqIaRDXTlYRg==}
ms@2.0.0:
resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
@@ -6452,8 +6452,8 @@ packages:
oxc-resolver@11.19.1:
resolution: {integrity: sha512-qE/CIg/spwrTBFt5aKmwe3ifeDdLfA2NESN30E42X/lII5ClF8V7Wt6WIJhcGZjp0/Q+nQ+9vgxGk//xZNX2hg==}
oxlint@1.54.0:
resolution: {integrity: sha512-ObSjVwf0ZYA5U5Cmelj0PsCuqCJXsm2TxZ40tgUSAY7Wu0lKAsNjor6cgXHXSys8jOwv1ICjtzouoWHdKGHbZg==}
oxlint@1.55.0:
resolution: {integrity: sha512-T+FjepiyWpaZMhekqRpH8Z3I4vNM610p6w+Vjfqgj5TZUxHXl7N8N5IPvmOU8U4XdTRxqtNNTh9Y4hLtr7yvFg==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
peerDependencies:
@@ -7605,8 +7605,8 @@ packages:
resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==}
engines: {node: '>=14.0'}
undici@7.23.0:
resolution: {integrity: sha512-HVMxHKZKi+eL2mrUZDzDkKW3XvCjynhbtpSq20xQp4ePDFeSFuAfnvM0GIwZIv8fiKHjXFQ5WjxhCt15KRNj+g==}
undici@7.24.0:
resolution: {integrity: sha512-jxytwMHhsbdpBXxLAcuu0fzlQeXCNnWdDyRHpvWsUl8vd98UwYdl9YTyn8/HcpcJPC3pwUveefsa3zTxyD/ERg==}
engines: {node: '>=20.18.1'}
unicode-canonical-property-names-ecmascript@2.0.1:
@@ -9348,10 +9348,10 @@ snapshots:
'@iconify/types': 2.0.0
mlly: 1.8.0
'@inlang/paraglide-js@2.14.0(babel-plugin-macros@3.1.0)':
'@inlang/paraglide-js@2.15.0(babel-plugin-macros@3.1.0)':
dependencies:
'@inlang/recommend-sherlock': 0.2.1
'@inlang/sdk': 2.7.0(babel-plugin-macros@3.1.0)
'@inlang/sdk': 2.8.0(babel-plugin-macros@3.1.0)
commander: 11.1.0
consola: 3.4.0
json5: 2.2.3
@@ -9364,7 +9364,7 @@ snapshots:
dependencies:
comment-json: 4.5.0
'@inlang/sdk@2.7.0(babel-plugin-macros@3.1.0)':
'@inlang/sdk@2.8.0(babel-plugin-macros@3.1.0)':
dependencies:
'@lix-js/sdk': 0.4.7(babel-plugin-macros@3.1.0)
'@sinclair/typebox': 0.31.28
@@ -10079,61 +10079,61 @@ snapshots:
'@oxc-resolver/binding-win32-x64-msvc@11.19.1':
optional: true
'@oxlint/binding-android-arm-eabi@1.54.0':
'@oxlint/binding-android-arm-eabi@1.55.0':
optional: true
'@oxlint/binding-android-arm64@1.54.0':
'@oxlint/binding-android-arm64@1.55.0':
optional: true
'@oxlint/binding-darwin-arm64@1.54.0':
'@oxlint/binding-darwin-arm64@1.55.0':
optional: true
'@oxlint/binding-darwin-x64@1.54.0':
'@oxlint/binding-darwin-x64@1.55.0':
optional: true
'@oxlint/binding-freebsd-x64@1.54.0':
'@oxlint/binding-freebsd-x64@1.55.0':
optional: true
'@oxlint/binding-linux-arm-gnueabihf@1.54.0':
'@oxlint/binding-linux-arm-gnueabihf@1.55.0':
optional: true
'@oxlint/binding-linux-arm-musleabihf@1.54.0':
'@oxlint/binding-linux-arm-musleabihf@1.55.0':
optional: true
'@oxlint/binding-linux-arm64-gnu@1.54.0':
'@oxlint/binding-linux-arm64-gnu@1.55.0':
optional: true
'@oxlint/binding-linux-arm64-musl@1.54.0':
'@oxlint/binding-linux-arm64-musl@1.55.0':
optional: true
'@oxlint/binding-linux-ppc64-gnu@1.54.0':
'@oxlint/binding-linux-ppc64-gnu@1.55.0':
optional: true
'@oxlint/binding-linux-riscv64-gnu@1.54.0':
'@oxlint/binding-linux-riscv64-gnu@1.55.0':
optional: true
'@oxlint/binding-linux-riscv64-musl@1.54.0':
'@oxlint/binding-linux-riscv64-musl@1.55.0':
optional: true
'@oxlint/binding-linux-s390x-gnu@1.54.0':
'@oxlint/binding-linux-s390x-gnu@1.55.0':
optional: true
'@oxlint/binding-linux-x64-gnu@1.54.0':
'@oxlint/binding-linux-x64-gnu@1.55.0':
optional: true
'@oxlint/binding-linux-x64-musl@1.54.0':
'@oxlint/binding-linux-x64-musl@1.55.0':
optional: true
'@oxlint/binding-openharmony-arm64@1.54.0':
'@oxlint/binding-openharmony-arm64@1.55.0':
optional: true
'@oxlint/binding-win32-arm64-msvc@1.54.0':
'@oxlint/binding-win32-arm64-msvc@1.55.0':
optional: true
'@oxlint/binding-win32-ia32-msvc@1.54.0':
'@oxlint/binding-win32-ia32-msvc@1.55.0':
optional: true
'@oxlint/binding-win32-x64-msvc@1.54.0':
'@oxlint/binding-win32-x64-msvc@1.55.0':
optional: true
'@paper-design/shaders-react@0.0.71(@types/react@19.2.14)(react@19.2.4)':
@@ -10983,10 +10983,10 @@ snapshots:
'@radix-ui/rect@1.1.1': {}
'@rolldown/pluginutils@1.0.0-rc.2': {}
'@rolldown/pluginutils@1.0.0-rc.3': {}
'@rolldown/pluginutils@1.0.0-rc.7': {}
'@rollup/pluginutils@4.2.1':
dependencies:
estree-walker: 2.0.2
@@ -11395,9 +11395,9 @@ snapshots:
react: 19.2.4
react-dom: 19.2.4(react@19.2.4)
'@tanstack/react-virtual@3.13.21(react-dom@19.2.4(react@19.2.4))(react@19.2.4)':
'@tanstack/react-virtual@3.13.22(react-dom@19.2.4(react@19.2.4))(react@19.2.4)':
dependencies:
'@tanstack/virtual-core': 3.13.21
'@tanstack/virtual-core': 3.13.22
react: 19.2.4
react-dom: 19.2.4(react@19.2.4)
@@ -11483,7 +11483,7 @@ snapshots:
'@tanstack/table-core@8.21.3': {}
'@tanstack/virtual-core@3.13.21': {}
'@tanstack/virtual-core@3.13.22': {}
'@tanstack/virtual-core@3.13.9': {}
@@ -12058,15 +12058,15 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@vitejs/plugin-react-swc@4.2.3(vite@7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2))':
'@vitejs/plugin-react-swc@4.3.0(vite@7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2))':
dependencies:
'@rolldown/pluginutils': 1.0.0-rc.2
'@rolldown/pluginutils': 1.0.0-rc.7
'@swc/core': 1.15.11
vite: 7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2)
transitivePeerDependencies:
- '@swc/helpers'
'@vitejs/plugin-react@5.1.4(vite@7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2))':
'@vitejs/plugin-react@5.2.0(vite@7.3.1(@types/node@24.11.0)(jiti@2.6.1)(less@4.2.0)(lightningcss@1.31.1)(sass-embedded@1.98.0)(sass@1.98.0)(stylus@0.62.0)(terser@5.36.0)(tsx@4.21.0)(yaml@2.8.2))':
dependencies:
'@babel/core': 7.29.0
'@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.29.0)
@@ -13090,10 +13090,10 @@ snapshots:
fraction.js@5.3.4: {}
framer-motion@12.35.2(@emotion/is-prop-valid@1.3.0)(react-dom@19.2.4(react@19.2.4))(react@19.2.4):
framer-motion@12.36.0(@emotion/is-prop-valid@1.3.0)(react-dom@19.2.4(react@19.2.4))(react@19.2.4):
dependencies:
motion-dom: 12.35.2
motion-utils: 12.29.2
motion-dom: 12.36.0
motion-utils: 12.36.0
tslib: 2.8.1
optionalDependencies:
'@emotion/is-prop-valid': 1.3.0
@@ -13788,7 +13788,7 @@ snapshots:
merge2@1.4.1: {}
meta-json-schema@1.19.20: {}
meta-json-schema@1.19.21: {}
micromark-core-commonmark@2.0.1:
dependencies:
@@ -14009,11 +14009,11 @@ snapshots:
vscode-uri: 3.0.8
yaml: 2.8.1
motion-dom@12.35.2:
motion-dom@12.36.0:
dependencies:
motion-utils: 12.29.2
motion-utils: 12.36.0
motion-utils@12.29.2: {}
motion-utils@12.36.0: {}
ms@2.0.0: {}
@@ -14190,27 +14190,27 @@ snapshots:
'@oxc-resolver/binding-win32-ia32-msvc': 11.19.1
'@oxc-resolver/binding-win32-x64-msvc': 11.19.1
oxlint@1.54.0:
oxlint@1.55.0:
optionalDependencies:
'@oxlint/binding-android-arm-eabi': 1.54.0
'@oxlint/binding-android-arm64': 1.54.0
'@oxlint/binding-darwin-arm64': 1.54.0
'@oxlint/binding-darwin-x64': 1.54.0
'@oxlint/binding-freebsd-x64': 1.54.0
'@oxlint/binding-linux-arm-gnueabihf': 1.54.0
'@oxlint/binding-linux-arm-musleabihf': 1.54.0
'@oxlint/binding-linux-arm64-gnu': 1.54.0
'@oxlint/binding-linux-arm64-musl': 1.54.0
'@oxlint/binding-linux-ppc64-gnu': 1.54.0
'@oxlint/binding-linux-riscv64-gnu': 1.54.0
'@oxlint/binding-linux-riscv64-musl': 1.54.0
'@oxlint/binding-linux-s390x-gnu': 1.54.0
'@oxlint/binding-linux-x64-gnu': 1.54.0
'@oxlint/binding-linux-x64-musl': 1.54.0
'@oxlint/binding-openharmony-arm64': 1.54.0
'@oxlint/binding-win32-arm64-msvc': 1.54.0
'@oxlint/binding-win32-ia32-msvc': 1.54.0
'@oxlint/binding-win32-x64-msvc': 1.54.0
'@oxlint/binding-android-arm-eabi': 1.55.0
'@oxlint/binding-android-arm64': 1.55.0
'@oxlint/binding-darwin-arm64': 1.55.0
'@oxlint/binding-darwin-x64': 1.55.0
'@oxlint/binding-freebsd-x64': 1.55.0
'@oxlint/binding-linux-arm-gnueabihf': 1.55.0
'@oxlint/binding-linux-arm-musleabihf': 1.55.0
'@oxlint/binding-linux-arm64-gnu': 1.55.0
'@oxlint/binding-linux-arm64-musl': 1.55.0
'@oxlint/binding-linux-ppc64-gnu': 1.55.0
'@oxlint/binding-linux-riscv64-gnu': 1.55.0
'@oxlint/binding-linux-riscv64-musl': 1.55.0
'@oxlint/binding-linux-s390x-gnu': 1.55.0
'@oxlint/binding-linux-x64-gnu': 1.55.0
'@oxlint/binding-linux-x64-musl': 1.55.0
'@oxlint/binding-openharmony-arm64': 1.55.0
'@oxlint/binding-win32-arm64-msvc': 1.55.0
'@oxlint/binding-win32-ia32-msvc': 1.55.0
'@oxlint/binding-win32-x64-msvc': 1.55.0
p-retry@7.1.1:
dependencies:
@@ -15366,7 +15366,7 @@ snapshots:
dependencies:
'@fastify/busboy': 2.1.1
undici@7.23.0: {}
undici@7.24.0: {}
unicode-canonical-property-names-ecmascript@2.0.1: {}
+1 -2
View File
@@ -62,6 +62,5 @@
"matchPackageNames": ["/vitest/", "/cypress/", "/wdio/"]
}
],
"prConcurrentLimit": 30,
"commitMessageSuffix": " [skip ci]"
"prConcurrentLimit": 30
}
+1 -1
View File
@@ -24,7 +24,7 @@
"picocolors": "1.1.1",
"tar": "7.5.11",
"telegram": "2.26.22",
"undici": "7.23.0",
"undici": "7.24.0",
"yargs": "18.0.0"
}
}
-35
View File
@@ -1,35 +0,0 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
ignore:
- dependency-name: "github.com/xtaci/smux"
groups:
# Specify a name for the group, which will be used in pull request titles
# and branch names
dependencies:
# Define patterns to include dependencies in the group (based on
# dependency name)
patterns:
- "*" # A wildcard that matches all dependencies in the package
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# Create a group of dependencies to be updated together in one pull request
groups:
# Specify a name for the group, which will be used in pull request titles
# and branch names
dependencies:
# Define patterns to include dependencies in the group (based on
# dependency name)
patterns:
- "*" # A wildcard that matches all dependencies in the package
+1 -1
View File
@@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.1"
go-version: "1.26.1"
id: go
# Updated cache step
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.1"
go-version: "1.26.1"
id: go
- name: Check out code into the Go module directory
+1 -1
View File
@@ -55,7 +55,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.1"
go-version: "1.26.1"
- name: Get dependencies
run: go mod download
+1 -1
View File
@@ -13,7 +13,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.1"
go-version: "1.26.1"
id: go
- name: Check out code into the Go module directory
+69 -78
View File
@@ -1,136 +1,127 @@
module github.com/Ehco1996/ehco
go 1.25.1
go 1.26.1
require (
github.com/alecthomas/kingpin/v2 v2.4.0
github.com/getsentry/sentry-go v0.28.1
github.com/go-ping/ping v1.1.0
github.com/getsentry/sentry-go v0.43.0
github.com/go-ping/ping v1.2.0
github.com/gobwas/ws v1.4.0
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/hashicorp/go-retryablehttp v0.7.8
github.com/juju/ratelimit v1.0.2
github.com/labstack/echo/v4 v4.12.0
github.com/labstack/echo/v4 v4.15.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/client_model v0.6.2
github.com/prometheus/common v0.67.2
github.com/prometheus/node_exporter v1.9.0
github.com/sagernet/sing v0.5.1
github.com/sagernet/sing-box v1.9.4
github.com/prometheus/common v0.67.5
github.com/prometheus/node_exporter v1.10.2
github.com/sagernet/sing v0.8.2
github.com/sagernet/sing-box v1.13.2
github.com/stretchr/testify v1.11.1
github.com/urfave/cli/v2 v2.27.4
github.com/xtls/xray-core v1.251015.0
github.com/urfave/cli/v2 v2.27.7
github.com/xtls/xray-core v1.260206.0
go.uber.org/atomic v1.11.0
go.uber.org/zap v1.27.0
golang.org/x/sync v0.17.0
golang.org/x/time v0.14.0
google.golang.org/grpc v1.76.0
modernc.org/sqlite v1.32.0
go.uber.org/zap v1.27.1
golang.org/x/sync v0.20.0
golang.org/x/time v0.15.0
google.golang.org/grpc v1.79.2
modernc.org/sqlite v1.46.1
)
require (
cyphar.com/go-pathrs v0.2.1 // indirect
cyphar.com/go-pathrs v0.2.4 // indirect
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/andybalholm/brotli v1.2.0 // indirect
github.com/apernet/quic-go v0.57.2-0.20260111184307-eec823306178 // indirect
github.com/beevik/ntp v1.5.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudflare/circl v1.6.1 // indirect
github.com/coreos/go-systemd/v22 v22.6.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/cyphar/filepath-securejoin v0.6.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dennwc/btrfs v0.0.0-20241002142654-12ae127e0bf6 // indirect
github.com/dennwc/ioctl v1.0.0 // indirect
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 // indirect
github.com/cloudflare/circl v1.6.3 // indirect
github.com/coreos/go-systemd/v22 v22.7.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dennwc/btrfs v0.0.0-20260222081608-edfb8b9e4f55 // indirect
github.com/dennwc/ioctl v1.0.1-0.20181021180353-017804252068 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ema/qdisc v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/florianl/go-nfqueue/v2 v2.0.2 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/google/btree v1.1.2 // indirect
github.com/godbus/dbus/v5 v5.2.2 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/pprof v0.0.0-20240528025155-186aa0362fba // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-envparse v0.1.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hodgesds/perf-utils v0.7.0 // indirect
github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973 // indirect
github.com/jsimonetti/rtnetlink/v2 v2.1.0 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/jsimonetti/rtnetlink/v2 v2.2.0 // indirect
github.com/klauspost/compress v1.18.4 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/lufia/iostat v1.2.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-xmlrpc v0.0.3 // indirect
github.com/mdlayher/ethtool v0.5.0 // indirect
github.com/mdlayher/ethtool v0.5.1 // indirect
github.com/mdlayher/genetlink v1.3.2 // indirect
github.com/mdlayher/netlink v1.8.0 // indirect
github.com/mdlayher/netlink v1.9.0 // indirect
github.com/mdlayher/socket v0.5.1 // indirect
github.com/mdlayher/wifi v0.7.0 // indirect
github.com/miekg/dns v1.1.68 // indirect
github.com/mdlayher/wifi v0.7.2 // indirect
github.com/miekg/dns v1.1.72 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/opencontainers/selinux v1.13.0 // indirect
github.com/oschwald/maxminddb-golang v1.12.0 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/opencontainers/selinux v1.13.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pires/go-proxyproto v0.8.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pires/go-proxyproto v0.11.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/prometheus-community/go-runit v0.1.0 // indirect
github.com/prometheus/procfs v0.19.2 // indirect
github.com/quic-go/qpack v0.5.1 // indirect
github.com/quic-go/quic-go v0.55.0 // indirect
github.com/refraction-networking/utls v1.8.1 // indirect
github.com/prometheus/procfs v0.20.1 // indirect
github.com/quic-go/qpack v0.6.0 // indirect
github.com/refraction-networking/utls v1.8.2 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/safchain/ethtool v0.6.2 // indirect
github.com/sagernet/gvisor v0.0.0-20240428053021-e691de28565f // indirect
github.com/sagernet/netlink v0.0.0-20240523065131-45e60152f9ba // indirect
github.com/sagernet/sing-dns v0.2.3 // indirect
github.com/sagernet/sing-shadowsocks v0.2.7 // indirect
github.com/sagernet/sing-tun v0.3.2 // indirect
github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 // indirect
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e // indirect
github.com/safchain/ethtool v0.7.0 // indirect
github.com/sagernet/fswatch v0.1.1 // indirect
github.com/sagernet/gvisor v0.0.0-20250811-sing-box-mod.1 // indirect
github.com/sagernet/netlink v0.0.0-20240916134442-83396419aa8b // indirect
github.com/sagernet/nftables v0.3.0-mod.1 // indirect
github.com/sagernet/sing-shadowsocks v0.2.9 // indirect
github.com/sagernet/sing-tun v0.8.2 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/vishvananda/netlink v1.3.1 // indirect
github.com/vishvananda/netns v0.0.5 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/xtls/reality v0.0.0-20251014195629-e4eec4520535 // indirect
github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect
github.com/xtls/reality v0.0.0-20251116175510-cd53f7d50237 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
golang.org/x/crypto v0.43.0 // indirect
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect
golang.org/x/mod v0.29.0 // indirect
golang.org/x/net v0.46.0 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/text v0.30.0 // indirect
golang.org/x/tools v0.38.0 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect
golang.org/x/mod v0.34.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.35.0 // indirect
golang.org/x/tools v0.43.0 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect
google.golang.org/protobuf v1.36.10 // indirect
golang.zx2c4.com/wireguard v0.0.0-20250521234502-f333402bd9cb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gvisor.dev/gvisor v0.0.0-20250428193742-2d800c3129d5 // indirect
gvisor.dev/gvisor v0.0.0-20260122175437-89a5d21be8f0 // indirect
howett.net/plist v1.0.1 // indirect
lukechampine.com/blake3 v1.4.1 // indirect
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
modernc.org/libc v1.55.3 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.8.0 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/token v1.1.0 // indirect
modernc.org/libc v1.70.0 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
)
+174 -186
View File
@@ -1,47 +1,49 @@
cyphar.com/go-pathrs v0.2.1 h1:9nx1vOgwVvX1mNBWDu93+vaceedpbsDqo+XuBGL40b8=
cyphar.com/go-pathrs v0.2.1/go.mod h1:y8f1EMG7r+hCuFf/rXsKqMJrJAUoADZGNh5/vZPKcGc=
cyphar.com/go-pathrs v0.2.4 h1:iD/mge36swa1UFKdINkr1Frkpp6wZsy3YYEildj9cLY=
cyphar.com/go-pathrs v0.2.4/go.mod h1:y8f1EMG7r+hCuFf/rXsKqMJrJAUoADZGNh5/vZPKcGc=
github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY=
github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE=
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b h1:mimo19zliBX/vSQ6PWWSL9lK8qwHozUj03+zLoEB8O0=
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs=
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
github.com/apernet/quic-go v0.57.2-0.20260111184307-eec823306178 h1:bSq8n+gX4oO/qnM3MKf4kroW75n+phO9Qp6nigJKZ1E=
github.com/apernet/quic-go v0.57.2-0.20260111184307-eec823306178/go.mod h1:N1WIjPphkqs4efXWuyDNQ6OjjIK04vM3h+bEgwV+eVU=
github.com/beevik/ntp v1.5.0 h1:y+uj/JjNwlY2JahivxYvtmv4ehfi3h74fAuABB9ZSM4=
github.com/beevik/ntp v1.5.0/go.mod h1:mJEhBrwT76w9D+IfOEGvuzyuudiW9E52U2BaTrMOYow=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cilium/ebpf v0.19.0 h1:Ro/rE64RmFBeA9FGjcTc+KmCeY6jXmryu6FfnzPRIao=
github.com/cilium/ebpf v0.19.0/go.mod h1:fLCgMo3l8tZmAdM3B2XqdFzXBpwkcSTroaVqN08OWVY=
github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0=
github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs=
github.com/coreos/go-systemd/v22 v22.6.0 h1:aGVa/v8B7hpb0TKl0MWoAavPDmHvobFe5R5zn0bCJWo=
github.com/coreos/go-systemd/v22 v22.6.0/go.mod h1:iG+pp635Fo7ZmV/j14KUcmEyWF+0X7Lua8rrTWzYgWU=
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cyphar/filepath-securejoin v0.6.0 h1:BtGB77njd6SVO6VztOHfPxKitJvd/VPT+OFBFMOi1Is=
github.com/cyphar/filepath-securejoin v0.6.0/go.mod h1:A8hd4EnAeyujCJRrICiOWqjS1AX0a9kM5XL+NwKoYSc=
github.com/cilium/ebpf v0.20.0 h1:atwWj9d3NffHyPZzVlx3hmw1on5CLe9eljR8VuHTwhM=
github.com/cilium/ebpf v0.20.0/go.mod h1:pzLjFymM+uZPLk/IXZUL63xdx5VXEo+enTzxkZXdycw=
github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8=
github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
github.com/coreos/go-systemd/v22 v22.7.0 h1:LAEzFkke61DFROc7zNLX/WA2i5J8gYqe0rSj9KI28KA=
github.com/coreos/go-systemd/v22 v22.7.0/go.mod h1:xNUYtjHu2EDXbsxz1i41wouACIwT7Ybq9o0BQhMwD0w=
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/cyphar/filepath-securejoin v0.6.1 h1:5CeZ1jPXEiYt3+Z6zqprSAgSWiggmpVyciv8syjIpVE=
github.com/cyphar/filepath-securejoin v0.6.1/go.mod h1:A8hd4EnAeyujCJRrICiOWqjS1AX0a9kM5XL+NwKoYSc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dennwc/btrfs v0.0.0-20241002142654-12ae127e0bf6 h1:fV+JlCY0cCJh3l0jfE7iB3ZmrdfJSgfcjdrCQhPokGg=
github.com/dennwc/btrfs v0.0.0-20241002142654-12ae127e0bf6/go.mod h1:MYsOV9Dgsec3FFSOjywi0QK5r6TeBbdWxdrMGtiYXHA=
github.com/dennwc/ioctl v1.0.0 h1:DsWAAjIxRqNcLn9x6mwfuf2pet3iB7aK90K4tF16rLg=
github.com/dennwc/ioctl v1.0.0/go.mod h1:ellh2YB5ldny99SBU/VX7Nq0xiZbHphf1DrtHxxjMk0=
github.com/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw=
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 h1:y7y0Oa6UawqTFPCDw9JG6pdKt4F9pAhHv0B7FMGaGD0=
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dennwc/btrfs v0.0.0-20260222081608-edfb8b9e4f55 h1:VAnGuI8RNnP8vHqCn8X1O63TexAv+QjMqffBdkLbYKU=
github.com/dennwc/btrfs v0.0.0-20260222081608-edfb8b9e4f55/go.mod h1:Kn6RQo4OP1ZEoLB3uldDJabFcf72VgDRInxEqLEo8OE=
github.com/dennwc/ioctl v1.0.1-0.20181021180353-017804252068 h1:K71w/n/Y74EQsKo91511t7TK35YRPrk9G+2anKYNPXk=
github.com/dennwc/ioctl v1.0.1-0.20181021180353-017804252068/go.mod h1:ellh2YB5ldny99SBU/VX7Nq0xiZbHphf1DrtHxxjMk0=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/ema/qdisc v1.0.0 h1:EHLG08FVRbWLg8uRICa3xzC9Zm0m7HyMHfXobWFnXYg=
github.com/ema/qdisc v1.0.0/go.mod h1:FhIc0fLYi7f+lK5maMsesDqwYojIOh3VfRs8EVd5YJQ=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/getsentry/sentry-go v0.28.1 h1:zzaSm/vHmGllRM6Tpx1492r0YDzauArdBfkJRtY6P5k=
github.com/getsentry/sentry-go v0.28.1/go.mod h1:1fQZ+7l7eeJ3wYi82q5Hg8GqAPgefRq+FP/QhafYVgg=
github.com/florianl/go-nfqueue/v2 v2.0.2 h1:FL5lQTeetgpCvac1TRwSfgaXUn0YSO7WzGvWNIp3JPE=
github.com/florianl/go-nfqueue/v2 v2.0.2/go.mod h1:VA09+iPOT43OMoCKNfXHyzujQUty2xmzyCRkBOlmabc=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/getsentry/sentry-go v0.43.0 h1:XbXLpFicpo8HmBDaInk7dum18G9KSLcjZiyUKS+hLW4=
github.com/getsentry/sentry-go v0.43.0/go.mod h1:XDotiNZbgf5U8bPDUAfvcFmOnMQQceESxyKaObSssW0=
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344 h1:Arcl6UOIS/kgO2nW3A65HN+7CMjSDP/gofXL4CZt1V4=
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
@@ -52,28 +54,26 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/go-ping/ping v1.1.0 h1:3MCGhVX4fyEUuhsfwPrsEdQw6xspHkv5zHsiSoDFZYw=
github.com/go-ping/ping v1.1.0/go.mod h1:xIFjORFzTxqIV/tDVGO4eDy/bLuSyawEeojSm3GfRGk=
github.com/go-ping/ping v1.2.0 h1:vsJ8slZBZAXNCK4dPcI2PEE9eM9n9RbXbGouVQ/Y4yQ=
github.com/go-ping/ping v1.2.0/go.mod h1:xIFjORFzTxqIV/tDVGO4eDy/bLuSyawEeojSm3GfRGk=
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs=
github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/godbus/dbus/v5 v5.2.2 h1:TUR3TgtSVDmjiXOgAAyaZbYmIeP3DPkld3jgKGV8mXQ=
github.com/godbus/dbus/v5 v5.2.2/go.mod h1:3AAv2+hPq5rdnr5txxxRwiGjPXamgoIHgz9FPBfOp3c=
github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U=
github.com/golang/mock v1.7.0-rc.1/go.mod h1:s42URUywIqd+OcERslBJvOjepvNymP31m3q8d/GkuRs=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/pprof v0.0.0-20240528025155-186aa0362fba h1:ql1qNgCyOB7iAEk8JTNM+zJrgIbnyCKX/wdlyPufP5g=
github.com/google/pprof v0.0.0-20240528025155-186aa0362fba/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs=
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -85,8 +85,8 @@ github.com/hashicorp/go-envparse v0.1.0 h1:bE++6bhIsNCPLvgDZkYqo3nA+/PFI51pkrHdm
github.com/hashicorp/go-envparse v0.1.0/go.mod h1:OHheN1GoygLlAkTlXLXvAdnXdZxy8JUweQ1rAXx1xnc=
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48=
github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hodgesds/perf-utils v0.7.0 h1:7KlHGMuig4FRH5fNw68PV6xLmgTe7jKs9hgAcEAbioU=
@@ -94,67 +94,63 @@ github.com/hodgesds/perf-utils v0.7.0/go.mod h1:LAklqfDadNKpkxoAJNHpD5tkY0rkZEVd
github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973 h1:hk4LPqXIY/c9XzRbe7dA6qQxaT6Axcbny0L/G5a4owQ=
github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973/go.mod h1:PoK3ejP3LJkGTzKqRlpvCIFas3ncU02v8zzWDW+g0FY=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA=
github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
github.com/jsimonetti/rtnetlink/v2 v2.1.0 h1:3sSPD0k+Qvia3wbv6kZXCN0Dlz6Swv7RHjvvonuOcKE=
github.com/jsimonetti/rtnetlink/v2 v2.1.0/go.mod h1:hPPUTE+ekH3HD+zCEGAGLxzFY9HrJCyD1aN7JJ3SHIY=
github.com/jsimonetti/rtnetlink/v2 v2.2.0 h1:/KfZ310gOAFrXXol5VwnFEt+ucldD/0dsSRZwpHCP9w=
github.com/jsimonetti/rtnetlink/v2 v2.2.0/go.mod h1:lbjDHxC+5RJ08lzPeA90Ls2pEoId3F08MoEMlhfHxeI=
github.com/juju/ratelimit v1.0.2 h1:sRxmtRiajbvrcLQT7S+JbqU0ntsb9W2yhSdNN8tWfaI=
github.com/juju/ratelimit v1.0.2/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk=
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c=
github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/labstack/echo/v4 v4.12.0 h1:IKpw49IMryVB2p1a4dzwlhP1O2Tf2E0Ir/450lH+kI0=
github.com/labstack/echo/v4 v4.12.0/go.mod h1:UP9Cr2DJXbOK3Kr9ONYzNowSh7HP0aG0ShAyycHSJvM=
github.com/labstack/echo/v4 v4.15.1 h1:S9keusg26gZpjMmPqB5hOEvNKnmd1lNmcHrbbH2lnFs=
github.com/labstack/echo/v4 v4.15.1/go.mod h1:xmw1clThob0BSVRX1CRQkGQ/vjwcpOMjQZSZa9fKA/c=
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8=
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/lufia/iostat v1.2.1 h1:tnCdZBIglgxD47RyD55kfWQcJMGzO+1QBziSQfesf2k=
github.com/lufia/iostat v1.2.1/go.mod h1:rEPNA0xXgjHQjuI5Cy05sLlS2oRcSlWHRLrvh/AQ+Pg=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-xmlrpc v0.0.3 h1:Y6WEMLEsqs3RviBrAa1/7qmbGB7DVD3brZIbqMbQdGY=
github.com/mattn/go-xmlrpc v0.0.3/go.mod h1:mqc2dz7tP5x5BKlCahN/n+hs7OSZKJkS9JsHNBRlrxA=
github.com/mdlayher/ethtool v0.5.0 h1:7MpuhvUE574uVQDfkXotePLdfSNetlx3GDikFcdlVQA=
github.com/mdlayher/ethtool v0.5.0/go.mod h1:ROV9hwnETqDdpLv8E8WkCa8FymlkhFEeiB9cg3qzNkk=
github.com/mdlayher/ethtool v0.5.1 h1:U4GThY6WgNJUJsMrUzBmoOTdQHFWxFPTHTeNnn3GCvU=
github.com/mdlayher/ethtool v0.5.1/go.mod h1:Pz39PaAy96Ea1SrCvEO/pPEAeULvRJjO6zspuEMhJy4=
github.com/mdlayher/genetlink v1.3.2 h1:KdrNKe+CTu+IbZnm/GVUMXSqBBLqcGpRDa0xkQy56gw=
github.com/mdlayher/genetlink v1.3.2/go.mod h1:tcC3pkCrPUGIKKsCsp0B3AdaaKuHtaxoJRz3cc+528o=
github.com/mdlayher/netlink v1.8.0 h1:e7XNIYJKD7hUct3Px04RuIGJbBxy1/c4nX7D5YyvvlM=
github.com/mdlayher/netlink v1.8.0/go.mod h1:UhgKXUlDQhzb09DrCl2GuRNEglHmhYoWAHid9HK3594=
github.com/mdlayher/netlink v1.9.0 h1:G8+GLq2x3v4D4MVIqDdNUhTUC7TKiCy/6MDkmItfKco=
github.com/mdlayher/netlink v1.9.0/go.mod h1:YBnl5BXsCoRuwBjKKlZ+aYmEoq0r12FDA/3JC+94KDg=
github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos=
github.com/mdlayher/socket v0.5.1/go.mod h1:TjPLHI1UgwEv5J1B5q0zTZq12A/6H7nKmtTanQE37IQ=
github.com/mdlayher/wifi v0.7.0 h1:0BvMO+gLu06pvOpINs+wVY9KgwBOyEm5TUpyLmy6yF8=
github.com/mdlayher/wifi v0.7.0/go.mod h1:Px0mNl8jXl5uiC2FWgoD6AAGWVhq19sMmppboqR59Gg=
github.com/miekg/dns v1.1.68 h1:jsSRkNozw7G/mnmXULynzMNIsgY2dHC8LO6U6Ij2JEA=
github.com/miekg/dns v1.1.68/go.mod h1:fujopn7TB3Pu3JM69XaawiU0wqjpL9/8xGop5UrTPps=
github.com/mdlayher/wifi v0.7.2 h1:5yBq4nTm2HIYarKpJHrHU8q2BuxlX/BEfPa8kVKeOYU=
github.com/mdlayher/wifi v0.7.2/go.mod h1:zJM6S0QpUxpUgf915rgAQHE4/e1YzRRkhK3M26NPakI=
github.com/miekg/dns v1.1.72 h1:vhmr+TF2A3tuoGNkLDFK9zi36F2LS+hKTRW0Uf8kbzI=
github.com/miekg/dns v1.1.72/go.mod h1:+EuEPhdHOsfk6Wk5TT2CzssZdqkmFhf8r+aVyDEToIs=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/opencontainers/selinux v1.13.0 h1:Zza88GWezyT7RLql12URvoxsbLfjFx988+LGaWfbL84=
github.com/opencontainers/selinux v1.13.0/go.mod h1:XxWTed+A/s5NNq4GmYScVy+9jzXhGBVEOAyucdRUY8s=
github.com/oschwald/maxminddb-golang v1.12.0 h1:9FnTOD0YOhP7DGxGsq4glzpGy5+w7pq50AS6wALUMYs=
github.com/oschwald/maxminddb-golang v1.12.0/go.mod h1:q0Nob5lTCqyQ8WT6FYgS1L7PXKVVbgiymefNwIjPzgY=
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/opencontainers/selinux v1.13.1 h1:A8nNeceYngH9Ow++M+VVEwJVpdFmrlxsN22F+ISDCJE=
github.com/opencontainers/selinux v1.13.1/go.mod h1:S10WXZ/osk2kWOYKy1x2f/eXF5ZHJoUs8UU/2caNRbg=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/pires/go-proxyproto v0.8.1 h1:9KEixbdJfhrbtjpz/ZwCdWDD2Xem0NZ38qMYaASJgp0=
github.com/pires/go-proxyproto v0.8.1/go.mod h1:ZKAAyp3cgy5Y5Mo4n9AlScrkCZwUy0g3Jf+slqQVcuU=
github.com/pires/go-proxyproto v0.11.0 h1:gUQpS85X/VJMdUsYyEgyn59uLJvGqPhJV5YvG68wXH4=
github.com/pires/go-proxyproto v0.11.0/go.mod h1:ZKAAyp3cgy5Y5Mo4n9AlScrkCZwUy0g3Jf+slqQVcuU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU=
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/prometheus-community/go-runit v0.1.0 h1:uTWEj/Fn2RoLdfg/etSqwzgYNOYPrARx1BHUN052tGA=
@@ -163,48 +159,42 @@ github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.67.2 h1:PcBAckGFTIHt2+L3I33uNRTlKTplNzFctXcWhPyAEN8=
github.com/prometheus/common v0.67.2/go.mod h1:63W3KZb1JOKgcjlIr64WW/LvFGAqKPj0atm+knVGEko=
github.com/prometheus/node_exporter v1.9.0 h1:qjXtu1H4Cj8JnVGCiAoW5Bpu8woL6O5b69bhPw3TNjc=
github.com/prometheus/node_exporter v1.9.0/go.mod h1:wJdVxMYyn1H59zeEJfCQv5CTnxBc2PKOpA3zc+nFU2s=
github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws=
github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw=
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
github.com/quic-go/qtls-go1-20 v0.4.1 h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs=
github.com/quic-go/qtls-go1-20 v0.4.1/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k=
github.com/quic-go/quic-go v0.55.0 h1:zccPQIqYCXDt5NmcEabyYvOnomjs8Tlwl7tISjJh9Mk=
github.com/quic-go/quic-go v0.55.0/go.mod h1:DR51ilwU1uE164KuWXhinFcKWGlEjzys2l8zUl5Ss1U=
github.com/refraction-networking/utls v1.8.1 h1:yNY1kapmQU8JeM1sSw2H2asfTIwWxIkrMJI0pRUOCAo=
github.com/refraction-networking/utls v1.8.1/go.mod h1:jkSOEkLqn+S/jtpEHPOsVv/4V4EVnelwbMQl4vCWXAM=
github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4=
github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw=
github.com/prometheus/node_exporter v1.10.2 h1:H88cUFLuB8Jn/u2U3M4D5KYnae07LIm+0ZTcgoKEK54=
github.com/prometheus/node_exporter v1.10.2/go.mod h1:F9EKoxCWmKgzJHBfL1EKEvxaGWyahuKZpxArLSI70lA=
github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc=
github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo=
github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
github.com/refraction-networking/utls v1.8.2 h1:j4Q1gJj0xngdeH+Ox/qND11aEfhpgoEvV+S9iJ2IdQo=
github.com/refraction-networking/utls v1.8.2/go.mod h1:jkSOEkLqn+S/jtpEHPOsVv/4V4EVnelwbMQl4vCWXAM=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg=
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/safchain/ethtool v0.6.2 h1:O3ZPFAKEUEfbtE6J/feEe2Ft7dIJ2Sy8t4SdMRiIMHY=
github.com/safchain/ethtool v0.6.2/go.mod h1:VS7cn+bP3Px3rIq55xImBiZGHVLNyBh5dqG6dDQy8+I=
github.com/sagernet/gvisor v0.0.0-20240428053021-e691de28565f h1:NkhuupzH5ch7b/Y/6ZHJWrnNLoiNnSJaow6DPb8VW2I=
github.com/sagernet/gvisor v0.0.0-20240428053021-e691de28565f/go.mod h1:KXmw+ouSJNOsuRpg4wgwwCQuunrGz4yoAqQjsLjc6N0=
github.com/sagernet/netlink v0.0.0-20240523065131-45e60152f9ba h1:EY5AS7CCtfmARNv2zXUOrsEMPFDGYxaw65JzA2p51Vk=
github.com/sagernet/netlink v0.0.0-20240523065131-45e60152f9ba/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM=
github.com/sagernet/quic-go v0.46.0-beta.4 h1:k9f7VSKaM47AY6MPND0Qf1KRN7HwimPg9zdOFTXTiCk=
github.com/sagernet/quic-go v0.46.0-beta.4/go.mod h1:zJmVdJUNqEDXfubf4KtIOUHHerggjBduiGRLNzJspcM=
github.com/sagernet/sing v0.5.1 h1:mhL/MZVq0TjuvHcpYcFtmSD1BFOxZ/+8ofbNZcg1k1Y=
github.com/sagernet/sing v0.5.1/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
github.com/sagernet/sing-box v1.9.4 h1:Sf2JffjKvcG2a2+YWPOP0NiCOqpu2iPU12RkpZ0PhaM=
github.com/sagernet/sing-box v1.9.4/go.mod h1:DGX0xLYqlQa36DX1PTWJBh6EnChI1hUyzwoJUObhlW4=
github.com/sagernet/sing-dns v0.2.3 h1:YzeBUn2tR38F7HtvGEQ0kLRLmZWMEgi/+7wqa4Twb1k=
github.com/sagernet/sing-dns v0.2.3/go.mod h1:BJpJv6XLnrUbSyIntOT6DG9FW0f4fETmPAHvNjOprLg=
github.com/sagernet/sing-shadowsocks v0.2.7 h1:zaopR1tbHEw5Nk6FAkM05wCslV6ahVegEZaKMv9ipx8=
github.com/sagernet/sing-shadowsocks v0.2.7/go.mod h1:0rIKJZBR65Qi0zwdKezt4s57y/Tl1ofkaq6NlkzVuyE=
github.com/sagernet/sing-tun v0.3.2 h1:z0bLUT/YXH9RrJS9DsIpB0Bb9afl2hVJOmHd0zA3HJY=
github.com/sagernet/sing-tun v0.3.2/go.mod h1:DxLIyhjWU/HwGYoX0vNGg2c5QgTQIakphU1MuERR5tQ=
github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 h1:emzAzMZ1L9iaKCTxdy3Em8Wv4ChIAGnfiz18Cda70g4=
github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771/go.mod h1:bR6DqgcAl1zTcOX8/pE2Qkj9XO00eCNqmKb7lXP8EAg=
github.com/safchain/ethtool v0.7.0 h1:rlJzfDetsVvT61uz8x1YIcFn12akMfuPulHtZjtb7Is=
github.com/safchain/ethtool v0.7.0/go.mod h1:MenQKEjXdfkjD3mp2QdCk8B/hwvkrlOTm/FD4gTpFxQ=
github.com/sagernet/fswatch v0.1.1 h1:YqID+93B7VRfqIH3PArW/XpJv5H4OLEVWDfProGoRQs=
github.com/sagernet/fswatch v0.1.1/go.mod h1:nz85laH0mkQqJfaOrqPpkwtU1znMFNVTpT/5oRsVz/o=
github.com/sagernet/gvisor v0.0.0-20250811-sing-box-mod.1 h1:bYLFFxOBLbmeMjMSCzsXJwNAS1EHoBb+G9GlE5oBgM8=
github.com/sagernet/gvisor v0.0.0-20250811-sing-box-mod.1/go.mod h1:NJKBtm9nVEK3iyOYWsUlrDQuoGh4zJ4KOPhSYVidvQ4=
github.com/sagernet/netlink v0.0.0-20240916134442-83396419aa8b h1:ppoda3bl004POPsp3ut7V+4Mn6+DUbTxyxpB0BjpaIk=
github.com/sagernet/netlink v0.0.0-20240916134442-83396419aa8b/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM=
github.com/sagernet/nftables v0.3.0-mod.1 h1:OMe+qoEAx8EipYAQbD2FI5erVvKmTS9+cYhdpg+vezY=
github.com/sagernet/nftables v0.3.0-mod.1/go.mod h1:8kslHG4VvYNihcco+i6uxIX7qbT8A56T0y5q7U44ZaQ=
github.com/sagernet/quic-go v0.59.0-sing-box-mod.4 h1:6qvrUW79S+CrPwWz6cMePXohgjHoKxLo3c+MDhNwc3o=
github.com/sagernet/quic-go v0.59.0-sing-box-mod.4/go.mod h1:OqILvS182CyOol5zNNo6bguvOGgXzV459+chpRaUC+4=
github.com/sagernet/sing v0.8.2 h1:kX1IH9SWJv4S0T9M8O+HNahWgbOuY1VauxbF7NU5lOg=
github.com/sagernet/sing v0.8.2/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
github.com/sagernet/sing-box v1.13.2 h1:wChNq1BIqr5YKjGMWNWwmXSfEBaKk4q76WD2TH8tpRs=
github.com/sagernet/sing-box v1.13.2/go.mod h1:KdOFknh0k/LSGlWPwc6A2+KqnRyI7gliIRoxPxMM5Dw=
github.com/sagernet/sing-shadowsocks v0.2.9 h1:Paep5zCszRKsEn8587O0MnhFWKJwDW1Y4zOYYlIxMkM=
github.com/sagernet/sing-shadowsocks v0.2.9/go.mod h1:TE/Z6401Pi8tgr0nBZcM/xawAI6u3F6TTbz4nH/qw+8=
github.com/sagernet/sing-tun v0.8.2 h1:rQr/x3eQCHh3oleIaoJdPdJwqzZp4+QWcJLT0Wz2xKY=
github.com/sagernet/sing-tun v0.8.2/go.mod h1:pLCo4o+LacXEzz0bhwhJkKBjLlKOGPBNOAZ97ZVZWzs=
github.com/siebenmann/go-kstat v0.0.0-20210513183136-173c9b0a9973 h1:GfSdC6wKfTGcgCS7BtzF5694Amne1pGCSTY252WhlEY=
github.com/siebenmann/go-kstat v0.0.0-20210513183136-173c9b0a9973/go.mod h1:G81aIFAMS9ECrwBYR9YxhlPjWgrItd+Kje78O6+uqm8=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -212,17 +202,14 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8=
github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ=
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e h1:5QefA066A1tF8gHIiADmOVOV5LS43gt3ONnlEl3xkwI=
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e/go.mod h1:5t19P9LBIrNamL6AcMQOncg/r10y3Pc01AbHeMhwlpU=
github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU=
github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
@@ -233,24 +220,26 @@ github.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zd
github.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
github.com/xtls/reality v0.0.0-20251014195629-e4eec4520535 h1:nwobseOLLRtdbP6z7Z2aVI97u8ZptTgD1ofovhAKmeU=
github.com/xtls/reality v0.0.0-20251014195629-e4eec4520535/go.mod h1:vbHCV/3VWUvy1oKvTxxWJRPEWSeR1sYgQHIh6u/JiZQ=
github.com/xtls/xray-core v1.251015.0 h1:P7b3vt8ShhH31k4h6VJ/Pxar3tY9eK+7S8eygd6rsP0=
github.com/xtls/xray-core v1.251015.0/go.mod h1:72ZU/srfutsNPmw9y8SCGRy0iccvshIRk8BNGR8D2Ik=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps=
go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 h1:FnBeRrxr7OU4VvAzt5X7s6266i6cSVkkFPS0TuXWbIg=
github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
github.com/xtls/reality v0.0.0-20251116175510-cd53f7d50237 h1:UXjrmniKlY+ZbIqpN91lejB3pszQQQRVu1vqH/p/aGM=
github.com/xtls/reality v0.0.0-20251116175510-cd53f7d50237/go.mod h1:vbHCV/3VWUvy1oKvTxxWJRPEWSeR1sYgQHIh6u/JiZQ=
github.com/xtls/xray-core v1.260206.0 h1:gY8IV6u76CW93txL9QmacgZ0Udxr2Q3e9qUxXAhdHqI=
github.com/xtls/xray-core v1.260206.0/go.mod h1:GyFIgVGRJkt3eyV/NMcdxOKXcJPqGGpyupHzy16uJhU=
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48=
go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8=
go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0=
go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs=
go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18=
go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE=
go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8=
go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew=
go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI=
go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
@@ -261,57 +250,55 @@ go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ=
go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 h1:mgKeJMpvi0yx/sU5GsxQ7p6s2wtOnGAHZWCHUM4KGzY=
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70=
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4=
golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 h1:jiDhWWeC7jfWqR9c/uplMOqJ0sbNlNWv0UkzE0vX1MA=
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90/go.mod h1:xE1HEv6b+1SCZ5/uscMRjUBKtIxworgEcEi+/n9NQDQ=
golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=
golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20211031064116-611d5d643895/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=
golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=
golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=
golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 h1:/jFs0duh4rdb8uIfPMv78iAJGcPKDeqAFnaLBropIC4=
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA=
golang.zx2c4.com/wireguard v0.0.0-20250521234502-f333402bd9cb h1:whnFRlWMcXI9d+ZbWg+4sHnLp52d5yiIPUxMBSt4X9A=
golang.zx2c4.com/wireguard v0.0.0-20250521234502-f333402bd9cb/go.mod h1:rpwXGsirqLqN2L0JDJQlwOboGHmptD5ZD6T2VmcqhTw=
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b h1:zPKJod4w6F1+nRGDI9ubnXYhU9NSWoFAijkHkUXeTK8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.76.0 h1:UnVkv1+uMLYXoIz6o7chp59WfQUYA2ex/BXQ9rHZu7A=
google.golang.org/grpc v1.76.0/go.mod h1:Ju12QI8M6iQJtbcsV+awF5a4hfJMLi4X0JLo94ULZ6c=
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c h1:xgCzyF2LFIO/0X2UAoVRiXKU5Xg6VjToG4i2/ecSswk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
google.golang.org/grpc v1.79.2 h1:fRMD94s2tITpyJGtBBn7MkMseNpOZU8ZxgC3MMBaXRU=
google.golang.org/grpc v1.79.2/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
@@ -320,38 +307,39 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gvisor.dev/gvisor v0.0.0-20250428193742-2d800c3129d5 h1:sfK5nHuG7lRFZ2FdTT3RimOqWBg8IrVm+/Vko1FVOsk=
gvisor.dev/gvisor v0.0.0-20250428193742-2d800c3129d5/go.mod h1:3r5CMtNQMKIvBlrmM9xWUNamjKBYPOWyXOjmg5Kts3g=
gvisor.dev/gvisor v0.0.0-20260122175437-89a5d21be8f0 h1:Lk6hARj5UPY47dBep70OD/TIMwikJ5fGUGX0Rm3Xigk=
gvisor.dev/gvisor v0.0.0-20260122175437-89a5d21be8f0/go.mod h1:QkHjoMIBaYtpVufgwv3keYAbln78mBoCuShZrPrer1Q=
howett.net/plist v1.0.1 h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM=
howett.net/plist v1.0.1/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g=
lukechampine.com/blake3 v1.4.1 h1:I3Smz7gso8w4/TunLKec6K2fn+kyKtDxr/xcQEN84Wg=
lukechampine.com/blake3 v1.4.1/go.mod h1:QFosUxmjB8mnrWFSNwKmvxHpfY72bmD2tQ0kBMM3kwo=
modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ=
modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ=
modernc.org/ccgo/v4 v4.19.2 h1:lwQZgvboKD0jBwdaeVCTouxhxAyN6iawF3STraAal8Y=
modernc.org/ccgo/v4 v4.19.2/go.mod h1:ysS3mxiMV38XGRTTcgo0DQTeTmAO4oCmJl1nX9VFI3s=
modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ=
modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw=
modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU=
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI=
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4=
modernc.org/libc v1.55.3 h1:AzcW1mhlPNrRtjS5sS+eW2ISCgSOLLNyFzRh/V3Qj/U=
modernc.org/libc v1.55.3/go.mod h1:qFXepLhz+JjFThQ4kzwzOjA/y/artDeg+pcYnY+Q83w=
modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E=
modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU=
modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc=
modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss=
modernc.org/sqlite v1.32.0 h1:6BM4uGza7bWypsw4fdLRsLxut6bHe4c58VeqjRgST8s=
modernc.org/sqlite v1.32.0/go.mod h1:UqoylwmTb9F+IqXERT8bW9zzOWN8qwAIcLdzeBZs4hA=
modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
modernc.org/cc/v4 v4.27.1 h1:9W30zRlYrefrDV2JE2O8VDtJ1yPGownxciz5rrbQZis=
modernc.org/cc/v4 v4.27.1/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
modernc.org/ccgo/v4 v4.32.0 h1:hjG66bI/kqIPX1b2yT6fr/jt+QedtP2fqojG2VrFuVw=
modernc.org/ccgo/v4 v4.32.0/go.mod h1:6F08EBCx5uQc38kMGl+0Nm0oWczoo1c7cgpzEry7Uc0=
modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM=
modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU=
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=
modernc.org/gc/v3 v3.1.2 h1:ZtDCnhonXSZexk/AYsegNRV1lJGgaNZJuKjJSWKyEqo=
modernc.org/gc/v3 v3.1.2/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
modernc.org/libc v1.70.0 h1:U58NawXqXbgpZ/dcdS9kMshu08aiA6b7gusEusqzNkw=
modernc.org/libc v1.70.0/go.mod h1:OVmxFGP1CI/Z4L3E0Q3Mf1PDE0BucwMkcXjjLntvHJo=
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8=
modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
modernc.org/sqlite v1.46.1 h1:eFJ2ShBLIEnUWlLy12raN0Z1plqmFX9Qe3rjQTKt6sU=
modernc.org/sqlite v1.46.1/go.mod h1:CzbrU2lSB1DKUusvwGz7rqEKIq+NUd8GWuBBZDs9/nA=
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
+1 -1
View File
@@ -5,7 +5,7 @@ import "time"
type RelayType string
var (
Version = "1.1.5"
Version = "1.1.6"
GitBranch string
GitRevision string
BuildTime string
+4 -2
View File
@@ -5,6 +5,7 @@ import (
"fmt"
"net"
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/common/sniff"
"github.com/sagernet/sing/common/buf"
"github.com/sagernet/sing/common/bufio"
@@ -103,12 +104,13 @@ func (b *BaseRelayServer) sniffAndBlockProtocol(c net.Conn) (net.Conn, error) {
ctx, cancel := context.WithTimeout(context.Background(), b.cfg.Options.SniffTimeout)
defer cancel()
sniffMetadata, err := sniff.PeekStream(ctx, c, buffer, b.cfg.Options.SniffTimeout, sniff.TLSClientHello, sniff.HTTPHost)
sniffMetadata := &adapter.InboundContext{}
err := sniff.PeekStream(ctx, sniffMetadata, c, nil, buffer, b.cfg.Options.SniffTimeout, sniff.TLSClientHello, sniff.HTTPHost)
if err != nil {
b.l.Debugf("sniff error: %s", err)
}
if sniffMetadata != nil {
if sniffMetadata.Protocol != "" {
b.l.Infof("sniffed protocol: %s", sniffMetadata.Protocol)
for _, p := range b.cfg.Options.BlockedProtocols {
if sniffMetadata.Protocol == p {
+9 -3
View File
@@ -130,9 +130,15 @@ func (b *readerImpl) processLoadMetrics(metricMap map[string]*dto.MetricFamily,
func (b *readerImpl) calculateFinalMetrics(nm *NodeMetrics, cpu *cpuStats) {
nm.CpuCoreCount = cpu.cores
nm.CpuUsagePercent = 100 * (cpu.totalTime - cpu.idleTime) / cpu.totalTime
nm.MemoryUsagePercent = 100 * float64(nm.MemoryUsageBytes) / float64(nm.MemoryTotalBytes)
nm.DiskUsagePercent = 100 * float64(nm.DiskUsageBytes) / float64(nm.DiskTotalBytes)
if cpu.totalTime > 0 {
nm.CpuUsagePercent = 100 * (cpu.totalTime - cpu.idleTime) / cpu.totalTime
}
if nm.MemoryTotalBytes > 0 {
nm.MemoryUsagePercent = 100 * float64(nm.MemoryUsageBytes) / float64(nm.MemoryTotalBytes)
}
if nm.DiskTotalBytes > 0 {
nm.DiskUsagePercent = 100 * float64(nm.DiskUsageBytes) / float64(nm.DiskTotalBytes)
}
nm.CpuUsagePercent = math.Round(nm.CpuUsagePercent*100) / 100
nm.MemoryUsagePercent = math.Round(nm.MemoryUsagePercent*100) / 100
+4 -2
View File
@@ -75,8 +75,10 @@ func (b *bandwidthRecorder) RecordOnce(ctx context.Context) (uploadIncr float64,
elapsed := now.Sub(b.lastRecordTime).Seconds()
uploadIncr = (send - b.currentSendBytes)
downloadIncr = (recv - b.currentRecvBytes)
b.uploadBandwidthBytes = uploadIncr / elapsed
b.downloadBandwidthBytes = downloadIncr / elapsed
if elapsed > 0 {
b.uploadBandwidthBytes = uploadIncr / elapsed
b.downloadBandwidthBytes = downloadIncr / elapsed
}
}
b.lastRecordTime = now
b.currentRecvBytes = recv
+1
View File
@@ -12,6 +12,7 @@ const (
ProtocolSS = "ss"
ProtocolTrojan = "trojan"
ProtocolVless = "vless"
)
func InProxyTags(tag string) bool {
+12 -1
View File
@@ -19,8 +19,19 @@ import (
func buildXrayInstanceCfg(cfg *conf.Config) (*core.Config, error) {
for _, inbound := range cfg.InboundConfigs {
// add tls certs for trojan
if inbound.Tag == XrayTrojanProxyTag || inbound.Tag == XrayVmessProxyTag || inbound.Tag == XrayVlessProxyTag {
// Skip TLS cert injection for Reality — it uses its own key management
if inbound.StreamSetting != nil && inbound.StreamSetting.Security == "reality" {
if inbound.StreamSetting.SocketSettings != nil {
inbound.StreamSetting.SocketSettings.TcpMptcp = true
} else {
inbound.StreamSetting.SocketSettings = &conf.SocketConfig{
TcpMptcp: true,
}
}
continue
}
// Inject TLS certs for standard TLS inbounds
if err := tls.InitTlsCfg(); err != nil {
return nil, err
}
+12 -3
View File
@@ -15,6 +15,7 @@ import (
"github.com/xtls/xray-core/common/serial"
"github.com/xtls/xray-core/proxy/shadowsocks_2022"
"github.com/xtls/xray-core/proxy/trojan"
"github.com/xtls/xray-core/proxy/vless"
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
@@ -26,6 +27,7 @@ type User struct {
ID int `json:"user_id"`
Method string `json:"method"`
Password string `json:"password"`
Flow string `json:"flow"`
Level int `json:"level"`
Enable bool `json:"enable"`
@@ -85,10 +87,11 @@ func (u *User) UpdateFromServer(serverSideUser *User) {
u.Method = serverSideUser.Method
u.Enable = serverSideUser.Enable
u.Password = serverSideUser.Password
u.Flow = serverSideUser.Flow
}
func (u *User) Equal(new *User) bool {
return u.Method == new.Method && u.Enable == new.Enable && u.Password == new.Password
return u.Method == new.Method && u.Enable == new.Enable && u.Password == new.Password && u.Flow == new.Flow
}
func (u *User) ToXrayUser() *protocol.User {
@@ -99,6 +102,11 @@ func (u *User) ToXrayUser() *protocol.User {
case ProtocolSS:
memoryAccount := &shadowsocks_2022.MemoryAccount{Key: u.Password}
account = serial.ToTypedMessage(memoryAccount.ToProto())
case ProtocolVless:
account = serial.ToTypedMessage(&vless.Account{
Id: u.Password,
Flow: u.Flow,
})
default:
zap.S().DPanicf("unknown protocol %s", u.Protocol)
return nil
@@ -138,7 +146,7 @@ func NewUserPool(grpcEndPoint, remoteConfigURL, metricURL string, proxyTags []st
return up
}
func (up *UserPool) CreateUser(userId, level int, password, method, protocol string, enable bool) *User {
func (up *UserPool) CreateUser(userId, level int, password, method, protocol, flow string, enable bool) *User {
up.Lock()
defer up.Unlock()
u := &User{
@@ -149,6 +157,7 @@ func (up *UserPool) CreateUser(userId, level int, password, method, protocol str
Enable: enable,
Method: method,
Protocol: protocol,
Flow: flow,
}
up.users[u.ID] = u
return u
@@ -261,7 +270,7 @@ func (up *UserPool) syncUserConfigsFromServer(ctx context.Context, proxyTag stri
oldUser, found := up.GetUser(newUser.ID)
if !found {
newUser := up.CreateUser(
newUser.ID, newUser.Level, newUser.Password, newUser.Method, newUser.Protocol, newUser.Enable)
newUser.ID, newUser.Level, newUser.Password, newUser.Method, newUser.Protocol, newUser.Flow, newUser.Enable)
if newUser.Enable {
if err := AddInboundUser(ctx, up.proxyClient, proxyTag, newUser); err != nil {
return err
+10 -7
View File
@@ -159,7 +159,6 @@ func SendTcpMsg(msg []byte, address string) []byte {
if _, err := conn.Write(msg); err != nil {
log.Fatal(err)
}
time.Sleep(time.Second * 1)
buf := make([]byte, len(msg))
n, err := conn.Read(buf)
if err != nil {
@@ -197,17 +196,21 @@ func EchoTcpMsgLong(msg []byte, sleepTime time.Duration, address string) error {
return nil
}
func SendUdpMsg(msg []byte, address string) []byte {
func SendUdpMsg(msg []byte, address string) ([]byte, error) {
conn, err := net.Dial("udp", address)
if err != nil {
log.Fatal(err)
return nil, fmt.Errorf("dial udp: %w", err)
}
defer conn.Close()
if _, err := conn.Write(msg); err != nil {
log.Fatal(err)
return nil, fmt.Errorf("write udp: %w", err)
}
buf := make([]byte, len(msg))
time.Sleep(time.Second * 1)
n, _ := conn.Read(buf)
return buf[:n]
// set a read deadline to avoid hanging forever if the UDP response is lost
conn.SetReadDeadline(time.Now().Add(5 * time.Second))
n, err := conn.Read(buf)
if err != nil {
return nil, fmt.Errorf("read udp: %w", err)
}
return buf[:n], nil
}
+17 -7
View File
@@ -64,8 +64,8 @@ func TestMain(m *testing.M) {
func startRelayServers() []*relay.Relay {
options := conf.Options{
EnableUDP: true,
IdleTimeoutSec: 1,
ReadTimeoutSec: 1,
IdleTimeoutSec: 3,
ReadTimeoutSec: 3,
}
cfg := config.Config{
RelayConfigs: []*conf.Config{
@@ -216,11 +216,21 @@ func testUDPRelay(t *testing.T, address string, concurrent bool, concurrency ...
msg := []byte("hello udp")
runTest := func() error {
res := echo.SendUdpMsg(msg, address)
if !bytes.Equal(msg, res) {
return fmt.Errorf("response mismatch: got %s, want %s", res, msg)
// UDP is unreliable, retry up to 3 times
var lastErr error
for attempt := 0; attempt < 3; attempt++ {
res, err := echo.SendUdpMsg(msg, address)
if err != nil {
lastErr = err
continue
}
if !bytes.Equal(msg, res) {
lastErr = fmt.Errorf("response mismatch: got %s, want %s", res, msg)
continue
}
return nil
}
return nil
return fmt.Errorf("failed after 3 attempts: %w", lastErr)
}
if concurrent {
@@ -247,6 +257,6 @@ func testUDPRelay(t *testing.T, address string, concurrent bool, concurrency ...
}
func TestRelayIdleTimeout(t *testing.T) {
err := echo.EchoTcpMsgLong([]byte("hello"), time.Second*2, RAW_LISTEN)
err := echo.EchoTcpMsgLong([]byte("hello"), time.Second*4, RAW_LISTEN)
require.Error(t, err, "Connection should be rejected")
}
+2 -2
View File
@@ -33,8 +33,8 @@ var (
)
var defaultHeader = http.Header{
"content-type": []string{"application/grpc"},
"user-agent": []string{"grpc-go/1.36.0"},
"Content-Type": []string{"application/grpc"},
"User-Agent": []string{"grpc-go/1.36.0"},
}
type DialFn = func(ctx context.Context, network, addr string) (net.Conn, error)
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019-2024 vernesong
Copyright (c) 2019-2026 vernesong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+5 -70
View File
@@ -1,25 +1,14 @@
<h1 align="center">
<img src="https://raw.githubusercontent.com/vernesong/OpenClash/dev/img/logo.png" alt="Clash" width="200">
<br>OpenClash<br>
</h1>
<p align="center">
<a target="_blank" href="https://github.com/Dreamacro/clash/releases/tag/v1.13.0">
<img src="https://img.shields.io/badge/Clash-v1.13.0-blue.svg">
</a>
</p>
<p align="center">
本插件是一个可运行在 OpenWrt 上的<a href="https://github.com/Dreamacro/clash" target="_blank"> Clash </a>客户端
本插件是一个可运行在 OpenWrt 上的<a href="https://github.com/MetaCubeX/mihomo" target="_blank"> Mihomo(Clash) </a>客户端
</p>
<p align="center">
兼容 Shadowsocks、ShadowsocksR、Vmess、Trojan、Snell 等协议,根据灵活的规则配置实现策略代理
</p>
<p align="center">
- 感谢<a href="https://github.com/frainzy1477" target="_blank"> frainzy1477 </a>,本插件基于<a href="https://github.com/frainzy1477/luci-app-clash" target="_blank"> Luci For Clash </a>进行二次开发 -
</p>
使用手册
---
@@ -32,7 +21,7 @@
---
* IPK [前往下载](https://github.com/vernesong/OpenClash/releases)
* IPK & APK [前往下载](https://github.com/vernesong/OpenClash/releases)
依赖
@@ -115,15 +104,12 @@ make menuconfig
* [MIT License](https://github.com/vernesong/OpenClash/blob/master/LICENSE)
* 内核 [clash](https://github.com/Dreamacro/clash) by [Dreamacro](https://github.com/Dreamacro)
* 内核 [Mihomo](https://github.com/MetaCubeX/mihomo) by [MetaCubeX](https://github.com/MetaCubeX)
* 本项目代码基于 [Luci For Clash](https://github.com/frainzy1477/luci-app-clash) by [frainzy1477](https://github.com/frainzy1477)
* GEOIP数据库 [GeoLite2](https://dev.maxmind.com/geoip/geoip2/geolite2/) by [MaxMind](https://www.maxmind.com)
* IP检查 [MyIP](https://github.com/SukkaW/MyIP) by [SukkaW](https://github.com/SukkaW)
* 控制面板 [clash-dashboard](https://github.com/Dreamacro/clash-dashboard) by [Dreamacro](https://github.com/Dreamacro)
* IP检查 [IP](https://ip.skk.moe/) by [SukkaW](https://ip.skk.moe/)
* 控制面板 [zashboard](https://github.com/Zephyruso/zashboard) by [Dreamacro](https://github.com/Zephyruso)
* 控制面板 [yacd](https://github.com/haishanh/yacd) by [haishanh](https://github.com/haishanh)
* lhie1规则 [lhie1-Rules](https://github.com/lhie1/Rules) by [lhie1](https://github.com/lhie1)
* ConnersHua规则 [ConnersHua-Rules](https://github.com/ConnersHua/Profiles/tree/master) by [ConnersHua](https://github.com/ConnersHua)
* 游戏规则 [SSTap-Rule](https://github.com/FQrabbit/SSTap-Rule) by [FQrabbit](https://github.com/FQrabbit)
* 流媒体解锁检测 [RegionRestrictionCheck](https://github.com/lmc999/RegionRestrictionCheck) by [lmc999](https://github.com/lmc999)
请作者喝杯咖啡
@@ -138,54 +124,3 @@ make menuconfig
<p align="left">
<img width="300" src="https://github.com/vernesong/OpenClash/raw/master/img/USDT-Wallet.png">
</p>
* 比特币-BTC
<p align="left">
<img width="300" src="https://github.com/vernesong/OpenClash/raw/master/img/BTC-Wallet.png">
</p>
* 以太币-ETH
<p align="left">
<img width="300" src="https://github.com/vernesong/OpenClash/raw/master/img/ETH-Wallet.png">
</p>
预览
---
* 运行状态
<p align="center">
<img src="https://github.com/vernesong/OpenClash/raw/master/img/state.png">
</p>
* 全局设置
<p align="center">
<img src="https://github.com/vernesong/OpenClash/raw/master/img/settings.png">
</p>
* 服务器&策略组
<p align="center">
<img src="https://github.com/vernesong/OpenClash/raw/master/img/servers.png">
</p>
* 规则&策略组
<p align="center">
<img src="https://github.com/vernesong/OpenClash/raw/master/img/game-settings.png">
</p>
* 配置文件订阅
<p align="center">
<img src="https://github.com/vernesong/OpenClash/raw/master/img/config-subscribe.png">
</p>
* 配置文件管理
<p align="center">
<img src="https://github.com/vernesong/OpenClash/raw/master/img/config.png">
</p>
* 运行日志
<p align="center">
<img src="https://github.com/vernesong/OpenClash/raw/master/img/log.png">
</p>
+1 -9
View File
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.47.055
PKG_VERSION:=0.47.071
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
@@ -61,7 +61,6 @@ define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/config
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/rule_provider
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/proxy_provider
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/backup
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/core
mkdir -p $(PKG_BUILD_DIR)/root/usr/share/openclash/backup/overwrite
cp -f "$(PKG_BUILD_DIR)/root/etc/config/openclash" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash" >/dev/null 2>&1
@@ -111,8 +110,6 @@ endef
define Package/$(PKG_NAME)/prerm
#!/bin/sh
uci -q set openclash.config.enable=0
uci -q commit openclash
[ -n "$(pidof clash)" ] && /etc/init.d/openclash stop 2>/dev/null
if [ -f "/etc/config/openclash" ] && [ ! -f "/tmp/openclash.bak" ]; then
cp -f "/etc/config/openclash" "/tmp/openclash.bak" >/dev/null 2>&1
@@ -138,17 +135,12 @@ define Package/$(PKG_NAME)/postrm
rm -rf /tmp/openclash_start.log >/dev/null 2>&1
rm -rf /tmp/openclash_last_version >/dev/null 2>&1
rm -rf /tmp/openclash.change >/dev/null 2>&1
rm -rf /tmp/Proxy_Group >/dev/null 2>&1
rm -rf /tmp/rules_name >/dev/null 2>&1
rm -rf /tmp/rule_providers_name >/dev/null 2>&1
rm -rf /tmp/clash_last_version >/dev/null 2>&1
rm -rf /usr/share/openclash >/dev/null 2>&1
rm -rf ${DNSMASQ_CONF_DIR}/dnsmasq_openclash_custom_domain.conf >/dev/null 2>&1
rm -rf ${DNSMASQ_CONF_DIR}/dnsmasq_openclash_chnroute_pass.conf >/dev/null 2>&1
rm -rf ${DNSMASQ_CONF_DIR}/dnsmasq_openclash_chnroute6_pass.conf >/dev/null 2>&1
rm -rf /tmp/dler* >/dev/null 2>&1
rm -rf /tmp/etc/openclash >/dev/null 2>&1
rm -rf /tmp/openclash_edit_file_name >/dev/null 2>&1
rm -rf /tmp/openclash_announcement >/dev/null 2>&1
rm -rf /www/luci-static/resources/openclash >/dev/null 2>&1
sed -i '/OpenClash Append/,/OpenClash Append End/d' "/usr/lib/lua/luci/model/network.lua" >/dev/null 2>&1
@@ -42,11 +42,6 @@ function index()
entry({"admin", "services", "openclash", "one_key_update_check"}, call("action_one_key_update_check"))
entry({"admin", "services", "openclash", "switch_mode"}, call("action_switch_mode"))
entry({"admin", "services", "openclash", "op_mode"}, call("action_op_mode"))
entry({"admin", "services", "openclash", "dler_info"}, call("action_dler_info"))
entry({"admin", "services", "openclash", "dler_checkin"}, call("action_dler_checkin"))
entry({"admin", "services", "openclash", "dler_logout"}, call("action_dler_logout"))
entry({"admin", "services", "openclash", "dler_login"}, call("action_dler_login"))
entry({"admin", "services", "openclash", "dler_login_info_save"}, call("action_dler_login_info_save"))
entry({"admin", "services", "openclash", "sub_info_get"}, call("sub_info_get"))
entry({"admin", "services", "openclash", "config_name"}, call("action_config_name"))
entry({"admin", "services", "openclash", "switch_config"}, call("action_switch_config"))
@@ -75,22 +70,17 @@ function index()
entry({"admin", "services", "openclash", "announcement"}, call("action_announcement"))
entry({"admin", "services", "openclash", "settings"},cbi("openclash/settings"),_("Plugin Settings"), 30).leaf = true
entry({"admin", "services", "openclash", "config-overwrite"},cbi("openclash/config-overwrite"),_("Overwrite Settings"), 40).leaf = true
entry({"admin", "services", "openclash", "servers"},cbi("openclash/servers"),_("Onekey Create"), 50).leaf = true
entry({"admin", "services", "openclash", "config-subscribe"},cbi("openclash/config-subscribe"),_("Config Subscribe"), 60).leaf = true
entry({"admin", "services", "openclash", "servers"},cbi("openclash/servers"),nil).leaf = true
entry({"admin", "services", "openclash", "other-rules-edit"},cbi("openclash/other-rules-edit"), nil).leaf = true
entry({"admin", "services", "openclash", "custom-dns-edit"},cbi("openclash/custom-dns-edit"), nil).leaf = true
entry({"admin", "services", "openclash", "other-file-edit"},cbi("openclash/other-file-edit"), nil).leaf = true
entry({"admin", "services", "openclash", "rule-providers-settings"},cbi("openclash/rule-providers-settings"),_("Rule Providers Append"), 60).leaf = true
entry({"admin", "services", "openclash", "game-rules-manage"},form("openclash/game-rules-manage"), nil).leaf = true
entry({"admin", "services", "openclash", "rule-providers-manage"},form("openclash/rule-providers-manage"), nil).leaf = true
entry({"admin", "services", "openclash", "proxy-provider-file-manage"},form("openclash/proxy-provider-file-manage"), nil).leaf = true
entry({"admin", "services", "openclash", "rule-providers-file-manage"},form("openclash/rule-providers-file-manage"), nil).leaf = true
entry({"admin", "services", "openclash", "game-rules-file-manage"},form("openclash/game-rules-file-manage"), nil).leaf = true
entry({"admin", "services", "openclash", "config-subscribe"},cbi("openclash/config-subscribe"),_("Config Subscribe"), 70).leaf = true
entry({"admin", "services", "openclash", "config-subscribe-edit"},cbi("openclash/config-subscribe-edit"), nil).leaf = true
entry({"admin", "services", "openclash", "servers-config"},cbi("openclash/servers-config"), nil).leaf = true
entry({"admin", "services", "openclash", "groups-config"},cbi("openclash/groups-config"), nil).leaf = true
entry({"admin", "services", "openclash", "proxy-provider-config"},cbi("openclash/proxy-provider-config"), nil).leaf = true
entry({"admin", "services", "openclash", "rule-providers-config"},cbi("openclash/rule-providers-config"), nil).leaf = true
entry({"admin", "services", "openclash", "config"},form("openclash/config"),_("Config Manage"), 80).leaf = true
entry({"admin", "services", "openclash", "log"},cbi("openclash/log"),_("Server Logs"), 90).leaf = true
entry({"admin", "services", "openclash", "myip_check"}, call("action_myip_check"))
@@ -177,19 +167,13 @@ end
local function startlog()
local info = ""
local line_trans = ""
if fs.access("/tmp/openclash_start.log") then
info = luci.sys.exec("sed -n '$p' /tmp/openclash_start.log 2>/dev/null")
line_trans = info
if string.len(info) > 0 then
if not string.find (info, "") or not string.find (info, "") then
line_trans = trans_line_nolabel(info)
else
line_trans = trans_line(info)
end
end
info = trans_line(info)
end
end
return line_trans
return info
end
local function pkg_type()
@@ -234,23 +218,19 @@ local function coremetacv()
end
local function corelv()
local status = process_status("/usr/share/openclash/clash_version.sh")
local core_meta_lv = ""
local core_smart_enable = fs.uci_get_config("config", "smart_enable") or "0"
if not status then
if fs.access("/tmp/clash_last_version") and tonumber(os.time() - fs.mtime("/tmp/clash_last_version")) < 1800 then
if core_smart_enable == "1" then
core_meta_lv = luci.sys.exec("sed -n 2p /tmp/clash_last_version 2>/dev/null |tr -d '\n'")
else
core_meta_lv = luci.sys.exec("sed -n 1p /tmp/clash_last_version 2>/dev/null |tr -d '\n'")
end
if fs.access("/tmp/clash_last_version") then
if core_smart_enable == "1" then
core_meta_lv = luci.sys.exec("sed -n 2p /tmp/clash_last_version 2>/dev/null |tr -d '\n'")
else
action_get_last_version()
core_meta_lv = "loading..."
core_meta_lv = luci.sys.exec("sed -n 1p /tmp/clash_last_version 2>/dev/null |tr -d '\n'")
end
else
core_meta_lv = "loading..."
end
action_get_last_version()
return core_meta_lv
end
@@ -274,23 +254,19 @@ local function opcv()
end
local function oplv()
local status = process_status("/usr/share/openclash/openclash_version.sh")
local oplv = ""
if not status then
if fs.access("/tmp/openclash_last_version") and tonumber(os.time() - fs.mtime("/tmp/openclash_last_version")) < 1800 then
oplv = luci.sys.exec("sed -n 1p /tmp/openclash_last_version 2>/dev/null |tr -d '\n'")
else
action_get_last_version()
oplv = "loading..."
end
if fs.access("/tmp/openclash_last_version") then
oplv = luci.sys.exec("sed -n 1p /tmp/openclash_last_version 2>/dev/null |tr -d '\n'")
else
oplv = "loading..."
end
action_get_last_version()
return oplv
end
local function opup()
luci.sys.call("rm -rf /tmp/*_last_version 2>/dev/null && bash /usr/share/openclash/openclash_version.sh >/dev/null 2>&1")
return luci.sys.call("bash /usr/share/openclash/openclash_update.sh >/dev/null 2>&1 &")
end
@@ -298,7 +274,6 @@ local function coreup()
uci:set("openclash", "config", "enable", "1")
uci:commit("openclash")
local type = luci.http.formvalue("core_type")
luci.sys.call("rm -rf /tmp/*_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh >/dev/null 2>&1")
return luci.sys.call(string.format("/usr/share/openclash/openclash_core.sh '%s' >/dev/null 2>&1 &", type))
end
@@ -346,21 +321,13 @@ end
function core_download()
local cdn_url = luci.http.formvalue("url")
if cdn_url then
luci.sys.call(string.format("rm -rf /tmp/clash_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh '%s' >/dev/null 2>&1", cdn_url))
luci.sys.call(string.format("bash /usr/share/openclash/openclash_core.sh 'Meta' '%s' >/dev/null 2>&1 &", cdn_url))
else
luci.sys.call("rm -rf /tmp/clash_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh >/dev/null 2>&1")
luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Meta' >/dev/null 2>&1 &")
end
end
function download_rule()
local filename = luci.http.formvalue("filename")
local state = luci.sys.call(string.format('/usr/share/openclash/openclash_download_rule_list.sh "%s" >/dev/null 2>&1',filename))
return state
end
function action_flush_dns_cache()
local state = 0
if is_running() then
@@ -368,8 +335,8 @@ function action_flush_dns_cache()
local dase = dase() or ""
local cn_port = cn_port()
if not daip or not cn_port then return end
fake_ip_state = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/fakeip/flush', dase, daip, cn_port))
dns_state = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/dns/flush', dase, daip, cn_port))
fake_ip_state = luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/fakeip/flush', dase, daip, cn_port))
dns_state = luci.sys.exec(string.format('curl -sL -m 3 --retry 2-H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/dns/flush', dase, daip, cn_port))
end
luci.http.prepare_content("application/json")
luci.http.write_json({
@@ -384,7 +351,7 @@ function action_flush_smart_cache()
local dase = dase() or ""
local cn_port = cn_port()
if not daip or not cn_port then return end
flush_state = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/smart/flush', dase, daip, cn_port))
flush_state = luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPOST http://"%s":"%s"/cache/smart/flush', dase, daip, cn_port))
end
luci.http.prepare_content("application/json")
luci.http.write_json({
@@ -393,13 +360,8 @@ function action_flush_smart_cache()
end
function action_update_config()
-- filename or config_file is basename
-- filename is basename
local filename = luci.http.formvalue("filename")
local config_file = luci.http.formvalue("config_file")
if not filename and config_file then
filename = config_file
end
luci.http.prepare_content("application/json")
@@ -450,195 +412,9 @@ end
function action_one_key_update()
local cdn_url = luci.http.formvalue("url")
if cdn_url then
return luci.sys.call(string.format("rm -rf /tmp/*_last_version 2>/dev/null && bash /usr/share/openclash/openclash_update.sh 'one_key_update' '%s' >/dev/null 2>&1 &", cdn_url))
return luci.sys.call(string.format("bash /usr/share/openclash/openclash_update.sh 'one_key_update' '%s' >/dev/null 2>&1 &", cdn_url))
else
return luci.sys.call("rm -rf /tmp/*_last_version 2>/dev/null && bash /usr/share/openclash/openclash_update.sh 'one_key_update' >/dev/null 2>&1 &")
end
end
local function dler_login_info_save()
uci:set("openclash", "config", "dler_email", luci.http.formvalue("email"))
uci:set("openclash", "config", "dler_passwd", luci.http.formvalue("passwd"))
uci:set("openclash", "config", "dler_checkin", luci.http.formvalue("checkin"))
uci:set("openclash", "config", "dler_checkin_interval", luci.http.formvalue("interval"))
if tonumber(luci.http.formvalue("multiple")) > 100 then
uci:set("openclash", "config", "dler_checkin_multiple", "100")
elseif tonumber(luci.http.formvalue("multiple")) < 1 or not tonumber(luci.http.formvalue("multiple")) then
uci:set("openclash", "config", "dler_checkin_multiple", "1")
else
uci:set("openclash", "config", "dler_checkin_multiple", luci.http.formvalue("multiple"))
end
uci:commit("openclash")
return "success"
end
local function dler_login()
local info, token, get_sub, sub_info, sub_key, sub_match, sub_convert, sid
local sub_path = "/tmp/dler_sub"
local email = fs.uci_get_config("config", "dler_email")
local passwd = fs.uci_get_config("config", "dler_passwd")
if email and passwd then
info = luci.sys.exec(string.format("curl -sL -H 'Content-Type: application/json' -d '{\"email\":\"%s\", \"passwd\":\"%s\", \"token_expire\":\"365\" }' -X POST https://dler.cloud/api/v1/login", email, passwd))
if info then
info = json.parse(info)
end
if info and info.ret == 200 then
token = info.data.token
uci:set("openclash", "config", "dler_token", token)
uci:commit("openclash")
get_sub = string.format("curl -sL -H 'Content-Type: application/json' -d '{\"access_token\":\"%s\"}' -X POST https://dler.cloud/api/v1/managed/clash -o %s", token, sub_path)
luci.sys.exec(get_sub)
sub_info = fs.readfile(sub_path)
if sub_info then
sub_info = json.parse(sub_info)
end
if sub_info and sub_info.ret == 200 then
sub_key = {"smart","ss","vmess","trojan"}
for _,v in ipairs(sub_key) do
while true do
sub_match = false
sub_convert = false
uci:foreach("openclash", "config_subscribe",
function(s)
if s.name == "Dler Cloud - " .. v and s.address == sub_info[v] then
sub_match = true
end
if s.name == "Dler Cloud - " .. v and s.address ~= sub_info[v] then
sub_convert = true
sid = s['.name']
end
end)
if sub_match then break end
if sub_convert then
uci:set("openclash", sid, "address", sub_info[v])
else
sid = uci:add("openclash", "config_subscribe")
uci:set("openclash", sid, "name", "Dler Cloud - " .. v)
uci:set("openclash", sid, "address", sub_info[v])
end
uci:commit("openclash")
break
end
luci.sys.exec(string.format('curl -sL -m 3 --retry 2 --user-agent "clash" "%s" -o "/etc/openclash/config/Dler Cloud - %s.yaml" >/dev/null 2>&1', sub_info[v], v))
end
end
return info.ret
else
uci:delete("openclash", "config", "dler_token")
uci:commit("openclash")
fs.unlink(sub_path)
fs.unlink("/tmp/dler_checkin")
fs.unlink("/tmp/dler_info")
if info and info.msg then
return info.msg
else
return "login faild"
end
end
else
uci:delete("openclash", "config", "dler_token")
uci:commit("openclash")
fs.unlink(sub_path)
fs.unlink("/tmp/dler_checkin")
fs.unlink("/tmp/dler_info")
return "email or passwd is wrong"
end
end
local function dler_logout()
local info, token
local token = fs.uci_get_config("config", "dler_token")
if token then
info = luci.sys.exec(string.format("curl -sL -H 'Content-Type: application/json' -d '{\"access_token\":\"%s\"}' -X POST https://dler.cloud/api/v1/logout", token))
if info then
info = json.parse(info)
end
if info and info.ret == 200 then
uci:delete("openclash", "config", "dler_token")
uci:delete("openclash", "config", "dler_checkin")
uci:delete("openclash", "config", "dler_checkin_interval")
uci:delete("openclash", "config", "dler_checkin_multiple")
uci:commit("openclash")
fs.unlink("/tmp/dler_sub")
fs.unlink("/tmp/dler_checkin")
fs.unlink("/tmp/dler_info")
return info.ret
else
if info and info.msg then
return info.msg
else
return "logout faild"
end
end
else
return "logout faild"
end
end
local function dler_info()
local info, path, get_info
local token = fs.uci_get_config("config", "dler_token")
path = "/tmp/dler_info"
if token then
get_info = string.format("curl -sL -H 'Content-Type: application/json' -d '{\"access_token\":\"%s\"}' -X POST https://dler.cloud/api/v1/information -o %s", token, path)
if not fs.access(path) then
luci.sys.exec(get_info)
else
if fs.readfile(path) == "" or not fs.readfile(path) then
luci.sys.exec(get_info)
else
if (os.time() - fs.mtime(path) > 900) then
luci.sys.exec(get_info)
end
end
end
info = fs.readfile(path)
if info then
info = json.parse(info)
end
if info and info.ret == 200 and info.data then
return info.data
elseif info and info.msg and info.msg ~= "api error, ignore" then
luci.sys.exec(string.format("echo -e %s Dler Cloud Account Login Failed, The Error Info is【%s】 >> /tmp/openclash.log", os.date("%Y-%m-%d %H:%M:%S"), info.msg))
info.msg = "api error, ignore"
fs.writefile(path, json.stringify(info))
elseif info and info.msg and info.msg == "api error, ignore" then
return "error"
else
fs.unlink(path)
luci.sys.exec(string.format("echo -e %s Dler Cloud Account Login Failed! Please Check And Try Again... >> /tmp/openclash.log", os.date("%Y-%m-%d %H:%M:%S")))
end
return "error"
else
return "error"
end
end
local function dler_checkin()
local info
local path = "/tmp/dler_checkin"
local token = fs.uci_get_config("config", "dler_token")
local multiple = fs.uci_get_config("config", "dler_checkin_multiple") or 1
if token then
info = luci.sys.exec(string.format("curl -sL -H 'Content-Type: application/json' -d '{\"access_token\":\"%s\", \"multiple\":\"%s\"}' -X POST https://dler.cloud/api/v1/checkin", token, multiple))
if info then
info = json.parse(info)
end
if info and info.ret == 200 then
fs.unlink("/tmp/dler_info")
fs.writefile(path, info)
luci.sys.exec(string.format("echo -e %s Dler Cloud Checkin Successful, Result:【%s】 >> /tmp/openclash.log", os.date("%Y-%m-%d %H:%M:%S"), info.data.checkin))
return info
else
if info and info.msg then
luci.sys.exec(string.format("echo -e %s Dler Cloud Checkin Failed, Result:【%s】 >> /tmp/openclash.log", os.date("%Y-%m-%d %H:%M:%S"), info.msg))
else
luci.sys.exec(string.format("echo -e %s Dler Cloud Checkin Failed! Please Check And Try Again... >> /tmp/openclash.log",os.date("%Y-%m-%d %H:%M:%S")))
end
return info
end
else
return "error"
return luci.sys.call("bash /usr/share/openclash/openclash_update.sh 'one_key_update' >/dev/null 2>&1 &")
end
end
@@ -761,10 +537,10 @@ function fetch_sub_info(sub_url, sub_ua)
local info, upload, download, total, day_expire, http_code
local used, expire, day_left, percent, surplus
info = luci.sys.exec(string.format("curl -sLI -X GET -m 10 -w 'http_code=%%{http_code}' -H 'User-Agent: %s' '%s'", sub_ua, sub_url))
info = luci.sys.exec(string.format("curl -sLI -X GET -m 10 --retry 2 -w 'http_code=%%{http_code}' -H 'User-Agent: %s' '%s'", sub_ua, sub_url))
local http_match = string.match(info, "http_code=(%d+)")
if not info or not http_match or tonumber(http_match) ~= 200 then
info = luci.sys.exec(string.format("curl -sLI -X GET -m 10 -w 'http_code=%%{http_code}' -H 'User-Agent: Quantumultx' '%s'", sub_url))
info = luci.sys.exec(string.format("curl -sLI -X GET -m 10 --retry 2 -w 'http_code=%%{http_code}' -H 'User-Agent: Quantumultx' '%s'", sub_url))
http_match = string.match(info, "http_code=(%d+)")
end
@@ -972,7 +748,7 @@ function get_sub_url(filename)
end
function sub_info_get()
local sub_ua, filename, sub_info
local sub_ua, filename, sub_info, url_result
local providers_data = {}
filename = luci.http.formvalue("filename")
@@ -988,7 +764,7 @@ function sub_info_get()
)
if filename and not is_start() then
local url_result = get_sub_url(filename)
url_result = get_sub_url(filename)
if not url_result then
sub_info = "No Sub Info Found"
@@ -1021,7 +797,8 @@ function sub_info_get()
luci.http.write_json({
sub_info = sub_info,
providers = providers_data,
get_time = os.time()
get_time = os.time(),
url_result = url_result
})
end
@@ -1032,7 +809,7 @@ function action_rule_mode()
local dase = dase() or ""
local cn_port = cn_port()
if not daip or not cn_port then return end
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
if info then
mode = info["mode"]
else
@@ -1061,7 +838,7 @@ function action_switch_rule_mode()
if is_running() then
if not daip or not cn_port then luci.http.status(500, "Switch Faild") return end
info = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPATCH http://"%s":"%s"/configs -d \'{\"mode\": \"%s\"}\'', dase, daip, cn_port, mode))
info = luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPATCH http://"%s":"%s"/configs -d \'{\"mode\": \"%s\"}\'', dase, daip, cn_port, mode))
if info ~= "" then
luci.http.status(500, "Switch Faild")
end
@@ -1111,7 +888,7 @@ function action_log_level()
local dase = dase() or ""
local cn_port = cn_port()
if not daip or not cn_port then return end
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
if info then
level = info["log-level"]
else
@@ -1126,27 +903,6 @@ function action_log_level()
})
end
function action_switch_log()
local level, info
if is_running() then
local daip = daip()
local dase = dase() or ""
local cn_port = cn_port()
level = luci.http.formvalue("log_level")
if not daip or not cn_port or not level then luci.http.status(500, "Switch Faild") return end
info = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPATCH http://"%s":"%s"/configs -d \'{\"log-level\": \"%s\"}\'', dase, daip, cn_port, level))
if info ~= "" then
luci.http.status(500, "Switch Faild")
end
else
luci.http.status(500, "Switch Faild")
end
luci.http.prepare_content("application/json")
luci.http.write_json({
info = info;
})
end
local function s(e)
local t=0
local a={' B/S',' KB/S',' MB/S',' GB/S',' TB/S',' PB/S'}
@@ -1208,8 +964,8 @@ function action_toolbar_show()
local cn_port = cn_port()
if not daip or not cn_port then return end
traffic = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/traffic', dase, daip, cn_port)))
connections = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/connections', dase, daip, cn_port)))
traffic = json.parse(luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/traffic', dase, daip, cn_port)))
connections = json.parse(luci.sys.exec(string.format('curl -sL -m 3 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/connections', dase, daip, cn_port)))
if traffic and connections and connections.connections then
connection = #(connections.connections)
@@ -1283,41 +1039,6 @@ function action_save_corever_branch()
})
end
function action_dler_login_info_save()
luci.http.prepare_content("application/json")
luci.http.write_json({
dler_login_info_save = dler_login_info_save();
})
end
function action_dler_info()
luci.http.prepare_content("application/json")
luci.http.write_json({
dler_info = dler_info();
})
end
function action_dler_checkin()
luci.http.prepare_content("application/json")
luci.http.write_json({
dler_checkin = dler_checkin();
})
end
function action_dler_logout()
luci.http.prepare_content("application/json")
luci.http.write_json({
dler_logout = dler_logout();
})
end
function action_dler_login()
luci.http.prepare_content("application/json")
luci.http.write_json({
dler_login = dler_login();
})
end
function action_one_key_update_check()
luci.http.prepare_content("application/json")
luci.http.write_json({
@@ -1366,7 +1087,7 @@ function action_switch_dashboard()
local switch_name = luci.http.formvalue("name")
local switch_type = luci.http.formvalue("type")
local state = luci.sys.call(string.format('/usr/share/openclash/openclash_download_dashboard.sh "%s" "%s" >/dev/null 2>&1', switch_name, switch_type))
if switch_name == "Dashboard" and tonumber(state) == 1 then
if switch_name == "Dashboard" and tonumber(state) == 0 then
if switch_type == "Official" then
uci:set("openclash", "config", "dashboard_type", "Official")
uci:commit("openclash")
@@ -1374,7 +1095,7 @@ function action_switch_dashboard()
uci:set("openclash", "config", "dashboard_type", "Meta")
uci:commit("openclash")
end
elseif switch_name == "Yacd" and tonumber(state) == 1 then
elseif switch_name == "Yacd" and tonumber(state) == 0 then
if switch_type == "Official" then
uci:set("openclash", "config", "yacd_type", "Official")
uci:commit("openclash")
@@ -1492,10 +1213,14 @@ end
function action_get_last_version()
if not process_status("/usr/share/openclash/clash_version.sh") then
luci.sys.call("bash /usr/share/openclash/clash_version.sh &")
if tonumber(os.time() - (fs.mtime("/tmp/clash_last_version") or 0)) > 1800 then
luci.sys.call("bash /usr/share/openclash/clash_version.sh &")
end
end
if not process_status("/usr/share/openclash/openclash_version.sh") then
luci.sys.call("bash /usr/share/openclash/openclash_version.sh &")
if tonumber(os.time() - (fs.mtime("/tmp/openclash_last_version") or 0)) > 1800 then
luci.sys.call("bash /usr/share/openclash/openclash_version.sh &")
end
end
end
@@ -1570,6 +1295,7 @@ function action_refresh_log()
luci.http.prepare_content("application/json")
local logfile = "/tmp/openclash.log"
local log_len = tonumber(luci.http.formvalue("log_len")) or 0
local core_refresh = luci.http.formvalue("core_refresh") == "true"
if not fs.access(logfile) then
luci.http.write_json({
@@ -1594,54 +1320,54 @@ function action_refresh_log()
end
local exclude_pattern = "UDP%-Receive%-Buffer%-Size|^Sec%-Fetch%-Mode|^User%-Agent|^Access%-Control|^Accept|^Origin|^Referer|^Connection|^Pragma|^Cache%-"
local core_pattern = " DBG | INF |level=| WRN | ERR | FTL "
local core_pattern = "level=|^time="
local limit = 1000
local start_line = (log_len > 0 and total_lines > log_len) and (log_len + 1) or 1
local core_cmd, oc_cmd, core_raw, oc_raw
local core_logs = {}
local oc_logs = {}
local core_cmd = string.format(
core_cmd = string.format(
"tail -n +%d '%s' | grep -v -E '%s' | grep -E '%s' | tail -n %d",
start_line, logfile, exclude_pattern, core_pattern, limit
)
local core_raw = luci.sys.exec(core_cmd)
local oc_cmd = string.format(
oc_cmd = string.format(
"tail -n +%d '%s' | grep -v -E '%s' | grep -v -E '%s' | tail -n %d",
start_line, logfile, exclude_pattern, core_pattern, limit
)
local oc_raw = luci.sys.exec(oc_cmd)
local core_log = ""
if core_refresh then
core_raw = luci.sys.exec(core_cmd)
end
oc_raw = luci.sys.exec(oc_cmd)
if core_raw and core_raw ~= "" then
local core_logs = {}
for line in core_raw:gmatch("[^\n]+") do
local line_trans = line
if string.match(string.sub(line, 0, 8), "%d%d:%d%d:%d%d") then
line_trans = '"'..os.date("%Y-%m-%d", os.time()).. " "..os.date("%H:%M:%S", tonumber(string.sub(line, 0, 8)))..'"'..string.sub(line, 9, -1)
end
table.insert(core_logs, line_trans)
end
if #core_logs > 0 then
core_log = table.concat(core_logs, "\n")
table.insert(core_logs, line)
end
end
local oc_log = ""
if oc_raw and oc_raw ~= "" then
local oc_logs = {}
for line in oc_raw:gmatch("[^\n]+") do
local line_trans
if not string.find(line, "") or not string.find(line, "") then
line_trans = trans_line_nolabel(line)
else
line_trans = trans_line(line)
if not string.match(string.sub(line, 1, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
line = os.date("%Y-%m-%d %H:%M:%S") .. ' [Fatal] ' .. line
end
table.insert(oc_logs, line_trans)
end
if #oc_logs > 0 then
oc_log = table.concat(oc_logs, "\n")
table.insert(oc_logs, trans_line(line))
end
end
if #core_logs > limit then
core_logs = {table.unpack(core_logs, #core_logs - limit + 1)}
end
if #oc_logs > limit then
oc_logs = {table.unpack(oc_logs, #oc_logs - limit + 1)}
end
local core_log = #core_logs > 0 and table.concat(core_logs, "\n") or ""
local oc_log = #oc_logs > 0 and table.concat(oc_logs, "\n") or ""
luci.http.write_json({
len = total_lines,
update = true,
@@ -1872,8 +1598,6 @@ function rename_file()
local new_file_path = file_path .. new_file_name
local old_run_file_path = "/etc/openclash/" .. old_file_name
local new_run_file_path = "/etc/openclash/" .. new_file_name
local old_backup_file_path = "/etc/openclash/backup/" .. old_file_name
local new_backup_file_path = "/etc/openclash/backup/" .. new_file_name
if fs.rename(old_file_path, new_file_path) then
if file_path == "/etc/openclash/config/" then
if fs.uci_get_config("config", "config_path") == old_file_path then
@@ -1884,10 +1608,6 @@ function rename_file()
fs.rename(old_run_file_path, new_run_file_path)
end
if fs.isfile(old_backup_file_path) then
fs.rename(old_backup_file_path, new_backup_file_path)
end
uci:foreach("openclash", "config_subscribe",
function(s)
if s.name == fs.filename(old_file_name) and fs.filename(new_file_name) ~= new_file_name then
@@ -1895,13 +1615,6 @@ function rename_file()
end
end)
uci:foreach("openclash", "other_rules",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
uci:set("openclash", s[".name"], "config", new_file_name)
end
end)
uci:foreach("openclash", "groups",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
@@ -1916,13 +1629,6 @@ function rename_file()
end
end)
uci:foreach("openclash", "rule_provider_config",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
uci:set("openclash", s[".name"], "config", new_file_name)
end
end)
uci:foreach("openclash", "servers",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
@@ -1930,20 +1636,6 @@ function rename_file()
end
end)
uci:foreach("openclash", "game_config",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
uci:set("openclash", s[".name"], "config", new_file_name)
end
end)
uci:foreach("openclash", "rule_providers",
function(s)
if s.config == old_file_name and fs.filename(new_file_name) ~= new_file_name then
uci:set("openclash", s[".name"], "config", new_file_name)
end
end)
uci:commit("openclash")
end
luci.http.status(200, "Rename File Successful")
@@ -1956,19 +1648,13 @@ end
function manual_stream_unlock_test()
local type = luci.http.formvalue("type")
local cmd = string.format('/usr/share/openclash/openclash_streaming_unlock.lua "%s"', type)
local line_trans
luci.http.prepare_content("text/plain; charset=utf-8")
local util = io.popen(cmd)
if util and util ~= "" then
while true do
local ln = util:read("*l")
if ln then
if not string.find (ln, "") or not string.find (ln, "") then
line_trans = trans_line_nolabel(ln)
else
line_trans = trans_line(ln)
end
luci.http.write(line_trans)
luci.http.write(trans_line(ln))
luci.http.write("\n")
end
if not process_status("openclash_streaming_unlock.lua "..type) or not process_status("openclash_streaming_unlock.lua ") then
@@ -1984,19 +1670,13 @@ end
function all_proxies_stream_test()
local type = luci.http.formvalue("type")
local cmd = string.format('/usr/share/openclash/openclash_streaming_unlock.lua "%s" "%s"', type, "all")
local line_trans
luci.http.prepare_content("text/plain; charset=utf-8")
local util = io.popen(cmd)
if util and util ~= "" then
while true do
local ln = util:read("*l")
if ln then
if not string.find (ln, "") or not string.find (ln, "") then
line_trans = trans_line_nolabel(ln)
else
line_trans = trans_line(ln)
end
luci.http.write(line_trans)
luci.http.write(trans_line(ln))
luci.http.write("\n")
end
if not process_status("openclash_streaming_unlock.lua "..type) or not process_status("openclash_streaming_unlock.lua ") then
@@ -2009,95 +1689,70 @@ function all_proxies_stream_test()
luci.http.status(500, "Something Wrong While Testing...")
end
function trans_line_nolabel(data)
if data == nil or data == "" then
return ""
end
local line_trans = ""
if string.len(data) >= 19 and string.match(string.sub(data, 0, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
line_trans = string.sub(data, 0, 20)..luci.i18n.translate(string.sub(data, 21, -1))
else
line_trans = luci.i18n.translate(data)
end
return line_trans
end
function trans_line(data)
if data == nil or data == "" then
return ""
end
local no_trans = {}
local line_trans = ""
local a = string.find(data, "")
if not a then
if string.len(data) >= 19 and string.match(string.sub(data, 0, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
return string.sub(data, 0, 20) .. luci.i18n.translate(string.sub(data, 21, -1))
else
return luci.i18n.translate(data)
local has_timestamp = string.len(data) >= 19 and string.match(string.sub(data, 1, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d")
local time_part = ""
local level_part = ""
local content_start = has_timestamp and 21 or 1
if has_timestamp then
time_part = string.sub(data, 1, 20)
local level_start, level_end, level_content = string.find(data, "%[([^%]]+)%]", 21)
if level_start and level_end and level_start == 21 then
level_part = "[" .. luci.i18n.translate(level_content) .. "] "
content_start = level_end + 2
end
end
local b_pos = string.find(data, "")
if not b_pos then
return luci.i18n.translate(data)
end
local segments = {}
local last_pos = content_start
local pos = string.find(data, "", content_start)
local b = b_pos + 2
local c = 21
local d = 0
local v
local x
while pos do
if pos > last_pos then
table.insert(segments, {
type = "trans",
text = string.sub(data, last_pos, pos - 1)
})
end
while true do
table.insert(no_trans, a)
table.insert(no_trans, b)
local next_a = string.find(data, "", b+1)
local next_b = string.find(data, "", b+1)
if next_a and next_b then
a = next_a
b = next_b + 2
else
local close_pos = string.find(data, "", pos + 1)
if not close_pos then
table.insert(segments, {
type = "trans",
text = string.sub(data, pos, -1)
})
break
end
table.insert(segments, {
type = "no_trans",
text = string.sub(data, pos, close_pos + 2)
})
last_pos = close_pos + 3
pos = string.find(data, "", last_pos)
end
if #no_trans % 2 ~= 0 then
table.remove(no_trans)
if last_pos <= string.len(data) then
table.insert(segments, {
type = "trans",
text = string.sub(data, last_pos, -1)
})
end
for k = 1, #no_trans, 2 do
x = no_trans[k]
v = no_trans[k+1]
if x and v then
if x <= 21 or not string.match(string.sub(data, 0, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
line_trans = line_trans .. luci.i18n.translate(string.sub(data, d, x - 1)) .. string.sub(data, x, v)
d = v + 1
elseif v <= string.len(data) then
line_trans = line_trans .. luci.i18n.translate(string.sub(data, c, x - 1)) .. string.sub(data, x, v)
end
c = v + 1
end
end
if c > string.len(data) then
if d == 0 then
if string.match(string.sub(data, 0, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
line_trans = string.sub(data, 0, 20) .. line_trans
end
end
else
if d == 0 then
if string.match(string.sub(data, 0, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
line_trans = string.sub(data, 0, 20) .. line_trans .. luci.i18n.translate(string.sub(data, c, -1))
end
line_trans = time_part .. level_part
for _, seg in ipairs(segments) do
if seg.type == "trans" then
line_trans = line_trans .. luci.i18n.translate(seg.text)
else
line_trans = line_trans .. luci.i18n.translate(string.sub(data, c, -1))
line_trans = line_trans .. seg.text
end
end
@@ -2364,7 +2019,7 @@ function action_myip_check()
if result.ipify and result.ipify.ip then
local geo_cmd = string.format(
'curl -sL -m 5 -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "https://api-ipv4.ip.sb/geoip/%s" 2>/dev/null',
'curl -sL -m 5 --retry 2 -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "https://api-ipv4.ip.sb/geoip/%s" 2>/dev/null',
result.ipify.ip
)
local geo_data = luci.sys.exec(geo_cmd)
@@ -2417,7 +2072,7 @@ function action_website_check()
end
local cmd = string.format(
'curl -sL -m 5 --connect-timeout 3 -w "%%{http_code},%%{time_total},%%{time_connect},%%{time_appconnect}" "%s" -o /dev/null 2>/dev/null',
'curl -sL -m 5 --connect-timeout 3 --retry 2 -w "%%{http_code},%%{time_total},%%{time_connect},%%{time_appconnect}" "%s" -o /dev/null 2>/dev/null',
test_url
)
@@ -2606,7 +2261,7 @@ function action_switch_oc_setting()
return false
end
local reload_result = luci.sys.exec(string.format('curl -sL -m 5 --connect-timeout 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPUT http://"%s":"%s"/configs?force=true -d \'{"path":"%s"}\' 2>&1', dase, daip, cn_port, runtime_config_path))
local reload_result = luci.sys.exec(string.format('curl -sL -m 5 --connect-timeout 2 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPUT http://"%s":"%s"/configs?force=true -d \'{"path":"%s"}\' 2>&1', dase, daip, cn_port, runtime_config_path))
if reload_result ~= "" then
luci.http.status(500, "Switch Failed")
@@ -2839,7 +2494,7 @@ function action_generate_pac()
local mixed_port = fs.uci_get_config("config", "mixed_port") or "7893"
if not proxy_ip then
result.error = "Unable to get proxy IP"
result.error = luci.i18n.translate("Unable to get proxy IP")
luci.http.prepare_content("application/json")
luci.http.write_json(result)
return
@@ -2959,7 +2614,7 @@ function action_generate_pac()
luci.sys.call("chmod 644 " .. pac_file_path)
else
result.error = "Failed to write PAC file"
result.error = luci.i18n.translate("Failed to write PAC file")
luci.http.prepare_content("application/json")
luci.http.write_json(result)
return
@@ -2972,7 +2627,7 @@ function action_generate_pac()
result.pac_url = pac_url
if not auth_exists then
result.error = "warning: No authentication configured, please be aware of the risk of information leakage!"
result.error = luci.i18n.translate("No authentication configured, please be aware of the risk of information leakage!")
end
luci.http.prepare_content("application/json")
@@ -3640,7 +3295,7 @@ function action_add_subscription()
local address = luci.http.formvalue("address")
local sub_ua = luci.http.formvalue("sub_ua") or "clash.meta"
local sub_convert = luci.http.formvalue("sub_convert") or "0"
local convert_address = luci.http.formvalue("convert_address") or "https://api.dler.io/sub"
local convert_address = luci.http.formvalue("convert_address") or ""
local template = luci.http.formvalue("template") or ""
local emoji = luci.http.formvalue("emoji") or "false"
local udp = luci.http.formvalue("udp") or "false"
@@ -4129,7 +3784,7 @@ function action_overwrite_subscribe_info()
local overwrite_dir = "/etc/openclash/overwrite/"
local file_path = overwrite_dir .. section_name
if url and url ~= "" then
local cmd = string.format('curl -sL --connect-timeout 5 -m 15 "%s" -o "%s"', url, file_path)
local cmd = string.format('curl -sL --connect-timeout 5 -m 15 --retry 2 "%s" -o "%s"', url, file_path)
local ret = luci.sys.call(cmd)
if not fs.access(file_path) then
fs.writefile(file_path, "")
@@ -4259,14 +3914,6 @@ function action_get_subscribe_info_data()
luci.http.status(400, "Bad Request")
return
end
local data = {}
uci:foreach("openclash", "subscribe_info", function(s)
if s.name == filename then
data = s
end
end)
luci.http.prepare_content("application/json")
luci.http.write_json(data)
luci.http.write_json(get_sub_url(filename))
end
@@ -8,14 +8,11 @@ local fs = require "luci.openclash"
local uci = require("luci.model.uci").cursor()
m = SimpleForm("openclash",translate("OpenClash"))
m.description = translate("A Clash Client For OpenWrt")
m.description = translate("A Mihomo(Clash) Client For OpenWrt")
m.reset = false
m.submit = false
m:section(SimpleSection).template = "openclash/status"
if fs.uci_get_config("config", "dler_token") then
m:append(Template("openclash/dlercloud"))
end
m:append(Template("openclash/myip"))
m:append(Template("openclash/developer"))
@@ -56,7 +56,6 @@ s:tab("dns", "DNS "..translate("Settings"))
s:tab("meta", translate("Meta Settings"))
s:tab("smart", translate("Smart Settings"))
s:tab("rules", translate("Rules Setting"))
s:tab("developer", translate("Developer Settings"))
----- General Settings
o = s:taboption("settings", ListValue, "interface_name", translate("Bind Network Interface"))
@@ -444,10 +443,6 @@ o = s:taboption("smart", DummyValue, "flush_smart_cache", translate("Flush Smart
o.template = "openclash/flush_smart_cache"
---- Rules Settings
o = s:taboption("rules", Flag, "rule_source", translate("Enable Other Rules"))
o.description = translate("Use Other Rules")
o.default = 0
o = s:taboption("rules", Flag, "enable_rule_proxy", translate("Rule Match Proxy Mode"))
o.description = translate("Append Some Rules to Config, Allow Only Traffic Proxies that Match the Rule, Prevent BT/P2P Passing")
o.default = 0
@@ -496,36 +491,20 @@ function custom_rules_2.write(self, section, value)
end
end
---- developer
o = s:taboption("developer", Value, "ymchange_custom")
o.template = "cbi/tvalue"
o.description = translate("Custom Config Overwrite Scripts Which Will Run After Plugin Own Completely, Please Be Careful, The Wrong Changes May Lead to Exceptions")
o.rows = 30
o.wrap = "off"
function o.cfgvalue(self, section)
return NXFS.readfile("/etc/openclash/custom/openclash_custom_overwrite.sh") or ""
end
function o.write(self, section, value)
if value then
value = value:gsub("\r\n?", "\n")
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_custom_overwrite.sh")
if value ~= old_value then
NXFS.writefile("/etc/openclash/custom/openclash_custom_overwrite.sh", value)
end
end
end
-- [[ Edit Custom DNS ]] --
ds = m:section(TypedSection, "dns_servers", translate("Add Custom DNS Servers")..translate("(Take Effect After Choose Above)"))
ds.anonymous = true
ds.addremove = true
ds.sortable = true
ds.template = "openclash/tblsection_dns"
ds.template = "openclash/tblsection"
ds.extedit = luci.dispatcher.build_url("admin/services/openclash/custom-dns-edit/%s")
function ds.create(...)
local sid = TypedSection.create(...)
function ds.create(self, section)
local sid = TypedSection.create(self, section)
if sid then
local name = luci.http.formvalue("cbi.cts.tagname.".. self.config .. "." .. self.sectiontype)
if name and #name > 0 then
self.map.uci:set("openclash", sid, "group", name)
end
luci.http.redirect(ds.extedit % sid)
return
end
@@ -541,9 +520,9 @@ end
---- group
o = ds:option(ListValue, "group", translate("DNS Server Group"))
o:value("nameserver", translate("NameServer "))
o:value("fallback", translate("FallBack "))
o:value("default", translate("Default-NameServer"))
o:value("nameserver", translate("nameserver "))
o:value("fallback", translate("fallback "))
o:value("default", translate("default-nameserver"))
o.default = "nameserver"
o.rempty = false
@@ -573,53 +552,6 @@ o = ds:option(Flag, "disable_ipv6", translate("Disable-IPv6"))
o.rmempty = false
o.default = o.disbled
-- [[ Other Rules Manage ]]--
ss = m:section(TypedSection, "other_rules", translate("Other Rules Edit")..translate("(Take Effect After Choose Above)"))
ss.anonymous = true
ss.addremove = true
ss.sortable = true
ss.template = "cbi/tblsection"
ss.extedit = luci.dispatcher.build_url("admin/services/openclash/other-rules-edit/%s")
function ss.create(...)
local sid = TypedSection.create(...)
if sid then
luci.http.redirect(ss.extedit % sid)
return
end
end
ss.render = function(self, ...)
Map.render(self, ...)
if type(optimize_cbi_ui) == "function" then
optimize_cbi_ui()
end
end
o = ss:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
o = ss:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = ss:option(DummyValue, "rule_name", translate("Other Rules Name"))
function o.cfgvalue(...)
if Value.cfgvalue(...) == "lhie1" then
return translate("lhie1 Rules")
else
return translate("None")
end
end
o = ss:option(DummyValue, "Note", translate("Note"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
-- [[ Edit Authentication ]] --
s = m:section(TypedSection, "authentication", translate("Set Authentication of SOCKS5/HTTP(S)"))
s.anonymous = true
@@ -17,8 +17,6 @@ m = Map(openclash, translate("Config Subscribe Edit"))
m.pageaction = false
m.description=translate("Convert Subscribe function of Online is Supported By subconverter Written By tindy X") ..
"<br/>"..
"<br/>"..translate("API By tindy X & lhie1")..
"<br/>"..
"<br/>"..translate("Subconverter external configuration (subscription conversion template) Description: https://github.com/tindy2013/subconverter#external-configuration-file")..
"<br/>"..
"<br/>"..translate("If you need to customize the external configuration file (subscription conversion template), please write it according to the instructions, upload it to the accessible location of the external network, and fill in the address correctly when using it")..
@@ -57,32 +55,6 @@ function o.validate(self, value)
return value
end
local sub_path = "/tmp/dler_sub"
local info, token, get_sub, sub_info
local token = fs.uci_get_config("config", "dler_token")
if token then
get_sub = string.format("curl -sL -H 'Content-Type: application/json' --connect-timeout 2 -d '{\"access_token\":\"%s\"}' -X POST https://dler.cloud/api/v1/managed/clash -o %s", token, sub_path)
if not nixio.fs.access(sub_path) then
luci.sys.exec(get_sub)
else
if fs.readfile(sub_path) == "" or not fs.readfile(sub_path) then
luci.sys.exec(get_sub)
end
end
sub_info = fs.readfile(sub_path)
if sub_info then
sub_info = json.parse(sub_info)
end
if sub_info and sub_info.ret == 200 then
o:value(sub_info.smart)
o:value(sub_info.ss)
o:value(sub_info.vmess)
o:value(sub_info.trojan)
else
fs.unlink(sub_path)
end
end
---- UA
o = s:option(Value, "sub_ua", "User-Agent")
o.description = font_red..bold_on..translate("Used for Downloading Subscriptions, Defaults to Clash")..bold_off..font_off
@@ -102,11 +74,10 @@ o = s:option(Value, "convert_address", translate("Convert Address"))
o.rmempty = true
o.description = font_red..bold_on..translate("Note: There is A Risk of Privacy Leakage in Online Convert")..bold_off..font_off
o:depends("sub_convert", "1")
o:value("https://api.dler.io/sub", translate("api.dler.io")..translate("(Default)"))
o:value("https://api.wcc.best/sub", translate("api.wcc.best"))
o:value("https://api.asailor.org/sub", translate("api.asailor.org"))
o.default = "https://api.dler.io/sub"
o.placeholder = "https://api.dler.io/sub"
o.default = "https://api.wcc.best/sub"
o.placeholder = "https://api.wcc.best/sub"
---- Template
o = s:option(ListValue, "template", translate("Template Name"))
@@ -196,10 +167,10 @@ o.rmempty = true
---- de_exkey
o = s:option(MultiValue, "de_ex_keyword", font_red..bold_on..translate("Exclude Keyword Match Default")..bold_off..font_off)
o.rmempty = true
o:value("过期时间")
o:value("剩余流量")
o:value("TG群")
o:value("官网")
o:value(translate("Expire"))
o:value(translate("Traffic"))
o:value(translate("Plan"))
o:value(translate("Official"))
local t = {
{Commit, Back}
@@ -149,7 +149,6 @@ o = a:option(Button, "Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
fs.unlink("/tmp/Proxy_Group")
m.uci:commit("openclash")
end
@@ -157,18 +156,8 @@ o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Update Config")
o.inputstyle = "apply"
o.write = function()
fs.unlink("/tmp/Proxy_Group")
m.uci:set("openclash", "config", "enable", 1)
m.uci:commit("openclash")
uci:foreach("openclash", "config_subscribe",
function(s)
if s.name ~= "" and s.name ~= nil and s.enabled == "1" then
local back_cfg_path_yaml="/etc/openclash/backup/" .. s.name .. ".yaml"
local back_cfg_path_yml="/etc/openclash/backup/" .. s.name .. ".yml"
fs.unlink(back_cfg_path_yaml)
fs.unlink(back_cfg_path_yml)
end
end)
SYS.call("/usr/share/openclash/openclash.sh >/dev/null 2>&1 &")
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
end
@@ -57,16 +57,11 @@ um = sul:option(DummyValue, "", nil)
um.template = "openclash/dvalue"
local dir, fd, clash
clash = "/etc/openclash/clash"
dir = "/etc/openclash/config/"
bakck_dir="/etc/openclash/backup"
proxy_pro_dir="/etc/openclash/proxy_provider/"
rule_pro_dir="/etc/openclash/rule_provider/"
core_dir="/etc/openclash/core/core/"
backup_dir="/tmp/"
create_bakck_dir=fs.mkdir(bakck_dir)
create_proxy_pro_dir=fs.mkdir(proxy_pro_dir)
create_rule_pro_dir=fs.mkdir(rule_pro_dir)
HTTP.setfilehandler(
function(meta, chunk, eof)
@@ -101,15 +96,11 @@ HTTP.setfilehandler(
if fp == "config" then
CHIF = "1"
if IsYamlFile(meta.file) then
local yamlbackup="/etc/openclash/backup/" .. meta.file
local c=fs.copy(dir .. meta.file,yamlbackup)
default_config_set(meta.file)
end
if IsYmlFile(meta.file) then
local ymlname=string.lower(string.sub(meta.file,0,-5))
local ymlbackup="/etc/openclash/backup/".. ymlname .. ".yaml"
local c=fs.rename(dir .. meta.file,"/etc/openclash/config/".. ymlname .. ".yaml")
local c=fs.copy("/etc/openclash/config/".. ymlname .. ".yaml",ymlbackup)
local yamlname=ymlname .. ".yaml"
default_config_set(yamlname)
end
@@ -160,7 +151,6 @@ HTTP.setfilehandler(
fs.unlink(backup_dir .. meta.file)
um.value = translate("Backup File Restore Successful!")
end
fs.unlink("/tmp/Proxy_Group")
end
end
)
@@ -177,12 +167,7 @@ a=fs.stat(o)
if a then
e[t]={}
e[t].name=fs.basename(o)
BACKUP_FILE="/etc/openclash/backup/".. e[t].name
if fs.mtime(BACKUP_FILE) then
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(BACKUP_FILE))
else
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
end
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
if fs.uci_get_config("config", "config_path") and string.sub(fs.uci_get_config("config", "config_path"), 23, -1) == e[t].name then
e[t].state=translate("Enabled")
else
@@ -206,22 +191,27 @@ st.template="openclash/cfg_check"
sb.template="openclash/sub_info_show"
btnis=tb:option(Button,"switch",translate("SwiTch"))
btnis.template="openclash/other_button"
btnis.render=function(o,t,a)
if not e[t] then return false end
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
a.display=""
else
a.display="none"
end
o.inputstyle="apply"
Button.render(o,t,a)
if not e[t] then return false end
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
a.display=""
else
a.display="none"
end
o.inputstyle="apply"
Button.render(o,t,a)
end
btnis.write=function(a,t)
fs.unlink("/tmp/Proxy_Group")
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name)
uci:commit("openclash")
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name)
uci:commit("openclash")
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
end
btned=tb:option(Button,"edit",translate("Edit"))
btned.inputstyle="apply"
btned.write=function(a,t)
local file_path = "etc/openclash/config/" .. fs.basename(e[t].name)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "config", "%s") % file_path)
end
btnrn=tb:option(DummyValue,"/etc/openclash/config/",translate("Rename"))
@@ -238,9 +228,9 @@ actions.render = function(self, t, a)
if not e[t] then return end
self.keylist = {}
self.vallist = {}
-- Edit
table.insert(self.keylist, "edit")
table.insert(self.vallist, translate("Edit"))
-- Servers manage
table.insert(self.keylist, "servers_manage")
table.insert(self.vallist, translate("Servers Manage"))
-- Copy
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
@@ -271,9 +261,9 @@ btnapply.write = function(self, t)
if not e[t] then return end
local action = self.map:formvalue("cbid." .. self.map.config .. "." .. t .. ".actions")
if action == "edit" then
if action == "servers_manage" then
local file_path = "etc/openclash/config/" .. fs.basename(e[t].name)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "config", "%s") % file_path)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "servers", "%s") % file_path)
elseif action == "copy" then
local num = 1
while true do
@@ -325,8 +315,6 @@ btnapply.write = function(self, t)
fd:close()
HTTP.close()
elseif action == "remove" then
fs.unlink("/tmp/Proxy_Group")
fs.unlink("/etc/openclash/backup/"..fs.basename(e[t].name))
fs.unlink("/etc/openclash/history/"..fs.filename(e[t].name)..".db")
fs.unlink("/etc/openclash/"..fs.basename(e[t].name))
local a=fs.unlink("/etc/openclash/config/"..fs.basename(e[t].name))
@@ -341,7 +329,7 @@ p.reset = false
p.submit = false
local provider_manage = {
{proxy_mg, rule_mg, game_mg}
{proxy_mg, rule_mg}
}
promg = p:section(Table, provider_manage)
@@ -360,13 +348,6 @@ o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-file-manage"))
end
o = promg:option(Button, "game_mg", " ")
o.inputtitle = translate("Game Rules File List")
o.inputstyle = "reload"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
end
m = SimpleForm("openclash",translate("Config File Edit"))
m.reset = false
m.submit = false
@@ -429,7 +410,6 @@ o = a:option(Button, "Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
fs.unlink("/tmp/Proxy_Group")
uci:commit("openclash")
end
@@ -442,7 +422,6 @@ o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Apply Settings")
o.inputstyle = "apply"
o.write = function()
fs.unlink("/tmp/Proxy_Group")
uci:set("openclash", "config", "enable", 1)
uci:commit("openclash")
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
@@ -78,6 +78,12 @@ o = s:option(Flag, "node_resolve", translate("Node Domain Resolve"), translate("
o.rmempty = false
o.default = o.disbled
---- disable-reuse
o = s:option(Flag, "disable_reuse", translate("Disable Reuse"), translate("Disable Reuse The Connection"))
o:depends("type", "tls")
o.rmempty = false
o.default = o.disbled
---- Force HTTP/3
o = s:option(Flag, "http3", translate("Force HTTP/3"), translate("Force HTTP/3 to connect"))
o:depends("type", "https")
@@ -1,123 +0,0 @@
local rule_form
local openclash = "openclash"
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local UTIL = require "luci.util"
local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor()
local g,h={}
for n,m in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
h=fs.stat(m)
if h then
g[n]={}
g[n].num=string.format(n)
g[n].name=fs.basename(m)
g[n].mtime=os.date("%Y-%m-%d %H:%M:%S",h.mtime)
g[n].size=fs.filesize(h.size)
g[n].remove=0
g[n].enable=false
end
end
rule_form=SimpleForm("game_rules_file_list",translate("Game Rules File List"))
rule_form.reset=false
rule_form.submit=false
tb2=rule_form:section(Table,g)
nu2=tb2:option(DummyValue,"num",translate("Serial Number"))
nm2=tb2:option(DummyValue,"name",translate("File Name"))
mt2=tb2:option(DummyValue,"mtime",translate("Update Time"))
sz2=tb2:option(DummyValue,"size",translate("Size"))
btned1=tb2:option(Button,"edit",translate("Edit"))
btned1.render=function(g,n,h)
g.inputstyle="apply"
Button.render(g,n,h)
end
btned1.write=function(h,n)
local file_path = "etc/openclash/game_rules/" .. fs.basename(g[n].name)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "game-rules-file-manage", "%s") %file_path)
end
btndl2 = tb2:option(Button,"download2",translate("Download Config"))
btndl2.template="openclash/other_button"
btndl2.render=function(m,n,h)
m.inputstyle="remove"
Button.render(m,n,h)
end
btndl2.write = function (h,n)
local sPath, sFile, fd, block
sPath = "/etc/openclash/game_rules/"..g[n].name
sFile = NXFS.basename(sPath)
if fs.isdirectory(sPath) then
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
sFile = sFile .. ".tar.gz"
else
fd = nixio.open(sPath, "r")
end
if not fd then
return
end
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
HTTP.prepare_content("application/octet-stream")
while true do
block = fd:read(nixio.const.buffersize)
if (not block) or (#block ==0) then
break
else
HTTP.write(block)
end
end
fd:close()
HTTP.close()
end
btnrm2=tb2:option(Button,"remove2",translate("Remove"))
btnrm2.render=function(g,n,h)
g.inputstyle="reset"
Button.render(g,n,h)
end
btnrm2.write=function(h,n)
local h=fs.unlink("/etc/openclash/game_rules/"..luci.openclash.basename(g[n].name))
if h then table.remove(g,n)end
return h
end
local t = {
{Refresh, Create, Delete_all, Apply}
}
a = rule_form:section(Table, t)
o = a:option(Button, "Refresh", " ")
o.inputtitle = translate("Refresh Page")
o.inputstyle = "apply"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
end
o = a:option(DummyValue, "Create", " ")
o.rawhtml = true
o.template = "openclash/input_file_name"
o.value = "/etc/openclash/game_rules/"
o = a:option(Button, "Delete_all", " ")
o.inputtitle = translate("Delete All File")
o.inputstyle = "remove"
o.write = function()
luci.sys.call("rm -rf /etc/openclash/game_rules/* >/dev/null 2>&1")
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
end
o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "reset"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "config"))
end
rule_form:append(Template("openclash/toolbar_show"))
return rule_form
@@ -1,100 +0,0 @@
local form, m
local openclash = "openclash"
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local UTIL = require "luci.util"
local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor()
m = SimpleForm("openclash", translate("Game Rules List"))
m.description=translate("Rule Project:").." SSTap-Rule ( https://github.com/FQrabbit/SSTap-Rule )"
m.reset = false
m.submit = false
local t = {
{Refresh, Apply}
}
a = m:section(Table, t)
o = a:option(Button, "Refresh", " ")
o.inputtitle = translate("Refresh Page")
o.inputstyle = "apply"
o.write = function()
SYS.call("rm -rf /tmp/rules_name 2>/dev/null")
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
end
o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "reset"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-settings"))
end
if not NXFS.access("/tmp/rules_name") then
SYS.call("awk -F ',' '{print $1}' /usr/share/openclash/res/game_rules.list > /tmp/rules_name 2>/dev/null")
end
file = io.open("/tmp/rules_name", "r");
---- Rules List
local e={},o,t
if NXFS.access("/tmp/rules_name") then
for o in file:lines() do
table.insert(e,o)
end
for t,o in ipairs(e) do
e[t]={}
e[t].num=string.format(t)
e[t].name=o
e[t].filename=string.sub(luci.sys.exec(string.format("grep -F '%s,' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $3}' 2>/dev/null",e[t].name)),1,-2)
if e[t].filename == "" then
e[t].filename=string.sub(luci.sys.exec(string.format("grep -F '%s,' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $2}' 2>/dev/null",e[t].name)),1,-2)
end
RULE_FILE="/etc/openclash/game_rules/".. e[t].filename
if fs.mtime(RULE_FILE) then
e[t].size=fs.filesize(fs.stat(RULE_FILE).size)
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(RULE_FILE))
else
e[t].size="/"
e[t].mtime="/"
end
if fs.isfile(RULE_FILE) then
e[t].exist=translate("Exist")
else
e[t].exist=translate("Not Exist")
end
e[t].remove=0
end
end
file:close()
form=SimpleForm("filelist")
form.reset=false
form.submit=false
tb=form:section(Table,e)
nu=tb:option(DummyValue,"num",translate("Serial Number"))
st=tb:option(DummyValue,"exist",translate("State"))
st.template="openclash/cfg_check"
nm=tb:option(DummyValue,"name",translate("Rule Name"))
fm=tb:option(DummyValue,"filename",translate("File Name"))
sz=tb:option(DummyValue,"size",translate("Size"))
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
btnis=tb:option(DummyValue,"filename",translate("Download Rule"))
btnis.template="openclash/download_rule"
btnrm=tb:option(Button,"remove",translate("Remove"))
btnrm.render=function(e,t,a)
e.inputstyle="reset"
Button.render(e,t,a)
end
btnrm.write=function(a,t)
fs.unlink("/etc/openclash/game_rules/"..e[t].filename)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
end
return m, form
@@ -5,6 +5,15 @@ local uci = luci.model.uci.cursor()
local fs = require "luci.openclash"
local sys = require "luci.sys"
local sid = arg[1]
local file_path = ""
for i = 2, #(arg) do
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
end
if not fs.isfile(file_path) and file_path ~= "" then
file_path = luci.http.urldecode(file_path)
end
font_red = [[<b style=color:red>]]
font_off = [[</b>]]
@@ -24,7 +33,7 @@ end
m = Map(openclash, translate("Edit Group"))
m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers%s" % file_path)
if m.uci:get(openclash, sid) ~= "groups" then
luci.http.redirect(m.redirect)
return
@@ -182,11 +191,11 @@ o = s:option(DynamicList, "other_group", translate("Other Group (Support Regex)"
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT' & 'REJECT-DROP' & 'PASS' & 'GLOBAL'")..bold_off..font_off
o:value("all", translate("All Groups"))
uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil and s.name ~= m.uci:get(openclash, sid, "name") then
o:value(s.name)
end
end)
function(s)
if s.name ~= "" and s.name ~= nil and s.name ~= m.uci:get(openclash, sid, "name") and (s.config == m.uci:get(openclash, sid, "config") or s.config == "all") then
o:value(s.name)
end
end)
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
@@ -194,6 +203,107 @@ o:value("PASS")
o:value("GLOBAL")
o.rmempty = true
local function sync_group_name(section, old_name, new_name)
if old_name == "" or old_name == nil or old_name == new_name then
return
end
local function matches(value, pattern)
if not value or not pattern then
return false
end
local ok, result = pcall(function() return string.match(value, pattern) end)
if ok and result then
return true
end
return value == pattern
end
-- servers 的 groups 列表
uci:foreach(openclash, "servers", function(s)
local groups = uci:get(openclash, s[".name"], "groups")
if groups then
local new_groups = {}
local changed = false
for _, item in ipairs(groups) do
if matches(old_name, item) then
table.insert(new_groups, new_name)
changed = true
else
table.insert(new_groups, item)
end
end
if changed then
uci:delete(openclash, s[".name"], "groups")
uci:set_list(openclash, s[".name"], "groups", new_groups)
end
end
end)
-- proxy-provider 的 groups 列表
uci:foreach(openclash, "proxy-provider", function(s)
local groups = uci:get(openclash, s[".name"], "groups")
if groups then
local new_groups = {}
local changed = false
for _, item in ipairs(groups) do
if matches(old_name, item) then
table.insert(new_groups, new_name)
changed = true
else
table.insert(new_groups, item)
end
end
if changed then
uci:delete(openclash, s[".name"], "groups")
uci:set_list(openclash, s[".name"], "groups", new_groups)
end
end
end)
-- groups 的 other_group 列表
uci:foreach(openclash, "groups", function(s)
if s[".name"] ~= section then
local other_group = uci:get(openclash, s[".name"], "other_group")
if other_group then
local new_other = {}
local changed = false
for _, item in ipairs(other_group) do
if matches(old_name, item) then
table.insert(new_other, new_name)
changed = true
else
table.insert(new_other, item)
end
end
if changed then
uci:delete(openclash, s[".name"], "other_group")
uci:set_list(openclash, s[".name"], "other_group", new_other)
end
end
end
end)
-- dns_servers 的 specific_group 选项
uci:foreach(openclash, "dns_servers", function(s)
local specific_group = uci:get(openclash, s[".name"], "specific_group")
if matches(old_name, specific_group) then
uci:set(openclash, s[".name"], "specific_group", new_name)
end
end)
-- servers 的 dialer_proxy 选项
uci:foreach(openclash, "servers", function(s)
local dialer_proxy = uci:get(openclash, s[".name"], "dialer_proxy")
if matches(old_name, dialer_proxy) then
uci:set(openclash, s[".name"], "dialer_proxy", new_name)
end
end)
uci:commit(openclash)
end
local t = {
{Commit, Back}
}
@@ -203,8 +313,11 @@ o = a:option(Button,"Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
local old_name = m.uci:get(openclash, sid, "old_name") or ""
local new_name = luci.http.formvalue("cbid.openclash." .. sid .. ".name") or m.uci:get(openclash, sid, "name")
sync_group_name(sid, old_name, new_name)
m.uci:set(openclash, sid, "old_name", new_name)
m.uci:commit(openclash)
sys.call("/usr/share/openclash/yml_groups_name_ch.sh")
luci.http.redirect(m.redirect)
end
@@ -3,7 +3,6 @@ local SYS = require "luci.sys"
local HTTP = require "luci.http"
local fs = require "luci.openclash"
local file_path = ""
local edit_file_name = "/tmp/openclash_edit_file_name"
for i = 2, #(arg) do
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
@@ -13,16 +12,6 @@ if not fs.isfile(file_path) and file_path ~= "" then
file_path = luci.http.urldecode(file_path)
end
--re-get file path to save
if NXFS.readfile(edit_file_name) ~= file_path and fs.isfile(file_path) then
NXFS.writefile(edit_file_name, file_path)
else
if not fs.isfile(file_path) and fs.isfile(edit_file_name) then
file_path = NXFS.readfile(edit_file_name)
fs.unlink(edit_file_name)
end
end
m = Map("openclash", translate("File Edit"))
m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/"..arg[1])
@@ -1,347 +0,0 @@
local m, s, o
local openclash = "openclash"
local uci = luci.model.uci.cursor()
local fs = require "luci.openclash"
local sys = require "luci.sys"
local sid = arg[1]
font_red = [[<b style=color:red>]]
font_green = [[<b style=color:green>]]
font_off = [[</b>]]
bold_on = [[<strong>]]
bold_off = [[</strong>]]
function IsYamlFile(e)
e=e or""
local e=string.lower(string.sub(e,-5,-1))
return e == ".yaml"
end
function IsYmlFile(e)
e=e or""
local e=string.lower(string.sub(e,-4,-1))
return e == ".yml"
end
m = Map(openclash, translate("Other Rules Edit"))
m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/config-overwrite")
if m.uci:get(openclash, sid) ~= "other_rules" then
luci.http.redirect(m.redirect)
return
end
-- [[ Other Rules Setting ]]--
s = m:section(NamedSection, sid, "other_rules")
s.anonymous = true
s.addremove = false
o = s:option(Value, "Note", translate("Note"))
o.default = "default"
o.rmempty = false
o = s:option(ListValue, "config", translate("Config File"))
local e,a={}
local groupnames,filename
local group_list = {}
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].name=fs.basename(f)
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
o:value(e[t].name)
end
if e[t].name == m.uci:get(openclash, sid, "config") then
filename = e[t].name
groupnames = sys.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',f))
if groupnames then
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
if groupname ~= nil and groupname ~= "" then
table.insert(group_list, groupname)
end
end
end
end
end
end
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
table.insert(group_list, s.name)
end
end)
table.sort(group_list)
table.insert(group_list, "DIRECT")
table.insert(group_list, "REJECT")
table.insert(group_list, "REJECT-DROP")
table.insert(group_list, "PASS")
table.insert(group_list, "GLOBAL")
o = s:option(Button, translate("Get Group Names"))
o.title = translate("Get Group Names")
o.inputtitle = translate("Get Group Names")
o.description = translate("Get Group Names After Select Config File")
o.inputstyle = "reload"
o.write = function()
m.uci:commit("openclash")
luci.http.redirect(luci.dispatcher.build_url("admin/services/openclash/other-rules-edit/%s") % sid)
end
if group_list ~= nil and filename ~= nil then
o = s:option(ListValue, "rule_name", translate("Other Rules Name"))
o.rmempty = true
o:value("lhie1", translate("lhie1 Rules"))
o = s:option(ListValue, "GlobalTV", translate("GlobalTV"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "AsianTV", translate("AsianTV"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "MainlandTV", translate("CN Mainland TV"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Proxy", translate("Proxy"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Youtube", translate("Youtube"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Bilibili", translate("Bilibili"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Bahamut", translate("Bahamut"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "HBOMax", translate("HBO Max"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Pornhub", translate("Pornhub"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Apple", translate("Apple"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "AppleTV", translate("Apple TV"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "GoogleFCM", translate("Google FCM"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Scholar", translate("Scholar"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Microsoft", translate("Microsoft"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "AI_Suite", translate("AI Suite"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Netflix", translate("Netflix"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Disney", translate("Disney Plus"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Discovery", translate("Discovery Plus"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "DAZN", translate("DAZN"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Spotify", translate("Spotify"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Steam", translate("Steam"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "TikTok", translate("TikTok"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "miHoYo", translate("miHoYo"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Speedtest", translate("Speedtest"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Telegram", translate("Telegram"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Crypto", translate("Crypto"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Discord", translate("Discord"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "PayPal", translate("PayPal"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "AdBlock", translate("AdBlock"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "HTTPDNS", translate("HTTPDNS"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Domestic", translate("Domestic"))
o:depends("rule_name", "lhie1")
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "Others", translate("Others"))
o:depends("rule_name", "lhie1")
o.rmempty = true
o.description = translate("Choose Proxy Groups, Base On Your Config File").." ( "..font_green..bold_on..filename..bold_off..font_off.." )"
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
end
local t = {
{Commit, Back}
}
a = m:section(Table, t)
o = a:option(Button,"Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
m.uci:commit(openclash)
--luci.http.redirect(m.redirect)
end
o = a:option(Button,"Back", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "reset"
o.write = function()
m.uci:revert(openclash, sid)
luci.http.redirect(m.redirect)
end
m:append(Template("openclash/toolbar_show"))
return m
@@ -5,6 +5,15 @@ local uci = luci.model.uci.cursor()
local sys = require "luci.sys"
local sid = arg[1]
local fs = require "luci.openclash"
local file_path = ""
for i = 2, #(arg) do
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
end
if not fs.isfile(file_path) and file_path ~= "" then
file_path = luci.http.urldecode(file_path)
end
font_red = [[<b style=color:red>]]
font_off = [[</b>]]
@@ -24,7 +33,7 @@ end
m = Map(openclash, translate("Edit Proxy-Provider"))
m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers%s" % file_path)
if m.uci:get(openclash, sid) ~= "proxy-provider" then
luci.http.redirect(m.redirect)
return
@@ -49,11 +58,6 @@ for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
end
end
o = s:option(Flag, "manual", translate("Custom Tag"))
o.rmempty = false
o.default = "0"
o.description = translate("Mark as Custom Node to Prevent Retention config from being Deleted When Enabled")
o = s:option(ListValue, "type", translate("Provider Type"))
o.rmempty = true
o.description = translate("Choose The Provider Type")
@@ -158,12 +162,12 @@ function o.validate(self, value)
end
o = s:option(DynamicList, "groups", translate("Proxy Group (Support Regex)"))
o.description = font_red..bold_on..translate("No Need Set when Config Create, The added Proxy Groups Must Exist")..bold_off..font_off
o.description = font_red..bold_on..translate("The added Proxy Groups Must Exist")..bold_off..font_off
o.rmempty = true
o:value("all", translate("All Groups"))
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
if s.name ~= "" and s.name ~= nil and (s.config == m.uci:get(openclash, sid, "config") or s.config == "all") then
o:value(s.name)
end
end)
@@ -43,7 +43,6 @@ btned1.write=function(r,x)
end
btndl1 = tb1:option(Button,"download1",translate("Download Config"))
btndl1.template="openclash/other_button"
btndl1.render=function(y,x,r)
y.inputstyle="remove"
Button.render(y,x,r)
@@ -1,208 +0,0 @@
local m, s, o
local openclash = "openclash"
local uci = luci.model.uci.cursor()
local fs = require "luci.openclash"
local sys = require "luci.sys"
local sid = arg[1]
font_red = [[<b style=color:red>]]
font_off = [[</b>]]
bold_on = [[<strong>]]
bold_off = [[</strong>]]
function IsYamlFile(e)
e=e or""
local e=string.lower(string.sub(e,-5,-1))
return e == ".yaml"
end
function IsYmlFile(e)
e=e or""
local e=string.lower(string.sub(e,-4,-1))
return e == ".yml"
end
m = Map(openclash, translate("Edit Rule Providers"))
m.pageaction = false
m.description=translate("规则集使用介绍:https://wiki.metacubex.one/config/rule-providers/content/")
m.redirect = luci.dispatcher.build_url("admin/services/openclash/rule-providers-settings")
if m.uci:get(openclash, sid) ~= "rule_providers" then
luci.http.redirect(m.redirect)
return
end
-- [[ Rule Providers Setting ]]--
s = m:section(NamedSection, sid, "rule_providers")
s.anonymous = true
s.addremove = false
o = s:option(ListValue, "config", translate("Config File"))
o:value("all", translate("Use For All Config File"))
local e,a={}
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].name=fs.basename(f)
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
o:value(e[t].name)
end
end
end
o = s:option(Value, "name", translate("Rule Providers Name"))
o.rmempty = false
o.default = "Rule-provider - "..sid
o = s:option(ListValue, "type", translate("Rule Providers Type"))
o.rmempty = true
o.description = translate("Choose The Rule Providers Type")
o:value("http")
o:value("file")
o:value("inline")
o = s:option(ListValue, "format", translate("Rule Format"))
o.rmempty = true
o.description = translate("Choose The Rule File Format, For More Info:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/rule-providers/content/\")'>https://wiki.metacubex.one/config/rule-providers/content/</a>"
o:value("yaml")
o:value("text")
o:value("mrs")
o:depends("type", "file")
o:depends("type", "http")
o = s:option(ListValue, "behavior", translate("Rule Behavior"))
o.rmempty = true
o.description = translate("Choose The Rule Behavior")
o:value("domain")
o:value("ipcidr")
o:value("classical", translate("classical").." "..translate("(Not Support mrs Format)"))
o = s:option(ListValue, "path", translate("Rule Providers Path"))
o.description = translate("Update Your Rule Providers File From Config Luci Page")
local p,h={}
for t,f in ipairs(fs.glob("/etc/openclash/rule_provider/*"))do
h=fs.stat(f)
if h then
p[t]={}
p[t].name=fs.basename(f)
o:value("./rule_provider/"..p[t].name)
end
end
for t,f in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
h=fs.stat(f)
if h then
p[t]={}
p[t].name=fs.basename(f)
o:value("./game_rules/"..p[t].name)
end
end
o.rmempty = false
o:depends("type", "file")
o = s:option(Value, "url", translate("Rule Providers URL"))
o.rmempty = false
o:depends("type", "http")
o = s:option(Value, "interval", translate("Rule Providers Interval(s)"))
o.default = "86400"
o.rmempty = false
o:depends("type", "http")
o = s:option(ListValue, "position", translate("Append Position"))
o.rmempty = false
o:value("0", translate("Priority Match"))
o:value("1", translate("Extended Match"))
o = s:option(ListValue, "group", translate("Set Proxy Group"))
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT' & 'REJECT-DROP' & 'PASS' & 'GLOBAL'")..bold_off..font_off
o.rmempty = true
local groupnames, filename
local group_list = {}
filename = m.uci:get(openclash, "config", "config_path")
if filename then
groupnames = sys.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
if groupnames then
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
if groupname ~= nil and groupname ~= "" then
table.insert(group_list, groupname)
end
end
end
end
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
table.insert(group_list, s.name)
end
end)
table.sort(group_list)
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o:value("DIRECT")
o:value("REJECT")
o:value("REJECT-DROP")
o:value("PASS")
o:value("GLOBAL")
-- [[ other-setting ]]--
o = s:option(Value, "other_parameters", translate("Other Parameters"))
o.template = "cbi/tvalue"
o.rows = 20
o.wrap = "off"
o.description = font_red..bold_on..translate("Edit Your Other Parameters Here")..bold_off..font_off
o.rmempty = true
function o.cfgvalue(self, section)
if self.map:get(section, "other_parameters") == nil then
return "# Example:\n"..
"# Only support YAML, four spaces need to be reserved at the beginning of each line to maintain formatting alignment\n"..
"# 示例:\n"..
"# 仅支持 YAML, 每行行首需要多保留四个空格以使脚本处理后能够与上方配置保持格式对齐\n"..
"# inline Example:\n"..
"# payload:\n"..
"# - '.blogger.com'\n"..
"# - '*.*.microsoft.com'\n"..
"# - 'books.itunes.apple.com'\n"
else
return Value.cfgvalue(self, section)
end
end
function o.validate(self, value)
if value then
value = value:gsub("\r\n?", "\n")
value = value:gsub("%c*$", "")
end
return value
end
local t = {
{Commit, Back}
}
a = m:section(Table, t)
o = a:option(Button,"Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
m.uci:commit(openclash)
sys.call("/usr/share/openclash/yml_groups_name_ch.sh")
luci.http.redirect(m.redirect)
end
o = a:option(Button,"Back", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "reset"
o.write = function()
m.uci:revert(openclash, sid)
luci.http.redirect(m.redirect)
end
m:append(Template("openclash/toolbar_show"))
m:append(Template("openclash/config_editor"))
return m
@@ -43,7 +43,6 @@ btned1.write=function(h,n)
end
btndl2 = tb2:option(Button,"download2",translate("Download Config"))
btndl2.template="openclash/other_button"
btndl2.render=function(m,n,h)
m.inputstyle="remove"
Button.render(m,n,h)
@@ -1,106 +0,0 @@
local form, m
local openclash = "openclash"
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local UTIL = require "luci.util"
local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor()
m = SimpleForm("openclash", translate("Other Rule Providers List"))
m.description=translate("Rule Project:").." lhie1 ( https://github.com/dler-io/Rules )<br/>"..
translate("Rule Project:").." ACL4SSR ( https://github.com/ACL4SSR/ACL4SSR/tree/master )"
m.reset = false
m.submit = false
local t = {
{Apply}
}
a = m:section(Table, t)
o = a:option(Button, "Refresh", " ")
o.inputtitle = translate("Refresh Page")
o.inputstyle = "apply"
o.write = function()
SYS.call("rm -rf /tmp/rule_providers_name 2>/dev/null")
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
end
o = a:option(Button, "Apply", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "reset"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-settings"))
end
if not NXFS.access("/tmp/rule_providers_name") then
SYS.call("awk -v d=',' -F ',' '{print $4d$5}' /usr/share/openclash/res/rule_providers.list > /tmp/rule_providers_name 2>/dev/null")
end
file = io.open("/tmp/rule_providers_name", "r");
---- Rules List
local e={},o,t
if NXFS.access("/tmp/rule_providers_name") then
for o in file:lines() do
table.insert(e,o)
end
for t,o in ipairs(e) do
e[t]={}
e[t].num=string.format(t)
e[t].name=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",o)),1,-2)
e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $6}' 2>/dev/null",o)),1,-2)
if e[t].lfilename == "" then
e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $5}' 2>/dev/null",o)),1,-2)
end
e[t].filename=o
e[t].author=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $2}' 2>/dev/null",o)),1,-2)
e[t].rule_type=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $3}' 2>/dev/null",o)),1,-2)
RULE_FILE="/etc/openclash/rule_provider/".. e[t].lfilename
if fs.mtime(RULE_FILE) then
e[t].size=fs.filesize(fs.stat(RULE_FILE).size)
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(RULE_FILE))
else
e[t].size="/"
e[t].mtime="/"
end
if fs.isfile(RULE_FILE) then
e[t].exist=translate("Exist")
else
e[t].exist=translate("Not Exist")
end
e[t].remove=0
end
end
file:close()
form=SimpleForm("filelist")
form.reset=false
form.submit=false
tb=form:section(Table,e)
nu=tb:option(DummyValue,"num",translate("Serial Number"))
st=tb:option(DummyValue,"exist",translate("State"))
st.template="openclash/cfg_check"
tp=tb:option(DummyValue,"rule_type",translate("Rule Type"))
nm=tb:option(DummyValue,"name",translate("Rule Name"))
au=tb:option(DummyValue,"author",translate("Rule Author"))
fm=tb:option(DummyValue,"lfilename",translate("File Name"))
sz=tb:option(DummyValue,"size",translate("Size"))
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
btnis=tb:option(DummyValue,"filename",translate("Download Rule"))
btnis.template="openclash/download_rule"
btnrm=tb:option(Button,"remove",translate("Remove"))
btnrm.render=function(e,t,a)
e.inputstyle="reset"
Button.render(e,t,a)
end
btnrm.write=function(a,t)
fs.unlink("/etc/openclash/rule_provider/"..e[t].lfilename)
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
end
return m, form
@@ -1,286 +0,0 @@
local m, s, o
local openclash = "openclash"
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local UTIL = require "luci.util"
local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor()
m = Map(openclash, translate("Rule Providers Append"))
m.pageaction = false
m.description=translate("Attention:")..
"<br/>"..translate("The game proxy is a test function and does not guarantee the availability of rules")..
"<br/>"..translate("Preparation steps:")..
"<br/>"..translate("1. Check the policy group and node you are going to use, Policy group type suggestion: fallback, game nodes must be support UDP and not a Vmess")..
"<br/>"..translate("2. Click the <manage third party game rules> or <manage third party rule set> button to enter the rule list and download the rules you want to use")..
"<br/>"..translate("3. On this page, set the corresponding configuration file and policy group of the rule you have downloaded, and save the settings")..
"<br/>"..
"<br/>"..translate("When setting this page, if the groups is empty, please go to the <Onekey Create> page to add")..
"<br/>"..
"<br/>"..translate("Introduction to rule set usage:").." <a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/rule-providers/content/\")'>"..translate("https://wiki.metacubex.one/config/rule-providers/content/").."</a>"
function IsRuleFile(e)
e=e or""
local e=string.lower(string.sub(e,-6,-1))
return e==".rules"
end
function IsYamlFile(e)
e=e or""
local e=string.lower(string.sub(e,-5,-1))
return e == ".yaml"
end
function IsYmlFile(e)
e=e or""
local e=string.lower(string.sub(e,-4,-1))
return e == ".yml"
end
local groupnames, filename
local group_list = {}
filename = m.uci:get(openclash, "config", "config_path")
if filename then
groupnames = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
if groupnames then
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
if groupname ~= nil and groupname ~= "" then
table.insert(group_list, groupname)
end
end
end
end
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
table.insert(group_list, s.name)
end
end)
table.sort(group_list)
table.insert(group_list, "DIRECT")
table.insert(group_list, "REJECT")
table.insert(group_list, "REJECT-DROP")
table.insert(group_list, "PASS")
table.insert(group_list, "GLOBAL")
-- [[ Edit Game Rule ]] --
s = m:section(TypedSection, "game_config", translate("Game Rules Append"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.rmempty = false
---- enable flag
o = s:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
---- config
o = s:option(ListValue, "config", translate("Config File"))
o:value("all", translate("Use For All Config File"))
local e,a={}
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].name=fs.basename(f)
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
o:value(e[t].name)
end
end
end
---- rule name
o = s:option(DynamicList, "rule_name", translate("Game Rule's Name"))
local e,a={}
for t,f in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].filename=fs.basename(f)
if IsRuleFile(e[t].filename) then
e[t].name=string.gsub(luci.sys.exec(string.format("grep ',%s$' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $1}' 2>/dev/null",e[t].filename)), "[\r\n]", "")
if e[t].name ~= "" and e[t].name ~= nil then
o:value(e[t].name)
end
end
end
end
o.rmempty = true
---- Proxy Group
o = s:option(ListValue, "group", translate("Select Proxy Group"))
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
-- [[ Edit Other Rule Provider ]] --
s = m:section(TypedSection, "rule_provider_config", translate("Other Rule Providers Append"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.rmempty = false
---- enable flag
o = s:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
---- config
o = s:option(ListValue, "config", translate("Config File"))
o:value("all", translate("Use For All Config File"))
local e,a={}
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].name=fs.basename(f)
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
o:value(e[t].name)
end
end
end
---- rule name
o = s:option(DynamicList, "rule_name", translate("Rule Provider's Name"))
local e,a={}
for t,f in ipairs(fs.glob("/etc/openclash/rule_provider/*"))do
a=fs.stat(f)
if a then
e[t]={}
e[t].filename=fs.basename(f)
if IsYamlFile(e[t].filename) or IsYmlFile(e[t].filename) then
e[t].name=string.gsub(luci.sys.exec(string.format("grep ',%s$' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",e[t].filename)), "[\r\n]", "")
if e[t].name ~= "" and e[t].name ~= nil then
o:value(e[t].name)
end
end
end
end
o.rmempty = true
---- Proxy Group
o = s:option(ListValue, "group", translate("Select Proxy Group"))
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(Value, "interval", translate("Rule Providers Interval(s)"))
o.default = "86400"
o.rmempty = false
---- position
o = s:option(ListValue, "position", translate("Append Position"))
o.rmempty = false
o:value("0", translate("Priority Match"))
o:value("1", translate("Extended Match"))
-- [[ Edit Custom Rule Provider ]] --
s = m:section(TypedSection, "rule_providers", translate("Custom Rule Providers Append"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.extedit = luci.dispatcher.build_url("admin/services/openclash/rule-providers-config/%s")
function s.create(...)
local sid = TypedSection.create(...)
if sid then
luci.http.redirect(s.extedit % sid)
return
end
end
---- enable flag
o = s:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
o = s:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("all")
end
o = s:option(DummyValue, "name", translate("Rule Providers Name"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
---- Proxy Group
o = s:option(ListValue, "group", translate("Select Proxy Group"))
o.rmempty = true
for _, groupname in ipairs(group_list) do
o:value(groupname)
end
o = s:option(ListValue, "position", translate("Append Position"))
o.rmempty = false
o:value("0", translate("Priority Match"))
o:value("1", translate("Extended Match"))
local rm = {
{rule_mg, pro_mg}
}
rmg = m:section(Table, rm)
o = rmg:option(Button, "rule_mg", " ")
o.inputtitle = translate("Game Rules Manage")
o.inputstyle = "reload"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
end
o = rmg:option(Button, "pro_mg", " ")
o.inputtitle = translate("Other Rule Provider Manage")
o.inputstyle = "reload"
o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
end
local t = {
{Commit, Apply}
}
ss = m:section(Table, t)
o = ss:option(Button, "Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
m.uci:commit("openclash")
end
o = ss:option(Button, "Apply", " ")
o.inputtitle = translate("Apply Settings")
o.inputstyle = "apply"
o.write = function()
m.uci:set("openclash", "config", "enable", 1)
m.uci:commit("openclash")
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
end
m:append(Template("openclash/toolbar_show"))
return m
@@ -6,6 +6,15 @@ local fs = require "luci.openclash"
local sys = require "luci.sys"
local sid = arg[1]
local uuid = luci.sys.exec("cat /proc/sys/kernel/random/uuid")
local file_path = ""
for i = 2, #(arg) do
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
end
if not fs.isfile(file_path) and file_path ~= "" then
file_path = luci.http.urldecode(file_path)
end
font_red = [[<b style=color:red>]]
font_off = [[</b>]]
@@ -99,7 +108,7 @@ local obfs = {
m = Map(openclash, translate("Edit Server"))
m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers%s" % file_path)
if m.uci:get(openclash, sid) ~= "servers" then
luci.http.redirect(m.redirect)
@@ -130,11 +139,6 @@ for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
end
end
o = s:option(Flag, "manual", translate("Custom Tag"))
o.rmempty = false
o.default = "0"
o.description = translate("Mark as Custom Node to Prevent Retention config from being Deleted When Enabled")
o = s:option(ListValue, "type", translate("Server Node Type"))
o:value("ss", translate("Shadowsocks"))
o:value("ssr", translate("ShadowsocksR"))
@@ -1174,18 +1178,18 @@ o.rmempty = true
o.description = font_red..bold_on..translate("The added Dialer Proxy or Group Must Exist")..bold_off..font_off
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
if s.name ~= "" and s.name ~= nil and (s.config == m.uci:get(openclash, sid, "config") or s.config == "all") then
o:value(s.name)
end
end)
o = s:option(DynamicList, "groups", translate("Proxy Group (Support Regex)"))
o.description = font_red..bold_on..translate("No Need Set when Config Create, The added Proxy Groups Must Exist")..bold_off..font_off
o.description = font_red..bold_on..translate("The added Proxy Groups Must Exist")..bold_off..font_off
o.rmempty = true
o:value("all", translate("All Groups"))
m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
if s.name ~= "" and s.name ~= nil and (s.config == m.uci:get(openclash, sid, "config") or s.config == "all") then
o:value(s.name)
end
end)
@@ -3,13 +3,17 @@ local m, s, o
local openclash = "openclash"
local uci = luci.model.uci.cursor()
local fs = require "luci.openclash"
local file_path = ""
font_red = [[<b style=color:red>]]
font_off = [[</b>]]
bold_on = [[<strong>]]
bold_off = [[</strong>]]
for i = 1, #(arg) do
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
end
m = Map(openclash, translate("Onekey Create (Servers&Groups manage)"))
if not fs.isfile(file_path) and file_path ~= "" then
file_path = luci.http.urldecode(file_path)
end
m = Map(openclash, translate("Servers & Groups manage"))
m.pageaction = false
m.description=translate("Attention:")..
"<br/>"..translate("1. Before modifying the configuration file, please click the button below to read the configuration file")..
@@ -18,175 +22,142 @@ m.description=translate("Attention:")..
"<br/>"..translate("Introduction to proxy usage:").." <a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/proxies/\")'>"..translate("https://wiki.metacubex.one/config/proxies/").."</a>"..
"<br/>"..translate("Introduction to proxy-provider usage:").." <a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/proxy-providers/\")'>"..translate("https://wiki.metacubex.one/config/proxy-providers/").."</a>"
s = m:section(TypedSection, "openclash")
s.anonymous = true
o = s:option(Flag, "create_config", translate("Create Config"))
o.description = font_red .. bold_on .. translate("Create Config By One-Click Only Need Proxies") .. bold_off .. font_off
o.default = 0
o = s:option(ListValue, "rule_sources", translate("Choose Template For Create Config"))
o.description = translate("Use Other Rules To Create Config")
o:depends("create_config", 1)
o:value("lhie1", translate("lhie1 Rules"))
o = s:option(Flag, "mix_proxies", translate("Mix Proxies"))
o.description = font_red .. bold_on .. translate("Mix This Page's Proxies") .. bold_off .. font_off
o:depends("create_config", 1)
o.default = 0
o = s:option(Flag, "servers_update", translate("Keep Settings"))
o.description = font_red .. bold_on .. translate("Only Update Servers Below When Subscription") .. bold_off .. font_off
o.default = 0
o = s:option(DynamicList, "new_servers_group", translate("New Servers Group (Support Regex)"))
o.description = translate("Set The New Subscribe Server's Default Proxy Groups")
o.rmempty = true
o:depends("servers_update", 1)
o:value("all", translate("All Groups"))
m.uci:foreach("openclash", "groups",
function(s)
o:value(s.name)
end)
-- [[ Groups Manage ]]--
s = m:section(TypedSection, "groups", translate("Proxy Groups(No Need Set when Config Create)"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.extedit = luci.dispatcher.build_url("admin/services/openclash/groups-config/%s")
function s.create(...)
local sid = TypedSection.create(...)
gs = m:section(TypedSection, "groups", translate("Proxy Groups"))
gs.anonymous = true
gs.addremove = true
gs.sortable = true
gs.template = "openclash/tblsection"
gs.extedit = luci.dispatcher.build_url("admin/services/openclash/groups-config/%s"..file_path)
function gs.create(self, section)
local sid = TypedSection.create(self, section)
if sid then
luci.http.redirect(s.extedit % sid)
local name = luci.http.formvalue("cbi.cts.tagname.".. self.config .. "." .. self.sectiontype)
if name and #name > 0 then
self.map.uci:set("openclash", sid, "config", name)
end
luci.http.redirect(gs.extedit % sid)
return
end
end
---- enable flag
o = s:option(Flag, "enabled", translate("Enable"))
o = gs:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
o = s:option(DummyValue, "config", translate("Config File"))
o = gs:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("all")
end
o = s:option(DummyValue, "type", translate("Group Type"))
o = gs:option(DummyValue, "type", translate("Group Type"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "name", translate("Group Name"))
o = gs:option(DummyValue, "name", translate("Group Name"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
-- [[ Proxy-Provider Manage ]]--
s = m:section(TypedSection, "proxy-provider", translate("Proxy-Provider"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.extedit = luci.dispatcher.build_url("admin/services/openclash/proxy-provider-config/%s")
function s.create(...)
local sid = TypedSection.create(...)
ps = m:section(TypedSection, "proxy-provider", translate("Proxy-Provider"))
ps.anonymous = true
ps.addremove = true
ps.sortable = true
ps.template = "openclash/tblsection"
ps.extedit = luci.dispatcher.build_url("admin/services/openclash/proxy-provider-config/%s"..file_path)
function ps.create(self, section)
local sid = TypedSection.create(self, section)
if sid then
luci.http.redirect(s.extedit % sid)
local name = luci.http.formvalue("cbi.cts.tagname.".. self.config .. "." .. self.sectiontype)
if name and #name > 0 then
self.map.uci:set("openclash", sid, "config", name)
end
luci.http.redirect(ps.extedit % sid)
return
end
end
o = s:option(Flag, "enabled", translate("Enable"))
o = ps:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
o = s:option(Flag, "manual", translate("Custom Tag"))
o.rmempty = false
o.default = "0"
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
o = s:option(DummyValue, "config", translate("Config File"))
o = ps:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("all")
end
o = s:option(DummyValue, "type", translate("Provider Type"))
o = ps:option(DummyValue, "type", translate("Provider Type"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "name", translate("Provider Name"))
o = ps:option(DummyValue, "name", translate("Provider Name"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
-- [[ Servers Manage ]]--
s = m:section(TypedSection, "servers", translate("Proxies"))
s.anonymous = true
s.addremove = true
s.sortable = true
s.template = "openclash/tblsection"
s.extedit = luci.dispatcher.build_url("admin/services/openclash/servers-config/%s")
function s.create(...)
local sid = TypedSection.create(...)
ss = m:section(TypedSection, "servers", translate("Proxies"))
ss.anonymous = true
ss.addremove = true
ss.sortable = true
ss.template = "openclash/tblsection"
ss.extedit = luci.dispatcher.build_url("admin/services/openclash/servers-config/%s"..file_path)
function ss.create(self, section)
local sid = TypedSection.create(self, section)
if sid then
luci.http.redirect(s.extedit % sid)
local name = luci.http.formvalue("cbi.cts.tagname.".. self.config .. "." .. self.sectiontype)
if name and #name > 0 then
self.map.uci:set("openclash", sid, "config", name)
end
luci.http.redirect(ss.extedit % sid)
return
end
end
---- enable flag
o = s:option(Flag, "enabled", translate("Enable"))
o = ss:option(Flag, "enabled", translate("Enable"))
o.rmempty = false
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "1"
end
o = s:option(Flag, "manual", translate("Custom Tag"))
o.rmempty = false
o.default = "0"
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
o = s:option(DummyValue, "config", translate("Config File"))
o = ss:option(DummyValue, "config", translate("Config File"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("all")
end
o = s:option(DummyValue, "type", translate("Type"))
o = ss:option(DummyValue, "type", translate("Type"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "name", translate("Server Alias"))
o = ss:option(DummyValue, "name", translate("Server Alias"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "server", translate("Server Address"))
o = ss:option(DummyValue, "server", translate("Server Address"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "port", translate("Server Port"))
o = ss:option(DummyValue, "port", translate("Server Port"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("None")
end
o = s:option(DummyValue, "udp", translate("UDP Support"))
o = ss:option(DummyValue, "udp", translate("UDP Support"))
function o.cfgvalue(...)
if Value.cfgvalue(...) == "true" then
return translate("Enable")
@@ -207,8 +178,13 @@ o = b:option(Button,"Delete_Unused_Servers", " ")
o.inputtitle = translate("Delete Unused Servers")
o.inputstyle = "reset"
o.write = function()
luci.sys.call("sh /usr/share/openclash/cfg_unused_servers_del.sh 2>/dev/null")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
m.uci:foreach("openclash", "servers",
function(s)
if s.enabled ~= "1" then
m.uci:delete("openclash", s[".name"])
end
end)
m.uci:commit("openclash")
end
o = b:option(Button,"Delete_Servers", " ")
@@ -217,7 +193,6 @@ o.inputstyle = "reset"
o.write = function()
m.uci:delete_all("openclash", "servers", function(s) return true end)
m.uci:commit("openclash")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
end
o = b:option(Button,"Delete_Proxy_Provider", " ")
@@ -226,7 +201,6 @@ o.inputstyle = "reset"
o.write = function()
m.uci:delete_all("openclash", "proxy-provider", function(s) return true end)
m.uci:commit("openclash")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
end
o = b:option(Button,"Delete_Groups", " ")
@@ -235,11 +209,10 @@ o.inputstyle = "reset"
o.write = function()
m.uci:delete_all("openclash", "groups", function(s) return true end)
m.uci:commit("openclash")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
end
local t = {
{Load_Config, Commit, Apply}
{Load_Config, Commit, Apply, Back}
}
a = m:section(Table, t)
@@ -249,15 +222,13 @@ o.inputtitle = translate("Read Config")
o.inputstyle = "apply"
o.write = function()
m.uci:commit("openclash")
luci.sys.call("/usr/share/openclash/yml_groups_get.sh 2>/dev/null &")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
luci.sys.call("/usr/share/openclash/yml_groups_get.sh \"%s\" 2>/dev/null" % file_path)
end
o = a:option(Button, "Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
fs.unlink("/tmp/Proxy_Group")
m.uci:commit("openclash")
end
@@ -266,9 +237,14 @@ o.inputtitle = translate("Apply Settings")
o.inputstyle = "apply"
o.write = function()
m.uci:commit("openclash")
fs.unlink("/tmp/Proxy_Group")
luci.sys.call("/usr/share/openclash/yml_groups_set.sh >/dev/null 2>&1 &")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
luci.sys.call("/usr/share/openclash/yml_groups_set.sh \"%s\" >/dev/null 2>&1 &" % file_path)
end
o = a:option(Button,"Back", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "apply"
o.write = function()
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
end
m:append(Template("openclash/toolbar_show"))
@@ -8,6 +8,13 @@ local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor()
local json = require "luci.jsonc"
local datatype = require "luci.cbi.datatypes"
local net = require "luci.model.network".init()
local devices = {}
for _, iface in ipairs(net:get_interfaces()) do
if iface:name() then
table.insert(devices, {name = iface:name()})
end
end
-- 优化 CBI UI(新版 LuCI 专用)
local function optimize_cbi_ui()
@@ -72,7 +79,6 @@ s:tab("auto_restart", translate("Auto Restart"))
s:tab("version_update", translate("Version Update"))
s:tab("developer", translate("Developer Settings"))
s:tab("debug", translate("Debug Logs"))
s:tab("dlercloud", translate("Dler Cloud"))
o = s:taboption("op_mode", ListValue, "en_mode", font_red..bold_on..translate("Select Mode")..bold_off..font_off)
o.description = translate("Select Mode For OpenClash Work, Try Flush DNS Cache If Network Error")
@@ -218,6 +224,10 @@ o = s:taboption("lan_ac", DynamicList, "wan_ac_black_ips", translate("WAN Bypass
o.datatype = "ipmask"
o.description = translate("In The Fake-IP Mode, Only Pure IP Requests Are Supported, Please Setting Fake-IP-Filter First If You Need Domain Type Requests")
o = s:taboption("lan_ac", DynamicList, "wan_ac_black_ports", translate("WAN Bypassed Port List"))
o.datatype = "or(port, portrange)"
o.description = translate("In The Fake-IP Mode, Only Pure IP Requests Are Supported, Please Setting Fake-IP-Filter First If You Need Domain Type Requests")
s2 = m:section(TypedSection, "lan_ac_traffic", translate("Lan Traffic Access List"),
"1. "..translate("The Traffic From The Local Specified Port Will Not Pass The Core, Try To Set When The Bypass Gateway Forwarding Fails").."; ".."2. "..translate("In The Fake-IP Mode, Only Pure IP Requests Are Supported, Please Setting Fake-IP-Filter First If You Need Domain Type Requests"))
@@ -268,6 +278,42 @@ o:value("both", translate("Both"))
o.default = "tcp"
o.rmempty = false
o = s2:option(ListValue, "interface", translate("Interface"))
o:value("")
o.default = ""
for _, dev in ipairs(devices) do
o:value(dev.name)
end
o.rmempty = true
o = s2:option(ListValue, "user", translate("User"))
o:value("")
o.default = ""
local passwd_content = NXFS.readfile("/etc/passwd")
local users = ""
if passwd_content then
for line in string.gmatch(passwd_content, "[^\n]+") do
if line:match("^[^#]") and line:match(":") then
local fields = {}
for field in string.gmatch(line, "([^:]+)") do
table.insert(fields, field)
end
if #fields >= 3 then
local username = fields[1]
local uid_str = fields[3]
local uid = tonumber(uid_str)
if uid and uid >= 0 then
users = users .. uid .. ":" .. username .. "\n"
end
end
end
end
end
for uid, username in string.gmatch(users, "(%d+):(%S+)") do
o:value(uid, username)
end
o.rmempty = true
o = s2:option(Value, "dscp", translate("DSCP"))
o.datatype = "range(0,63)"
o.rmempty = true
@@ -417,17 +463,16 @@ o.default = 1
o = s:taboption("traffic_control", DynamicList, "intranet_allowed_wan_name", translate("WAN Interface Name"))
o.description = translate("Select WAN Interface Name For The Intranet Allowed")
o:depends("intranet_allowed", "1")
local interfaces = SYS.exec("ls -l /sys/class/net/ 2>/dev/null |awk '{print $9}' 2>/dev/null")
for interface in string.gmatch(interfaces, "%S+") do
o:value(interface)
for _, dev in ipairs(devices) do
o:value(dev.name)
end
o = s:taboption("traffic_control", ListValue, "lan_interface_name", translate("LAN Interface Name"))
o.description = translate("Select LAN Interface Name")
o:value("0", translate("Disable"))
o.default = "0"
for interface in string.gmatch(interfaces, "%S+") do
o:value(interface)
for _, dev in ipairs(devices) do
o:value(dev.name)
end
o = s:taboption("traffic_control", Value, "local_network_pass", translate("Local IPv4 Network Bypassed List"))
@@ -841,42 +886,6 @@ o.value = "OpenAI"
o:depends("stream_auto_select_openai", "1")
---- update Settings
o = s:taboption("rules_update", Flag, "other_rule_auto_update", translate("Auto Update"))
o.description = font_red..bold_on..translate("Auto Update Other Rules")..bold_off..font_off
o.default = 0
o = s:taboption("rules_update", ListValue, "other_rule_update_week_time", translate("Update Time (Every Week)"))
o:depends("other_rule_auto_update", "1")
o:value("*", translate("Every Day"))
o:value("1", translate("Every Monday"))
o:value("2", translate("Every Tuesday"))
o:value("3", translate("Every Wednesday"))
o:value("4", translate("Every Thursday"))
o:value("5", translate("Every Friday"))
o:value("6", translate("Every Saturday"))
o:value("0", translate("Every Sunday"))
o.default = "1"
o = s:taboption("rules_update", ListValue, "other_rule_update_day_time", translate("Update time (every day)"))
o:depends("other_rule_auto_update", "1")
for t = 0,23 do
o:value(t, t..":00")
end
o.default = "0"
o = s:taboption("rules_update", Button, translate("Other Rules Update"))
o:depends("other_rule_auto_update", "1")
o.title = translate("Update Other Rules")
o.inputtitle = translate("Check And Update")
o.description = translate("Other Rules Update(Only in Use)")..", "..translate("Current Version:").." "..font_green..bold_on..translate(fs.get_resourse_mtime("/usr/share/openclash/res/lhie1.yaml"))..bold_off..font_off
o.inputstyle = "reload"
o.write = function()
m.uci:set("openclash", "config", "enable", 1)
m.uci:commit("openclash")
SYS.call("/usr/share/openclash/openclash_rule.sh >/dev/null 2>&1 &")
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
end
o = s:taboption("geo_update", Flag, "geo_auto_update", font_red..bold_on..translate("Auto Update GeoIP MMDB")..bold_off..font_off)
o.default = 0
@@ -911,7 +920,7 @@ o:depends("geo_auto_update", "1")
o = s:taboption("geo_update", Button, translate("GEOIP Update"))
o.title = translate("Update GeoIP MMDB")
o.description = translate("Current Version:").." "..font_green..bold_on..translate(fs.get_resourse_mtime("/etc/openclash/Country.mmdb"))..bold_off..font_off
o.description = translate("Current Version:").." "..font_green..bold_on..fs.get_resourse_mtime("/etc/openclash/Country.mmdb")..bold_off..font_off
o.inputtitle = translate("Check And Update")
o.inputstyle = "reload"
o.write = function()
@@ -954,7 +963,7 @@ o:depends("geoip_auto_update", "1")
o = s:taboption("geo_update", Button, translate("GEOIP Dat Update"))
o.title = translate("Update GeoIP Dat")
o.description = translate("Current Version:").." "..font_green..bold_on..translate(fs.get_resourse_mtime("/etc/openclash/GeoIP.dat"))..bold_off..font_off
o.description = translate("Current Version:").." "..font_green..bold_on..fs.get_resourse_mtime("/etc/openclash/GeoIP.dat")..bold_off..font_off
o.inputtitle = translate("Check And Update")
o.inputstyle = "reload"
o.write = function()
@@ -997,7 +1006,7 @@ o:depends("geosite_auto_update", "1")
o = s:taboption("geo_update", Button, translate("GEOSITE Update"))
o.title = translate("Update GeoSite Database")
o.description = translate("Current Version:").." "..font_green..bold_on..translate(fs.get_resourse_mtime("/etc/openclash/GeoSite.dat"))..bold_off..font_off
o.description = translate("Current Version:").." "..font_green..bold_on..fs.get_resourse_mtime("/etc/openclash/GeoSite.dat")..bold_off..font_off
o.inputtitle = translate("Check And Update")
o.inputstyle = "reload"
o.write = function()
@@ -1040,7 +1049,7 @@ o:depends("geoasn_auto_update", "1")
o = s:taboption("geo_update", Button, translate("ASN Update"))
o.title = translate("Update Geo ASN Database")
o.description = translate("Current Version:").." "..font_green..bold_on..translate(fs.get_resourse_mtime("/etc/openclash/ASN.mmdb"))..bold_off..font_off
o.description = translate("Current Version:").." "..font_green..bold_on..fs.get_resourse_mtime("/etc/openclash/ASN.mmdb")..bold_off..font_off
o.inputtitle = translate("Check And Update")
o.inputstyle = "reload"
o.write = function()
@@ -1090,6 +1099,7 @@ o.default = "https://ispip.clang.cn/all_cn_ipv6.txt"
o = s:taboption("chnr_update", Button, translate("Chnroute Lists Update"))
o.title = translate("Update Chnroute Lists")
o.description = translate("Current Version:").." "..font_green..bold_on.. "IPv4 ("..fs.get_resourse_mtime("/etc/openclash/china_ip_route.ipset")..")"..bold_off..font_off.." "..font_green..bold_on.. "& IPv6 ("..fs.get_resourse_mtime("/etc/openclash/china_ip6_route.ipset")..")"..bold_off..font_off
o.inputtitle = translate("Check And Update")
o.inputstyle = "reload"
o.write = function()
@@ -1298,54 +1308,6 @@ end
o = s:taboption("debug", DummyValue, "", nil)
o.template = "openclash/debug"
---- dlercloud
o = s:taboption("dlercloud", Value, "dler_email")
o.title = translate("Account Email Address")
o.rmempty = true
o = s:taboption("dlercloud", Value, "dler_passwd")
o.title = translate("Account Password")
o.password = true
o.rmempty = true
if fs.uci_get_config("config", "dler_token") then
o = s:taboption("dlercloud", Flag, "dler_checkin")
o.title = translate("Checkin")
o.default = 0
o.rmempty = true
end
o = s:taboption("dlercloud", Value, "dler_checkin_interval")
o.title = translate("Checkin Interval (hour)")
o:depends("dler_checkin", "1")
o.default = "1"
o.rmempty = true
o = s:taboption("dlercloud", Value, "dler_checkin_multiple")
o.title = translate("Checkin Multiple")
o.datatype = "uinteger"
o.default = "1"
o:depends("dler_checkin", "1")
o.rmempty = true
o.description = font_green..bold_on..translate("Multiple Must Be a Positive Integer and No More Than 100")..bold_off..font_off
function o.validate(self, value)
if tonumber(value) < 1 then
return "1"
end
if tonumber(value) > 100 then
return "100"
end
return value
end
o = s:taboption("dlercloud", DummyValue, "dler_login", translate("Account Login"))
o.template = "openclash/dler_login"
if fs.uci_get_config("config", "dler_token") then
o.value = font_green..bold_on..translate("Account logged in")..bold_off..font_off
else
o.value = font_red..bold_on..translate("Account not logged in")..bold_off..font_off
end
local t = {
{Commit, Apply}
}
@@ -315,12 +315,15 @@ function get_resourse_mtime(path)
end
end
local file = fs.readlink(real_path) or real_path
local model_version = os.date("%Y-%m-%d %H:%M:%S", mtime(real_path))
if model_version and model_version ~= "" then
return model_version
else
return "Unknown"
end
local resourse_etag_version = SYS.exec(string.format("source /usr/share/openclash/openclash_etag.sh && GET_ETAG_TIMESTAMP_BY_PATH '%s'", real_path))
if resourse_etag_version and resourse_etag_version ~= "" then
return resourse_etag_version
end
local resourse_version = os.date("%Y-%m-%d %H:%M:%S", mtime(real_path))
if resourse_version and resourse_version ~= "" then
return resourse_version
end
return "Unknown"
end
function uci_get_config(section, key)
@@ -1,4 +1,8 @@
<style>
@font-face {
font-family: 'Twemoji Mozilla';
src: url('/luci-static/resources/openclash/fonts/TwemojiMozilla-flags-B12sb_Bp.woff2') format('woff2');
}
.oc[data-darkmode="true"] .config-editor-model .CodeMirror {
background: var(--bg-white);
color: var(--text-primary);
@@ -308,6 +312,12 @@
.oc .config-editor-model .CodeMirror.zoom-125 { font-size: 17.5px; }
.oc .config-editor-model .CodeMirror.zoom-150 { font-size: 21px; }
.oc .config-editor-model .CodeMirror.zoom-200 { font-size: 28px; }
.oc .config-editor-model .CodeMirror, .oc .config-editor-model .CodeMirror-line {
font-family: 'Twemoji Mozilla', "Microsoft Yahei", "sans-serif", "Helvetica Neue", "Helvetica", "Hiragino Sans GB" !important;
}
.oc .config-editor-model .CodeMirror-hints.log {
font-family: 'Twemoji Mozilla', "Open Sans", "PingFangSC-Regular", "Microsoft Yahei", "WenQuanYi Micro Hei", "Helvetica Neue", "Helvetica", "Hiragino Sans GB", "sans-serif" !important;
}
#config-mergeview-container .CodeMirror-merge,
#config-mergeview-container .CodeMirror-merge-pane,
#config-mergeview-container .CodeMirror,
@@ -611,7 +621,6 @@
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/search/matchesonscrollbar.css">
<script src="/luci-static/resources/openclash/lib/codemirror.js"></script>
<script src="/luci-static/resources/openclash/mode/yaml/yaml.js"></script>
<script src="/luci-static/resources/openclash/mode/lua/lua.js"></script>
<script src="/luci-static/resources/openclash/mode/shell/shell.js"></script>
<script src="/luci-static/resources/openclash/mode/properties/properties.js"></script>
<script src="/luci-static/resources/openclash/addon/fold/foldcode.js"></script>
@@ -635,6 +644,16 @@
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/merge/merge.css">
<script type="text/javascript">
var levelTranslations = {
'info': '<%:Info%>',
'warning': '<%:Warning%>',
'error': '<%:Error%>',
'debug': '<%:Debug%>',
'tip': '<%:Tip%>',
'watchdog': '<%:Watchdog%>',
'fatal': '<%:Fatal%>'
};
var ConfigEditor = {
overlay: null,
model: null,
@@ -9,7 +9,7 @@
border: none !important;
}
.CodeMirror-merge-r-chunk {
background: #0095ff2e !important;
background: #0095ff2e !important;
}
.CodeMirror-merge-2pane .CodeMirror-merge-gap {
height: 700px !important;
@@ -28,15 +28,22 @@
box-sizing: border-box;
word-break: break-all !important;
overflow-wrap: break-word !important;
font-family: 'Twemoji Mozilla', "Microsoft Yahei", "sans-serif", "Helvetica Neue", "Helvetica", "Hiragino Sans GB" !important;
}
.CodeMirror-hints.log {
font-family: 'Twemoji Mozilla', "Open Sans", "PingFangSC-Regular", "Microsoft Yahei", "WenQuanYi Micro Hei", "Helvetica Neue", "Helvetica", "Hiragino Sans GB", "sans-serif" !important;
}
:root[data-darkmode="true"] .CodeMirror-merge-gap {
background: #d0cfcf !important;
}
@font-face {
font-family: 'Twemoji Mozilla';
src: url('/luci-static/resources/openclash/fonts/TwemojiMozilla-flags-B12sb_Bp.woff2') format('woff2');
}
</style>
<link rel="stylesheet" href="/luci-static/resources/openclash/lib/codemirror.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/material.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/material-log.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/idea.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/log.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/fold/foldgutter.css"/>
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/lint/lint.css">
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/display/fullscreen.css">
@@ -44,7 +51,7 @@
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/search/matchesonscrollbar.css">
<script src="/luci-static/resources/openclash/lib/codemirror.js"></script>
<script src="/luci-static/resources/openclash/mode/yaml/yaml.js"></script>
<script src="/luci-static/resources/openclash/mode/lua/lua.js"></script>
<script src="/luci-static/resources/openclash/mode/log/log.js"></script>
<script src="/luci-static/resources/openclash/mode/shell/shell.js"></script>
<script src="/luci-static/resources/openclash/addon/fold/foldcode.js"></script>
<script src="/luci-static/resources/openclash/addon/fold/foldgutter.js"></script>
@@ -72,14 +79,16 @@ local fs = require "luci.openclash"
local conf = fs.uci_get_config("config", "config_path")
if not conf then conf = "/etc/openclash/config/config.yaml" end
local conf_name = fs.basename(conf)
if not conf_name then conf_name = "config.yaml" end
if not conf_name then conf_name = "config.yaml" end
local sconf = "/etc/openclash/"..conf_name
local path_info = os.getenv("PATH_INFO") or ""
local sid = path_info:match("(cfg[0-9a-f]+)") or ""
-%>
<table id="my_editor_div" style="width: 100%; text-align: center; display: none;">
<tr>
<td style="width: 50%; overflow: hidden;"><%:Modify Your Config file:%> <b style=color:green><%=conf_name%></b> <%:Here, Except The Settings That Were Taken Over%></td>
<%-
if fs.isfile(sconf) then
-%>
@@ -95,6 +104,15 @@ local sconf = "/etc/openclash/"..conf_name
</table>
<script type="text/javascript">//<![CDATA[
var levelTranslations = {
'info': '<%:Info%>',
'warning': '<%:Warning%>',
'error': '<%:Error%>',
'debug': '<%:Debug%>',
'tip': '<%:Tip%>',
'watchdog': '<%:Watchdog%>',
'fatal': '<%:Fatal%>'
};
function isDarkBackground(element) {
var cachedTheme = localStorage.getItem('oc-theme');
@@ -209,8 +227,8 @@ function merge_editor(id, id2, target, target2, readOnly, readOnly2, wid, height
});
merge_editor.edit.on("change", function(cm) {
id.value = cm.getValue();
});
id.value = cm.getValue();
});
if (wid && height) {
merge_editor.editor().setSize(wid, height);
@@ -233,27 +251,27 @@ function editor(id, readOnly, wid, height)
lint: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter", "CodeMirror-lint-markers"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
});
if (readOnly == "true") {
if (readOnly) {
editor.setOption("readOnly","true");
};
if (wid && height) {
editor.setSize(wid, height);
};
@@ -272,21 +290,21 @@ function shell_editor(id, readOnly, wid, height)
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
});
if (wid && height) {
@@ -297,7 +315,7 @@ function shell_editor(id, readOnly, wid, height)
function other_editor(id, readOnly, wid, height)
{
var editor = CodeMirror.fromTextArea(id, {
mode: "lua",
mode: "text/yaml",
autoRefresh: true,
styleActiveLine: true,
lineNumbers: true,
@@ -307,21 +325,21 @@ function other_editor(id, readOnly, wid, height)
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
},
"Tab": function(cm) {
if (cm.somethingSelected()) {
cm.indentSelection('add')
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
cm.replaceSelection(spaces)
}
}
}
});
if (wid && height) {
@@ -329,52 +347,56 @@ function other_editor(id, readOnly, wid, height)
};
};
function other_log_area(id, readOnly, wid, height)
function log_editor(id, name, readOnly, wid, height)
{
var other_log_area = CodeMirror.fromTextArea(id, {
mode: "lua",
window['editor_' + name] = CodeMirror.fromTextArea(id, {
mode: "log",
autoRefresh: true,
styleActiveLine: true,
lineNumbers: true,
theme: "idea",
theme: "log",
lineWrapping: true,
matchBrackets: true,
matchBrackets: false,
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
if (readOnly == "true") {
other_log_area.setOption("readOnly","true");
if (readOnly) {
window['editor_' + name].setOption("readOnly","true");
};
if (wid && height) {
other_log_area.setSize(wid, height);
window['editor_' + name].setSize(wid, height);
};
if (isDarkBackground(document.body)) {
document.documentElement.setAttribute('data-darkmode', 'true');
};
other_log_area.markText({line:0,ch:0},{line:9999,ch:9999}, {css: 'font-size:13px'});
};
var custom_cfg_value = document.getElementById("cbid.openclash." + window.location.pathname.split("/")[window.location.pathname.split("/").length - 1] + ".other_parameters");
var core_log = document.getElementById("core_log");
var oc_log = document.getElementById("cbid.openclash.config.clog");
if (core_log && oc_log) {
log_editor(oc_log, 'oc', true, '100%', '540px');
log_editor(core_log, 'core', true, '100%', '540px');
};
var custom_cfg_value = document.getElementById("cbid.openclash.<%=sid%>.other_parameters");
if (custom_cfg_value) {
editor(custom_cfg_value, 'false', '100%', '300px');
editor(custom_cfg_value, false, '100%', '300px');
};
var custom_firewall = document.getElementById("cbid.openclash.config.firewall_custom");
var custom_ymchange = document.getElementById("cbid.openclash.config.ymchange_custom");
if (custom_firewall) {
shell_editor(custom_firewall, 'false', "100%", '300px');
};
if (custom_ymchange) {
shell_editor(custom_ymchange, 'false', "100%", '300px');
shell_editor(custom_firewall, false, "100%", '300px');
};
var myEditor_use = document.getElementById("cbid.table.1.user");
@@ -383,7 +405,7 @@ var myEditor_def = document.getElementById("cbid.table.1.default");
if (myEditor_use && myEditor_def) {
var myEditor_div_use = document.getElementById("cbi-table-1-user");
var myEditor_div_def = document.getElementById("cbi-table-1-default");
myEditor_div_def.parentNode.parentNode.style.cssText="text-align: left !important"
myEditor_div_def.parentNode.className='cbi-value';
myEditor_div_def.parentNode.style.display="revert"
@@ -392,7 +414,7 @@ if (myEditor_use && myEditor_def) {
myEditor_div_use.parentNode.className='cbi-value';
myEditor_div_use.parentNode.style.display="revert"
myEditor_div_use.parentNode.style.width="100%"
merge_editor(myEditor_use, myEditor_def, myEditor_div_use, myEditor_div_def, 'true', 'false', 'auto', '700px');
merge_editor(myEditor_use, myEditor_def, myEditor_div_use, myEditor_div_def, true, false, 'auto', '700px');
};
var myEditor_hosts = document.getElementById("cbid.openclash.config.custom_hosts");
@@ -407,98 +429,44 @@ var myEditor_custom_sniffer = document.getElementById("cbid.openclash.config.sni
var myEditor_proxy_name_pol = document.getElementById("cbid.openclash.config.custom_proxy_server_dns_policy");
if (myEditor_hosts) {
editor(myEditor_hosts, 'false', '100%', '300px');
editor(myEditor_hosts, false, '100%', '300px');
};
if (myEditor_edit_file) {
editor(myEditor_edit_file, 'false', '100%', '700px');
editor(myEditor_edit_file, false, '100%', '700px');
};
if (myEditor_fall_fil) {
editor(myEditor_fall_fil, 'false', '100%', '300px');
editor(myEditor_fall_fil, false, '100%', '300px');
};
if (myEditor_name_pol) {
editor(myEditor_name_pol, 'false', '100%', '300px');
editor(myEditor_name_pol, false, '100%', '300px');
};
if (myEditor_proxy_name_pol) {
editor(myEditor_proxy_name_pol, 'false', '100%', '300px');
editor(myEditor_proxy_name_pol, false, '100%', '300px');
};
if (myEditor_name_cus_r1) {
editor(myEditor_name_cus_r1, 'false', '100%', '300px');
editor(myEditor_name_cus_r2, 'false', '100%', '300px');
editor(myEditor_name_cus_r1, false, '100%', '300px');
editor(myEditor_name_cus_r2, false, '100%', '300px');
};
if (myEditor_fake_filter) {
other_editor(myEditor_fake_filter, 'false', '100%', '300px');
other_editor(myEditor_fake_filter, false, '100%', '300px');
};
if (myEditor_custom_domain_dns) {
other_editor(myEditor_custom_domain_dns, 'false', '100%', '300px');
other_editor(myEditor_custom_domain_dns, false, '100%', '300px');
};
if (myEditor_custom_sniffer) {
other_editor(myEditor_custom_sniffer, 'false', '100%', '300px');
};
var core_log = document.getElementById("core_log");
var oc_log = document.getElementById("cbid.openclash.config.clog");
if (core_log && oc_log) {
var core_editor = CodeMirror.fromTextArea(core_log, {
mode: "lua",
autoRefresh: true,
styleActiveLine: true,
lineNumbers: true,
theme: "idea",
lineWrapping: true,
matchBrackets: true,
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
var oc_editor = CodeMirror.fromTextArea(oc_log, {
mode: "lua",
autoRefresh: true,
styleActiveLine: true,
lineNumbers: true,
theme: "idea",
lineWrapping: true,
matchBrackets: true,
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
extraKeys: {
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
core_editor.setSize("100%", "540px");
core_editor.setOption("readOnly","true");
oc_editor.setSize("100%", "540px");
oc_editor.setOption("readOnly","true");
if (isDarkBackground(document.body)) {
core_editor.setOption('theme', 'material-log');
oc_editor.setOption('theme', 'material-log');
document.documentElement.setAttribute('data-darkmode', 'true');
};
other_editor(myEditor_custom_sniffer, false, '100%', '300px');
};
var proxy_mg = document.getElementById('cbi-table-1-proxy_mg');
var rule_mg = document.getElementById('cbi-table-1-rule_mg');
var game_mg = document.getElementById('cbi-table-1-game_mg');
var Commit = document.getElementById('cbi-table-1-Commit');
var Apply = document.getElementById('cbi-table-1-Apply');
var Create = document.getElementById('cbi-table-1-Create');
@@ -506,7 +474,6 @@ var Create = document.getElementById('cbi-table-1-Create');
if (proxy_mg) {
proxy_mg.style.textAlign="center";
rule_mg.style.textAlign="center";
game_mg.style.textAlign="center";
Commit.style.textAlign="center";
Apply.style.textAlign="center";
Create.style.textAlign="center";
@@ -785,7 +785,6 @@
<label for="convert-address-input"><%:Convert Address%>:</label>
<div class="form-select-wrapper">
<select id="convert-address-input" class="form-select">
<option value="https://api.dler.io/sub">api.dler.io (<%:Default%>)</option>
<option value="https://api.wcc.best/sub">api.wcc.best</option>
<option value="https://api.asailor.org/sub">api.asailor.org</option>
<option value="custom"><%:Custom%></option>
@@ -901,24 +900,24 @@
<label for="exclude-default-select"><%:Exclude Keyword Match Default%>:</label>
<div class="form-checkbox-group">
<label class="form-checkbox">
<input type="checkbox" id="exclude-expire" value="过期时间">
<input type="checkbox" id="exclude-expire" value="<%:Expire%>">
<span class="checkmark"></span>
<%:Expire Time%>
<%:Expire%>
</label>
<label class="form-checkbox">
<input type="checkbox" id="exclude-traffic" value="剩余流量">
<input type="checkbox" id="exclude-traffic" value="<%:Traffic%>">
<span class="checkmark"></span>
<%:Remaining Traffic%>
<%:Traffic%>
</label>
<label class="form-checkbox">
<input type="checkbox" id="exclude-tg" value="TG群">
<input type="checkbox" id="exclude-plan" value="<%:Plan%>">
<span class="checkmark"></span>
<%:TG Group%>
<%:Plan%>
</label>
<label class="form-checkbox">
<input type="checkbox" id="exclude-website" value="官网">
<input type="checkbox" id="exclude-website" value="<%:Official%>">
<span class="checkmark"></span>
<%:Official Website%>
<%:Official%>
</label>
</div>
</div>
@@ -1160,7 +1159,7 @@ var ConfigUploader = {
resetAdvancedOptions: function() {
document.getElementById('sub-convert-enable').checked = false;
document.getElementById('sub-convert-options').style.display = 'none';
document.getElementById('convert-address-input').value = 'https://api.dler.io/sub';
document.getElementById('convert-address-input').selectedIndex = 0;
document.getElementById('convert-address-custom').style.display = 'none';
document.getElementById('convert-address-custom').value = '';
@@ -1184,7 +1183,7 @@ var ConfigUploader = {
document.getElementById('exclude-keyword-input').value = '';
document.getElementById('exclude-expire').checked = false;
document.getElementById('exclude-traffic').checked = false;
document.getElementById('exclude-tg').checked = false;
document.getElementById('exclude-plan').checked = false;
document.getElementById('exclude-website').checked = false;
},
@@ -1249,7 +1248,7 @@ var ConfigUploader = {
document.getElementById('sub-convert-options').style.display = 'block';
if (data.convert_address) {
if (data.convert_address === 'https://api.dler.io/sub' || data.convert_address === 'https://api.wcc.best/sub' || data.convert_address === 'https://api.asailor.org/sub') {
if (data.convert_address === 'https://api.wcc.best/sub' || data.convert_address === 'https://api.asailor.org/sub') {
document.getElementById('convert-address-input').value = data.convert_address;
if (data.convert_address === 'custom') {
document.getElementById('convert-address-custom').style.display = 'block';
@@ -1303,10 +1302,10 @@ var ConfigUploader = {
}
if (data.de_ex_keyword) {
var defaults = data.de_ex_keyword.split(' ');
document.getElementById('exclude-expire').checked = defaults.indexOf('过期时间') !== -1;
document.getElementById('exclude-traffic').checked = defaults.indexOf('剩余流量') !== -1;
document.getElementById('exclude-tg').checked = defaults.indexOf('TG群') !== -1;
document.getElementById('exclude-website').checked = defaults.indexOf('官网') !== -1;
document.getElementById('exclude-expire').checked = defaults.indexOf(document.getElementById('exclude-expire').value) !== -1;
document.getElementById('exclude-traffic').checked = defaults.indexOf(document.getElementById('exclude-traffic').value) !== -1;
document.getElementById('exclude-plan').checked = defaults.indexOf(document.getElementById('exclude-plan').value) !== -1;
document.getElementById('exclude-website').checked = defaults.indexOf(document.getElementById('exclude-website').value) !== -1;
}
}
},
@@ -1520,7 +1519,7 @@ var ConfigUploader = {
var advancedEnabled = document.getElementById('advanced-options-enable').checked;
var subConvert = advancedEnabled && document.getElementById('sub-convert-enable').checked;
var convertAddress = 'https://api.dler.io/sub';
var convertAddress = '';
var template = '';
var emoji = false;
var udp = false;
@@ -1548,13 +1547,13 @@ var ConfigUploader = {
keywords = document.getElementById('keyword-input').value;
excludeKeywords = document.getElementById('exclude-keyword-input').value;
if (document.getElementById('exclude-expire').checked) excludeDefaults.push('过期时间');
if (document.getElementById('exclude-traffic').checked) excludeDefaults.push('剩余流量');
if (document.getElementById('exclude-tg').checked) excludeDefaults.push('TG群');
if (document.getElementById('exclude-website').checked) excludeDefaults.push('官网');
if (document.getElementById('exclude-expire').checked) excludeDefaults.push(document.getElementById('exclude-expire').value);
if (document.getElementById('exclude-traffic').checked) excludeDefaults.push(document.getElementById('exclude-traffic').value);
if (document.getElementById('exclude-plan').checked) excludeDefaults.push(document.getElementById('exclude-plan').value);
if (document.getElementById('exclude-website').checked) excludeDefaults.push(document.getElementById('exclude-website').value);
if (convertAddress === 'custom') {
convertAddress = convertAddressCustom.trim() || 'https://api.dler.io/sub';
convertAddress = convertAddressCustom.trim();
}
if (template === '0') {
@@ -10,7 +10,13 @@ local dns_host = "www.instagram.com"
<style>
:root[data-darkmode="true"] .diag-style {
background-color: #404040;
color: #ffffff;
background-color: #404040;
}
:root[data-darkmode="true"] .diag-style select, .diag-style input {
color: #ffffff;
background-color: #404040;
}
:root[data-darkmode="true"] #diag-rc-output > pre {
@@ -24,6 +30,12 @@ local dns_host = "www.instagram.com"
}
.diag-style {
color: #000;
background-color: #f5f5f5;
}
.diag-style select, .diag-style input {
color: #000;
background-color: #f5f5f5;
}
@@ -57,12 +69,6 @@ local dns_host = "www.instagram.com"
<script type="text/javascript">//<![CDATA[
setTimeout(function(){
if (isDarkBackground(document.body)) {
document.documentElement.setAttribute('data-darkmode', 'true');
};
}, 300);
function show_diag_info(addr)
{
var addr = addr;
File diff suppressed because one or more lines are too long
@@ -1,111 +0,0 @@
<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
function dler_login(btn,option)
{
btn.disabled = true;
if (option == "dler_login") {
var s = document.getElementById(option+'-status');
var e = document.getElementsByName('cbid.openclash.config.dler_email');
var p = document.getElementsByName('cbid.openclash.config.dler_passwd');
var c = document.getElementsByName('cbid.openclash.config.dler_checkin');
if (!e[0].value || !p[0].value) {
btn.disabled = false;
s.innerHTML ="<font color='red'><strong>"+"<%:Error Login Info%>"+"</strong></font>";
return false;
};
if (c[0] && c[0].checked) {
c = "1";
var i = document.getElementsByName('cbid.openclash.config.dler_checkin_interval');
var m = document.getElementsByName('cbid.openclash.config.dler_checkin_multiple');
if (!i[0].value || !(/(^[1-9]\d*$)/.test(i[0].value))) { i = "1"} else {i = i[0].value};
if (!m[0].value || !(/(^[1-9]\d*$)/.test(m[0].value)))
{
btn.disabled = false;
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 100%>"+"</strong></font>";
return false;
}
else if (m[0].value < 1)
{
btn.disabled = false;
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 100%>"+"</strong></font>";
return false;
}
else if (m[0].value > 100)
{
btn.disabled = false;
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 100%>"+"</strong></font>";
return false;
}
else {
m = m[0].value;
};
}
else {
c = "0";
var i = "1";
var m = "1";
};
btn.value = '<%:Login...%>';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_login_info_save")%>', {email: e[0].value, passwd : p[0].value, checkin: c, interval: i, multiple: m}, function(x, status) {
if (x && x.status == 200) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_login")%>', null, function(x, status) {
if (s)
{
if (x && x.status == 200 && status.dler_login == 200) {
s.innerHTML ="<font color='green'><strong>"+"<%:Dler Cloud Login Successful%>"+"</strong></font>";
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
}
else {
s.innerHTML ="<font color='red'><strong>"+"<%:Dler Cloud Login Faild%>"+"</strong></font>";
if (status.dler_login) {
alert("<%:Dler Cloud Login Faild%>: "+status.dler_login)
}
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
}
}
btn.disabled = false;
btn.value = '<%:Login Account%>';
});
}
});
};
if (option == "dler_logout") {
var s = document.getElementById('dler_login-status');
btn.value = '<%:Logout...%>';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_logout")%>', null, function(x, status) {
if (s)
{
if (x && x.status == 200 && status.dler_logout == 200) {
s.innerHTML ="<font color='green'><strong>"+"<%:Dler Cloud Logout Successful%>"+"</strong></font>";
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
}
else {
s.innerHTML ="<font color='red'><strong>"+"<%:Dler Cloud Logout Faild%>"+"</strong></font>";
if (status.dler_logout) {
alert("<%:Dler Cloud Logout Faild%>: "+status.dler_logout)
}
}
}
btn.disabled = false;
btn.value = '<%:Logout Account%>';
}
);
};
return false;
}
function web_dler(btn)
{
btn.disabled = true;
url='https://bit.ly/32mrABp';
window.open(url);
btn.disabled = false;
return false;
}
//]]></script>
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Login Account%>" onclick="return dler_login(this,'dler_login')" />
<input type="button" class="btn cbi-button cbi-button-remove" value="<%:Logout Account%>" onclick="return dler_login(this,'dler_logout')" />
<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Official Website%>" onclick="return web_dler(this)" />
<span id="<%=self.option%>-status"><%=self.value%></span>
<%+cbi/valuefooter%>
File diff suppressed because one or more lines are too long
@@ -1,41 +0,0 @@
<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
function act_download_rule(btn,filename)
{
btn.disabled = true;
btn.value = '<%:Downloading Rule...%> ';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","download_rule")%>',
{
filename: filename
},
function(x,status)
{
if ( x && x.status == 200 ) {
if(status.rule_download_status=="0")
{
btn.value = '<%:Download Failed%>';
}
else if (status.rule_download_status=="1")
{
btn.value = '<%:Download Successful%>';
}
else if (status.rule_download_status=="2")
{
btn.value = '<%:Rule No Change%>';
}
}
else {
btn.value = '<%:Download Timeout%>';
}
}
);
btn.disabled = false;
return false;
}
//]]></script>
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Click to Update%>" onclick="return act_download_rule(this,'<%=self:cfgvalue(section)%>')" />
<%+cbi/valuefooter%>
@@ -3,15 +3,15 @@
*{margin: 0;padding: 0;}
ul{
list-style: none;
list-style: none;
}
#tab{
width: 100%;
height: 100%;
border: 1px solid #ddd;
box-shadow: 0 0 2px #ddd;
overflow: hidden;
width: 100%;
height: 100%;
border: 1px solid #ddd;
box-shadow: 0 0 2px #ddd;
overflow: hidden;
}
#tab-header {
@@ -120,7 +120,7 @@ ul{
}
#tab-content .dom{
display: none;
display: none;
}
#tab-content .dom ul li{
@@ -233,66 +233,66 @@ ul{
}
:root[data-darkmode="true"] {
.radio-button {
background: #374151;
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.15);
}
.radio-button label {
background: #1f2937;
color: #d1d5db;
border-color: #4b5563;
}
.radio-button label:hover {
color: #3b82f6;
border-color: #3b82f6;
background: #22304a;
}
.radio-button input[type="radio"]:checked + label {
background: #3b82f6;
color: #fff;
border-color: #3b82f6;
box-shadow: 0 1px 2px 0 rgba(59,130,246,0.18);
}
.radio-button {
background: #374151;
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.15);
}
.radio-button label {
background: #1f2937;
color: #d1d5db;
border-color: #4b5563;
}
.radio-button label:hover {
color: #3b82f6;
border-color: #3b82f6;
background: #22304a;
}
.radio-button input[type="radio"]:checked + label {
background: #3b82f6;
color: #fff;
border-color: #3b82f6;
box-shadow: 0 1px 2px 0 rgba(59,130,246,0.18);
}
}
</style>
<body>
<div id="tab" class="cbi-section">
<div id="tab-header">
<ul class="cbi-tabmenu">
<li name="tab-header" class="cbi-tab"><a href="#"><%:OpenClash Log%></a></li>
<li name="tab-header" class="cbi-tab-disabled"><a href="#"><%:Core Log%></a></li>
</ul>
</div>
<div id="tab-content">
<div class="dom" style="display: block;">
<textarea id="cbid.openclash.config.clog" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
</div>
<div class="dom">
<textarea id="core_log" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
<div class="radio-button">
<input type="radio" id="info" name="radios" value="info" checked onclick="return switch_log_level(this.value)"/>
<label for="info">Info</label>
<input type="radio" id="warning" name="radios" value="warning" onclick="return switch_log_level(this.value)"/>
<label for="warning">Warning</label>
<input type="radio" id="error" name="radios" value="error" onclick="return switch_log_level(this.value)"/>
<label for="error">Error</label>
<input type="radio" id="debug" name="radios" value="debug" onclick="return switch_log_level(this.value)"/>
<label for="debug">Debug</label>
<input type="radio" id="silent" name="radios" value="silent" onclick="return switch_log_level(this.value)"/>
<label for="silent">Silent</label>
</div>
</div>
</div>
</div>
<div id="tab" class="cbi-section">
<div id="tab-header">
<ul class="cbi-tabmenu">
<li name="tab-header" class="cbi-tab"><a href="#"><%:OpenClash Log%></a></li>
<li name="tab-header" class="cbi-tab-disabled"><a href="#"><%:Core Log%></a></li>
</ul>
</div>
<div id="tab-content">
<div class="dom" style="display: block;">
<textarea id="cbid.openclash.config.clog" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
</div>
<div class="dom">
<textarea id="core_log" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
<div class="radio-button">
<input type="radio" id="info" name="radios" value="info" checked onclick="return switch_log_level(this.value)"/>
<label for="info"><%:Info%></label>
<input type="radio" id="warning" name="radios" value="warning" onclick="return switch_log_level(this.value)"/>
<label for="warning"><%:Warning%></label>
<input type="radio" id="error" name="radios" value="error" onclick="return switch_log_level(this.value)"/>
<label for="error"><%:Error%></label>
<input type="radio" id="debug" name="radios" value="debug" onclick="return switch_log_level(this.value)"/>
<label for="debug"><%:Debug%></label>
<input type="radio" id="silent" name="radios" value="silent" onclick="return switch_log_level(this.value)"/>
<label for="silent"><%:Silent%></label>
</div>
</div>
</div>
</div>
<fieldset style="text-align: center; width: 100%" class="cbi-section">
<div class="btn-group">
<input type="button" class="btn cbi-button cbi-button-apply" id="stop_refresh_button" value="<%:Stop Refresh%>" onclick=" return stop_refresh() "/>
<input type="button" class="btn cbi-button cbi-button-apply" id="start_refresh_button" value="<%:Start Refresh%>" onclick=" return start_refresh() "/>
<input type="button" class="btn cbi-button cbi-button-apply" id="del_log_button" value="<%:Clean%>" onclick=" return del_log() " />
<input type="button" class="btn cbi-button cbi-button-apply" id="down_log_button" value="<%:Download Log%>" onclick=" return download_log() " />
</div>
<div class="btn-group">
<input type="button" class="btn cbi-button cbi-button-apply" id="stop_refresh_button" value="<%:Stop Refresh%>" onclick=" return stop_refresh() "/>
<input type="button" class="btn cbi-button cbi-button-apply" id="start_refresh_button" value="<%:Start Refresh%>" onclick=" return start_refresh() "/>
<input type="button" class="btn cbi-button cbi-button-apply" id="del_log_button" value="<%:Clean%>" onclick=" return del_log() " />
<input type="button" class="btn cbi-button cbi-button-apply" id="down_log_button" value="<%:Download Log%>" onclick=" return download_log() " />
</div>
</fieldset>
</body>
@@ -304,46 +304,60 @@ var lv = document.getElementById('cbid.openclash.config.clog');
var cl = document.getElementById('core_log');
var animatingOC = false;
var animatingCore = false;
var coreWebSocket = null;
var coreLogBuffer = [];
var currentLogLevel = 'info';
var wsRetryDelay = 2000;
var wsRetryTimer = null;
var isPolling = false;
var core_refresh = true;
function setLogTab(log_level) {
var radio = document.getElementsByName("radios");
for (i=0; i<radio.length; i++) {
if (radio[i].value == log_level && ! radio[i].checked) {
radio[i].checked = true;
}
}
};
function get_log_level() {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "log_level")%>', null, function(x, status) {
if (x && x.status == 200 && status.log_level != "") {
var radio = document.getElementsByName("radios");
for (i=0; i<radio.length; i++) {
if (radio[i].value == status.log_level && ! radio[i].checked) {
radio[i].checked = true;
}
}
}
});
s=setTimeout("get_log_level()",5000);
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "log_level")%>', null, function(x, status) {
if (x && x.status == 200 && status.log_level != "") {
currentLogLevel = status.log_level;
setLogTab(currentLogLevel);
coreLogWebSocket();
}
});
};
function switch_log_level(value)
{
clearTimeout(s);
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_log")%>', {log_level: value}, function(x, status) {
if (x && x.status == 200) {
alert(' <%:Log Level%>: ' + value + ' <%:switching succeeded!%>');
get_log_level();
}
else {
alert(' <%:Log Level%>: ' + value + ' <%:switching failed!%>');
get_log_level();
}
});
if (!coreWebSocket || coreWebSocket.readyState !== WebSocket.OPEN) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_log")%>', {log_level: value}, function(x, status) {
if (!x || x.status != 200) {
alert(' <%:Log Level%>: ' + value + ' <%:switching failed!%>');
return
}
});
}
currentLogLevel = value;
setLogTab(currentLogLevel);
coreLogWebSocket();
};
function stop_refresh() {
clearTimeout(r);
return
clearTimeout(r);
coreLogWebSocketStop();
return
};
function start_refresh() {
clearTimeout(r);
r=setTimeout("poll_log()",1000*2);
return
clearTimeout(r);
coreLogWebSocket();
r=setTimeout("poll_log()",1000);
return
};
function createAndDownloadFile(fileName, content) {
@@ -360,8 +374,8 @@ function download_log(){
var timestamp = dt.getFullYear()+"-"+(dt.getMonth()+1)+"-"+dt.getDate()+"-"+dt.getHours()+"-"+dt.getMinutes()+"-"+dt.getSeconds();
var oc_content = "";
if (typeof oc_editor !== 'undefined' && oc_editor) {
oc_content = oc_editor.getValue();
if (typeof editor_oc !== 'undefined' && editor_oc) {
oc_content = editor_oc.getValue();
} else if (lv && lv.value) {
oc_content = lv.value;
} else if (lv && lv.innerHTML) {
@@ -369,8 +383,8 @@ function download_log(){
}
var core_content = "";
if (typeof core_editor !== 'undefined' && core_editor) {
core_content = core_editor.getValue();
if (typeof editor_core !== 'undefined' && editor_core) {
core_content = editor_core.getValue();
} else if (cl && cl.value) {
core_content = cl.value;
} else if (cl && cl.innerHTML) {
@@ -378,7 +392,7 @@ function download_log(){
}
oc_content = oc_content.split('\n').filter(function(line) {
return line.indexOf("】订阅的下载链接为【") === -1 && line.indexOf("】Downloading URL【") === -1;
return line.indexOf("】<%:Downloading URL%>【") === -1;
}).join('\n');
if (!oc_content.trim() && !core_content.trim()) {
@@ -398,27 +412,136 @@ function download_log(){
};
function del_log() {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_log")%>',null,function(x, data){
lv.innerHTML="";
cl.innerHTML="";
log_len = 0;
oc_editor.setValue(lv.value);
core_editor.setValue(cl.value);
core_editor.refresh();
oc_editor.refresh();
});
return
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_log")%>',null,function(x, data){
lv.innerHTML="";
cl.innerHTML="";
coreLogBuffer = [];
log_len = 0;
editor_oc.setValue(lv.value);
editor_core.setValue(cl.value);
editor_core.refresh();
editor_oc.refresh();
});
return
};
function p(s) {
return s < 10 ? '0' + s: s;
return s < 10 ? '0' + s: s;
};
function getWebSocketConnectionInfo(callback) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
if (x && x.status == 200 && status) {
callback(status);
} else {
callback(null);
}
});
}
function coreLogWebSocketStop() {
if (wsRetryTimer) {
clearTimeout(wsRetryTimer);
wsRetryTimer = null;
}
var ws = coreWebSocket;
coreWebSocket = null;
if (!ws) return;
["onopen", "onmessage", "onerror", "onclose"].forEach(function(event) {
try {
ws[event] = null;
} catch (e) {}
});
try {
if (ws.readyState !== WebSocket.CLOSED && ws.readyState !== WebSocket.CLOSING) {
ws.close();
}
} catch (e) {}
coreLogBuffer = [];
}
function coreLogWebSocketRetry() {
wsRetryTimer = setTimeout(function() {
coreLogWebSocket();
}, wsRetryDelay);
}
function coreLogWebSocket() {
coreLogWebSocketStop();
getWebSocketConnectionInfo(function(status) {
if (!status || !status.daip || !status.cn_port || !status.clash) {
return;
}
var protocol = window.location.protocol === "https:" ? "wss://" : "ws://";
var host, port;
if (status.daip && window.location.hostname === status.daip) {
host = status.daip;
port = status.cn_port;
} else if (status.daip && window.location.hostname !== status.daip &&
status.db_foward_domain && status.db_foward_port) {
host = status.db_foward_domain;
port = status.db_foward_port;
} else {
host = status.daip;
port = status.cn_port;
}
var token = status.dase;
var level = currentLogLevel;
var wsUrl = protocol + host + ":" + port + "/logs?token=" + token + "&level=" + level;
try {
coreWebSocket = new WebSocket(wsUrl);
coreWebSocket.onopen = function() {
coreLogBuffer = [];
};
coreWebSocket.onmessage = function(event) {
if (event.data) {
try {
var msgData = JSON.parse(event.data);
if (msgData && msgData.payload) {
var now = new Date();
var timestamp = now.getFullYear() + "-" + p(now.getMonth() + 1) + "-" + p(now.getDate()) + " " +
p(now.getHours()) + ":" + p(now.getMinutes()) + ":" + p(now.getSeconds());
var type = msgData.type || 'info';
var translatedType = levelTranslations[type] || type;
coreLogBuffer.push(timestamp + " [" + translatedType + "] " + msgData.payload);
}
} catch (e) {
coreLogWebSocketRetry();
}
}
};
coreWebSocket.onerror = function(error) {
coreLogWebSocketRetry();
};
coreWebSocket.onclose = function(event) {
coreWebSocket = null;
if (!event.wasClean) {
coreLogWebSocketRetry();
}
};
} catch (e) {
coreLogWebSocketRetry();
}
});
}
function line_tolocal(str) {
var trans_local = new Array();
var local_count = 0;
str.trim().split('\n').forEach(function(v, i) {
var regex = /(time=)"([^"]*)"/g;
var res = regex.exec(v);
@@ -428,13 +551,15 @@ function line_tolocal(str) {
var dt = new Date(res[2]);
if (!isNaN(dt.getTime())) {
if (v.indexOf("level=") != -1) {
var log_info = v.substring(res[2].length + 7);
} else {
var log_info = v.substring(res[2].length + 2);
}
trans_local[local_count] = dt.getFullYear() + "-" + p(dt.getMonth() + 1) + "-" + p(dt.getDate()) + " " +
p(dt.getHours()) + ":" + p(dt.getMinutes()) + ":" + p(dt.getSeconds()) + log_info;
var timestamp = dt.getFullYear() + "-" + p(dt.getMonth() + 1) + "-" + p(dt.getDate()) + " " +
p(dt.getHours()) + ":" + p(dt.getMinutes()) + ":" + p(dt.getSeconds());
var levelMatch = v.match(/level=(\w+)/);
var level = levelMatch ? levelMatch[1] : 'info';
var translatedLevel = levelTranslations[level] || level;
var msgMatch = v.match(/msg="(.*)"/);
var msg = msgMatch ? msgMatch[1] : '';
trans_local[local_count] = timestamp + " [" + translatedLevel + "] " + msg;
local_count++;
} else {
trans_local[local_count] = v;
@@ -500,7 +625,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
isAtTop = (target.scrollTop < 20);
}
if ((target === oc_editor && animatingOC) || (target === core_editor && animatingCore) || !isActiveTab) {
if ((target === editor_oc && animatingOC) || (target === editor_core && animatingCore) || !isActiveTab) {
var content = "";
var lines = newLines.slice().reverse();
for (var i = 0; i < lines.length; i++) {
@@ -557,7 +682,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
return;
}
if (target === oc_editor || target === lv) {
if (target === editor_oc || target === lv) {
animatingOC = true;
} else {
animatingCore = true;
@@ -596,7 +721,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
function displayNextBatch() {
if (currentBatchCount >= logLines.length) {
if (target === oc_editor || target === lv) {
if (target === editor_oc || target === lv) {
animatingOC = false;
} else {
animatingCore = false;
@@ -661,7 +786,7 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
if (currentBatchCount < logLines.length) {
setTimeout(displayNextBatch, interval);
} else {
if (target === oc_editor || target === lv) {
if (target === editor_oc || target === lv) {
animatingOC = false;
} else {
animatingCore = false;
@@ -691,15 +816,54 @@ function smoothlyDisplayLogs(newLines, target, isEditor, currentContent, isActiv
}
function poll_log(){
var activeTabId = 0;
var titles = document.getElementsByName('tab-header');
var core_logs = [];
var oc_logs = [];
var currentCoreContent = "";
var currentContent = "";
var bufferToProcess = [];
for(var i=0; i<titles.length; i++){
if(titles[i].className === 'cbi-tab') {
activeTabId = i;
break;
}
}
if (coreWebSocket && coreWebSocket.readyState == WebSocket.OPEN) {
if (coreLogBuffer.length > 0) {
core_refresh = false;
bufferToProcess = coreLogBuffer;
coreLogBuffer = [];
core_logs = line_tolocal(bufferToProcess.join('\n'));
if (editor_core) {
currentCoreContent = editor_core.getValue();
smoothlyDisplayLogs(core_logs, editor_core, true, currentCoreContent, activeTabId === 1);
} else if (cl) {
currentCoreContent = cl.innerHTML;
smoothlyDisplayLogs(core_logs, cl, false, currentCoreContent, activeTabId === 1);
}
}
}
if (isPolling) {
r = setTimeout("poll_log()", 1000);
return;
}
isPolling = true;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "refresh_log")%>',
{
log_len: log_len
log_len: log_len, core_refresh: core_refresh
},
function(x, status) {
if (x && x.status == 200) {
if (status) {
if (!status.update) {
r = setTimeout("poll_log()", 2000);
isPolling = false;
r = setTimeout("poll_log()", 1000);
return;
}
@@ -707,45 +871,37 @@ function poll_log(){
log_len = status.len;
}
var activeTabId = 0;
var titles = document.getElementsByName('tab-header');
for(var i=0; i<titles.length; i++){
if(titles[i].className === 'cbi-tab') {
activeTabId = i;
break;
}
}
if (status.oc_log && status.oc_log !== "") {
var oc_logs = line_tolocal(status.oc_log);
oc_logs = line_tolocal(status.oc_log);
if (oc_logs && oc_logs.length > 0) {
if (oc_editor) {
var currentContent = oc_editor.getValue();
smoothlyDisplayLogs(oc_logs, oc_editor, true, currentContent, activeTabId === 0);
if (oc_logs.length > 0) {
if (editor_oc) {
currentContent = editor_oc.getValue();
smoothlyDisplayLogs(oc_logs, editor_oc, true, currentContent, activeTabId === 0);
} else if (lv) {
var currentContent = lv.innerHTML;
currentContent = lv.innerHTML;
smoothlyDisplayLogs(oc_logs, lv, false, currentContent, activeTabId === 0);
}
}
}
if (status.core_log && status.core_log !== "") {
var core_logs = line_tolocal(status.core_log);
core_logs = line_tolocal(status.core_log);
if (core_logs && core_logs.length > 0) {
if (core_editor) {
var currentCoreContent = core_editor.getValue();
smoothlyDisplayLogs(core_logs, core_editor, true, currentCoreContent, activeTabId === 1);
if (core_logs.length > 0) {
if (editor_core) {
currentCoreContent = editor_core.getValue();
smoothlyDisplayLogs(core_logs, editor_core, true, currentCoreContent, activeTabId === 1);
} else if (cl) {
var currentCoreContent = cl.innerHTML;
currentCoreContent = cl.innerHTML;
smoothlyDisplayLogs(core_logs, cl, false, currentCoreContent, activeTabId === 1);
}
}
}
}
}
r = setTimeout("poll_log()", 2000);
isPolling = false;
r = setTimeout("poll_log()", 1000);
}
);
};
@@ -767,13 +923,13 @@ window.onload = function(){
tab.className = 'cbi-tab';
divs[tab.id].style.display = 'block';
if(tab.id == 0 && typeof oc_editor !== 'undefined') {
if(tab.id == 0 && typeof editor_oc !== 'undefined') {
setTimeout(function(){
oc_editor.refresh();
editor_oc.refresh();
}, 10);
} else if(tab.id == 1 && typeof core_editor !== 'undefined') {
} else if(tab.id == 1 && typeof editor_core !== 'undefined') {
setTimeout(function(){
core_editor.refresh();
editor_core.refresh();
}, 10);
}
};
@@ -1,7 +0,0 @@
<%+cbi/valueheader%>
<% if self:cfgvalue(section) ~= false then %>
<input class="btn cbi-button cbi-input-<%=self.inputstyle or "button" %>" style="display: <%= display %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> />
<% else %>
-
<% end %>
<%+cbi/valuefooter%>
@@ -25,7 +25,7 @@ function act_manual_unlock_test_<%=stream_id_name%>(btn, type)
{
manual_<%=stream_id_name%>_type_legend.style.display = 'none';
manual_<%=stream_id_name%>_type_output.innerHTML = '<textarea id="manual_<%=stream_id_name%>_type_output" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="10" cols="50" readonly="readonly" >'+x.responseText+'</textarea>';
other_log_area(document.getElementById("manual_<%=stream_id_name%>_type_output"), 'true', manual_<%=stream_id_name%>_type_output.offsetWidth, '250px');
log_area(document.getElementById("manual_<%=stream_id_name%>_type_output"), 'manual_stream_unlock_test', 'true', manual_<%=stream_id_name%>_type_output.offsetWidth, '250px');
}
else
{
@@ -58,7 +58,7 @@ function act_all_proxies_test_<%=stream_id_name%>(btn, type)
{
all_<%=stream_id_name%>_legend.style.display = 'none';
all_<%=stream_id_name%>_output.innerHTML = '<textarea id="all_<%=stream_id_name%>_output" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="10" cols="50" readonly="readonly" >'+x.responseText+'</textarea>';
other_log_area(document.getElementById("all_<%=stream_id_name%>_output"), 'true', all_<%=stream_id_name%>_output.offsetWidth, '250px');
log_editor(document.getElementById("all_<%=stream_id_name%>_output"), 'all_proxies_stream_test', true, all_<%=stream_id_name%>_output.offsetWidth, '250px');
}
else
{
@@ -14,6 +14,9 @@
--success-dark: #047857;
--warning-color: #f59e0b;
--error-color: #dc2626;
--tip-color: #f9bb51;
--info-color: #2563eb;
--watchdog-color: #b300ff;
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
--radius-sm: 6px;
@@ -40,6 +43,11 @@
--primary-color: #3b82f6;
--success-color: #34d399;
--success-dark: #10b981;
--error-color: #ff7070;
--tip-color: #f9bb51;
--warning-color: #fa41c8;
--watchdog-color: #c147f5;
--info-color: #2563eb;
}
.oc * {
@@ -204,8 +212,8 @@
padding: 8px 32px 8px 12px;
border: 1px solid var(--border-light);
border-radius: var(--radius-sm);
background: var(--bg-white);
color: var(--text-primary);
background: var(--bg-white) !important;
color: var(--text-primary) !important;
font-size: 13px;
appearance: none;
cursor: pointer;
@@ -640,22 +648,22 @@
var smart_enable_cdn = document.getElementById('SMART_ENABLE_CDN');
function initDarkMode() {
var ocContainer = document.querySelector('.oc');
if (!ocContainer) return;
var ocContainers = document.querySelectorAll('.oc');
if (!ocContainers.length) return;
var shouldUseDark = isDarkBackground(document.body);
if (shouldUseDark) {
ocContainer.setAttribute('data-darkmode', 'true');
} else {
ocContainer.removeAttribute('data-darkmode');
}
ocContainers.forEach(function(ocContainer) {
if (shouldUseDark) {
ocContainer.setAttribute('data-darkmode', 'true');
document.documentElement.setAttribute('data-darkmode', 'true');
} else {
ocContainer.removeAttribute('data-darkmode');
document.documentElement.removeAttribute('data-darkmode');
}
});
}
document.addEventListener('DOMContentLoaded', function() {
initDarkMode();
});
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initDarkMode);
} else {
@@ -14,10 +14,11 @@
--primary-color: #3b82f6;
--success-color: #059669;
--success-dark: #047857;
--warning-color: #f59e0b;
--tip-color: #f59e0b;
--error-color: #dc2626;
--warning-log: #ff00bb;
--watch-log: #b300ff;
--warning-color: #ff00bb;
--watchdog-color: #b300ff;
--info-color: #3b82f6;
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
--radius-sm: 6px;
@@ -50,9 +51,10 @@
--success-color: #34d399;
--success-dark: #10b981;
--error-color: #ff7070;
--warning-color: #f9bb51;
--warning-log: #fa41c8;
--watch-log: #c147f5;
--tip-color: #f9bb51;
--warning-color: #fa41c8;
--watchdog-color: #c147f5;
--info-color: #3b82f6;
}
.oc[data-darkmode="true"] .plugin-toggle-slider {
@@ -94,7 +96,7 @@
}
.oc[data-darkmode="true"] .subscription-progress-fill.medium {
background: var(--warning-color);
background: var(--tip-color);
}
.oc[data-darkmode="true"] .subscription-progress-fill.low {
@@ -942,7 +944,7 @@
}
.oc .subscription-progress-fill.medium {
background: var(--warning-color);
background: var(--tip-color);
}
.oc .subscription-progress-fill.low {
@@ -2248,14 +2250,10 @@
DISCONNECTED: 2,
ERROR: 3
},
retryAttempts: {},
maxRetries: 3,
reconnectDelay: 2000,
reconnectDelay: 5000,
heartbeatInterval: 30000,
heartbeatTimers: {},
_ws_connect: false,
_ws_error: false,
_ws_retry: 0,
_allowedCloseCodes: [1000, 1001, 1005, 1006],
isSupported: function() {
@@ -2284,8 +2282,6 @@
options: options
};
this.retryAttempts[type] = 0;
if (ws.addEventListener) {
ws.addEventListener('open', this.handleOpen.bind(this, type));
ws.addEventListener('message', this.handleMessage.bind(this, type));
@@ -2362,8 +2358,6 @@
this.closeConnection(types[i]);
}
this._ws_connect = false;
this._ws_error = false;
this._ws_retry = 0;
},
handleMessage: function(type, event) {
@@ -2389,13 +2383,13 @@
connection.state = this.connectionStates.CONNECTED;
connection.lastActivity = Date.now();
}
this.retryAttempts[type] = 0;
this.startHeartbeat(type);
if (type === 'traffic' || Object.keys(this.connections).length === 3) {
if (Object.keys(this.connections).length === 3) {
this._ws_connect = true;
this._ws_error = false;
this._ws_retry = 0;
if (NetworkStatsManager.isEnabled) {
NetworkStatsManager.stop();
}
}
},
@@ -2404,15 +2398,14 @@
if (connection) {
connection.state = this.connectionStates.ERROR;
}
this._ws_error = true;
this.stopHeartbeat(type);
if (type === 'traffic') {
this.enableFallbackMode();
}
this.enableFallbackMode();
},
handleClose: function(type, event) {
// if not connected, start log display because core maybe restart
LogManager.startLogDisplay();
var connection = this.connections[type];
if (connection) {
connection.state = this.connectionStates.DISCONNECTED;
@@ -2429,7 +2422,6 @@
if (connection) {
connection.state = this.connectionStates.ERROR;
}
this._ws_error = true;
this.enableFallbackMode();
},
@@ -2437,25 +2429,22 @@
var self = this;
var connection = this.connections[type];
if (!connection || this.retryAttempts[type] >= this.maxRetries) {
if (!connection) {
this.enableFallbackMode();
return;
}
this.retryAttempts[type] = (this.retryAttempts[type] || 0) + 1;
var delay = this.reconnectDelay * Math.pow(1.5, this.retryAttempts[type] - 1);
setTimeout(function() {
if (self.connections[type] && self.connections[type].state !== self.connectionStates.CONNECTED) {
self.createConnection(type, connection.url, connection.messageHandler, connection.options);
}
}, delay);
}, this.reconnectDelay);
},
enableFallbackMode: function() {
this._ws_connect = false;
this.closeAll();
if (typeof NetworkStatsManager !== "undefined" && !NetworkStatsManager.isEnabled) {
if (!NetworkStatsManager.isEnabled) {
NetworkStatsManager.start();
}
},
@@ -2480,14 +2469,6 @@
}
}
return false;
},
resetRetryCount: function(type) {
if (type) {
this.retryAttempts[type] = 0;
} else {
this.retryAttempts = {};
}
}
};
@@ -2575,7 +2556,7 @@
this.updateSubscriptionDisplay(currentConfigFile, currentFileInfo);
if (currentConfigFile && SubscriptionManager.currentConfigFile !== currentConfigFile) {
if (SubscriptionManager.currentConfigFile !== currentConfigFile) {
SubscriptionManager.currentConfigFile = currentConfigFile;
SubscriptionManager.getSubscriptionInfo();
}
@@ -2967,7 +2948,7 @@
loadSubscriptionInfo: function() {
var currentConfig = ConfigFileManager.getCurrentConfig() || ConfigFileManager.getSelectedConfig();
if (currentConfig && currentConfig !== this.currentConfigFile) {
if (currentConfig !== this.currentConfigFile) {
this.currentConfigFile = currentConfig;
this.getSubscriptionInfo();
}
@@ -3376,7 +3357,6 @@
},
bindEvents: function() {
var self = this;
var textarea = document.getElementById('subscription-url-textarea');
var overlay = document.getElementById('subscription-url-overlay');
@@ -3444,24 +3424,38 @@
});
},
handleSubURL: function(urlresult) {
var textarea = document.getElementById('subscription-url-textarea');
if (!textarea) return;
var urls = '';
if (urlresult.type && urlresult.type === "multiple") {
for (var data in urlresult.providers) {
urls += urlresult.providers[data].url + '#name=' + urlresult.providers[data].name + '\n';
}
}
if (urlresult.type && urlresult.type === "single") {
urls = urlresult.url;
}
textarea.value = urls;
},
loadUrls: function() {
var self = this;
var existingData = localStorage.getItem('sub_info_' + this.filename);
if (existingData) {
existingData = JSON.parse(existingData);
if (existingData.url_result) {
this.handleSubURL(existingData.url_result);
return;
}
};
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "get_subscribe_info_data")%>', {
filename: this.filename
}, function(x, status) {
if (x && x.status == 200 && status) {
var textarea = document.getElementById('subscription-url-textarea');
if (textarea) {
var urls = '';
if (status.url) {
if (typeof status.url === 'string') {
urls = status.url;
} else if (Array.isArray(status.url)) {
urls = status.url.join('\n');
}
}
textarea.value = urls;
}
self.handleSubURL(status);
}
});
}
@@ -3489,9 +3483,9 @@
StateManager.clearCache('<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>');
if (DOMCache.oclog) {
if (DOMCache.oclog && initialMessage) {
DOMCache.oclog.style.display = 'inline-flex';
DOMCache.oclog.innerHTML = '<b style="color:var(--warning-color)">' + (initialMessage || '<%:Processing...%>') + '</b>';
DOMCache.oclog.innerHTML = '<b style="color:var(--tip-color)">' + initialMessage + '</b>';
}
this.isPolling = true;
@@ -3591,17 +3585,11 @@
checkForErrors: function(log) {
if (!log) return false;
if (log.match(/level=fatal|level=error|FTL \[Config]/)) {
if (log.match(/level=(fatal|error)/)) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {});
var errorMsg;
if (log.match(/level=(fatal|error)/)) {
var msgParts = log.split('msg=');
errorMsg = msgParts.length > 1 ? msgParts[1].replace(/"/g, '') : log;
} else { // FTL [Config]
var ftlParts = log.split('FTL [Config] ');
errorMsg = ftlParts.length > 1 ? ftlParts[1] : log;
}
var msgParts = log.split('msg=');
var errorMsg = msgParts.length > 1 ? msgParts[1].replace(/"/g, '') : log;
setTimeout(function() {
alert('<%:OpenClash Start Failed%>:\n\n' + errorMsg);
@@ -3621,6 +3609,7 @@
var color = this.getLogColor(cleanLog);
var displayText = this.formatLogText(cleanLog);
DOMCache.oclog.style.display = 'inline-flex';
DOMCache.oclog.innerHTML = '<b style="color:' + color + '">' + displayText + '</b>';
},
@@ -3629,19 +3618,13 @@
},
getLogColor: function(log) {
if (log.includes("Tip:") || log.includes("提示:")) {
return 'var(--warning-color)';
} else if (log.includes("Error:") || log.includes("错误:") || log.includes("level=error")) {
return 'var(--error-color)';
} else if (log.includes("Warning:") || log.includes("警告:") || log.includes("level=warning")) {
return 'var(--warning-log)';
} else if (log.includes("Watchdog:") || log.includes("守护程序:")) {
return 'var(--watch-log)';
} else if (log.match(/level=info|Success|Started|Ready/)) {
return 'var(--success-color)';
} else {
return 'var(--text-secondary)';
for (var levelKey in window.levelTranslations) {
var translatedText = '[' + window.levelTranslations[levelKey] + ']';
if (log.includes(translatedText)) {
return "var(--" + levelKey + "-color)";
}
}
return "var(--info-color)";
},
formatLogText: function(log) {
@@ -3695,12 +3678,12 @@
StateManager.cachedXHRGet('<%=luci.dispatcher.build_url("admin", "services", "openclash", "toolbar_show_sys")%>', function(x, status) {
if (x && x.status == 200 && x.responseText != "") {
self.retryCount = 0;
var cpuColor = status.cpu <= 50 ? "var(--success-color)" : (status.cpu <= 80 ? "var(--warning-color)" : "var(--error-color)");
var cpuColor = status.cpu <= 50 ? "var(--success-color)" : (status.cpu <= 80 ? "var(--tip-color)" : "var(--error-color)");
var cpuValue = status.cpu <= 100 ? status.cpu + " %" : "0 %";
document.getElementById("cpu_t").innerHTML = "<font style=\"color:"+cpuColor+"\">"+cpuValue+"</font>";
var loadValue = parseFloat(status.load_avg) || 0;
var loadColor = loadValue <= 50 ? "var(--success-color)" : (loadValue <= 80 ? "var(--warning-color)" : "var(--error-color)");
var loadColor = loadValue <= 50 ? "var(--success-color)" : (loadValue <= 80 ? "var(--tip-color)" : "var(--error-color)");
document.getElementById("load_a").innerHTML = "<font style=\"color:"+loadColor+"\">"+status.load_avg+" %</font>";
} else {
self.handleError();
@@ -3782,12 +3765,12 @@
];
if (!SystemStatusManager.isEnabled) {
var cpuColor = status.cpu <= 50 ? "var(--success-color)" : (status.cpu <= 80 ? "var(--warning-color)" : "var(--error-color)");
var cpuColor = status.cpu <= 50 ? "var(--success-color)" : (status.cpu <= 80 ? "var(--tip-color)" : "var(--error-color)");
var cpuValue = status.cpu <= 100 ? status.cpu + " %" : "0 %";
updates.push({element: document.getElementById("cpu_t"), content: "<font style=\"color:"+cpuColor+"\">"+cpuValue+"</font>"});
var loadValue = parseFloat(status.load_avg) || 0;
var loadColor = loadValue <= 50 ? "var(--success-color)" : (loadValue <= 80 ? "var(--warning-color)" : "var(--error-color)");
var loadColor = loadValue <= 50 ? "var(--success-color)" : (loadValue <= 80 ? "var(--tip-color)" : "var(--error-color)");
updates.push({element: document.getElementById("load_a"), content: "<font style=\"color:"+loadColor+"\">"+status.load_avg+" %</font>"});
}
@@ -4143,19 +4126,13 @@
if (status.clash && status.daip) {
if (!WSManager.hasActiveConnections()) {
if (!WSManager._ws_error || WSManager._ws_retry < 3) {
if (initializeWebSocketConnections(status)) {
WSManager._ws_retry++;
}
} else {
WSManager.enableFallbackMode();
}
initializeWebSocketConnections(status);
} else {
if (NetworkStatsManager && NetworkStatsManager.isEnabled) {
if (NetworkStatsManager.isEnabled) {
NetworkStatsManager.stop();
}
if (SystemStatusManager && !SystemStatusManager.isEnabled) {
if (!SystemStatusManager.isEnabled) {
SystemStatusManager.start();
}
}
@@ -4232,14 +4209,14 @@
var isChineseUser = userLang.indexOf('zh') === 0;
var tips = [
'<%:Tip: You can modify the profile on the profile page (for content that is not taken over)%>',
'<%:Tip: do not write configuration files? Try to create one click on the server page%>',
'<%:Tip: some website are abnormal? Try switching modes or using third-party rules%>',
'<%:Tip: using the fake IP mode can get a faster access experience%>',
'<%:Tip: the nameserver group must have at least one server set when using custom DNS%>',
'<%:Tip: after started, please wait patiently until the connection is normal%>',
'<%:Tip: if you don not use IPv6, please turn off the DHCP service of IPv6, otherwise the connection will be abnormal%>',
'<%:Tip: you can update the version in the settings page%>',
'<%:You can modify the profile on the profile page (for content that is not taken over)%>',
'<%:do not write configuration files? Try to create one click on the server page%>',
'<%:some website are abnormal? Try switching modes or using third-party rules%>',
'<%:using the fake IP mode can get a faster access experience%>',
'<%:the nameserver group must have at least one server set when using custom DNS%>',
'<%:after started, please wait patiently until the connection is normal%>',
'<%:if you don not use IPv6, please turn off the DHCP service of IPv6, otherwise the connection will be abnormal%>',
'<%:you can update the version in the settings page%>',
'<%:Note: It is not recommended to enable IPv6 and related services for routing. Most of the network connection problems reported so far are related to it%>',
'<%:Note: Turning on secure DNS in the browser will cause abnormal shunting, please be careful to turn it off%>',
'<%:Note: Some software will modify the device HOSTS, which will cause abnormal shunt, please pay attention to check%>',
@@ -4505,12 +4482,6 @@
}
}
function ws_terror() {
WSManager._ws_error = true;
NetworkStatsManager.start();
}
function ws_tmessage(event) {
var dataObj = event && event.data !== undefined ? event.data : event;
var data;
@@ -4938,7 +4909,7 @@
}
});
return false;
}
}
function copySecret() {
var secret = StateManager.current_status.dase || '';
@@ -4969,6 +4940,10 @@
var mixPort = StateManager.cached_proxy_info.mixed_port || '7893';
var proxyIp = StateManager.current_status.daip;
var proxyText = proxyIp + ':' + mixPort;
if (StateManager.cached_proxy_info.auth_user && StateManager.cached_proxy_info.auth_pass) {
proxyText = StateManager.cached_proxy_info.auth_user + ':' + StateManager.cached_proxy_info.auth_pass + '@' + proxyText;
}
proxyText = 'http://' + proxyText;
copyToClipboard(proxyText, '<%:Mix proxy address copied:%> ');
} else {
alert('<%:Proxy info not available, please try again later%>');
@@ -5062,13 +5037,8 @@
client_href: currentUrl.href
}, function(x, data) {
if (x && x.status == 200 && data.pac_url) {
if (data.error && data.error.indexOf("warning:") === 0) {
var warningMsg = data.error.replace("warning: ", "");
var warningTranslations = {
'No authentication configured, please be aware of the risk of information leakage!': '<%:No authentication configured, please be aware of the risk of information leakage!%>'
};
var translatedWarning = warningTranslations[warningMsg] || warningMsg;
alert('<%:Warning:%> ' + translatedWarning);
if (data.error && data.error !== "") {
alert(data.error);
}
copyToClipboard(data.pac_url, '<%:PAC file URL copied:%> ');
} else if (data.error) {
@@ -5392,11 +5362,11 @@
filename: filename
}, function(x, status) {
if (x.status == 200) {
if (typeof ConfigUploader !== 'undefined' && ConfigUploader.showEditSubscribe) {
if (ConfigUploader && ConfigUploader.showEditSubscribe) {
ConfigUploader.showEditSubscribe(status, filename);
} else {
setTimeout(function() {
if (typeof ConfigUploader !== 'undefined' && ConfigUploader.showEditSubscribe) {
if (ConfigUploader && ConfigUploader.showEditSubscribe) {
ConfigUploader.showEditSubscribe(status, filename);
} else {
alert('<%:Config editor not ready, please try again%>');
@@ -5418,11 +5388,11 @@
return false;
}
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.show) {
if (ConfigEditor.show) {
ConfigEditor.show(currentConfig);
} else {
setTimeout(function() {
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.show) {
if (ConfigEditor.show) {
ConfigEditor.show(currentConfig);
} else {
alert('<%:Config editor not ready, please try again%>');
@@ -5434,11 +5404,11 @@
}
function editOverwrite() {
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.showOverwrite) {
if (ConfigEditor.showOverwrite) {
ConfigEditor.showOverwrite();
} else {
setTimeout(function() {
if (typeof ConfigEditor !== 'undefined' && ConfigEditor.showOverwrite) {
if (ConfigEditor.showOverwrite) {
ConfigEditor.showOverwrite();
} else {
alert('<%:Config editor not ready, please try again%>');
@@ -55,15 +55,20 @@
line-height: 0;
flex-shrink: 0;
cursor: pointer;
background-color: unset;
border: unset;
}
.sub_setting img {
.sub_setting svg {
vertical-align: middle;
display: inline-block;
transition: opacity 0.3s ease;
width: 18px;
height: 18px;
color: #414c5c;
padding-left: 2px;
}
.sub_setting:hover img {
.sub_setting:hover svg {
opacity: 0.7;
}
@@ -95,14 +100,147 @@
background-color: #ffb9b9;
}
:root[data-darkmode="true"] #icon_wrench {
-webkit-filter: invert(1);
filter: invert(1);
.sub-info-url-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 10000;
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: blur(2px);
}
:root[data-darkmode="true"] #icon_arrow {
-webkit-filter: invert(1);
filter: invert(1);
.sub-info-url-model {
background: var(--bg-white, white);
border-radius: var(--radius-lg, 8px);
box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.15));
width: 90vw;
max-width: 550px;
min-width: 400px;
display: flex;
flex-direction: column;
overflow: hidden;
border: 1px solid var(--border-light, #e5e7eb);
max-height: 85vh;
transition: all var(--transition-fast, 0.2s);
}
.sub-info-url-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px;
border-bottom: 1px solid var(--border-light, #e5e7eb);
background: var(--bg-gray, #f9fafb);
flex-shrink: 0;
}
.sub-info-url-title {
font-size: 16px;
font-weight: 600;
color: var(--text-primary, #1f2937);
}
.sub-info-url-footer {
display: flex;
align-items: center;
justify-content: flex-end;
padding: 20px;
border-top: 1px solid var(--border-light, #e5e7eb);
background: var(--bg-gray, #f9fafb);
flex-shrink: 0;
gap: 12px;
}
.sub-info-url-content {
padding: 24px;
flex: 1;
overflow-y: auto;
}
.sub-info-url-form-group {
display: flex;
flex-direction: column;
gap: 8px;
}
.sub-info-url-form-group label {
font-size: 14px;
font-weight: 500;
color: var(--text-primary, #1f2937);
}
.sub-info-url-form-textarea {
width: 100%;
min-height: 120px;
padding: 10px 12px;
border: 1px solid var(--border-light, #e5e7eb);
border-radius: var(--radius-sm, 4px);
background: var(--bg-white, white);
color: var(--text-primary, #1f2937);
font-size: 14px;
font-family: inherit;
resize: vertical;
transition: all var(--transition-fast, 0.2s);
box-sizing: border-box;
}
.sub-info-url-form-textarea:focus {
outline: none;
border-color: var(--primary-color, #3b82f6);
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.sub-info-url-form-textarea::placeholder {
color: var(--text-secondary, #6b7280);
}
.sub-info-url-btn {
padding: 8px 16px;
border: 1px solid var(--border-light, #e5e7eb);
border-radius: var(--radius-sm, 4px);
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all var(--transition-fast, 0.2s);
white-space: nowrap;
}
.sub-info-url-cancel-btn {
background: var(--bg-white, white);
color: var(--text-secondary, #6b7280);
border-color: var(--border-light, #e5e7eb);
}
.sub-info-url-cancel-btn:hover {
background: var(--hover-bg, #f3f4f6);
color: var(--text-primary, #1f2937);
}
.sub-info-url-submit-btn {
background: var(--primary-color, #3b82f6);
color: white;
border-color: var(--primary-color, #3b82f6);
}
.sub-info-url-submit-btn:hover:not(:disabled) {
background: var(--primary-color, #3b82f6);
opacity: 0.9;
}
.sub-info-url-submit-btn:disabled {
background: var(--bg-gray, #f9fafb);
color: var(--text-secondary, #6b7280);
border-color: var(--border-light, #e5e7eb);
cursor: not-allowed;
}
:root[data-darkmode="true"] .sub_setting svg {
color: #e0e0e0;
}
:root[data-darkmode="true"] .text_show {
@@ -127,6 +265,62 @@
background-color: #cc6262;
}
:root[data-darkmode="true"] .sub-info-url-model {
background: var(--bg-white, #1f2937);
border-color: var(--border-light, #374151);
}
:root[data-darkmode="true"] .sub-info-url-header,
:root[data-darkmode="true"] .sub-info-url-footer {
background: var(--bg-gray, #111827);
border-color: var(--border-light, #374151);
}
:root[data-darkmode="true"] .sub-info-url-title {
color: var(--text-primary, #f3f4f6);
}
:root[data-darkmode="true"] .sub-info-url-form-group label {
color: var(--text-primary, #f3f4f6);
}
:root[data-darkmode="true"] .sub-info-url-form-textarea {
background: var(--bg-gray, #374151);
border-color: var(--border-light, #4b5563);
color: var(--text-primary, #f3f4f6);
}
:root[data-darkmode="true"] .sub-info-url-form-textarea:focus {
border-color: var(--primary-color, #60a5fa);
box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.1);
}
:root[data-darkmode="true"] .sub-info-url-form-textarea::placeholder {
color: var(--text-secondary, #9ca3af);
}
:root[data-darkmode="true"] .sub-info-url-cancel-btn {
background: var(--bg-white, #374151);
color: var(--text-secondary, #9ca3af);
border-color: var(--border-light, #4b5563);
}
:root[data-darkmode="true"] .sub-info-url-cancel-btn:hover {
background: var(--hover-bg, #4b5563);
color: var(--text-primary, #f3f4f6);
}
:root[data-darkmode="true"] .sub-info-url-submit-btn {
background: var(--primary-color, #3b82f6);
border-color: var(--primary-color, #3b82f6);
}
:root[data-darkmode="true"] .sub-info-url-submit-btn:disabled {
background: var(--bg-gray, #4b5563);
color: var(--text-secondary, #9ca3af);
border-color: var(--border-light, #374151);
}
@media (max-width: 1024px) {
.sub_tab, .sub_tab_show {
font-size: 11px;
@@ -152,10 +346,6 @@
min-width: 200px;
}
.sub_setting img {
height: 18px !important;
}
.sub_div {
gap: 4px;
width: calc(100% - 16px);
@@ -172,10 +362,6 @@
min-width: 180px !important;
}
.sub_setting img {
height: 16px !important;
}
.sub_div {
gap: 2px;
width: calc(100% - 12px);
@@ -192,24 +378,12 @@
min-width: 160px !important;
}
.sub_setting img {
height: 14px !important;
}
.sub_div {
width: calc(100% - 8px);
margin: 0 4px;
}
}
.sub_div * {
flex-shrink: 0;
}
.sub_div > span:first-child {
flex-shrink: 1;
}
/* Multiple providers container */
.sub_providers_container {
display: flex;
@@ -272,18 +446,6 @@
border-radius: 5px;
}
.sub_provider_fill.progress_bar_high {
background-color: #9edd9e;
}
.sub_provider_fill.progress_bar_medium {
background-color: #ffc99f;
}
.sub_provider_fill.progress_bar_low {
background-color: #ffb9b9;
}
.sub_provider_name {
position: relative;
z-index: 1;
@@ -304,18 +466,6 @@
border-color: #666666;
}
:root[data-darkmode="true"] .sub_provider_fill.progress_bar_high {
background-color: #5da05d;
}
:root[data-darkmode="true"] .sub_provider_fill.progress_bar_medium {
background-color: #cc8550;
}
:root[data-darkmode="true"] .sub_provider_fill.progress_bar_low {
background-color: #cc6262;
}
:root[data-darkmode="true"] .sub_provider_name {
color: #e0e0e0;
}
@@ -383,12 +533,20 @@
<div class="sub_div">
<span id='<%=idname%>' class="sub_tab"></span>
<span class="sub_setting">
<img id="icon_arrow" src='/luci-static/resources/openclash/img/arrow-clockwise-light.svg' height="20px" title='<%:Refresh%>' alt='<%:Refresh%>' onclick='return sub_info_refresh_<%=idname%>(this)'>
</span>
<span class="sub_setting">
<img id="icon_wrench" src='/luci-static/resources/openclash/img/wrench-light.svg' height="20px" title='<%:Specify URL%>' alt='<%:Specify URL%>' onclick='return set_subinfo_url_<%=idname%>(this,"<%=filename%>")'>
</span>
<button type="button" class="sub_setting" title='<%:Refresh%>' alt='<%:Refresh%>' onclick='return sub_info_refresh_<%=idname%>(this)'>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M23 4v6h-6"></path>
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path>
</svg>
</button>
<button type="button" class="sub_setting" title='<%:Specify URL%>' alt='<%:Specify URL%>' onclick='return set_subinfo_url_<%=idname%>(this,"<%=filename%>")'>
<svg viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="4">
<path d="M4 6H44V36H29L24 41L19 36H4V6Z"/>
<path d="M23 21H25.0025" />
<path d="M33.001 21H34.9999"/>
<path d="M13.001 21H14.9999"/>
</svg>
</button>
</div>
<script type="text/javascript">//<![CDATA[
@@ -398,10 +556,21 @@ var s_<%=idname%>;
sub_info_get_<%=idname%>();
setTimeout(function(){
initDarkMode();
}, 200);
function initDarkMode() {
if (typeof isDarkBackground === 'undefined') {
setTimeout(function() {
initDarkMode();
}, 100);
return;
}
if (isDarkBackground(document.body)) {
document.documentElement.setAttribute('data-darkmode', 'true');
};
}, 300);
}
}
function progressbar_<%=idname%>(v, m, pc, np, f, t, tr) {
var screenWidth = window.innerWidth || document.documentElement.clientWidth;
@@ -588,14 +757,12 @@ function sub_info_refresh_<%=idname%>()
(status.day_left)
);
}
}
else if ( x && x.status == 200 && status.sub_info == "No Sub Info Found" ) {
} else if ( x && x.status == 200 && status.sub_info == "No Sub Info Found" ) {
retry_<%=idname%> = 0;
localStorage.setItem("sub_info_<%=filename%>",JSON.stringify(status));
document.getElementById('<%=idname%>').className = "sub_tab_show";
document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>";
}
else {
} else {
if (document.getElementById('<%=idname%>').innerHTML == "" || retry_<%=idname%> > 2) {
document.getElementById('<%=idname%>').className = "sub_tab_show";
document.getElementById('<%=idname%>').innerHTML = "<span style=color:red><%:Sub Info Get Error%></span>";
@@ -603,13 +770,11 @@ function sub_info_refresh_<%=idname%>()
if (retry_<%=idname%> > 2) {
retry_<%=idname%> = 0;
localStorage.removeItem("sub_info_<%=filename%>");
}
else {
} else {
retry_<%=idname%> ++;
s_<%=idname%> = setTimeout("sub_info_refresh_<%=idname%>()",1000*120);
return
}
};
s_<%=idname%> = setTimeout("sub_info_refresh_<%=idname%>()",1000*1800);
});
@@ -657,29 +822,113 @@ function sub_info_get_<%=idname%>()
};
function set_subinfo_url_<%=idname%>(btn, filename) {
var new_url = prompt("<%:Paste the new url of subscribe infos sources here:%>", "");
if (filename == null || filename == "") {
return false;
}
if (new_url == null) {
return false;
}
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "set_subinfo_url")%>', {filename: filename, url: new_url}, function(x, status) {
if (x && x.status == 200 && status.info == "Success")
{
sub_info_refresh_<%=idname%>();
alert("<%:Specify subscribe infos sources url successfully!%>");
}
else if (x && x.status == 200 && status.info == "Delete success")
{
sub_info_refresh_<%=idname%>();
alert("<%:Delete Specify Subscribe infos sources url successfully!%>");
}
else
{
alert("<%:Specify subscribe infos sources url failed:%>\n" + status.info);
}
});
if (filename == null || filename == "") {
return false;
}
var dialogDiv = document.createElement('div');
dialogDiv.className = 'sub-info-url-overlay';
var contentDiv = document.createElement('div');
contentDiv.className = 'sub-info-url-model';
var headerDiv = document.createElement('div');
headerDiv.className = 'sub-info-url-header';
var titleDiv = document.createElement('div');
titleDiv.className = 'sub-info-url-title';
titleDiv.innerHTML = '<%:Paste the new url of subscribe infos sources here:%>';
headerDiv.appendChild(titleDiv);
var bodyDiv = document.createElement('div');
bodyDiv.className = 'sub-info-url-content';
var formGroup = document.createElement('div');
formGroup.className = 'sub-info-url-form-group';
var textarea = document.createElement('textarea');
textarea.className = 'sub-info-url-form-textarea';
textarea.placeholder = '<%:Enter URLs, one per line, use #name=example end for specifing display name%> (https://example.com#name=example)';
formGroup.appendChild(textarea);
bodyDiv.appendChild(formGroup);
var footerDiv = document.createElement('div');
footerDiv.className = 'sub-info-url-footer';
var cancelBtn = document.createElement('button');
cancelBtn.className = 'sub-info-url-btn sub-info-url-cancel-btn';
cancelBtn.type = 'button';
cancelBtn.innerHTML = '<%:Cancel%>';
var confirmBtn = document.createElement('button');
confirmBtn.className = 'sub-info-url-btn sub-info-url-submit-btn';
confirmBtn.type = 'button';
confirmBtn.innerHTML = '<%:Submit%>';
confirmBtn.onclick = function() {
var new_url = textarea.value.trim();
document.body.removeChild(dialogDiv);
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "set_subinfo_url")%>', {filename: filename, url: new_url}, function(x, status) {
if (x && x.status == 200 && status.info == "Success") {
sub_info_refresh_<%=idname%>();
alert("<%:Specify subscribe infos sources url successfully!%>");
}
else if (x && x.status == 200 && status.info == "Delete success") {
sub_info_refresh_<%=idname%>();
alert("<%:Delete Specify Subscribe infos sources url successfully!%>");
}
else {
alert("<%:Specify subscribe infos sources url failed:%>\n" + status.info);
}
});
};
cancelBtn.onclick = function() {
document.body.removeChild(dialogDiv);
};
footerDiv.appendChild(cancelBtn);
footerDiv.appendChild(confirmBtn);
contentDiv.appendChild(headerDiv);
contentDiv.appendChild(bodyDiv);
contentDiv.appendChild(footerDiv);
dialogDiv.appendChild(contentDiv);
document.body.appendChild(dialogDiv);
textarea.focus();
var handleSubURL = function(urlresult) {
var urls = '';
if (urlresult.type && urlresult.type === "multiple") {
for (var data in urlresult.providers) {
urls += urlresult.providers[data].url + '#name=' + urlresult.providers[data].name + '\n';
}
}
if (urlresult.type && urlresult.type === "single") {
urls = urlresult.url;
}
textarea.value = urls;
};
var existingData = localStorage.getItem('sub_info_' + filename);
if (existingData) {
existingData = JSON.parse(existingData);
if (existingData.url_result) {
handleSubURL(existingData.url_result);
return;
}
};
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "get_subscribe_info_data")%>', {
filename: filename
}, function(x, status) {
if (x && x.status == 200 && status) {
handleSubURL(status);
}
});
};
//]]></script>
@@ -56,7 +56,7 @@
btn.value = '<%:Downloading File...%>';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_dashboard")%>', {name: name, type : type}, function(x, status) {
if ( x && x.status == 200 ) {
if ( status.download_state == "1" ) {
if ( status.download_state == "0" ) {
if ( type == "Meta" ) {
if ( name == "Dashboard" ) {
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch Successful%> - <%:Switch To Official Version%>" onclick="return switch_dashboard(this, \'Dashboard\', \'Official\')"/>';
@@ -33,23 +33,32 @@ end
local a={}
local e={}
for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(o)
if a then
e[t]={}
e[t].name=fs.basename(o)
if self.sectiontype == "dns_servers" then
table.insert(e, {name="nameserver", title="nameserver"})
table.insert(e, {name="fallback", title="fallback"})
table.insert(e, {name="default", title="default-nameserver"})
else
for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
a=fs.stat(o)
if a then
e[t]={}
e[t].name=fs.basename(o)
end
end
if not table_include(e, "all") then
table.insert(e, 1, {name="all"})
end
end
if not table_include(e, "all") then
table.insert(e, 1, {name="all"})
end
local cfg_name
if uci:get("openclash", "config", "config_path") then
if os.getenv("PATH_INFO") then
local cfg_path = string.match(os.getenv("PATH_INFO"), "/config/(.+)$")
cfg_name = cfg_path and string.match(cfg_path, "([^/]+)$") or nil
end
if not cfg_name and uci:get("openclash", "config", "config_path") then
cfg_name = fs.basename(uci:get("openclash", "config", "config_path"))
end
local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]+") or "self.sectiontype"
-%>
@@ -96,13 +105,14 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li{
flex: 1 1 0;
min-width: 120px;
max-width: 100%;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 12px 0;
height: 40px;
font-size: 12px;
height: 100%;
font-size: 13px;
font-weight: 400;
color: #64748b;
background: transparent;
@@ -128,7 +138,7 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a{
display: block;
width: 100%;
height: 130%;
height: 100%;
text-align: center;
text-decoration: none;
background: none;
@@ -232,9 +242,9 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
<!-- tblsection -->
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
<% if self.title and #self.title > 0 then -%>
<legend><%=self.title%></legend>
<%- end %>
<%- if self.title and #self.title > 0 then -%>
<h3><%=self.title%></h3>
<%- end -%>
<%- if self.sortable then -%>
<input type="hidden" id="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" name="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" value="" />
<%- end -%>
@@ -243,98 +253,119 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
<div id="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tabmenu">
<ul class="cbi-tabmenu">
<%-
if #e ~= 1 then
for t,o in ipairs(e)do
if o.name == cfg_name and cfg_name then
-%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a><%=o.name%></a></li>
<%- elseif not cfg_name and o.name == "all" then -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a>ALL</a></li>
<%- elseif o.name == "all" then -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled"><a>ALL</a></li>
if self.sectiontype == "dns_servers" then
for i, tab in ipairs(e) do
if i == 1 then
-%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab" data-group="<%=tab.name%>"><a title="<%=tab.name%>"><%=tab.title%></a></li>
<%- else -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled"><a><%=o.name%></a></li>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled" data-group="<%=tab.name%>"><a title="<%=tab.name%>"><%=tab.title%></a></li>
<%- end -%>
<%- end -%>
<%- elseif #e ~= 1 then
for i, tab in ipairs(e) do
if tab.name == cfg_name and cfg_name then
-%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab" data-group="<%=tab.name%>"><a title="<%=tab.name%>"><%=tab.name%></a></li>
<%- elseif not cfg_name and tab.name == "all" then -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab" data-group="<%=tab.name%>"><a title="All">ALL</a></li>
<%- elseif tab.name == "all" then -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled" data-group="<%=tab.name%>"><a title="All">ALL</a></li>
<%- else -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled" data-group="<%=tab.name%>"><a title="<%=tab.name%>"><%=tab.name%></a></li>
<%- end -%>
<%- end -%>
<%- else -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a>ALL</a></li>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab" data-group="all"><a title="All">ALL</a></li>
<%- end -%>
</ul>
</div>
<div id="tab-content">
<%- for t,o in ipairs(e)do
if #e ~= 1 and o.name == cfg_name and cfg_name then
<%- for i, tab in ipairs(e) do
if self.sectiontype == "dns_servers" then
if tab.name == "nameserver" then
-%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
<%- elseif #e ~= 1 and o.name == "all" and not cfg_name then -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;" data-group="<%=tab.name%>">
<%- else -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" data-group="<%=tab.name%>">
<%- end -%>
<%- elseif #e ~= 1 and tab.name == cfg_name and cfg_name then -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;" data-group="<%=tab.name%>">
<%- elseif #e ~= 1 and tab.name == "all" and not cfg_name then -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;" data-group="<%=tab.name%>">
<%- elseif #e == 1 then -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;" data-group="all">
<%- else -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>">
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" data-group="<%=tab.name%>">
<%- end -%>
<table class="cbi-section-table">
<tr class="cbi-section-table-titles">
<table class="table cbi-section-table">
<tr class="tr cbi-section-table-titles">
<%- if not self.anonymous then -%>
<%- if self.sectionhead then -%>
<th class="cbi-section-table-cell"><%=self.sectionhead%></th>
<th class="th cbi-section-table-cell"><%=self.sectionhead%></th>
<%- else -%>
<th>&#160;</th>
<%- end -%>
<%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%>
<%- if i == 1 then -%>
<th class="cbi-section-table-cell"><%:Serial Number%></th>
<th class="th cbi-section-table-cell"><%:Serial Number%></th>
<%- end -%>
<th class="cbi-section-table-cell"<%=width(k)%>>
<th class="th cbi-section-table-cell"<%=width(k)%>>
<%- if k.titleref then -%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=k.titleref%>"><%- end -%>
<%-=k.title-%>
<%- if k.titleref then -%></a><%- end -%>
</th>
<%- count = count + 1; end; end; if self.sortable then -%>
<th class="cbi-section-table-cell"><%:Sort%></th>
<th class="th cbi-section-table-cell"><%:Sort%></th>
<%- end; if self.extedit or self.addremove then -%>
<th class="cbi-section-table-cell"><%:Edit%></th>
<th class="th cbi-section-table-cell"><%:Edit%></th>
<%- count = count + 1; end -%>
</tr>
<tr class="cbi-section-table-descr">
<tr class="tr cbi-section-table-descr">
<%- if not self.anonymous then -%>
<%- if self.sectiondesc then -%>
<th class="cbi-section-table-cell"><%=self.sectiondesc%></th>
<th class="th cbi-section-table-cell"><%=self.sectiondesc%></th>
<%- else -%>
<th></th>
<th class="th cbi-section-table-cell"></th>
<%- end -%>
<%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%>
<th class="cbi-section-table-cell"<%=width(k)%>><%=k.description%></th>
<%- if i == 1 then -%>
<th class="th cbi-section-table-cell"></th>
<%- end -%>
<th class="th cbi-section-table-cell"<%=width(k)%>><%=k.description%></th>
<%- end; end; if self.sortable then -%>
<th class="cbi-section-table-cell"></th>
<th class="th cbi-section-table-cell"></th>
<%- end; if self.extedit or self.addremove then -%>
<th class="cbi-section-table-cell"></th>
<th class="th cbi-section-table-cell"></th>
<%- end -%>
</tr>
<%- local isempty = true
local num = 1
for i, k in ipairs(self:cfgsections()) do
section = k
while true do
if not uci:get("openclash", section, "config") then
uci:set("openclash", section, "config", "all")
uci:save("openclash")
end
if uci:get("openclash", section, "config") ~= o.name then
break
end
local section = k
local should_render = false
local section_name
if self.sectiontype == "dns_servers" then
section_name = uci:get("openclash", section, "group")
else
section_name = uci:get("openclash", section, "config")
end
if section_name == tab.name then
should_render = true
end
if should_render then
isempty = false
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
-%>
<tr class="cbi-section-table-row<% if self.extedit or self.rowcolors then %> cbi-rowstyle-<%=rowstyle()%><% end %>" id="cbi-<%=self.config%>-<%=section%>">
<% if not self.anonymous then -%>
<tr class="tr cbi-section-table-row<% if self.extedit or self.rowcolors then %> cbi-rowstyle-<%=rowstyle()%><% end %>" id="cbi-<%=self.config%>-<%=section%>">
<%- if not self.anonymous then -%>
<th><h3><%=(type(self.sectiontitle) == "function") and self:sectiontitle(section) or k%></h3></th>
<%- end %>
<td class="cbi-section-table-cell">
<%- end -%>
<td class="td cbi-section-table-cell">
<p><%=num%></p>
<% num = num + 1 -%>
<%- num = num + 1 -%>
</td>
<%-
for k, node in ipairs(self.children) do
@@ -344,14 +375,14 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
end
-%>
<%- if self.sortable then -%>
<td class="cbi-section-table-cell">
<td class="tdcbi-section-table-cell">
<input class="cbi-button cbi-button-up" type="button" value="<%:∧%>" onclick="return cbi_row_swap(this, true, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move up%>" title="<%:Move up%>" />
<input class="cbi-button cbi-button-down" type="button" value="<%:%>" onclick="return cbi_row_swap(this, false, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move down%>" title="<%:Move down%>" />
</td>
<%- end -%>
<%- if self.extedit or self.addremove then -%>
<td class="cbi-section-table-cell">
<td class="td cbi-section-table-cell">
<%- if self.extedit then -%>
<input class="btn cbi-button cbi-button-edit" type="button" value="<%:Edit%>"
<%- if type(self.extedit) == "string" then
@@ -360,51 +391,53 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
%> onclick="location.href='<%=self:extedit(section)%>';return switch_to_tab<%=sectiontype%>()"
<%- end
%> alt="<%:Edit%>" title="<%:Edit%>" />
<%- end; if self.addremove then %>
<%- end; if self.addremove then -%>
<input class="btn cbi-button cbi-button-remove" type="submit" value="<%:Delete%>" onclick="this.form.cbi_state='del-section'; return switch_to_tab<%=sectiontype%>()" name="cbi.rts.<%=self.config%>.<%=k%>" alt="<%:Delete%>" title="<%:Delete%>" />
<%- end -%>
</td>
<%- end -%>
<%-
break
end
-%>
</tr>
<%- end -%>
<%- if isempty then -%>
<tr class="cbi-section-table-row">
<td colspan="<%=count%>"><em><br /><%:This section contains no values yet%></em></td>
</tr>
<tr class="tr cbi-section-table-row placeholder">
<td class="td" colspan="<%=count%>"><em><%:This section contains no values yet%></em></td>
</tr>
<%- end -%>
</table>
<% if self.error then %>
<%- if self.error then -%>
<div class="cbi-section-error">
<ul><% for _, c in pairs(self.error) do for _, e in ipairs(c) do -%>
<ul><%- for _, c in pairs(self.error) do for _, e in ipairs(c) do -%>
<li><%=pcdata(e):gsub("\n","<br />")%></li>
<%- end end %></ul>
<%- end end -%></ul>
</div>
<% end %>
<%- end -%>
<%- if self.addremove then -%>
<% if self.template_addremove then include(self.template_addremove) else -%>
<%- if self.template_addremove then include(self.template_addremove) else -%>
<div class="cbi-section-create cbi-tblsection-create">
<% if self.anonymous then %>
<input class="btn cbi-button cbi-button-add" type="submit" onclick="return switch_to_tab<%=sectiontype%>('create')" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" title="<%:Add%>" />
<% else %>
<%- if self.anonymous then -%>
<input class="btn cbi-button cbi-button-add" type="submit" onclick="return switch_to_tab<%=sectiontype%>('<%=tab.name%>')" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" title="<%:Add%>" />
<%- else -%>
<% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
<input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" data-type="uciname" data-optional="true" />
<input class="btn cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
<input type="submit" class="cbi-button cbi-button-add" onclick="this.form.cbi_state='add-section'; return switch_to_tab<%=sectiontype%>('<%=tab.name%>')" value="<%:Add%>" />
<% if self.invalid_cts then -%>
<br /><%:Invalid%></div>
<%- end %>
<% end %>
<%- end %>
</div>
<%- end %>
<%- end -%>
<%- end -%>
</div>
<%- end -%>
<%- if self.addremove then -%>
<input type="hidden" id="cbi.cts.tagname.<%=self.config%>.<%=self.sectiontype%>" name="cbi.cts.tagname.<%=self.config%>.<%=self.sectiontype%>" value="" />
<%- end -%>
</div>
</fieldset>
<!-- /tblsection -->
@@ -452,17 +485,20 @@ local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]
return luminance < 128;
};
function switch_to_tab<%=sectiontype%>(type){
function switch_to_tab<%=sectiontype%>(tab_name){
if(titles<%=sectiontype%>.length != divs<%=sectiontype%>.length) return;
if ( type == 'create' ) {
localStorage.setItem("titles<%=sectiontype%>", 0);
} else {
for(var j=0; j < titles<%=sectiontype%>.length; j++){
if(titles<%=sectiontype%>[j].className === 'cbi-tab'){
localStorage.setItem("titles<%=sectiontype%>", j);
break;
}
for(var j=0; j < titles<%=sectiontype%>.length; j++){
if(titles<%=sectiontype%>[j].className === 'cbi-tab'){
localStorage.setItem("titles<%=sectiontype%>", j);
break;
}
}
if (tab_name) {
var name = document.getElementById('cbi.cts.tagname.<%=self.config%>.<%=self.sectiontype%>');
if (name) {
name.value = tab_name;
}
}
@@ -1,488 +0,0 @@
<%-
local rowcnt = 1
local uci = require("luci.model.uci").cursor()
local fs = require "luci.openclash"
function rowstyle()
rowcnt = rowcnt + 1
return (rowcnt % 2) + 1
end
function width(o)
if o.width then
if type(o.width) == 'number' then
return ' style="width:%dpx"' % o.width
end
return ' style="width:%s"' % o.width
end
return ''
end
local head_width
local e={}
table.insert(e, {group="nameserver", title="NameServer"})
table.insert(e, {group="fallback", title="FallBack"})
table.insert(e, {group="default", title="Default-NameServer"})
local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]+") or "self.sectiontype"
-%>
<style type="text/css">
*{margin: 0;padding: 0;}
ul{
list-style: none;
}
h3{
margin-top: 0;
}
.cbi-value-field .cbi-dropdown, .cbi-value-field .cbi-input-select, .cbi-value input[type="text"], .cbi-value input[type="password"] {
min-width: auto;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%>{
display: flex;
align-items: center;
justify-content: flex-start;
padding: 16px 20px;
border-bottom: 1px solid var(--border-light, #e2e8f0);
background: var(--bg-gray, #f1f5f9);
min-width: 0;
box-shadow: none;
position: relative;
z-index: 1;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul{
display: flex;
width: 100%;
background: #f1f5f9;
border-radius: 8px;
border-bottom: none !important;
border: none !important;
gap: 5px;
margin: 0;
padding: 0;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li{
flex: 1 1 0;
min-width: 120px;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 12px 0;
height: 40px;
font-size: 12px;
font-weight: 400;
color: #64748b;
background: transparent;
border: 1px solid #e2e8f0;
border-radius: 8px;
cursor: pointer;
transition: all 0.18s;
margin: 0;
user-select: none;
position: relative;
box-sizing: border-box;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab{
background: #3b82f6;
color: #fff;
font-weight: 600;
z-index: 2;
border-radius: 6px;
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.03);
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a{
display: block;
width: 100%;
height: 130%;
text-align: center;
text-decoration: none;
background: none;
border: none;
outline: none;
font: inherit;
color: inherit;
cursor: inherit;
padding: 5px;
margin: 0;
user-select: none;
transition: color 0.18s;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab > a{
color: #fff !important;
font-weight: 500;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab-disabled{
color: #fff;
background: #f9f9f9;
opacity: 0.7;
cursor: pointer;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab-disabled a{
color: #000 !important;
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):hover,
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):focus{
color: #3b82f6;
background: rgba(59,130,246,0.10);
}
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):hover a,
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):focus a{
color: #3b82f6 !important;
}
#tab-content .dom-<%=self.config%>-<%=self.sectiontype%>{
display: none;
}
#tab-content .dom-<%=self.config%>-<%=self.sectiontype%> ul li{
float: left;
margin: 15px 10px;
width: 225px;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%>{
background: #374151;
border-bottom: 1px solid #374151;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul{
background: #374151;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li{
background: #1f2937;
color: #a1a1aa;
border-color: #374151;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab{
background: #2563eb;
color: #fff;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab a{
color: #fff !important;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab-disabled{
color: #1f2937;
background: #1f2937;
opacity: 0.7;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab-disabled a{
color: #fff !important;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):hover,
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):focus{
color: #3b82f6;
border-color: #3b82f6;
background: #22304a;
}
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):hover a,
:root[data-darkmode="true"] #tab-header-<%=self.config%>-<%=self.sectiontype%> ul li:not(.cbi-tab):focus a{
color: #60a5fa !important;
}
</style>
<!-- tblsection -->
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
<% if self.title and #self.title > 0 then -%>
<legend><%=self.title%></legend>
<%- end %>
<%- if self.sortable then -%>
<input type="hidden" id="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" name="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" value="" />
<%- end -%>
<div class="cbi-section-descr"><%=self.description%></div>
<%- local count = 0 -%>
<div id="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tabmenu">
<ul class="cbi-tabmenu">
<%- for i, tab in ipairs(e) do -%>
<%- if i == 1 then -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab" data-group="<%=tab.group%>"><a><%=tab.title%></a></li>
<%- else -%>
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled" data-group="<%=tab.group%>"><a><%=tab.title%></a></li>
<%- end -%>
<%- end -%>
</ul>
</div>
<div id="tab-content">
<%- for t,o in ipairs(e)do
if o.group == "nameserver" then
-%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;" data-group="<%=o.group%>">
<%- else -%>
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" data-group="<%=o.group%>">
<%- end -%>
<table class="cbi-section-table">
<tr class="cbi-section-table-titles">
<%- if not self.anonymous then -%>
<%- if self.sectionhead then -%>
<th class="cbi-section-table-cell"><%=self.sectionhead%></th>
<%- else -%>
<th>&#160;</th>
<%- end -%>
<%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%>
<%- if i == 1 then -%>
<th class="cbi-section-table-cell"><%:Serial Number%></th>
<%- end -%>
<th class="cbi-section-table-cell"<%=width(k)%>>
<%- if k.titleref then -%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=k.titleref%>"><%- end -%>
<%-=k.title-%>
<%- if k.titleref then -%></a><%- end -%>
</th>
<%- count = count + 1; end; end; if self.sortable then -%>
<th class="cbi-section-table-cell"><%:Sort%></th>
<%- end; if self.extedit or self.addremove then -%>
<th class="cbi-section-table-cell"><%:Edit%></th>
<%- count = count + 1; end -%>
</tr>
<tr class="cbi-section-table-descr">
<%- if not self.anonymous then -%>
<%- if self.sectiondesc then -%>
<th class="cbi-section-table-cell"><%=self.sectiondesc%></th>
<%- else -%>
<th></th>
<%- end -%>
<%- end; if self.extedit or self.addremove then -%>
<th></th>
<%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%>
<th class="cbi-section-table-cell"<%=width(k)%>><%=k.description%></th>
<%- end; end; if self.sortable then -%>
<th class="cbi-section-table-cell"></th>
<%- end; if self.extedit or self.addremove then -%>
<th class="cbi-section-table-cell"></th>
<%- end -%>
</tr>
<%- local isempty = true
local num = 1
for i, k in ipairs(self:cfgsections()) do
section = k
local section_group = fs.uci_get_config(section, "group")
if section_group == o.group then
isempty = false
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
-%>
<tr class="cbi-section-table-row<% if self.extedit or self.rowcolors then %> cbi-rowstyle-<%=rowstyle()%><% end %>" id="cbi-<%=self.config%>-<%=section%>">
<% if not self.anonymous then -%>
<th><h3><%=(type(self.sectiontitle) == "function") and self:sectiontitle(section) or k%></h3></th>
<%- end %>
<td class="cbi-section-table-cell">
<p><%=num%></p>
<% num = num + 1 -%>
</td>
<%-
for k, node in ipairs(self.children) do
if not node.optional then
node:render(section, scope or {})
end
end
-%>
<%- if self.sortable then -%>
<td class="cbi-section-table-cell">
<input class="cbi-button cbi-button-up" type="button" value="<%:∧%>" onclick="return cbi_row_swap(this, true, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move up%>" title="<%:Move up%>" />
<input class="cbi-button cbi-button-down" type="button" value="<%:%>" onclick="return cbi_row_swap(this, false, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move down%>" title="<%:Move down%>" />
</td>
<%- end -%>
<%- if self.extedit or self.addremove then -%>
<td class="cbi-section-table-cell">
<%- if self.extedit then -%>
<input class="btn cbi-button cbi-button-edit" type="button" value="<%:Edit%>"
<%- if type(self.extedit) == "string" then
%> onclick="location.href='<%=self.extedit:format(section)%>';return switch_to_tab<%=sectiontype%>()"
<%- elseif type(self.extedit) == "function" then
%> onclick="location.href='<%=self:extedit(section)%>';return switch_to_tab<%=sectiontype%>()"
<%- end
%> alt="<%:Edit%>" title="<%:Edit%>" />
<%- end; if self.addremove then %>
<input class="btn cbi-button cbi-button-remove" type="submit" value="<%:Delete%>" onclick="this.form.cbi_state='del-section';return switch_to_tab<%=sectiontype%>()" name="cbi.rts.<%=self.config%>.<%=k%>" alt="<%:Delete%>" title="<%:Delete%>" />
<%- end -%>
</td>
<%- end -%>
</tr>
<%- end -%>
<%- end -%>
<%- if isempty then -%>
<tr class="cbi-section-table-row">
<td colspan="<%=count%>"><em><br /><%:This section contains no values yet%></em></td>
</tr>
<%- end -%>
</table>
<% if self.error then %>
<div class="cbi-section-error">
<ul><% for _, c in pairs(self.error) do for _, e in ipairs(c) do -%>
<li><%=pcdata(e):gsub("\n","<br />")%></li>
<%- end end %></ul>
</div>
<% end %>
<%- if self.addremove then -%>
<% if self.template_addremove then include(self.template_addremove) else -%>
<div class="cbi-section-create cbi-tblsection-create">
<% if self.anonymous then %>
<input class="btn cbi-button cbi-button-add" type="submit" onclick="return switch_to_tab<%=sectiontype%>('create', '<%=o.group%>')" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" title="<%:Add%>" />
<% else %>
<% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
<input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=o.group%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=o.group%>" data-type="uciname" data-optional="true" />
<input type="hidden" name="cbi.opt.<%=self.config%>.<%=self.sectiontype%>.group" value="<%=o.group%>" />
<input class="btn cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
<% if self.invalid_cts then -%>
<br /><%:Invalid%></div>
<%- end %>
<% end %>
</div>
<%- end %>
<%- end -%>
</div>
<%- end -%>
</div>
</fieldset>
<!-- /tblsection -->
<script type="text/javascript">//<![CDATA[
window.addEventListener('load', onload<%=sectiontype%>, false);
var titles<%=sectiontype%> = document.getElementsByName('tab-header-<%=self.config%>-<%=self.sectiontype%>');
var divs<%=sectiontype%> = document.getElementsByClassName('dom-<%=self.config%>-<%=self.sectiontype%>');
function isDarkBackground(element) {
var cachedTheme = localStorage.getItem('oc-theme');
if (cachedTheme === 'dark') {
return true;
} else if (cachedTheme === 'light') {
return false;
}
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
return true;
}
var style = window.getComputedStyle(element);
var bgColor = style.backgroundColor;
let r, g, b;
if (/rgb\(/.test(bgColor)) {
var rgb = bgColor.match(/\d+/g);
r = parseInt(rgb);
g = parseInt(rgb);
b = parseInt(rgb);
} else if (/#/.test(bgColor)) {
if (bgColor.length === 4) {
r = parseInt(bgColor + bgColor, 16);
g = parseInt(bgColor + bgColor, 16);
b = parseInt(bgColor + bgColor, 16);
} else {
r = parseInt(bgColor.slice(1, 3), 16);
g = parseInt(bgColor.slice(3, 5), 16);
b = parseInt(bgColor.slice(5, 7), 16);
}
} else {
return false;
}
var luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b;
return luminance < 128;
};
function switch_to_tab<%=sectiontype%>(type){
if(titles<%=sectiontype%>.length != divs<%=sectiontype%>.length) return;
if ( type == 'create' ) {
localStorage.setItem("titles<%=sectiontype%>", 0);
} else {
for(var j=0; j < titles<%=sectiontype%>.length; j++){
if(titles<%=sectiontype%>[j].className === 'cbi-tab'){
localStorage.setItem("titles<%=sectiontype%>", j);
break;
}
}
}
localStorage.setItem("id<%=sectiontype%>",'cbi-<%=self.config%>-<%=self.sectiontype%>');
return true;
};
function onload<%=sectiontype%>() {
if (isDarkBackground(document.body)) {
document.documentElement.setAttribute('data-darkmode', 'true');
};
if(titles<%=sectiontype%>.length != divs<%=sectiontype%>.length) return;
if (localStorage.getItem("id<%=sectiontype%>")) {
if (document.getElementById(localStorage.getItem("id<%=sectiontype%>"))) {
document.getElementById(localStorage.getItem("id<%=sectiontype%>")).scrollIntoView();
};
localStorage.removeItem("id<%=sectiontype%>");
};
if (localStorage.getItem("titles<%=sectiontype%>")) {
if (titles<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")]) {
for(var j=0; j < titles<%=sectiontype%>.length; j++){
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
divs<%=sectiontype%>[j].style.display = 'none';
};
titles<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")].className = 'cbi-tab';
divs<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")].style.display = 'block';
};
localStorage.removeItem("titles<%=sectiontype%>");
};
for(var i=0; i < titles<%=sectiontype%>.length; i++){
var li<%=sectiontype%> = titles<%=sectiontype%>[i];
li<%=sectiontype%>.id = i;
var a<%=sectiontype%> = li<%=sectiontype%>.querySelector('a');
if (a<%=sectiontype%>) {
if (a<%=sectiontype%>.scrollWidth > a<%=sectiontype%>.clientWidth) {
a<%=sectiontype%>.style.textAlign = 'left';
} else {
a<%=sectiontype%>.style.textAlign = 'center';
}
}
li<%=sectiontype%>.onclick = function(){
for(var j=0; j < titles<%=sectiontype%>.length; j++){
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
divs<%=sectiontype%>[j].style.display = 'none';
};
this.className = 'cbi-tab';
divs<%=sectiontype%>[this.id].style.display = 'block';
localStorage.setItem("titles<%=sectiontype%>",this.id);
};
li<%=sectiontype%>.onTouchStart = function(){
for(var j=0; j < titles<%=sectiontype%>.length; j++){
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
divs<%=sectiontype%>[j].style.display = 'none';
};
this.className = 'cbi-tab';
divs<%=sectiontype%>[this.id].style.display = 'block';
localStorage.setItem("titles<%=sectiontype%>",this.id);
};
};
};
//]]>
</script>
@@ -144,7 +144,7 @@
function restore_config(btn)
{
btn.value = '<%:Restore Default Config%>';
btn.value = '<%:Restore Default%>';
btn.disabled = true;
var r = confirm("<%:Are you sure want to restore the default config?%>")
if (r == true) {
@@ -1,146 +1,132 @@
<style>
.cbi-input-select {
width: auto !important;
width: auto !important;
}
</style>
<fieldset class="cbi-section">
<table width="100%">
<tr><td width="100%" colspan="6">
<p align="center" id="update_tip">
<b><%:Note: if the update fails, you can manually download and upload%></b>
</p>
</td></tr>
<tr><td width="16.6%" align="right"><%:Compiled Version%></td>
<td width="16.6%" align="left">
<select class="cbi-input-select" name="CORE_VERSION" id="CORE_VERSION">
<option value="linux-386"><%:linux-386%></option>
<option value="linux-amd64-v1"><%:linux-amd64-v1(x86-64)%></option>
<option value="linux-amd64-v2"><%:linux-amd64-v2(x86-64)%></option>
<option value="linux-amd64-v3"><%:linux-amd64-v3(x86-64)%></option>
<option value="linux-armv5"><%:linux-armv5%></option>
<option value="linux-armv6"><%:linux-armv6%></option>
<option value="linux-armv7"><%:linux-armv7%></option>
<option value="linux-arm64"><%:linux-arm64(armv8)%></option>
<option value="linux-loong64-abi1"><%:linux-loong64-abi1%></option>
<option value="linux-loong64-abi2"><%:linux-loong64-abi2%></option>
<option value="linux-riscv64"><%:linux-riscv64%></option>
<option value="linux-s390x"><%:linux-s390x%></option>
<option value="linux-mips-hardfloat"><%:linux-mips-hardfloat%></option>
<option value="linux-mips-softfloat"><%:linux-mips-softfloat%></option>
<option value="linux-mips64"><%:linux-mips64%></option>
<option value="linux-mips64le"><%:linux-mips64le%></option>
<option value="linux-mipsle-softfloat"><%:linux-mipsle-softfloat%></option>
<option value="linux-mipsle-hardfloat"><%:linux-mipsle-hardfloat%></option>
<option value="0"><%:Not Set%></option>
</select>
</td>
<td width="16.6%" align="right"><%:Release Branch%></td>
<td width="16.6%" align="left"><select class="cbi-input-select" name="RELEASE_BRANCH" id="RELEASE_BRANCH">
<option value="master">Master</option>
<option value="dev">Developer</option>
</select></td>
<td width="16.6%" align="right"><%:Smart Core%> <a href="javascript:void(0);" onclick="window.open('https://github.com/vernesong/mihomo/releases', '_blank');" style="color: #0066cc; text-decoration: none;" title="<%:View core infos that support smart group%>"> (?)</a></td>
<td width="16.6%" align="left"><select class="cbi-input-select" name="SMART_ENABLE" id="SMART_ENABLE">
<option value="0"><%:Disabled%></option>
<option value="1"><%:Enable%></option>
</select></td>
</tr>
<tr>
<td width="100%" colspan="6">
<p align="center" id="update_tip" class="oc" style="background-color: unset;">
<b style="color: var(--info-color);"><%:Note: if the update fails, you can manually download and upload%></b>
</p>
</td>
</tr>
<tr>
<td width="16.6%" align="right"><%:Compiled Version%></td>
<td width="16.6%" align="left">
<select class="cbi-input-select" name="CORE_VERSION" id="CORE_VERSION">
<option value="linux-386"><%:linux-386%></option>
<option value="linux-amd64-v1"><%:linux-amd64-v1(x86-64)%></option>
<option value="linux-amd64-v2"><%:linux-amd64-v2(x86-64)%></option>
<option value="linux-amd64-v3"><%:linux-amd64-v3(x86-64)%></option>
<option value="linux-armv5"><%:linux-armv5%></option>
<option value="linux-armv6"><%:linux-armv6%></option>
<option value="linux-armv7"><%:linux-armv7%></option>
<option value="linux-arm64"><%:linux-arm64(armv8)%></option>
<option value="linux-loong64-abi1"><%:linux-loong64-abi1%></option>
<option value="linux-loong64-abi2"><%:linux-loong64-abi2%></option>
<option value="linux-riscv64"><%:linux-riscv64%></option>
<option value="linux-s390x"><%:linux-s390x%></option>
<option value="linux-mips-hardfloat"><%:linux-mips-hardfloat%></option>
<option value="linux-mips-softfloat"><%:linux-mips-softfloat%></option>
<option value="linux-mips64"><%:linux-mips64%></option>
<option value="linux-mips64le"><%:linux-mips64le%></option>
<option value="linux-mipsle-softfloat"><%:linux-mipsle-softfloat%></option>
<option value="linux-mipsle-hardfloat"><%:linux-mipsle-hardfloat%></option>
<option value="0"><%:Not Set%></option>
</select>
</td>
<td width="16.6%" align="right"><%:Release Branch%></td>
<td width="16.6%" align="left">
<select class="cbi-input-select" name="RELEASE_BRANCH" id="RELEASE_BRANCH">
<option value="master">Master</option>
<option value="dev">Developer</option>
</select>
</td>
<td width="16.6%" align="right"><%:Smart Core%>
<a href="javascript:void(0);" onclick="window.open('https://github.com/vernesong/mihomo/releases', '_blank');" style="color: #0066cc; text-decoration: none;" title="<%:View core infos that support smart group%>">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
</a>
</td>
<td width="16.6%" align="left">
<select class="cbi-input-select" name="SMART_ENABLE" id="SMART_ENABLE">
<option value="0"><%:Disabled%></option>
<option value="1"><%:Enable%></option>
</select>
</td>
</tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<table width="100%">
<tr><td width="100%" colspan="4">
<p align="center">
<b><%:Core Update%></b>
</p>
</td></tr>
<tr><td width="100%" colspan="4">
<tr>
<td width="100%" colspan="4">
<p align="center">
<b><%:Core Update%></b>
</p>
</td>
</tr>
<tr>
<td width="25%"><%:CPU Architecture%></td><td width="25%" align="left" id="CPU_MODEL"><%:Collecting data...%></td>
<td width="25%"><%:Last Check Update%></td><td width="25%" align="left" id="CHECKTIME"><%:Collecting data...%></td>
</tr>
<tr><td width="100%" colspan="4">
<p align="center">
<b><%:Core path:%>/etc/openclash/core/clash_meta</b>
</p>
</td></tr>
<tr>
<td width="100%" colspan="4">
<p align="center">
<b><%:Core path:%>/etc/openclash/core/clash_meta</b>
</p>
</td>
</tr>
<tr><td width="25%">[Meta] <%:Current Core%></td><td width="25%" align="left" id="CORE_META_CV"><%:Collecting data...%></td><td width="25%">[Meta] <%:Latest Core%></td><td width="25%" align="left" id="CORE_META_LV"><%:Collecting data...%></td></tr>
<tr><td width="25%"><%:Update Core%></td><td width="25%" align="left" id="core_meta_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Core%></td><td width="25%" align="left" id="ma_core_meta_up"><%:Collecting data...%></td></tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<table width="100%">
<tr><td width="100%" colspan="4">
<p align="center">
<b><%:Client Update%></b>
</p>
</td></tr>
<tr><td width="25%"><%:Current Client%></td><td width="25%" align="left" id="OP_CV"><%:Collecting data...%></td><td width="25%"><%:Latest Client%></td><td width="25%" align="left" id="OP_LV"><%:Collecting data...%></td></tr>
<tr><td width="25%"><%:Update Client%></td><td width="25%" align="left" id="op_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Client%></td><td width="25%" align="left" id="ma_op_up"><%:Collecting data...%></td></tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<table width="100%">
<tr>
<td width="33%">
<p align="center" id="restore">
<%:Collecting data...%>
</p>
</td>
<td width="33%">
<p align="center" id="remove_core">
<%:Collecting data...%>
</p>
</td>
<td width="33%">
<p align="center" id="one_key_update_cdn">
<%:Collecting data...%>
</p>
</td>
</tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<table width="100%">
<tr><td width="100%" colspan="4">
<p align="center">
<b><%:Backup Section%></b>
</p>
</td></tr>
<tr>
<td width="25%">
<p align="center" id="backup">
<%:Collecting data...%>
</p>
</td>
<td width="25%">
<p align="center" id="backup_ex_core">
<%:Collecting data...%>
</p>
</td>
<td width="25%">
<p align="center" id="backup_core_only">
<%:Collecting data...%>
</p>
</td>
<td width="100%" colspan="4">
<p align="center">
<b><%:Client Update%></b>
</p>
</td>
</tr>
<tr><td width="25%"><%:Current Client%></td><td width="25%" align="left" id="OP_CV"><%:Collecting data...%></td><td width="25%"><%:Latest Client%></td><td width="25%" align="left" id="OP_LV"><%:Collecting data...%></td></tr>
<tr><td width="25%"><%:Update Client%></td><td width="25%" align="left" id="op_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Client%></td><td width="25%" align="left" id="ma_op_up"><%:Collecting data...%></td></tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<table width="100%">
<tr>
<td width="25%">
<p align="center" id="backup_config_only">
<%:Collecting data...%>
</p>
</td>
<td width="25%">
<p align="center" id="backup_rule_only">
<%:Collecting data...%>
</p>
</td>
<td width="25%">
<p align="center" id="backup_proxy_only">
<%:Collecting data...%>
</p>
</td>
<td width="25%" align="center">
<div style="display: inline-block; white-space: nowrap;">
<select class="cbi-input-select" name="BACKUP_SELECT" id="BACKUP_SELECT">
<option value="backup"><%:Backup File%></option>
<option value="backup_ex_core"><%:Backup Exclude Cores%></option>
<option value="backup_only_core"><%:Backup Core%></option>
<option value="backup_only_config"><%:Backup Config%></option>
<option value="backup_only_rule"><%:Backup Rule Provider%></option>
<option value="backup_only_proxy"><%:Backup Proxy Provider%></option>
</select>
<span id="backup">
<%:Collecting data...%>
</span>
</div>
</td>
<td width="25%" align="center" id="restore">
<%:Collecting data...%>
</td>
<td width="25%" align="center" id="remove_core">
<%:Collecting data...%>
</td>
<td width="25%" align="center" id="one_key_update_cdn">
<%:Collecting data...%>
</td>
</tr>
</table>
</fieldset>
@@ -160,11 +146,7 @@
var ma_op_up = document.getElementById('ma_op_up');
var restore = document.getElementById('restore');
var backup = document.getElementById('backup');
var backup_ex_core = document.getElementById('backup_ex_core');
var backup_core_only = document.getElementById('backup_core_only');
var backup_config_only = document.getElementById('backup_config_only');
var backup_rule_only = document.getElementById('backup_rule_only');
var backup_proxy_only = document.getElementById('backup_proxy_only');
var backup_select = document.getElementById('BACKUP_SELECT');
var one_key_update_cdn = document.getElementById('one_key_update_cdn');
var remove_core = document.getElementById('remove_core');
var release_branch = document.getElementById('RELEASE_BRANCH');
@@ -173,29 +155,24 @@
op_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return op_update(this)"/>';
ma_core_meta_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_core_update(this,\'Meta\')"/>';
ma_op_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_op_update(this)"/>';
restore.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Restore Default Config%>" onclick="return restore_config(this)"/>';
restore.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Restore Default%>" onclick="return restore_config(this)"/>';
one_key_update_cdn.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Check Update%>" onclick="return all_one_key_update_cdn(this)"/>';
remove_core.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Remove Core%>" onclick="return remove_all_core(this)"/>';
backup.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup OpenClash%>" onclick="return backup_all_file(this)"/>';
backup_ex_core.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Exclude Cores%>" onclick="return backup_no_core(this)"/>';
backup_core_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Core%>" onclick="return backup_only_core(this)"/>';
backup_config_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Config%>" onclick="return backup_only_config(this)"/>';
backup_rule_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Rule Provider%>" onclick="return backup_only_rule(this)"/>';
backup_proxy_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Proxy Provider%>" onclick="return backup_only_proxy(this)"/>';
backup.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup File%>" onclick="return backup_file(this)"/>';
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_info")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
if ( status.corever && status.corever != "0" && status.corever != "" ) {
core_version.value = status.corever;
core_version.value = status.corever;
}
else {
core_version.value = "0";
core_version.value = "0";
}
if ( status.release_branch && status.release_branch != "" ) {
release_branch.value = status.release_branch;
release_branch.value = status.release_branch;
}
else {
release_branch.value = "master";
release_branch.value = "master";
}
if ( status.smart_enable && status.smart_enable != "" ) {
smart_enable.value = status.smart_enable;
@@ -215,190 +192,169 @@
});
function updateStatus(x, status) {
if ( x && x.status == 200 ) {
cpu_model.innerHTML = status.coremodel ? "<b style=color:green>"+status.coremodel+"</b>" : "<b style=color:red><%:Model Not Found%></b>";
if ( status.upchecktime != "1" ) {
checktime.innerHTML = "<b style=color:green>"+status.upchecktime+"</b>";
}
else {
checktime.innerHTML = "<b style=color:red><%:Check Failed%></b>";
}
if ( status.coremetacv == "0" ) {
core_meta_cv.innerHTML = "<b style=color:red><%:Unknown%></b>";
}
else {
core_meta_cv.innerHTML = "<b style=color:green>"+status.coremetacv+"</b>";
}
var coremetalvis = status.corelv;
if (coremetalvis != status.coremetacv && coremetalvis != "" && coremetalvis != "loading...") {
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+" <%:<New>%></b>";
}
else if (coremetalvis != "" && coremetalvis == status.coremetacv && coremetalvis != "loading...") {
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+"</b>";
}
else if (coremetalvis == "loading...") {
core_meta_lv.innerHTML = "<b style=color:green><%:Getting Last Version...%></b>";
}
else {
core_meta_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
}
var oplv = status.oplv;
op_cv.innerHTML = status.opcv != "0" ? "<b style=color:green>"+status.opcv+"</b>" : "<b style=color:red><%:Unknown%></b>";
if (oplv != "" && oplv != "loading..." && status.opcv != "0") {
function compareVersions(v1, v2) {
var ver1 = v1.replace(/^v/, '').split('.');
var ver2 = v2.replace(/^v/, '').split('.');
if ( x && x.status == 200 ) {
cpu_model.innerHTML = status.coremodel ? "<b style=color:green>"+status.coremodel+"</b>" : "<b style=color:red><%:Model Not Found%></b>";
var maxLen = Math.max(ver1.length, ver2.length);
while (ver1.length < maxLen) ver1.push('0');
while (ver2.length < maxLen) ver2.push('0');
if ( status.upchecktime != "1" ) {
checktime.innerHTML = "<b style=color:green>"+status.upchecktime+"</b>";
} else {
checktime.innerHTML = "<b style=color:red><%:Check Failed%></b>";
}
if ( status.coremetacv == "0" ) {
core_meta_cv.innerHTML = "<b style=color:red><%:Unknown%></b>";
} else {
core_meta_cv.innerHTML = "<b style=color:green>"+status.coremetacv+"</b>";
}
for (var i = 0; i < maxLen; i++) {
var num1 = parseInt(ver1[i], 10);
var num2 = parseInt(ver2[i], 10);
if (num1 > num2) return 1;
if (num1 < num2) return -1;
}
return 0;
}
var coremetalvis = status.corelv;
if (compareVersions(oplv, status.opcv) > 0) {
op_lv.innerHTML = "<b style=color:green>"+oplv+" <%:<New>%></b>";
} else {
op_lv.innerHTML = "<b style=color:green>"+oplv+"</b>";
}
}
else if (oplv != "" && oplv != "loading...") {
op_lv.innerHTML = "<b style=color:green>"+oplv+"</b>";
}
else if (oplv == "loading...") {
op_lv.innerHTML = "<b style=color:green><%:Getting Last Version...%></b>";
}
else {
op_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
}
}
}
if (coremetalvis != status.coremetacv && coremetalvis != "" && coremetalvis != "loading...") {
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+" <%:<New>%></b>";
} else if (coremetalvis != "" && coremetalvis == status.coremetacv && coremetalvis != "loading...") {
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+"</b>";
} else if (coremetalvis == "loading...") {
core_meta_lv.innerHTML = "<b style=color:green><%:Getting Last Version...%></b>";
} else {
core_meta_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
}
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, updateStatus);
var oplv = status.oplv;
op_cv.innerHTML = status.opcv != "0" ? "<b style=color:green>"+status.opcv+"</b>" : "<b style=color:red><%:Unknown%></b>";
XHR.poll(10, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, updateStatus);
if (oplv != "" && oplv != "loading..." && status.opcv != "0") {
function compareVersions(v1, v2) {
var ver1 = v1.replace(/^v/, '').split('.');
var ver2 = v2.replace(/^v/, '').split('.');
var maxLen = Math.max(ver1.length, ver2.length);
while (ver1.length < maxLen) ver1.push('0');
while (ver2.length < maxLen) ver2.push('0');
for (var i = 0; i < maxLen; i++) {
var num1 = parseInt(ver1[i], 10);
var num2 = parseInt(ver2[i], 10);
if (num1 > num2) return 1;
if (num1 < num2) return -1;
}
return 0;
}
if (compareVersions(oplv, status.opcv) > 0) {
op_lv.innerHTML = "<b style=color:green>"+oplv+" <%:<New>%></b>";
} else {
op_lv.innerHTML = "<b style=color:green>"+oplv+"</b>";
}
} else if (oplv != "" && oplv != "loading...") {
op_lv.innerHTML = "<b style=color:green>"+oplv+"</b>";
} else if (oplv == "loading...") {
op_lv.innerHTML = "<b style=color:green><%:Getting Last Version...%></b>";
} else {
op_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
}
}
}
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, updateStatus);
XHR.poll(10, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, updateStatus);
function handleStartLog(x, status) {
if ( x && x.status == 200 ) {
if ( status.startlog == "\n" || status.startlog == "" || status.startlog == "##FINISH##\n" ) {
var rdmdl = Math.floor(Math.random()*3)+1;
if(rdmdl == 1) {
update_tip.innerHTML = '<b><font><%:Note: if the update fails, you can manually download and upload%></font></b>';
}
else if(rdmdl == 2) {
update_tip.innerHTML = '<b><font><%:Note: the client may not support update, because the firmware with squashfs format will not release flash space after updating%></font></b>';
}
else if(rdmdl == 3) {
update_tip.innerHTML = '<b><font><%:Note: options will auto-save when you click to update or download%></font></b>';
}
}
else if ( status.startlog.match("level=fatal") || status.startlog.indexOf("FTL [Config]") != "-1" ) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {});
if ( status.startlog.match("level=fatal") ) {
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('msg=')[1]);
}
else {
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('FTL [Config] ')[1]);
}
}
else if ( status.startlog != "\n" && status.startlog != "" && status.startlog != "##FINISH##\n" ) {
if ( status.startlog.match("Tip:") || status.startlog.match("提示:")) {
update_tip.innerHTML = '<b style=color:#ff6f00>'+status.startlog+'</b>';
}
else if ( status.startlog.match("Error:") || status.startlog.match("错误:")) {
update_tip.innerHTML = '<b style=color:#FF0000>'+status.startlog+'</b>';
}
else if ( status.startlog.match("Warning:") || status.startlog.match("警告:")) {
update_tip.innerHTML = '<b style=color:#ff00bb>'+status.startlog+'</b>';
}
else if ( status.startlog.match("Watchdog:") || status.startlog.match("守护程序:")) {
update_tip.innerHTML = '<b style=color:#b300ff>'+status.startlog+'</b>';
}
else {
update_tip.innerHTML = '<b style=color:green>'+status.startlog+'</b>';
}
}
}
}
if ( x && x.status == 200 ) {
if ( status.startlog == "\n" || status.startlog == "" || status.startlog == "##FINISH##\n" ) {
var rdmdl = Math.floor(Math.random()*3)+1;
if(rdmdl == 1) {
update_tip.innerHTML = '<b style=color:var(--info-color)><%:Note: if the update fails, you can manually download and upload%></b>';
}
else if(rdmdl == 2) {
update_tip.innerHTML = '<b style=color:var(--info-color)><%:Note: the client may not support update, because the firmware with squashfs format will not release flash space after updating%></b>';
}
else if(rdmdl == 3) {
update_tip.innerHTML = '<b style=color:var(--info-color)><%:Note: options will auto-save when you click to update or download%></b>';
}
} else if ( status.startlog.match("level=fatal")) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {});
if ( status.startlog.match("level=fatal") ) {
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('msg=')[1]);
}
} else if ( status.startlog != "\n" && status.startlog != "" && status.startlog != "##FINISH##\n" ) {
for (var levelKey in window.levelTranslations) {
var translatedText = '[' + window.levelTranslations[levelKey] + ']';
if (status.startlog.match(translatedText)) {
update_tip.innerHTML = '<b style=color:var(--' + levelKey + '-color)>' + status.startlog + '</b>';
return;
}
}
update_tip.innerHTML = '<b style=color:var(--info-color)>' + status.startlog + '</b>';
}
}
}
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', null, handleStartLog);
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', null, handleStartLog);
function core_update(btn,type)
{
var v = core_version.value;
var r = release_branch.value;
function core_update(btn,type) {
var v = core_version.value;
var r = release_branch.value;
var s = smart_enable.value;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r, smart_enable: s}, function(x, status) {
if (x && x.status == 200) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "coreupdate")%>', {core_type: type}, function(x, status) {
btn.value = '<%:Check And Update%>';
btn.value = '<%:Check And Update%>';
btn.disabled = false;
return false;
});
}
});
}
}
function op_update(btn)
{
var v = core_version.value;
var r = release_branch.value;
function op_update(btn) {
var v = core_version.value;
var r = release_branch.value;
var s = smart_enable.value;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r, smart_enable: s}, function(x, status) {
if (x && x.status == 200) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "opupdate")%>', null, function(x, status) {
btn.value = '<%:Check And Update%>';
btn.value = '<%:Check And Update%>';
btn.disabled = false;
return false;
});
}
});
}
}
function ma_core_update(btn,type)
{
var v = core_version.value;
function ma_core_update(btn,type) {
var v = core_version.value;
var r = release_branch.value;
var s = smart_enable.value;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r, smart_enable: s}, function(x, status) {
if (x && x.status == 200) {
btn.value = '<%:Download%>';
btn.disabled = false;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_ma")%>', status.corever, function(x, status) {
if ( x && x.status == 200 ) {
if ( status.corever != "0" ) {
if (type == "Meta") {
if (s == "1") {
url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/smart/clash-'+status.corever+'.tar.gz';
window.location.href=url4;
}
else {
url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/meta/clash-'+status.corever+'.tar.gz';
window.location.href=url4;
if (x && x.status == 200) {
btn.value = '<%:Download%>';
btn.disabled = false;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_ma")%>', status.corever, function(x, status) {
if ( x && x.status == 200 ) {
if ( status.corever != "0" ) {
if (type == "Meta") {
if (s == "1") {
url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/smart/clash-'+status.corever+'.tar.gz';
window.location.href=url4;
} else {
url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/meta/clash-'+status.corever+'.tar.gz';
window.location.href=url4;
}
}
} else {
alert('<%:No Compiled Version is Selected, Please Select on The Top and Try Again!%>')
}
}
}
else {
alert('<%:No Compiled Version is Selected, Please Select on The Top and Try Again!%>')
}
});
return false;
}
});
return false;
}
});
}
});
}
function ma_op_update(btn)
{
btn.value = '<%:Download%>';
btn.disabled = false;
var v = core_version.value;
function ma_op_update(btn) {
btn.value = '<%:Download%>';
btn.disabled = false;
var v = core_version.value;
var r = release_branch.value;
var s = smart_enable.value;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r, smart_enable: s}, function(x, status) {
@@ -409,108 +365,56 @@
if ( oplv != "" && oplv != "loading..." ) {
if (status.pkg_type == "apk") {
url2='https://raw.githubusercontent.com/vernesong/OpenClash/package/'+r+'/luci-app-openclash-'+oplv+'.apk';
}
else {
} else {
url2='https://raw.githubusercontent.com/vernesong/OpenClash/package/'+r+'/luci-app-openclash_'+oplv+'_all.ipk';
}
window.location.href=url2;
}
else {
} else {
alert('<%:Failed to get the latest version. Please try again later!%>')
}
}
});
}
});
return false;
}
});
return false;
}
function remove_all_core(btn)
{
btn.value = '<%:Remove Core%>';
btn.disabled = true;
var r = confirm("<%:Are you sure want to remove all core files?%>")
if (r == true) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "remove_all_core")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
alert('<%:Remove succeeded!%>')
}
else {
alert('<%:Remove failed!%>')
}
});
} else {
}
btn.disabled = false;
return false;
}
function backup_all_file(btn)
{
btn.value = '<%:Backup OpenClash%>';
function remove_all_core(btn) {
btn.value = '<%:Remove Core%>';
btn.disabled = true;
window.location.href='<%="backup"%>';
var r = confirm("<%:Are you sure want to remove all core files?%>")
if (r == true) {
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "remove_all_core")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
alert('<%:Remove succeeded!%>')
} else {
alert('<%:Remove failed!%>')
}
});
}
btn.disabled = false;
return false;
}
}
function backup_no_core(btn)
{
btn.value = '<%:Backup Exclude Cores%>';
function backup_file(btn) {
btn.value = '<%:Backup File%>';
btn.disabled = true;
window.location.href='<%="backup_ex_core"%>';
window.location.href=backup_select.value;
btn.disabled = false;
return false;
}
}
function backup_only_core(btn)
{
btn.value = '<%:Backup Core%>';
btn.disabled = true;
window.location.href='<%="backup_only_core"%>';
btn.disabled = false;
return false;
}
function backup_only_config(btn)
{
btn.value = '<%:Backup Config%>';
btn.disabled = true;
window.location.href='<%="backup_only_config"%>';
btn.disabled = false;
return false;
}
function backup_only_rule(btn)
{
btn.value = '<%:Backup Rule Provider%>';
btn.disabled = true;
window.location.href='<%="backup_only_rule"%>';
btn.disabled = false;
return false;
}
function backup_only_proxy(btn)
{
btn.value = '<%:Backup Proxy Provider%>';
btn.disabled = true;
window.location.href='<%="backup_only_proxy"%>';
btn.disabled = false;
return false;
}
function all_one_key_update_cdn(btn)
{
var v = core_version.value;
function all_one_key_update_cdn(btn) {
var v = core_version.value;
var r = release_branch.value;
var s = smart_enable.value;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r, smart_enable: s}, function(x, status) {
if (x && x.status == 200) {
btn.value = '<%:Check Update%>';
btn.value = '<%:Check Update%>';
btn.disabled = false;
return select_git_cdn("one_key_update");
}
});
}
}
//]]></script>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -13,18 +13,14 @@ config openclash 'config'
option auto_update_time '0'
option cn_port '9090'
option dashboard_forward_ssl '0'
option rule_source '0'
option enable_custom_dns '0'
option ipv6_enable '0'
option ipv6_dns '0'
option enable_custom_clash_rules '0'
option other_rule_auto_update '0'
option core_version '0'
option en_mode 'fake-ip'
option enable_redirect_dns '1'
option servers_if_update '0'
option disable_masq_cache '1'
option servers_update '0'
option log_level '0'
option proxy_mode 'rule'
option intranet_allowed '1'
File diff suppressed because it is too large Load Diff
@@ -5,6 +5,6 @@
# This script is called by /etc/init.d/openclash
# Add your custom firewall rules here, they will be added after the end of the OpenClash iptables rules
LOG_OUT "Tip: Start Add Custom Firewall Rules..."
LOG_TIP "Start Add Custom Firewall Rules..."
exit 0
@@ -6,7 +6,7 @@
# This script is called by /etc/init.d/openclash
# Add your custom overwrite scripts here, they will be take effict after the OpenClash own srcipts
LOG_OUT "Tip: Start Running Custom Overwrite Scripts..."
LOG_TIP "Start Running Custom Overwrite Scripts..."
LOGTIME=$(echo $(date "+%Y-%m-%d %H:%M:%S"))
LOG_FILE="/tmp/openclash.log"
#Config Path
@@ -42,7 +42,7 @@ CONFIG_FILE="$1"
#2--key name
#3--hash
#ruby_merge_hash "$CONFIG_FILE" "['proxy-providers']" "'TW'=>{'type'=>'http', 'path'=>'./proxy_provider/TW.yaml', 'url'=>'https://gist.githubusercontent.com/raw/tw_clash', 'interval'=>3600, 'health-check'=>{'enable'=>true, 'url'=>'http://cp.cloudflare.com/generate_204', 'interval'=>300}}"
#ruby_merge_hash "$CONFIG_FILE" "['rule-providers']" "'Reject'=>{'type'=>'http', 'behavior'=>'classical', 'url'=>'https://testingcf.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Reject.yaml', 'path'=>'./rule_provider/Reject', 'interval'=>86400}"
#ruby_merge_hash "$CONFIG_FILE" "['rule-providers']" "'Reject'=>{'type'=>'http', 'behavior'=>'classical', 'url'=>'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/refs/heads/master/Clash/Apple.list', 'path'=>'./rule_provider/Apple.list', 'interval'=>86400}"
#Array Edit Demo
#1--config path
@@ -51,7 +51,7 @@ CONFIG_FILE="$1"
#4--match key value
#5--target key name
#6--target key value
#ruby_arr_edit "$CONFIG_FILE" "['proxy-groups']" "['name']" "Proxy" "['type']" "Smart"
#ruby_arr_edit "$CONFIG_FILE" "['proxy-groups']" "['name']" "Proxy" "['type']" "smart"
#ruby_arr_edit "$CONFIG_FILE" "['dns']['nameserver']" "" "114.114.114.114" "" "119.29.29.29"
#Array Insert Value Demo:
@@ -103,7 +103,7 @@ CONFIG_FILE="$1"
# begin
# Value = YAML.load_file('$CONFIG_FILE');
# rescue Exception => e
# puts '${LOGTIME} Error: Load File Failed,【' + e.message + '】';
# puts '${LOGTIME} [error] Load File Failed,【' + e.message + '】';
# end;
#General
@@ -117,7 +117,7 @@ CONFIG_FILE="$1"
# }.join;
# rescue Exception => e
# puts '${LOGTIME} Error: Set General Failed,【' + e.message + '】';
# puts '${LOGTIME} [error] Set General Failed,【' + e.message + '】';
# ensure
# File.open('$CONFIG_FILE','w') {|f| YAML.dump(Value, f)};
# end" 2>/dev/null >> $LOG_FILE
@@ -1,618 +0,0 @@
payload:
- 1.165.84.0/24
- 1.165.85.0/24
- 1.165.90.0/24
- 5.8.200.0/24
- 5.9.123.0/24
- 13.73.0.0/16
- 13.73.1.0/24
- 13.75.114.0/24
- 13.126.76.0/24
- 14.18.251.72/32
- 18.214.26.0/24
- 24.105.28.0/24
- 27.64.93.0/24
- 34.235.169.0/24
- 35.185.157.0/24
- 35.198.200.0/24
- 36.232.23.0/24
- 36.232.28.0/24
- 36.232.29.0/24
- 37.21.10.0/24
- 37.230.228.0/24
- 42.113.94.0/24
- 42.114.229.0/24
- 43.225.199.0/24
- 43.239.136.0/24
- 43.241.50.0/24
- 43.249.36.0/24
- 45.113.137.0/24
- 45.113.191.0/24
- 45.119.240.0/24
- 45.121.184.0/24
- 45.121.185.0/24
- 45.121.186.0/24
- 45.121.187.0/24
- 47.52.16.0/24
- 47.52.17.0/24
- 47.52.18.0/24
- 47.52.19.0/24
- 47.52.20.0/24
- 47.52.21.0/24
- 47.52.22.0/24
- 47.52.23.0/24
- 47.52.24.0/24
- 47.52.25.0/24
- 47.52.26.0/24
- 47.52.27.0/24
- 47.52.28.0/24
- 47.52.29.0/24
- 47.52.30.0/24
- 47.52.31.0/24
- 47.52.40.0/24
- 47.52.41.0/24
- 47.52.42.0/24
- 47.52.43.0/24
- 47.52.44.0/24
- 47.52.45.0/24
- 47.52.46.0/24
- 47.52.47.0/24
- 47.52.56.0/24
- 47.52.57.0/24
- 47.52.58.0/24
- 47.52.59.0/24
- 47.52.60.0/24
- 47.52.61.0/24
- 47.52.62.0/24
- 47.52.63.0/24
- 47.52.64.0/24
- 47.52.65.0/24
- 47.52.66.0/24
- 47.52.67.0/24
- 47.52.68.0/24
- 47.52.69.0/24
- 47.52.70.0/24
- 47.52.71.0/24
- 47.52.72.0/24
- 47.52.73.0/24
- 47.52.74.0/24
- 47.52.75.0/24
- 47.52.76.0/24
- 47.52.77.0/24
- 47.52.78.0/24
- 47.52.79.0/24
- 47.52.88.0/24
- 47.52.89.0/24
- 47.52.90.0/24
- 47.52.91.0/24
- 47.52.92.0/24
- 47.52.93.0/24
- 47.52.94.0/24
- 47.52.95.0/24
- 47.52.96.0/24
- 47.52.97.0/24
- 47.52.98.0/24
- 47.52.99.0/24
- 47.52.100.0/24
- 47.52.101.0/24
- 47.52.102.0/24
- 47.52.103.0/24
- 47.52.104.0/24
- 47.52.105.0/24
- 47.52.106.0/24
- 47.52.107.0/24
- 47.52.108.0/24
- 47.52.109.0/24
- 47.52.110.0/24
- 47.52.111.0/24
- 47.52.112.0/24
- 47.52.113.0/24
- 47.52.114.0/24
- 47.52.115.0/24
- 47.52.116.0/24
- 47.52.117.0/24
- 47.52.118.0/24
- 47.52.119.0/24
- 47.52.128.0/24
- 47.52.129.0/24
- 47.52.130.0/24
- 47.52.131.0/24
- 47.52.132.0/24
- 47.52.133.0/24
- 47.52.134.0/24
- 47.52.135.0/24
- 47.52.136.0/24
- 47.52.137.0/24
- 47.52.138.0/24
- 47.52.139.0/24
- 47.52.140.0/24
- 47.52.141.0/24
- 47.52.142.0/24
- 47.52.143.0/24
- 47.52.144.0/24
- 47.52.145.0/24
- 47.52.146.0/24
- 47.52.147.0/24
- 47.52.148.0/24
- 47.52.149.0/24
- 47.52.150.0/24
- 47.52.151.0/24
- 47.52.152.0/24
- 47.52.153.0/24
- 47.52.154.0/24
- 47.52.155.0/24
- 47.52.156.0/24
- 47.52.157.0/24
- 47.52.158.0/24
- 47.52.159.0/24
- 47.52.160.0/24
- 47.52.161.0/24
- 47.52.162.0/24
- 47.52.163.0/24
- 47.52.164.0/24
- 47.52.165.0/24
- 47.52.166.0/24
- 47.52.167.0/24
- 47.52.168.0/24
- 47.52.169.0/24
- 47.52.170.0/24
- 47.52.171.0/24
- 47.52.172.0/24
- 47.52.173.0/24
- 47.52.174.0/24
- 47.52.175.0/24
- 47.52.188.0/24
- 47.52.190.0/24
- 47.52.191.0/24
- 47.52.192.0/24
- 47.52.193.0/24
- 47.52.194.0/24
- 47.52.195.0/24
- 47.52.196.0/24
- 47.52.197.0/24
- 47.52.198.0/24
- 47.52.199.0/24
- 47.52.200.0/24
- 47.52.201.0/24
- 47.52.202.0/24
- 47.52.203.0/24
- 47.52.204.0/24
- 47.52.205.0/24
- 47.52.206.0/24
- 47.52.207.0/24
- 47.52.208.0/24
- 47.52.209.0/24
- 47.52.224.0/24
- 47.52.225.0/24
- 47.52.226.0/24
- 47.52.228.0/24
- 47.52.230.0/24
- 47.52.231.0/24
- 47.52.232.0/24
- 47.52.234.0/24
- 47.52.235.0/24
- 47.52.236.0/24
- 47.52.241.0/24
- 47.52.242.0/24
- 47.52.244.0/24
- 47.52.246.0/24
- 47.52.247.0/24
- 47.52.248.0/24
- 47.52.249.0/24
- 47.52.250.0/24
- 47.52.251.0/24
- 47.52.252.0/24
- 47.52.253.0/24
- 47.52.254.0/24
- 47.52.255.0/24
- 47.74.1.0/24
- 47.75.3.0/24
- 47.75.5.0/24
- 47.75.94.0/24
- 47.75.98.0/24
- 47.75.143.0/24
- 47.75.194.0/24
- 47.75.207.0/24
- 47.75.219.0/24
- 47.89.8.0/24
- 47.89.9.0/24
- 47.89.10.0/24
- 47.89.11.0/24
- 47.89.12.0/24
- 47.89.13.0/24
- 47.89.14.0/24
- 47.89.15.0/24
- 47.89.16.0/24
- 47.89.17.0/24
- 47.89.18.0/24
- 47.89.19.0/24
- 47.89.20.0/24
- 47.89.21.0/24
- 47.89.22.0/24
- 47.89.23.0/24
- 47.90.8.0/24
- 47.90.90.0/24
- 47.90.96.0/24
- 47.90.97.0/24
- 47.90.98.0/24
- 47.90.99.0/24
- 47.90.100.0/24
- 47.90.101.0/24
- 47.90.102.0/24
- 47.90.103.0/24
- 47.90.120.0/24
- 47.90.121.0/24
- 47.90.122.0/24
- 47.90.123.0/24
- 47.90.124.0/24
- 47.90.125.0/24
- 47.90.126.0/24
- 47.90.127.0/24
- 47.90.214.0/24
- 47.91.152.0/24
- 47.91.153.0/24
- 47.91.154.0/24
- 47.91.155.0/24
- 47.91.156.0/24
- 47.91.157.0/24
- 47.91.158.0/24
- 47.91.159.0/24
- 47.91.207.0/24
- 47.91.208.0/24
- 47.91.209.0/24
- 47.91.210.0/24
- 47.91.211.0/24
- 47.91.212.0/24
- 47.91.213.0/24
- 47.91.214.0/24
- 47.91.215.0/24
- 47.91.216.0/24
- 47.91.217.0/24
- 47.91.218.0/24
- 47.91.219.0/24
- 47.91.220.0/24
- 47.91.221.0/24
- 47.91.224.0/24
- 47.91.225.0/24
- 47.91.226.0/24
- 47.91.227.0/24
- 47.91.228.0/24
- 47.91.229.0/24
- 47.91.230.0/24
- 47.91.231.0/24
- 47.91.232.0/24
- 47.91.233.0/24
- 47.91.234.0/24
- 47.91.235.0/24
- 47.91.236.0/24
- 47.91.237.0/24
- 47.91.238.0/24
- 47.91.239.0/24
- 47.91.240.0/24
- 47.91.241.0/24
- 47.91.242.0/24
- 47.91.243.0/24
- 47.91.244.0/24
- 47.91.245.0/24
- 47.91.246.0/24
- 47.91.247.0/24
- 47.91.248.0/24
- 47.91.249.0/24
- 47.91.250.0/24
- 47.91.251.0/24
- 47.91.252.0/24
- 47.91.253.0/24
- 47.91.254.0/24
- 47.91.255.0/24
- 47.96.0.0/16
- 47.96.2.0/24
- 47.96.3.0/24
- 47.96.5.0/24
- 47.96.6.0/24
- 47.96.7.0/24
- 47.96.8.0/24
- 47.96.9.0/24
- 47.96.10.0/24
- 47.96.12.0/24
- 47.96.13.0/24
- 47.96.14.0/24
- 47.99.33.0/24
- 47.99.38.0/24
- 47.99.44.0/24
- 47.99.62.0/24
- 47.99.73.0/24
- 47.99.75.0/24
- 47.99.76.0/24
- 47.99.81.0/24
- 47.99.84.0/24
- 47.99.89.0/24
- 47.99.90.0/24
- 47.99.93.0/24
- 47.99.95.0/24
- 47.99.98.0/24
- 47.99.99.0/24
- 47.99.101.0/24
- 47.99.103.0/24
- 47.99.104.0/24
- 47.99.107.0/24
- 47.99.111.0/24
- 47.99.120.0/24
- 47.99.128.0/24
- 47.99.159.0/24
- 47.99.161.0/24
- 47.99.164.0/24
- 47.99.166.0/24
- 47.99.169.0/24
- 47.110.42.0/24
- 47.244.1.0/24
- 47.244.2.0/24
- 47.244.3.0/24
- 47.244.5.0/24
- 47.244.7.0/24
- 47.244.10.0/24
- 47.244.11.0/24
- 47.244.12.0/24
- 47.244.13.0/24
- 47.244.14.0/24
- 47.244.15.0/24
- 47.244.16.0/24
- 47.244.17.0/24
- 47.244.18.0/24
- 47.244.19.0/24
- 47.244.21.0/24
- 47.244.22.0/24
- 47.244.24.0/24
- 47.244.25.0/24
- 47.244.26.0/24
- 47.244.33.0/24
- 47.244.35.0/24
- 47.244.36.0/24
- 47.244.37.0/24
- 47.244.43.0/24
- 47.244.44.0/24
- 47.244.48.0/24
- 47.244.51.0/24
- 47.244.56.0/24
- 52.53.89.0/24
- 52.63.114.0/24
- 52.64.199.0/24
- 52.90.185.0/24
- 52.175.16.0/24
- 52.175.31.0/24
- 52.207.236.0/24
- 52.229.154.0/24
- 52.229.160.0/24
- 52.229.161.0/24
- 54.66.223.0/24
- 54.158.198.0/24
- 54.164.19.0/24
- 54.169.27.0/24
- 54.209.147.0/24
- 58.153.0.0/16
- 58.153.19.0/24
- 58.153.171.0/24
- 58.153.208.0/24
- 58.153.209.0/24
- 58.153.221.0/24
- 58.176.80.0/24
- 58.177.181.0/24
- 58.215.54.0/24
- 58.221.252.0/24
- 59.16.249.0/24
- 59.127.115.0/24
- 59.149.239.0/24
- 60.248.89.0/24
- 61.80.89.0/24
- 61.84.148.0/24
- 61.155.210.0/24
- 61.216.2.0/24
- 61.216.34.0/24
- 61.216.146.0/24
- 61.238.35.0/24
- 61.239.213.0/24
- 61.239.223.0/24
- 74.91.112.0/24
- 74.201.99.0/24
- 87.98.228.0/24
- 88.82.185.0/24
- 90.188.238.0/24
- 94.245.155.0/24
- 95.154.88.0/24
- 95.154.113.0/24
- 95.172.92.0/24
- 95.183.13.0/24
- 103.9.89.0/24
- 103.10.124.0/24
- 103.10.125.0/24
- 103.16.27.0/24
- 103.28.54.0/24
- 103.28.55.0/24
- 103.36.208.0/24
- 103.44.160.0/24
- 103.57.72.0/24
- 103.58.149.0/24
- 103.60.126.0/24
- 103.62.48.0/24
- 103.89.90.0/24
- 103.207.36.0/24
- 103.222.20.0/24
- 103.231.163.0/24
- 103.232.85.0/24
- 103.241.165.0/24
- 103.244.2.0/24
- 103.254.153.0/24
- 104.199.166.0/24
- 104.236.115.0/24
- 107.21.14.0/24
- 110.42.10.0/24
- 110.173.58.0/24
- 111.91.236.0/24
- 111.231.11.0/24
- 111.253.47.0/24
- 111.253.49.0/24
- 111.253.50.0/24
- 111.253.52.0/24
- 111.253.55.0/24
- 112.118.44.0/24
- 112.118.193.0/24
- 113.160.204.0/24
- 113.190.242.0/24
- 114.46.16.0/24
- 114.46.20.0/24
- 114.46.21.0/24
- 114.46.22.0/24
- 114.46.24.0/24
- 114.46.30.0/24
- 114.167.236.0/24
- 115.230.127.0/24
- 115.231.221.0/24
- 115.231.223.0/24
- 116.31.123.0/24
- 116.49.214.0/24
- 116.122.109.0/24
- 116.251.223.0/24
- 118.107.76.0/24
- 119.28.222.0/24
- 119.197.57.0/24
- 119.236.132.0/24
- 119.237.11.0/24
- 120.72.85.0/24
- 123.31.20.0/24
- 123.194.52.0/24
- 124.158.10.0/24
- 124.228.91.0/24
- 125.212.211.0/24
- 125.212.226.0/24
- 125.226.128.0/24
- 125.253.124.0/24
- 128.199.81.0/24
- 132.232.7.0/24
- 132.232.9.0/24
- 132.232.12.0/24
- 132.232.29.0/24
- 132.232.51.0/24
- 132.232.55.0/24
- 132.232.57.0/24
- 132.232.61.0/24
- 132.232.62.0/24
- 132.232.75.0/24
- 132.232.91.0/24
- 132.232.94.0/24
- 132.232.99.0/24
- 132.232.104.0/24
- 133.130.123.0/24
- 138.19.63.0/24
- 139.99.9.0/24
- 139.99.104.0/24
- 139.99.119.0/24
- 139.162.55.0/24
- 146.66.152.0/24
- 146.66.153.0/24
- 146.66.154.0/24
- 146.66.155.0/24
- 146.66.156.0/24
- 146.66.157.0/24
- 146.66.158.0/24
- 146.66.159.0/24
- 150.109.40.0/24
- 151.80.60.0/24
- 151.80.145.0/24
- 152.111.192.0/24
- 153.160.25.0/24
- 153.254.86.0/24
- 155.133.227.0/24
- 155.133.230.0/24
- 155.133.232.0/24
- 155.133.233.0/24
- 155.133.235.0/24
- 155.133.238.0/24
- 155.133.239.0/24
- 155.133.242.0/24
- 155.133.244.0/24
- 155.133.245.0/24
- 155.133.246.0/24
- 155.133.247.0/24
- 155.133.248.0/24
- 155.133.249.0/24
- 155.133.252.0/24
- 155.133.253.0/24
- 155.133.254.0/24
- 159.28.159.0/24
- 161.202.44.0/24
- 162.254.192.0/24
- 162.254.193.0/24
- 162.254.194.0/24
- 162.254.195.0/24
- 162.254.196.0/24
- 162.254.197.0/24
- 162.254.198.0/24
- 162.254.199.0/24
- 163.53.149.0/24
- 169.254.0.0/16
- 169.254.125.95/32
- 169.254.10.218/32
- 175.210.83.0/24
- 176.215.255.0/24
- 180.149.95.0/24
- 180.177.178.0/24
- 182.171.230.0/24
- 182.176.65.0/24
- 183.60.111.0/24
- 183.179.66.0/24
- 185.25.60.0/24
- 185.25.180.0/24
- 185.25.181.0/24
- 185.25.182.0/24
- 185.25.183.0/24
- 185.37.216.0/24
- 185.62.205.0/24
- 185.113.141.0/24
- 190.217.33.0/24
- 192.69.96.0/24
- 192.69.97.0/24
- 193.33.176.0/24
- 195.14.118.0/24
- 195.201.246.0/24
- 196.38.180.0/24
- 197.80.200.0/24
- 198.27.83.0/24
- 202.21.115.0/24
- 203.175.163.0/24
- 203.175.164.0/24
- 203.175.165.0/24
- 203.175.166.0/24
- 203.218.101.0/24
- 205.185.194.0/24
- 205.196.6.0/24
- 208.64.200.0/24
- 208.64.203.0/24
- 208.78.164.0/24
- 208.78.165.0/24
- 208.78.166.0/24
- 209.58.164.0/24
- 209.58.168.0/24
- 209.58.178.0/24
- 209.58.188.0/24
- 210.211.124.0/24
- 211.21.37.0/24
- 211.48.69.0/24
- 211.75.181.0/24
- 212.64.32.0/24
- 216.52.148.0/24
- 217.150.77.0/24
- 218.250.12.0/24
- 218.250.15.0/24
- 218.250.113.0/24
- 218.255.3.0/24
- 220.80.129.0/24
- 220.134.154.0/24
- 220.135.180.0/24
- 220.169.242.0/24
- 220.170.89.0/24
- 221.6.100.0/24
- 222.102.95.0/24
- 222.112.242.0/24
- 222.186.50.0/24
- 222.187.224.0/24
- 224.0.0.0/4
- 240.0.0.0/4
@@ -1,294 +0,0 @@
payload:
- 2.16.0.0/16
- 2.17.0.0/16
- 2.18.0.0/16
- 2.19.0.0/16
- 2.20.0.0/16
- 2.21.0.0/16
- 2.22.0.0/16
- 2.23.0.0/16
- 8.7.0.0/16
- 14.21.0.0/16
- 23.0.0.0/4
- 23.1.0.0/16
- 23.2.0.0/16
- 23.3.0.0/16
- 23.4.0.0/16
- 23.5.0.0/16
- 23.7.0.0/16
- 23.8.0.0/16
- 23.9.0.0/16
- 23.11.0.0/16
- 23.12.0.0/16
- 23.13.0.0/16
- 23.14.0.0/16
- 23.15.0.0/16
- 23.32.0.0/16
- 23.33.0.0/16
- 23.34.0.0/16
- 23.35.0.0/16
- 23.36.0.0/16
- 23.37.0.0/16
- 23.38.0.0/16
- 23.39.0.0/16
- 23.40.0.0/16
- 23.41.0.0/16
- 23.42.0.0/16
- 23.44.0.0/16
- 23.45.0.0/16
- 23.46.0.0/16
- 23.48.0.0/16
- 23.49.0.0/16
- 23.50.0.0/16
- 23.51.0.0/16
- 23.52.0.0/16
- 23.53.0.0/16
- 23.54.0.0/16
- 23.55.0.0/16
- 23.56.0.0/16
- 23.57.0.0/16
- 23.58.0.0/16
- 23.59.0.0/16
- 23.60.0.0/16
- 23.61.0.0/16
- 23.62.0.0/16
- 23.63.0.0/16
- 23.64.0.0/16
- 23.65.0.0/16
- 23.67.0.0/16
- 23.72.0.0/16
- 23.73.0.0/16
- 23.74.0.0/16
- 23.75.0.0/16
- 23.76.0.0/16
- 23.77.0.0/16
- 23.78.0.0/16
- 23.79.0.0/16
- 23.192.0.0/16
- 23.193.0.0/16
- 23.194.0.0/16
- 23.196.0.0/16
- 23.197.0.0/16
- 23.198.0.0/16
- 23.199.0.0/16
- 23.200.0.0/16
- 23.201.0.0/16
- 23.202.0.0/16
- 23.203.0.0/16
- 23.204.0.0/16
- 23.205.0.0/16
- 23.206.0.0/16
- 23.207.0.0/16
- 23.208.0.0/16
- 23.209.0.0/16
- 23.210.0.0/16
- 23.211.0.0/16
- 23.212.0.0/16
- 23.213.0.0/16
- 23.214.0.0/16
- 23.215.0.0/16
- 23.216.0.0/16
- 23.217.0.0/16
- 23.218.0.0/16
- 23.219.0.0/16
- 23.220.0.0/16
- 23.221.0.0/16
- 23.222.0.0/16
- 23.223.0.0/16
- 31.0.0.0/4
- 31.13.0.0/16
- 37.10.0.0/16
- 45.121.0.0/16
- 45.121.184.0/24
- 45.121.186.0/24
- 46.0.0.0/4
- 59.0.0.0/4
- 60.254.0.0/16
- 61.213.0.0/16
- 63.146.0.0/16
- 63.219.0.0/16
- 63.243.0.0/16
- 64.0.0.0/4
- 64.124.0.0/16
- 65.152.0.0/16
- 65.158.0.0/16
- 66.0.0.0/4
- 67.0.0.0/4
- 67.131.0.0/16
- 69.0.0.0/4
- 69.16.0.0/16
- 69.63.0.0/16
- 69.171.0.0/16
- 69.192.0.0/16
- 72.165.0.0/16
- 72.246.0.0/16
- 72.247.0.0/16
- 74.0.0.0/4
- 74.86.0.0/16
- 74.201.0.0/16
- 75.0.0.0/4
- 75.126.0.0/16
- 78.16.0.0/16
- 84.53.0.0/16
- 85.190.0.0/16
- 88.0.0.0/4
- 88.221.0.0/16
- 92.122.0.0/16
- 92.123.0.0/16
- 95.100.0.0/16
- 95.101.0.0/16
- 96.0.0.0/4
- 96.6.0.0/16
- 96.16.0.0/16
- 96.17.0.0/16
- 103.10.124.0/24
- 103.28.0.0/16
- 103.28.54.0/24
- 103.74.0.0/16
- 104.0.0.0/4
- 104.65.0.0/16
- 104.66.0.0/16
- 104.67.0.0/16
- 104.68.0.0/16
- 104.70.0.0/16
- 104.71.0.0/16
- 104.72.0.0/16
- 104.73.0.0/16
- 104.75.0.0/16
- 104.76.0.0/16
- 104.77.0.0/16
- 104.79.0.0/16
- 104.80.0.0/16
- 104.81.0.0/16
- 104.82.0.0/16
- 104.83.0.0/16
- 104.84.0.0/16
- 104.85.0.0/16
- 104.86.0.0/16
- 104.87.0.0/16
- 104.89.0.0/16
- 104.90.0.0/16
- 104.91.0.0/16
- 104.92.0.0/16
- 104.94.0.0/16
- 104.95.0.0/16
- 104.97.0.0/16
- 104.98.0.0/16
- 104.100.0.0/16
- 104.101.0.0/16
- 104.102.0.0/16
- 104.103.0.0/16
- 104.104.0.0/16
- 104.105.0.0/16
- 104.106.0.0/16
- 104.107.0.0/16
- 104.108.0.0/16
- 104.109.0.0/16
- 104.110.0.0/16
- 104.111.0.0/16
- 104.112.0.0/16
- 104.113.0.0/16
- 104.115.0.0/16
- 104.116.0.0/16
- 104.117.0.0/16
- 104.118.0.0/16
- 104.119.0.0/16
- 104.120.0.0/16
- 104.121.0.0/16
- 104.122.0.0/16
- 104.123.0.0/16
- 104.124.0.0/16
- 104.126.0.0/16
- 104.127.0.0/16
- 106.15.0.0/16
- 110.45.0.0/16
- 115.223.0.0/16
- 117.103.0.0/16
- 118.155.0.0/16
- 118.214.0.0/16
- 118.215.0.0/16
- 120.24.184.25/32
- 121.156.0.0/16
- 122.252.0.0/16
- 125.56.0.0/16
- 125.252.0.0/16
- 128.241.0.0/16
- 139.175.0.0/16
- 141.0.0.0/4
- 146.66.0.0/16
- 152.199.0.0/16
- 153.254.0.0/16
- 153.254.86.0/24
- 155.133.0.0/16
- 155.133.232.0/24
- 155.133.233.0/24
- 155.133.234.0/24
- 155.133.235.0/24
- 155.133.239.0/24
- 155.133.244.0/24
- 155.133.253.0/24
- 155.133.254.0/24
- 162.254.0.0/16
- 162.254.192.0/24
- 162.254.193.0/24
- 162.254.194.0/24
- 162.254.199.0/24
- 165.254.0.0/16
- 172.0.0.0/4
- 172.224.0.0/16
- 172.226.0.0/16
- 172.227.0.0/16
- 172.228.0.0/16
- 172.229.0.0/16
- 172.230.0.0/16
- 172.231.0.0/16
- 173.0.0.0/4
- 173.197.0.0/16
- 173.205.0.0/16
- 173.222.0.0/16
- 173.223.0.0/16
- 173.252.0.0/16
- 174.36.0.0/16
- 175.99.0.0/16
- 175.139.0.0/16
- 180.101.192.0/24
- 182.162.0.0/16
- 184.0.0.0/4
- 184.24.0.0/16
- 184.25.0.0/16
- 184.26.0.0/16
- 184.29.0.0/16
- 184.30.0.0/16
- 184.31.0.0/16
- 184.50.0.0/16
- 184.51.0.0/16
- 184.84.0.0/16
- 184.85.0.0/16
- 184.87.0.0/16
- 185.25.0.0/16
- 185.27.0.0/16
- 185.88.0.0/16
- 192.69.96.0/24
- 192.81.0.0/16
- 198.87.0.0/16
- 198.172.0.0/16
- 199.0.0.0/4
- 199.239.0.0/16
- 203.69.0.0/16
- 203.80.149.0/24
- 205.186.0.0/16
- 205.196.6.0/24
- 205.197.0.0/16
- 208.0.0.0/4
- 208.64.0.0/16
- 208.64.200.0/24
- 208.78.0.0/16
- 208.78.164.0/24
- 208.78.166.0/24
- 208.78.167.0/24
- 209.170.0.0/16
- 210.61.0.0/16
- 210.201.0.0/16
- 216.3.0.0/16
- 216.156.0.0/16
- 223.119.0.0/16
@@ -1,133 +0,0 @@
payload:
- 96.7.54.0/24
- 96.17.68.0/24
- 95.101.58.0/24
- 92.123.234.0/24
- 72.249.197.0/24
- 72.247.118.0/24
- 75.126.208.0/20
- 69.192.4.0/24
- 61.213.189.0/24
- 61.213.168.0/24
- 23.9.186.0/24
- 23.9.179.0/24
- 23.9.117.0/24
- 23.77.27.0/24
- 23.77.18.0/24
- 23.76.210.0/24
- 23.75.104.0/24
- 23.67.53.0/24
- 23.67.189.0/24
- 23.66.135.0/24
- 23.62.226.0/24
- 23.61.244.0/24
- 23.61.195.0/24
- 23.57.66.0/24
- 23.56.108.0/24
- 23.55.56.0/24
- 23.55.47.0/24
- 23.55.37.0/24
- 23.52.74.0/24
- 23.52.171.0/24
- 23.50.232.0/24
- 23.5.229.0/24
- 23.48.201.0/24
- 23.47.143.0/24
- 23.46.16.0/24
- 23.46.147.0/24
- 23.45.51.0/24
- 23.45.127.0/24
- 23.44.51.0/24
- 23.44.172.0/24
- 23.44.17.0/24
- 23.43.49.0/24
- 23.42.74.0/24
- 23.37.126.0/24
- 23.36.111.0/24
- 23.34.96.0/24
- 23.33.178.0/24
- 23.33.151.0/24
- 23.32.255.0/24
- 23.32.248.0/24
- 23.32.241.0/24
- 23.219.172.0/24
- 23.218.94.0/24
- 23.218.5.0/24
- 23.218.24.0/24
- 23.215.188.0/24
- 23.211.136.0/24
- 23.211.117.0/24
- 23.211.108.0/24
- 23.210.215.0/24
- 23.204.57.0/24
- 23.204.147.0/24
- 23.200.74.0/24
- 23.2.16.0/24
- 23.199.34.0/24
- 23.198.137.0/24
- 23.198.136.0/24
- 23.198.103.0/24
- 23.192.168.0/24
- 23.192.119.0/24
- 23.15.4.0/24
- 23.12.40.0/24
- 23.1.237.0/24
- 23.1.236.0/24
- 23.1.234.0/24
- 23.7.208.0/20
- 223.119.50.0/24
- 223.119.248.0/24
- 220.90.198.0/24
- 219.76.10.0/24
- 203.74.140.0/24
- 203.69.141.0/24
- 202.4.185.0/24
- 2.21.98.0/24
- 2.20.27.0/24
- 189.6.45.0/24
- 184.87.133.0/24
- 184.86.250.0/24
- 184.51.198.0/24
- 184.51.183.0/24
- 184.50.26.0/24
- 184.31.165.0/24
- 184.28.223.0/24
- 184.28.218.0/24
- 184.27.20.0/24
- 184.26.194.0/24
- 184.24.58.0/24
- 184.150.58.0/24
- 184.150.154.0/24
- 175.207.14.0/24
- 172.217.0.0/16
- 172.232.19.0/24
- 139.175.236.0/24
- 125.56.201.0/24
- 125.252.224.0/24
- 119.56.4.0/24
- 119.207.66.0/24
- 119.207.64.0/24
- 104.88.23.0/24
- 104.84.150.0/24
- 104.84.160.0/19
- 104.81.21.0/24
- 104.76.86.0/24
- 104.76.172.0/24
- 104.75.169.0/24
- 104.74.47.0/24
- 104.74.30.0/24
- 104.74.214.0/24
- 104.74.209.0/24
- 104.71.139.0/24
- 104.64.155.0/24
- 104.250.32.0/23
- 104.254.123.0/24
- 104.127.4.0/24
- 104.124.248.0/24
- 104.124.233.0/24
- 104.124.232.0/24
- 104.122.6.0/24
- 104.120.11.0/24
- 104.116.243.0/24
- 104.110.72.0/24
- 153.254.86.0/24
@@ -1,4 +0,0 @@
payload:
# > ABC
- DOMAIN-SUFFIX,edgedatg.com
- DOMAIN-SUFFIX,go.com
@@ -1,40 +0,0 @@
payload:
# > ChatGPT
- DOMAIN-SUFFIX,ai.com
- DOMAIN-SUFFIX,chatgpt.com
- DOMAIN-SUFFIX,openai.com
# > Chat GPT API & CDN
- DOMAIN-SUFFIX,cdn.oaistatic.com
- DOMAIN,chat.openai.com.cdn.cloudflare.net
- DOMAIN,openaiapi-site.azureedge.net
- DOMAIN,openaicom-api-bdcpf8c6d2e9atf6.z01.azurefd.net
- DOMAIN,openaicomproductionae4b.blob.core.windows.net
- DOMAIN,production-openaicom-storage.azureedge.net
- DOMAIN-SUFFIX,oaistatic.com
- DOMAIN-SUFFIX,oaiusercontent.com
- DOMAIN-SUFFIX,o33249.ingest.sentry.io
# > Claude
- DOMAIN-SUFFIX,anthropic.com
- DOMAIN-SUFFIX,claude.ai
# > Copilot
- DOMAIN-SUFFIX,copilot.microsoft.com
# > Gemini
- DOMAIN-SUFFIX,gemini.google.com
- DOMAIN-SUFFIX,generativelanguage.googleapis.com
- DOMAIN-SUFFIX,proactivebackend-pa.googleapis.com
# > Meta AI
- DOMAIN-SUFFIX,meta.ai
# > Perplexity AI
- DOMAIN-SUFFIX,perplexity.ai
# > Siri
- DOMAIN-SUFFIX,apple-relay.apple.com
- DOMAIN,guzzoni.smoot.apple.com
@@ -1,10 +0,0 @@
payload:
# > AbemaTV
# - USER-AGENT,AbemaTV*
- PROCESS-NAME,tv.abema
- DOMAIN-SUFFIX,abema.io
- DOMAIN-SUFFIX,abema.tv
- DOMAIN-SUFFIX,akamaized.net
- DOMAIN-SUFFIX,ameba.jp
- DOMAIN-SUFFIX,hayabusa.io
- DOMAIN-KEYWORD,abematv.akamaized.net
@@ -1,45 +0,0 @@
payload:
# > Amazon Prime Video
# - USER-AGENT,InstantVideo.US*
# - USER-AGENT,Prime%20Video*
- DOMAIN-KEYWORD,avoddashs
- DOMAIN-SUFFIX,aiv-cdn.net
- DOMAIN-SUFFIX,aiv-delivery.net
- DOMAIN-SUFFIX,amazonprimevideos.com
- DOMAIN-SUFFIX,amazonvideo.cc
- DOMAIN-SUFFIX,amazonvideo.com
- DOMAIN-SUFFIX,amazonvideodirect.cc
- DOMAIN-SUFFIX,atv-ext.amazon.com
- DOMAIN-SUFFIX,atv-ext-eu.amazon.com
- DOMAIN-SUFFIX,atv-ext-fe.amazon.com
- DOMAIN-SUFFIX,atv-ps.amazon.com
- DOMAIN-SUFFIX,atv-ps-eu.amazon.co.uk
- DOMAIN-SUFFIX,atv-ps-eu.amazon.com
- DOMAIN-SUFFIX,atv-ps-fe.amazon.co.jp
- DOMAIN-SUFFIX,atv-ps-fe.amazon.com
- DOMAIN-SUFFIX,fls-na.amazon.com
- DOMAIN-SUFFIX,media-amazon.com
- DOMAIN-SUFFIX,primevideo.cc
- DOMAIN-SUFFIX,primevideo.com
- DOMAIN-SUFFIX,prime-video.com
- DOMAIN-SUFFIX,primevideo.info
- DOMAIN-SUFFIX,primevideo.org
- DOMAIN-SUFFIX,primevideo.tv
- DOMAIN-SUFFIX,pv-cdn.net
- DOMAIN-SUFFIX,video.a2z.com
- DOMAIN,avodmp4s3ww-a.akamaihd.net
- DOMAIN,d1v5ir2lpwr8os.cloudfront.net
- DOMAIN,d1y002tclu9djj.cloudfront.net
- DOMAIN,d22qjgkvxw22r6.cloudfront.net
- DOMAIN,d25xi40x97liuc.cloudfront.net
- DOMAIN,dmqdd6hw24ucf.cloudfront.net
- DOMAIN,d27xxe7juh1us6.cloudfront.net
- DOMAIN,dualstack.pefs-alb-266603904.eu-west-1.elb.amazonaws.com
# // 美区网页版需二选一走代理,如 URL-REGEX 则需 MITM www.amazon.com
# // DOMAIN,www.amazon.com
# URL-REGEX,^https?:\/\/www\.amazon\.com\/(Amazon-Video|gp\/video)\/
@@ -1,33 +0,0 @@
payload:
# > Apple API
- DOMAIN-KEYWORD,apple.com.akadns.net
- DOMAIN-KEYWORD,icloud.com.akadns.net
- DOMAIN-SUFFIX,aaplimg.com
- DOMAIN-SUFFIX,apple.co
- DOMAIN-SUFFIX,apple.com
- DOMAIN-SUFFIX,apple-cloudkit.com
- DOMAIN-SUFFIX,apple-mapkit.com
- DOMAIN-SUFFIX,appsto.re
- DOMAIN-SUFFIX,cdn-apple.com
- DOMAIN-SUFFIX,icloud.com
- DOMAIN-SUFFIX,icloud-content.com
- DOMAIN-SUFFIX,itunes.com
- DOMAIN-SUFFIX,me.com
- DOMAIN-SUFFIX,mzstatic.com
- IP-CIDR,17.0.0.0/8,no-resolve
- IP-CIDR,63.92.224.0/19,no-resolve
- IP-CIDR,65.199.22.0/23,no-resolve
- IP-CIDR,139.178.128.0/18,no-resolve
- IP-CIDR,144.178.0.0/19,no-resolve
- IP-CIDR,144.178.36.0/22,no-resolve
- IP-CIDR,144.178.48.0/20,no-resolve
- IP-CIDR,192.35.50.0/24,no-resolve
- IP-CIDR,198.183.17.0/24,no-resolve
- IP-CIDR,205.180.175.0/24,no-resolve
# > Apple News
- DOMAIN-SUFFIX,apple.comscoreresearch.com
- DOMAIN-SUFFIX,apple.news
# > Apple Maps
- PROCESS-NAME,com.apple.geod
@@ -1,16 +0,0 @@
payload:
# > Apple Music
# - USER-AGENT,Music*
- PROCESS-NAME,music
- DOMAIN-SUFFIX,applemusic.com
- DOMAIN-SUFFIX,blobstore.apple.com
- DOMAIN-SUFFIX,music.apple.com
- DOMAIN,aod.itunes.apple.com
- DOMAIN,aod-ssl.itunes.apple.com
- DOMAIN,audio.itunes.apple.com
- DOMAIN,audio-ssl.itunes.apple.com
- DOMAIN,mvod.itunes.apple.com
- DOMAIN,streamingaudio.itunes.apple.com
# iCloud Music Library
- DOMAIN-SUFFIX,blobstore.apple.com

Some files were not shown because too many files have changed in this diff Show More