Update On Sat Aug 17 20:30:55 CEST 2024

This commit is contained in:
github-action[bot]
2024-08-17 20:30:55 +02:00
parent 7390f900fb
commit 34f260cfe3
258 changed files with 3568 additions and 2812 deletions

1
.github/update.log vendored
View File

@@ -736,3 +736,4 @@ Update On Tue Aug 13 20:34:16 CEST 2024
Update On Wed Aug 14 20:33:18 CEST 2024
Update On Thu Aug 15 20:37:38 CEST 2024
Update On Fri Aug 16 20:32:54 CEST 2024
Update On Sat Aug 17 20:30:44 CEST 2024

View File

@@ -202,9 +202,7 @@ export const NodeList = forwardRef(function NodeList({}, ref) {
layoutId={`node-${render.renderLayoutKey}`}
className="relative overflow-hidden"
layout="position"
initial={{ scale: 0.7, opacity: 0 }}
animate={{ scale: 1, opacity: 1 }}
exit={{ opacity: 0 }}
initial={false}
>
<Card />
</motion.div>

View File

@@ -21,6 +21,11 @@ export const ProxyGroupName = memo(function ProxyGroupName({
initial={{ x: 100, opacity: 0 }}
animate={{ x: 0, opacity: 1 }}
exit={{ x: -100, opacity: 0 }}
transition={{
type: "spring",
bounce: 0,
duration: 0.5,
}}
>
{name}
</motion.div>

View File

@@ -1,7 +1,23 @@
import { MUI_BREAKPOINTS } from "@nyanpasu/ui/materialYou/createTheme";
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-require-imports */
const plugin = require("tailwindcss/plugin");
const getMUuiScreen = () => {
const breakpoints = MUI_BREAKPOINTS.values;
const result = {};
for (const key in breakpoints) {
if (breakpoints.hasOwnProperty(key)) {
result[key] = `${breakpoints[key]}px`;
}
}
return result;
};
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{tsx,ts}", "../ui/**/*.{tsx,ts}"],
@@ -23,7 +39,12 @@ module.exports = {
"100%": { transform: "translateX(-100%)" },
},
},
colors: {
scroller: "var(--scroller-color)",
container: "var(--background-color)",
},
},
screen: getMUuiScreen(),
},
plugins: [
require("tailwindcss-textshadow"),

View File

@@ -2,7 +2,7 @@
"manifest_version": 1,
"latest": {
"mihomo": "v1.18.7",
"mihomo_alpha": "alpha-92ec5f2",
"mihomo_alpha": "alpha-0793998",
"clash_rs": "v0.2.0",
"clash_premium": "2023-09-05-gdcc8d87"
},
@@ -36,5 +36,5 @@
"darwin-x64": "clash-darwin-amd64-n{}.gz"
}
},
"updated_at": "2024-08-15T22:20:24.086Z"
"updated_at": "2024-08-16T22:20:25.460Z"
}

View File

@@ -1,3 +1,27 @@
## v1.7.6
### Notice
- Clash Verge Rev 目前已进入稳定周期,日后更新将着重于 bug 修复与内核常规升级
### Features
- Meta(mihomo)内核升级 1.18.7
- 界面细节调整
- 优化服务模式安装逻辑
- 移除无用的 console log
- 能自动选择第一个订阅
### Bugs Fixes
- 修复服务模式安装问题
- 修复 Mac 下的代理绕过 CIDR 写法过滤
- 修复 32 位升级 URL
- 修复不同分组 URL 测试地址配置无效的问题
- 修复 Web UI 下的一处 hostname 参数
---
## v1.7.5
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "clash-verge",
"version": "1.7.5",
"version": "1.7.6",
"license": "GPL-3.0-only",
"scripts": {
"dev": "tauri dev",

View File

@@ -790,7 +790,7 @@ dependencies = [
[[package]]
name = "clash-verge"
version = "1.7.5"
version = "1.7.6"
dependencies = [
"anyhow",
"auto-launch",

View File

@@ -1,6 +1,6 @@
[package]
name = "clash-verge"
version = "1.7.5"
version = "1.7.6"
description = "clash verge"
authors = ["zzzgydi", "wonfen", "MystiPanda"]
license = "GPL-3.0-only"

View File

@@ -2,7 +2,7 @@
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"package": {
"productName": "Clash Verge",
"version": "1.7.5"
"version": "1.7.6"
},
"build": {
"distDir": "../dist",

View File

@@ -24,7 +24,7 @@ export const WebUIViewer = forwardRef<DialogRef>((props, ref) => {
const webUIList = verge?.web_ui_list || [
"https://metacubex.github.io/metacubexd/#/setup?http=true&hostname=%host&port=%port&secret=%secret",
"https://yacd.metacubex.one/?host=%host&port=%port&secret=%secret",
"https://yacd.metacubex.one/?hostname=%host&port=%port&secret=%secret",
];
const handleAdd = useLockFn(async (value: string) => {

View File

@@ -32,6 +32,7 @@
"vue-final-modal": "^4.5.4",
"vue-i18n": "^9.10.2",
"vue-lazyload": "^3.0.0",
"vue-reader": "^1.2.14",
"vue-router": "^4.3.0",
"vue-toastification": "^2.0.0-rc.5"
},
@@ -2762,6 +2763,16 @@
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
"dev": true
},
"node_modules/@types/localforage": {
"version": "0.0.34",
"resolved": "https://registry.npmjs.org/@types/localforage/-/localforage-0.0.34.tgz",
"integrity": "sha512-tJxahnjm9dEI1X+hQSC5f2BSd/coZaqbIl1m3TCl0q9SVuC52XcXfV0XmoCU1+PmjyucuVITwoTnN8OlTbEXXA==",
"deprecated": "This is a stub types definition for localforage (https://github.com/localForage/localForage). localforage provides its own type definitions, so you don't need @types/localforage installed!",
"license": "MIT",
"dependencies": {
"localforage": "*"
}
},
"node_modules/@types/lodash": {
"version": "4.17.0",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz",
@@ -4097,8 +4108,7 @@
"node_modules/core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
"dev": true
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
},
"node_modules/cross-spawn": {
"version": "7.0.3",
@@ -4148,6 +4158,19 @@
"resolved": "https://registry.npmjs.org/custom-error-instance/-/custom-error-instance-2.1.1.tgz",
"integrity": "sha512-p6JFxJc3M4OTD2li2qaHkDCw9SfMw82Ldr6OC9Je1aXiGfhx2W8p3GaoeaGrPJTUN9NirTM/KTxHWMUdR1rsUg=="
},
"node_modules/d": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz",
"integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==",
"license": "ISC",
"dependencies": {
"es5-ext": "^0.10.64",
"type": "^2.7.2"
},
"engines": {
"node": ">=0.12"
}
},
"node_modules/data-urls": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz",
@@ -4299,6 +4322,72 @@
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
"node_modules/epubjs": {
"version": "0.3.93",
"resolved": "https://registry.npmjs.org/epubjs/-/epubjs-0.3.93.tgz",
"integrity": "sha512-c06pNSdBxcXv3dZSbXAVLE1/pmleRhOT6mXNZo6INKmvuKpYB65MwU/lO7830czCtjIiK9i+KR+3S+p0wtljrw==",
"license": "BSD-2-Clause",
"dependencies": {
"@types/localforage": "0.0.34",
"@xmldom/xmldom": "^0.7.5",
"core-js": "^3.18.3",
"event-emitter": "^0.3.5",
"jszip": "^3.7.1",
"localforage": "^1.10.0",
"lodash": "^4.17.21",
"marks-pane": "^1.0.9",
"path-webpack": "0.0.3"
}
},
"node_modules/epubjs/node_modules/@xmldom/xmldom": {
"version": "0.7.13",
"resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.13.tgz",
"integrity": "sha512-lm2GW5PkosIzccsaZIz7tp8cPADSIlIHWDFTR1N0SzfinhhYgeIQjFMz4rYzanCScr3DqQLeomUDArp6MWKm+g==",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/es5-ext": {
"version": "0.10.64",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz",
"integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
"es6-iterator": "^2.0.3",
"es6-symbol": "^3.1.3",
"esniff": "^2.0.1",
"next-tick": "^1.1.0"
},
"engines": {
"node": ">=0.10"
}
},
"node_modules/es6-iterator": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
"integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
"license": "MIT",
"dependencies": {
"d": "1",
"es5-ext": "^0.10.35",
"es6-symbol": "^3.1.1"
}
},
"node_modules/es6-symbol": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz",
"integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==",
"license": "ISC",
"dependencies": {
"d": "^1.0.2",
"ext": "^1.7.0"
},
"engines": {
"node": ">=0.12"
}
},
"node_modules/esbuild": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz",
@@ -4657,6 +4746,21 @@
"node": ">=8"
}
},
"node_modules/esniff": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz",
"integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==",
"license": "ISC",
"dependencies": {
"d": "^1.0.1",
"es5-ext": "^0.10.62",
"event-emitter": "^0.3.5",
"type": "^2.7.2"
},
"engines": {
"node": ">=0.10"
}
},
"node_modules/espree": {
"version": "9.6.1",
"resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
@@ -4734,6 +4838,25 @@
"node": ">=0.10.0"
}
},
"node_modules/event-emitter": {
"version": "0.3.5",
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
"integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==",
"license": "MIT",
"dependencies": {
"d": "1",
"es5-ext": "~0.10.14"
}
},
"node_modules/ext": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
"integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
"license": "ISC",
"dependencies": {
"type": "^2.7.2"
}
},
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@@ -5160,6 +5283,12 @@
"node": ">= 4"
}
},
"node_modules/immediate": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
"integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==",
"license": "MIT"
},
"node_modules/import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
@@ -5203,8 +5332,7 @@
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/is-binary-path": {
"version": "2.1.0",
@@ -5318,8 +5446,7 @@
"node_modules/isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
"dev": true
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
},
"node_modules/isexe": {
"version": "2.0.0",
@@ -5465,6 +5592,18 @@
"integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==",
"dev": true
},
"node_modules/jszip": {
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz",
"integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==",
"license": "(MIT OR GPL-3.0-or-later)",
"dependencies": {
"lie": "~3.3.0",
"pako": "~1.0.2",
"readable-stream": "~2.3.6",
"setimmediate": "^1.0.5"
}
},
"node_modules/jwt-decode": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz",
@@ -5500,6 +5639,33 @@
"node": ">= 0.8.0"
}
},
"node_modules/lie": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
"license": "MIT",
"dependencies": {
"immediate": "~3.0.5"
}
},
"node_modules/localforage": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz",
"integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==",
"license": "Apache-2.0",
"dependencies": {
"lie": "3.1.1"
}
},
"node_modules/localforage/node_modules/lie": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz",
"integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==",
"license": "MIT",
"dependencies": {
"immediate": "~3.0.5"
}
},
"node_modules/locate-path": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
@@ -5518,8 +5684,7 @@
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"node_modules/lodash-es": {
"version": "4.17.21",
@@ -5636,6 +5801,12 @@
"node": ">=12"
}
},
"node_modules/marks-pane": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/marks-pane/-/marks-pane-1.0.9.tgz",
"integrity": "sha512-Ahs4oeG90tbdPWwAJkAAoHg2lRR8lAs9mZXETNPO9hYg3AkjUJBKi1NQ4aaIQZVGrig7c/3NUV1jANl8rFTeMg==",
"license": "MIT"
},
"node_modules/material-icons": {
"version": "1.13.12",
"resolved": "https://registry.npmjs.org/material-icons/-/material-icons-1.13.12.tgz",
@@ -5796,6 +5967,12 @@
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
"dev": true
},
"node_modules/next-tick": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
"integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==",
"license": "ISC"
},
"node_modules/node-releases": {
"version": "2.0.14",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz",
@@ -5976,6 +6153,12 @@
"node": ">=8"
}
},
"node_modules/path-webpack": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/path-webpack/-/path-webpack-0.0.3.tgz",
"integrity": "sha512-AmeDxedoo5svf7aB3FYqSAKqMxys014lVKBzy1o/5vv9CtU7U4wgGWL1dA2o6MOzcD53ScN4Jmiq6VbtLz1vIQ==",
"license": "MIT"
},
"node_modules/pathe": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
@@ -6216,8 +6399,7 @@
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
"dev": true
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
"node_modules/proper-lockfile": {
"version": "4.1.2",
@@ -6308,7 +6490,6 @@
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
"dev": true,
"dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
@@ -6557,8 +6738,7 @@
"node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"dev": true
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"node_modules/safe-json-parse": {
"version": "4.0.0",
@@ -6619,6 +6799,12 @@
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
},
"node_modules/setimmediate": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
"integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",
"license": "MIT"
},
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@@ -6719,7 +6905,6 @@
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"dependencies": {
"safe-buffer": "~5.1.0"
}
@@ -6956,6 +7141,12 @@
"node": ">=18"
}
},
"node_modules/type": {
"version": "2.7.3",
"resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz",
"integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==",
"license": "ISC"
},
"node_modules/type-check": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
@@ -7134,8 +7325,7 @@
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
"dev": true
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
"node_modules/video.js": {
"version": "8.10.0",
@@ -7374,6 +7564,55 @@
"resolved": "https://registry.npmjs.org/vue-lazyload/-/vue-lazyload-3.0.0.tgz",
"integrity": "sha512-h2keL/Rj550dLgesgOtXJS9qOiSMmuJNeVlfNAYV1/IYwOQYaWk5mFJlwRxmZDK9YC5gECcFLYYj7z1lKSf9ug=="
},
"node_modules/vue-reader": {
"version": "1.2.14",
"resolved": "https://registry.npmjs.org/vue-reader/-/vue-reader-1.2.14.tgz",
"integrity": "sha512-aGtJsmEdYcWLZmMqOrAzcb8/SYUcaz8zj9GtYFP+1cHs53IBG45/uZkywn/7RjWwFtiixSkLO7w/7qiqcyjwGQ==",
"license": "ISC",
"workspaces": [
"test/vue2",
"test/vue2.7"
],
"dependencies": {
"epubjs": "^0.3.93",
"vue-demi": "latest"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-rc.1",
"vue": "^2.0.0 || >=3.0.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
}
},
"node_modules/vue-reader/node_modules/vue-demi": {
"version": "0.14.10",
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.10.tgz",
"integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==",
"hasInstallScript": true,
"license": "MIT",
"bin": {
"vue-demi-fix": "bin/vue-demi-fix.js",
"vue-demi-switch": "bin/vue-demi-switch.js"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-rc.1",
"vue": "^3.0.0-0 || ^2.6.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
}
},
"node_modules/vue-router": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.3.0.tgz",

View File

@@ -42,6 +42,7 @@
"vue-final-modal": "^4.5.4",
"vue-i18n": "^9.10.2",
"vue-lazyload": "^3.0.0",
"vue-reader": "^1.2.14",
"vue-router": "^4.3.0",
"vue-toastification": "^2.0.0-rc.5"
},

View File

@@ -18,6 +18,7 @@ export default {
he: "עברית",
hu: "Magyar",
ar: "العربية",
ca: "Català",
de: "Deutsch",
el: "Ελληνικά",
en: "English",

View File

@@ -0,0 +1,78 @@
.epub-reader {
display: flex;
align-items: flex-end;
height: 100%;
}
.epub-reader .container {
width: 100%;
max-width: 100%;
height: calc(100% - 64px);
margin: 0;
}
.epub-reader .arrow.pre {
left: 0;
}
.epub-reader .readerArea {
background-color: var(--background) !important;
}
.epub-reader .titleArea {
color: var(--text);
}
.epub-reader .tocButtonBar {
background: var(--divider);
}
.epub-reader .tocButton {
color: var(--text);
}
.epub-reader .tocButton.tocButtonExpanded {
background-color: var(--background);
}
.epub-reader .tocAreaButton.active {
color: var(--blue);
border-color: var(--dark-blue);
}
.epub-reader .tocArea {
background-color: var(--background);
}
.epub-reader .readerArea .arrow {
color: var(--text);
}
.epub-reader .readerArea .arrow:hover {
color: var(--hover);
}
.epub-reader .size {
display: flex;
gap: 5px;
align-items: center;
z-index: 111;
right: 25px;
outline: none;
position: absolute;
top: 78px;
}
.epub-reader .size span {
color: var(--textSecondary);
}
.epub-reader .size button {
background: none;
outline: none;
border: none;
width: 25px;
height: 25px;
color: var(--textPrimary);
padding: 0;
}

View File

@@ -15,6 +15,7 @@
@import "./dashboard.css";
@import "./login.css";
@import "./mobile.css";
@import "./epubReader.css";
/* For testing only
:focus {

View File

@@ -0,0 +1,264 @@
{
"buttons": {
"cancel": "Cancel·lar",
"clear": "Netejar",
"close": "Tancar",
"continue": "Continuar",
"copy": "Copiar",
"copyFile": "Copiar fitxer",
"copyToClipboard": "Copiar al porta-retalls",
"copyDownloadLinkToClipboard": "Copiar l'enllaç de descàrrega al portapapers",
"create": "Crear",
"delete": "Esborrar",
"download": "Descarregar",
"file": "Fitxer",
"folder": "Carpeta",
"fullScreen": "Canviar a pantalla completa",
"hideDotfiles": "Ocultar fitxers que comencen per punt",
"info": "Info",
"more": "Més",
"move": "Moure",
"moveFile": "Moure fitxer",
"new": "Nou",
"next": "Següent",
"ok": "D'acord",
"permalink": "Enllaç permanent",
"previous": "Anterior",
"publish": "Publicar",
"rename": "Reanomenar",
"replace": "Substituir",
"reportIssue": "Reportar problema",
"save": "Desar",
"schedule": "Programar",
"search": "Cercar",
"select": "Seleccionar",
"selectMultiple": "Selecció múltiple",
"share": "Compartir",
"shell": "Prem Enter per cercar...",
"submit": "Enviar",
"switchView": "Canviar vista",
"toggleSidebar": "Mostrar/ocultar menú",
"update": "Actualitzar",
"upload": "Pujar",
"openFile": "Obrir fitxer",
"discardChanges": "Descartar"
},
"download": {
"downloadFile": "Descarregar fitxer",
"downloadFolder": "Descarregar directori",
"downloadSelected": "Descarregar seleccionats"
},
"upload": {
"abortUpload": "Are you sure you wish to abort?"
},
"errors": {
"forbidden": "No tens els permisos necessaris per accedir.",
"internal": "La veritat és que alguna cosa ha anat malament.",
"notFound": "No es pot accedir a aquest lloc.",
"connection": "No es pot accedir al servidor."
},
"files": {
"body": "Cos",
"closePreview": "Tancar vista prèvia",
"files": "Fitxers",
"folders": "Carpetes",
"home": "Inici",
"lastModified": "Última modificació",
"loading": "Carregant...",
"lonely": "Un se sent molt sol aquí...",
"metadata": "Metadades",
"multipleSelectionEnabled": "Selecció múltiple activada",
"name": "Nom",
"size": "Mida",
"sortByLastModified": "Ordenar per última modificació",
"sortByName": "Ordenar per nom",
"sortBySize": "Ordenar per mida",
"noPreview": "La vista prèvia no està disponible per a aquest fitxer."
},
"help": {
"click": "seleccionar fitxer o carpeta",
"ctrl": {
"click": "seleccionar múltiples fitxers o carpetes",
"f": "obre la cerca",
"s": "desa un fitxer o el descarrega a la carpeta en què estàs"
},
"del": "elimina els ítems seleccionats",
"doubleClick": "obre un fitxer o carpeta",
"esc": "neteja la selecció i/o tanca la finestra",
"f1": "aquesta informació",
"f2": "reanomenar fitxer",
"help": "Ajuda"
},
"login": {
"createAnAccount": "Crear un compte",
"loginInstead": "Usuari ja existent",
"password": "Contrasenya",
"passwordConfirm": "Confirmació de contrasenya",
"passwordsDontMatch": "Les contrasenyes no coincideixen",
"signup": "Registra't",
"submit": "Iniciar sessió",
"username": "Usuari",
"usernameTaken": "Nom d'usuari no disponible",
"wrongCredentials": "Usuari i/o contrasenya incorrectes"
},
"permanent": "Permanent",
"prompts": {
"copy": "Copiar",
"copyMessage": "Tria el lloc on vols copiar els teus fitxers:",
"currentlyNavigating": "Actualment estàs a:",
"deleteMessageMultiple": "Estàs segur que vols eliminar {count} fitxer(s)?",
"deleteMessageSingle": "Estàs segur que vols eliminar aquest fitxer/carpeta?",
"deleteMessageShare": "Estàs segur que vols eliminar aquest recurs compartit ({path})?",
"deleteUser": "Esteu segur que voleu eliminar aquest usuari?",
"deleteTitle": "Esborrar fitxers",
"displayName": "Nom:",
"download": "Descarregar fitxers",
"downloadMessage": "Tria el format de descàrrega.",
"error": "Alguna cosa ha fallat",
"fileInfo": "Informació del fitxer",
"filesSelected": "{count} fitxers seleccionats.",
"lastModified": "Última modificació",
"move": "Moure",
"moveMessage": "Tria una nova casa per als teus fitxers/carpeta(s):",
"newArchetype": "Crea un nou post basat en un arquetip. El teu fitxer serà creat a la carpeta de contingut.",
"newDir": "Nova carpeta",
"newDirMessage": "Escriu el nom de la nova carpeta.",
"newFile": "Nou fitxer",
"newFileMessage": "Escriu el nom del nou fitxer.",
"numberDirs": "Nombre de carpetes",
"numberFiles": "Nombre de fitxers",
"rename": "Reanomenar",
"renameMessage": "Escriu el nou nom per a",
"replace": "Substituir",
"replaceMessage": "Un dels fitxers que intentes pujar està creant conflicte pel seu nom. Vols canviar el nom del ja existent?\n",
"schedule": "Programar",
"scheduleMessage": "Tria una hora i data per programar la publicació d'aquest post.",
"show": "Mostrar",
"size": "Mida",
"upload": "Pujar",
"uploadFiles": "Pujant {files} fitxers...",
"uploadMessage": "Seleccioneu una opció per pujar.",
"optionalPassword": "Contrasenya opcional",
"resolution": "Resolució",
"discardEditorChanges": "Esteu segur que voleu descartar els canvis que heu fet?"
},
"search": {
"images": "Imatges",
"music": "Música",
"pdf": "PDF",
"pressToSearch": "Prem Enter per cercar...",
"search": "Cercar...",
"typeToSearch": "Escriu per fer una cerca...",
"types": "Tipus",
"video": "Vídeo"
},
"settings": {
"admin": "Admin",
"administrator": "Administrador",
"allowCommands": "Executar comandes",
"allowEdit": "Editar, reanomenar i esborrar fitxers o carpetes",
"allowNew": "Crear nous fitxers i carpetes",
"allowPublish": "Publicar nous posts i pàgines",
"allowSignup": "Permetre registre d'usuaris",
"avoidChanges": "(deixar en blanc per evitar canvis)",
"branding": "Marca",
"brandingDirectoryPath": "Ruta de la carpeta de personalització de marca",
"brandingHelp": "Pots personalitzar com es veu la teva instància de FileBrowser canviant-li el nom, reemplaçant el logotip, afegint estils personalitzats i fins i tot deshabilitant els enllaços externs que apunten cap a GitHub. \nPer a més informació sobre personalització de marca, si us plau revisa el {0}.",
"changePassword": "Canviar contrasenya",
"commandRunner": "Executor de comandes",
"commandRunnerHelp": "Aquí pots establir les comandes que s'executen en els esdeveniments anomenats. Has d'escriure'n una per línia. Les variables d'entorn {0} i {1} estaran disponibles, sent {0} relativa a {1}. Per a més informació sobre aquesta característica i les variables d'entorn disponibles, si us plau llegeix el {2}.",
"commandsUpdated": "Comandes actualitzades!",
"createUserDir": "Crea automàticament una carpeta d'inici quan s'afegeix un usuari",
"tusUploads": "Càrregues a trossos",
"tusUploadsHelp": "El File Browser suporta càrregues de fitxers a trossos, permetent la creació de càrregues de fitxers eficients, fiables, reanudables i a trossos fins i tot en xarxes poc fiables.",
"tusUploadsChunkSize": "Indica la mida màxima d'una sol·licitud (s'utilitzaran càrregues directes per a càrregues més petites). Podeu introduir un enter pla que indiqui la mida en bytes o una cadena com 10MB, 1GB, etc.",
"tusUploadsRetryCount": "Nombre de reintents a realitzar si una part falla en carregar-se.",
"userHomeBasePath": "Ruta base per als directoris personals dels usuaris",
"userScopeGenerationPlaceholder": "L'àmbit es generarà automàticament",
"createUserHomeDirectory": "Crear el directori principal de l'usuari",
"customStylesheet": "Modificar full d'estils",
"defaultUserDescription": "Aquestes són les configuracions per defecte per a nous usuaris.",
"disableExternalLinks": "Deshabilitar enllaços externs (excepte documentació)",
"disableUsedDiskPercentage": "Desactivar el gràfic de percentatge de disc utilitzat",
"documentation": "documentació",
"examples": "Exemples",
"executeOnShell": "Executar a la shell",
"executeOnShellDescription": "Per defecte, FileBrowser executa les comandes cridant directament els seus binaris. Si vols executar-los en una shell en lloc (com Bash o PowerShell), pots definir-ho aquí amb els arguments i flags necessaris. Si es defineix, la comanda que s'executa s'afegirà com a argument. Això s'aplica tant a les comandes d'usuari com als ganxos d'esdeveniments.",
"globalRules": "Es tracta d'un conjunt global de regles de permís i rebuig. S'apliquen a tots els usuaris. Pots definir regles específiques en la configuració de cada usuari per anul·lar aquestes.",
"globalSettings": "Ajustos globals",
"hideDotfiles": "Ocultar fitxers que comencen per punt",
"insertPath": "Introdueix la ruta",
"insertRegex": "Introduir expressió regular",
"instanceName": "Nom de la instància",
"language": "Idioma",
"lockPassword": "Evitar que l'usuari canviï la contrasenya",
"newPassword": "La teva nova contrasenya",
"newPasswordConfirm": "Confirma la teva contrasenya",
"newUser": "Nou usuari",
"password": "Contrasenya",
"passwordUpdated": "Contrasenya actualitzada!",
"path": "Ruta",
"perm": {
"create": "Crear fitxers i directoris",
"delete": "Eliminar fitxers i directoris",
"download": "Descarregar",
"execute": "Executar comandes",
"modify": "Editar fitxers",
"rename": "Reanomenar o moure fitxers i directoris",
"share": "Compartir fitxers"
},
"permissions": "Permisos",
"permissionsHelp": "Pots nomenar l'usuari com a administrador o triar els permisos individualment. Si selecciones \"Administrador\", totes les altres opcions s'activaran automàticament. L'administració d'usuaris és un privilegi d'administrador.\n",
"profileSettings": "Ajustos del perfil",
"ruleExample1": "prevé l'accés a una extensió de fitxer (Com .git) en cada carpeta.\n",
"ruleExample2": "bloqueja l'accés al fitxer anomenat Caddyfile a la carpeta arrel.",
"rules": "Regles",
"rulesHelp": "Aquí pots definir un conjunt de regles de permisos per a aquest usuari específic. Els fitxers bloquejats no es mostraran en les llistes i no seran accessibles per l'usuari. Pots utilitzar regex i rutes relatives a l'arrel de l'usuari.\n",
"scope": "Arrel",
"setDateFormat": "Establir el format exacte de la data",
"settingsUpdated": "Ajustos actualitzats!",
"shareDuration": "Compartir Duració",
"shareManagement": "Gestió Compartida",
"shareDeleted": "Recurs compartit eliminat!",
"singleClick": "Utilitza un sol clic per obrir fitxers i directoris",
"themes": {
"default": "Valor per defecte del sistema",
"dark": "Fosc",
"light": "Clar",
"title": "Tema"
},
"user": "Usuari",
"userCommands": "Comandes",
"userCommandsHelp": "Una llista separada per espais amb les comandes permeses per a aquest usuari. Exemple:\n",
"userCreated": "Usuari creat!",
"userDefaults": "Configuració d'usuari per defecte",
"userDeleted": "Usuari eliminat!",
"userManagement": "Administració d'usuaris",
"userUpdated": "Usuari actualitzat!",
"username": "Usuari",
"users": "Usuaris"
},
"sidebar": {
"help": "Ajuda",
"hugoNew": "Nou Hugo",
"login": "Iniciar sessió",
"logout": "Tancar sessió",
"myFiles": "Els meus fitxers",
"newFile": "Nou fitxer",
"newFolder": "Nova carpeta",
"preview": "Vista prèvia",
"settings": "Ajustos",
"signup": "Registra't",
"siteSettings": "Ajustos del lloc"
},
"success": {
"linkCopied": "Enllaç copiat!"
},
"time": {
"days": "Dies",
"hours": "Hores",
"minutes": "Minuts",
"seconds": "Segons",
"unit": "Unitat"
}
}

View File

@@ -82,9 +82,9 @@
</header-bar>
<div v-if="isMobile" id="file-selection">
<span v-if="fileStore.selectedCount > 0"
>{{ fileStore.selectedCount }} selected</span
>
<span v-if="fileStore.selectedCount > 0">
{{ t("prompts.filesSelected", fileStore.selectedCount) }}
</span>
<action
v-if="headerButtons.share"
icon="share"

View File

@@ -6,7 +6,7 @@
@mousemove="toggleNavigation"
@touchstart="toggleNavigation"
>
<header-bar v-if="isPdf || showNav">
<header-bar v-if="isPdf || isEpub || showNav">
<action icon="close" :label="$t('buttons.close')" @action="close()" />
<title>{{ name }}</title>
<action
@@ -57,7 +57,37 @@
</div>
<template v-else>
<div class="preview">
<ExtendedImage v-if="fileStore.req?.type == 'image'" :src="raw" />
<div v-if="isEpub" class="epub-reader">
<vue-reader
:location="location"
:url="raw"
:get-rendition="getRendition"
:epubInitOptions="{
requestCredentials: true,
}"
:epubOptions="{
allowPopups: true,
allowScriptedContent: true,
}"
@update:location="locationChange"
/>
<div class="size">
<button
@click="changeSize(Math.max(100, size - 10))"
class="reader-button"
>
<i class="material-icons">remove</i>
</button>
<button
@click="changeSize(Math.min(150, size + 10))"
class="reader-button"
>
<i class="material-icons">add</i>
</button>
<span>{{ size }}%</span>
</div>
</div>
<ExtendedImage v-else-if="fileStore.req?.type == 'image'" :src="raw" />
<audio
v-else-if="fileStore.req?.type == 'audio'"
ref="player"
@@ -129,20 +159,69 @@
</template>
<script setup lang="ts">
import { useStorage } from "@vueuse/core";
import { useAuthStore } from "@/stores/auth";
import { useFileStore } from "@/stores/file";
import { useLayoutStore } from "@/stores/layout";
import { files as api } from "@/api";
import { createURL } from "@/api/utils";
import { resizePreview } from "@/utils/constants";
import url from "@/utils/url";
import throttle from "lodash/throttle";
import HeaderBar from "@/components/header/HeaderBar.vue";
import Action from "@/components/header/Action.vue";
import ExtendedImage from "@/components/files/ExtendedImage.vue";
import VideoPlayer from "@/components/files/VideoPlayer.vue";
import { VueReader } from "vue-reader";
import { computed, inject, onBeforeUnmount, onMounted, ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import VideoPlayer from "@/components/files/VideoPlayer.vue";
import type { Rendition } from "epubjs";
import { getTheme } from "@/utils/theme";
const location = useStorage("book-progress", 0, undefined, {
serializer: {
read: (v) => JSON.parse(v),
write: (v) => JSON.stringify(v),
},
});
const size = useStorage("book-size", 120, undefined, {
serializer: {
read: (v) => JSON.parse(v),
write: (v) => JSON.stringify(v),
},
});
const locationChange = (epubcifi: number) => {
location.value = epubcifi;
};
let rendition: Rendition | null = null;
const changeSize = (val: number) => {
size.value = val;
rendition?.themes.fontSize(`${val}%`);
};
const getRendition = (_rendition: Rendition) => {
rendition = _rendition;
switch (getTheme()) {
case "dark": {
rendition.themes.override("color", "rgba(255, 255, 255, 0.6)");
break;
}
case "light": {
rendition.themes.override("color", "rgb(111, 111, 111)");
break;
}
}
rendition.themes.registerRules("h2Transparent", {
"h1,h2,h3,h4": {
"background-color": "transparent !important",
},
});
rendition?.themes.fontSize(`${size.value}%`);
rendition.themes.select("h2Transparent");
rendition.themes.override("background-color", "transparent", true);
};
const mediaTypes: ResourceType[] = ["image", "video", "audio", "blob"];
@@ -182,10 +261,17 @@ const raw = computed(() => {
return api.getPreviewURL(fileStore.req, "big");
}
if (isEpub.value) {
return createURL("api/raw" + fileStore.req?.path, {}, false);
}
return downloadUrl.value;
});
const isPdf = computed(() => fileStore.req?.extension.toLowerCase() == ".pdf");
const isEpub = computed(
() => fileStore.req?.extension.toLowerCase() == ".epub"
);
const isResizeEnabled = computed(() => resizePreview);

View File

@@ -28,7 +28,7 @@ require (
require (
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/apernet/quic-go v0.45.3-0.20240803200022-e3824dfb4b89 // indirect
github.com/apernet/quic-go v0.46.1-0.20240816230517-268ed2476167 // indirect
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 // indirect
github.com/cloudflare/circl v1.3.9 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect

View File

@@ -42,8 +42,8 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f h1:uVh0qpEslrWjgzx9vOcyCqsOY3c9kofDZ1n+qaw35ZY=
github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f/go.mod h1:xkkq9D4ygcldQQhKS/w9CadiCKwCngU7K9E3DaKahpM=
github.com/apernet/quic-go v0.45.3-0.20240803200022-e3824dfb4b89 h1:UKwGA1Lto7xQ3AGeTmBU7Y3WznMRTt9atOJ05xKNOSU=
github.com/apernet/quic-go v0.45.3-0.20240803200022-e3824dfb4b89/go.mod h1:MjGWpXA31DZZWESdX3/PjIpSWIT1fOm8FNCqyXXFZFU=
github.com/apernet/quic-go v0.46.1-0.20240816230517-268ed2476167 h1:+jKV1EuDJiUoa4XgRyle5w7wIo+0hil+YyUmwhd4ttk=
github.com/apernet/quic-go v0.46.1-0.20240816230517-268ed2476167/go.mod h1:MjGWpXA31DZZWESdX3/PjIpSWIT1fOm8FNCqyXXFZFU=
github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad h1:QzQ2sKpc9o42HNRR8ukM5uMC/RzR2HgZd/Nvaqol2C0=
github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad/go.mod h1:S5IydyLSN/QAfvY+r2GoomPJ6hidtXWm/Ad18sJVssk=
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0=

View File

@@ -3,7 +3,7 @@ module github.com/apernet/hysteria/core/v2
go 1.21
require (
github.com/apernet/quic-go v0.45.3-0.20240803200022-e3824dfb4b89
github.com/apernet/quic-go v0.46.1-0.20240816230517-268ed2476167
github.com/stretchr/testify v1.9.0
go.uber.org/goleak v1.2.1
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842

View File

@@ -1,5 +1,5 @@
github.com/apernet/quic-go v0.45.3-0.20240803200022-e3824dfb4b89 h1:UKwGA1Lto7xQ3AGeTmBU7Y3WznMRTt9atOJ05xKNOSU=
github.com/apernet/quic-go v0.45.3-0.20240803200022-e3824dfb4b89/go.mod h1:MjGWpXA31DZZWESdX3/PjIpSWIT1fOm8FNCqyXXFZFU=
github.com/apernet/quic-go v0.46.1-0.20240816230517-268ed2476167 h1:+jKV1EuDJiUoa4XgRyle5w7wIo+0hil+YyUmwhd4ttk=
github.com/apernet/quic-go v0.46.1-0.20240816230517-268ed2476167/go.mod h1:MjGWpXA31DZZWESdX3/PjIpSWIT1fOm8FNCqyXXFZFU=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=

View File

@@ -4,7 +4,7 @@ go 1.21
require (
github.com/apernet/hysteria/core/v2 v2.0.0-00010101000000-000000000000
github.com/apernet/quic-go v0.45.3-0.20240803200022-e3824dfb4b89
github.com/apernet/quic-go v0.46.1-0.20240816230517-268ed2476167
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6
github.com/hashicorp/golang-lru/v2 v2.0.5
github.com/miekg/dns v1.1.59

View File

@@ -1,7 +1,7 @@
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
github.com/apernet/quic-go v0.45.3-0.20240803200022-e3824dfb4b89 h1:UKwGA1Lto7xQ3AGeTmBU7Y3WznMRTt9atOJ05xKNOSU=
github.com/apernet/quic-go v0.45.3-0.20240803200022-e3824dfb4b89/go.mod h1:MjGWpXA31DZZWESdX3/PjIpSWIT1fOm8FNCqyXXFZFU=
github.com/apernet/quic-go v0.46.1-0.20240816230517-268ed2476167 h1:+jKV1EuDJiUoa4XgRyle5w7wIo+0hil+YyUmwhd4ttk=
github.com/apernet/quic-go v0.46.1-0.20240816230517-268ed2476167/go.mod h1:MjGWpXA31DZZWESdX3/PjIpSWIT1fOm8FNCqyXXFZFU=
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0=
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6/go.mod h1:J29hk+f9lJrblVIfiJOtTFk+OblBawmib4uz/VdKzlg=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=

View File

@@ -112,11 +112,17 @@ func (h *Sniffer) TCP(stream quic.Stream, reqAddr *string) ([]byte, error) {
tr := &teeReader{Stream: stream, Pre: pre}
req, _ := http.ReadRequest(bufio.NewReader(tr))
if req != nil && req.Host != "" {
// req.Host can be host:port, in which case we need to extract the host part
host, _, err := net.SplitHostPort(req.Host)
if err != nil {
// No port, just use the whole string
host = req.Host
}
_, port, err := net.SplitHostPort(*reqAddr)
if err != nil {
return nil, err
}
*reqAddr = net.JoinHostPort(req.Host, port)
*reqAddr = net.JoinHostPort(host, port)
}
return tr.Buffer(), nil
} else if h.isTLS(pre) {

View File

@@ -70,6 +70,18 @@ func TestSnifferTCP(t *testing.T) {
assert.Equal(t, *buf, putback)
assert.Equal(t, "example.com:80", reqAddr)
// Test HTTP with Host as host:port
*buf = []byte("GET / HTTP/1.1\r\n" +
"Host: example.com:8080\r\n" +
"User-Agent: test-agent\r\n" +
"Accept: */*\r\n\r\n")
index = 0
reqAddr = "222.222.222.222:10086"
putback, err = sniffer.TCP(stream, &reqAddr)
assert.NoError(t, err)
assert.Equal(t, *buf, putback)
assert.Equal(t, "example.com:10086", reqAddr)
// Test TLS
*buf, err = base64.StdEncoding.DecodeString("FgMBARcBAAETAwPJL2jlt1OAo+Rslkjv/aqKiTthKMaCKg2Gvd+uALDbDCDdY+UIk8ouadEB9fC3j52Y1i7SJZqGIgBRIS6kKieYrAAoEwITAcAswCvAMMAvwCTAI8AowCfACsAJwBTAEwCdAJwAPQA8ADUALwEAAKIAAAAOAAwAAAlpcGluZm8uaW8ABQAFAQAAAAAAKwAJCAMEAwMDAgMBAA0AGgAYCAQIBQgGBAEFAQIBBAMFAwIDAgIGAQYDACMAAAAKAAgABgAdABcAGAAQAAsACQhodHRwLzEuMQAzACYAJAAdACBguQbqNJNyamYxYcrBFpBP7pWv5TgZsP9gwGtMYNKVBQAxAAAAFwAA/wEAAQAALQACAQE=")
assert.NoError(t, err)

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-6.6 = .40
LINUX_KERNEL_HASH-6.6.40 = 5c3a3c03c055b8d601a6d7f80d1465ada6b83a12299f6ace2027b47f0baff538
LINUX_VERSION-6.6 = .46
LINUX_KERNEL_HASH-6.6.46 = 052f932396d9c7d84ceeda91226a8ef797c12188bde41e6c419602d990dd45f2

View File

@@ -134,7 +134,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
};
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -392,7 +392,7 @@ static void cps_smp_finish(void)
@@ -395,7 +395,7 @@ static void cps_smp_finish(void)
local_irq_enable();
}
@@ -143,7 +143,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
enum cpu_death {
CPU_DEATH_HALT,
@@ -429,7 +429,7 @@ static void cps_shutdown_this_cpu(enum c
@@ -432,7 +432,7 @@ static void cps_shutdown_this_cpu(enum c
}
}
@@ -152,7 +152,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
static void cps_kexec_nonboot_cpu(void)
{
@@ -439,9 +439,9 @@ static void cps_kexec_nonboot_cpu(void)
@@ -442,9 +442,9 @@ static void cps_kexec_nonboot_cpu(void)
cps_shutdown_this_cpu(CPU_DEATH_POWER);
}
@@ -164,7 +164,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
#ifdef CONFIG_HOTPLUG_CPU
@@ -610,7 +610,7 @@ static const struct plat_smp_ops cps_smp
@@ -613,7 +613,7 @@ static const struct plat_smp_ops cps_smp
.cpu_die = cps_cpu_die,
.cleanup_dead_cpu = cps_cleanup_dead_cpu,
#endif
@@ -175,8 +175,8 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
};
--- a/arch/mips/loongson64/reset.c
+++ b/arch/mips/loongson64/reset.c
@@ -53,7 +53,7 @@ static void loongson_halt(void)
}
@@ -39,7 +39,7 @@ static int firmware_poweroff(struct sys_
return NOTIFY_DONE;
}
-#ifdef CONFIG_KEXEC
@@ -184,9 +184,9 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
/* 0X80000000~0X80200000 is safe */
#define MAX_ARGS 64
@@ -158,7 +158,7 @@ static int __init mips_reboot_setup(void
_machine_halt = loongson_halt;
pm_power_off = loongson_poweroff;
@@ -152,7 +152,7 @@ static int __init mips_reboot_setup(void
firmware_poweroff, NULL);
}
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
@@ -195,7 +195,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
return -ENOMEM;
--- a/arch/mips/loongson64/smp.c
+++ b/arch/mips/loongson64/smp.c
@@ -864,7 +864,7 @@ const struct plat_smp_ops loongson3_smp_
@@ -883,7 +883,7 @@ const struct plat_smp_ops loongson3_smp_
.cpu_disable = loongson3_cpu_disable,
.cpu_die = loongson3_cpu_die,
#endif

View File

@@ -296,7 +296,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void r8168fp_adjust_ocp_cmd(struct rtl8169_private *tp, u32 *cmd, int type)
{
/* based on RTL8168FP_OOBMAC_BASE in vendor driver */
@@ -5258,6 +5316,7 @@ static int rtl_init_one(struct pci_dev *
@@ -5254,6 +5312,7 @@ static int rtl_init_one(struct pci_dev *
raw_spin_lock_init(&tp->cfg9346_usage_lock);
raw_spin_lock_init(&tp->config25_lock);
raw_spin_lock_init(&tp->mac_ocp_lock);
@@ -304,7 +304,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dev->tstats = devm_netdev_alloc_pcpu_stats(&pdev->dev,
struct pcpu_sw_netstats);
@@ -5414,6 +5473,12 @@ static int rtl_init_one(struct pci_dev *
@@ -5410,6 +5469,12 @@ static int rtl_init_one(struct pci_dev *
if (rc)
return rc;

View File

@@ -59,7 +59,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
obj-$(CONFIG_R8169) += r8169.o
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5473,11 +5473,10 @@ static int rtl_init_one(struct pci_dev *
@@ -5469,11 +5469,10 @@ static int rtl_init_one(struct pci_dev *
if (rc)
return rc;

View File

@@ -321,7 +321,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
padto = max_t(unsigned int, padto, ETH_ZLEN);
break;
default:
@@ -5225,7 +5282,7 @@ static void rtl_hw_initialize(struct rtl
@@ -5221,7 +5278,7 @@ static void rtl_hw_initialize(struct rtl
case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48:
rtl_hw_init_8168g(tp);
break;

View File

@@ -225,7 +225,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
void r8169_get_led_name(struct rtl8169_private *tp, int idx,
char *buf, int buf_len)
{
@@ -5530,10 +5581,12 @@ static int rtl_init_one(struct pci_dev *
@@ -5526,10 +5577,12 @@ static int rtl_init_one(struct pci_dev *
if (rc)
return rc;

View File

@@ -124,7 +124,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 ocp_base;
};
@@ -5126,6 +5128,8 @@ static void rtl_remove_one(struct pci_de
@@ -5122,6 +5124,8 @@ static void rtl_remove_one(struct pci_de
cancel_work_sync(&tp->wk.work);
@@ -133,7 +133,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
unregister_netdev(tp->dev);
if (tp->dash_type != RTL_DASH_NONE)
@@ -5586,9 +5590,9 @@ static int rtl_init_one(struct pci_dev *
@@ -5582,9 +5586,9 @@ static int rtl_init_one(struct pci_dev *
if (IS_ENABLED(CONFIG_R8169_LEDS)) {
if (rtl_is_8125(tp))

View File

@@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5128,7 +5128,8 @@ static void rtl_remove_one(struct pci_de
@@ -5124,7 +5124,8 @@ static void rtl_remove_one(struct pci_de
cancel_work_sync(&tp->wk.work);

View File

@@ -48,7 +48,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mtd->nvmem = nvmem_register(&config);
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -941,7 +941,7 @@ struct nvmem_device *nvmem_register(cons
@@ -940,7 +940,7 @@ struct nvmem_device *nvmem_register(cons
nvmem->nkeepout = config->nkeepout;
if (config->of_node)
nvmem->dev.of_node = config->of_node;

View File

@@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -847,14 +847,6 @@ static int nvmem_add_cells_from_layout(s
@@ -846,14 +846,6 @@ static int nvmem_add_cells_from_layout(s
}
#if IS_ENABLED(CONFIG_OF)

View File

@@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -816,7 +816,7 @@ static int nvmem_add_cells_from_layout(s
@@ -815,7 +815,7 @@ static int nvmem_add_cells_from_layout(s
int ret;
if (layout && layout->add_cells) {

View File

@@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -675,7 +675,6 @@ static int nvmem_validate_keepouts(struc
@@ -674,7 +674,6 @@ static int nvmem_validate_keepouts(struc
static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)
{
@@ -33,7 +33,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct device *dev = &nvmem->dev;
struct device_node *child;
const __be32 *addr;
@@ -705,8 +704,8 @@ static int nvmem_add_cells_from_dt(struc
@@ -704,8 +703,8 @@ static int nvmem_add_cells_from_dt(struc
info.np = of_node_get(child);
@@ -44,7 +44,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ret = nvmem_add_one_cell(nvmem, &info);
kfree(info.name);
@@ -895,6 +894,7 @@ struct nvmem_device *nvmem_register(cons
@@ -894,6 +893,7 @@ struct nvmem_device *nvmem_register(cons
kref_init(&nvmem->refcnt);
INIT_LIST_HEAD(&nvmem->cells);

View File

@@ -84,7 +84,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static int __nvmem_reg_read(struct nvmem_device *nvmem, unsigned int offset,
void *val, size_t bytes)
{
@@ -740,97 +737,22 @@ static int nvmem_add_cells_from_fixed_la
@@ -739,97 +736,22 @@ static int nvmem_add_cells_from_fixed_la
return err;
}
@@ -189,7 +189,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem,
struct nvmem_layout *layout)
{
@@ -838,7 +760,7 @@ const void *nvmem_layout_get_match_data(
@@ -837,7 +759,7 @@ const void *nvmem_layout_get_match_data(
const struct of_device_id *match;
layout_np = of_nvmem_layout_get_container(nvmem);
@@ -198,7 +198,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return match ? match->data : NULL;
}
@@ -950,19 +872,6 @@ struct nvmem_device *nvmem_register(cons
@@ -949,19 +871,6 @@ struct nvmem_device *nvmem_register(cons
goto err_put_device;
}
@@ -218,7 +218,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (config->cells) {
rval = nvmem_add_cells(nvmem, config->cells, config->ncells);
if (rval)
@@ -983,24 +892,24 @@ struct nvmem_device *nvmem_register(cons
@@ -982,24 +891,24 @@ struct nvmem_device *nvmem_register(cons
if (rval)
goto err_remove_cells;
@@ -249,7 +249,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (config->compat)
nvmem_sysfs_remove_compat(nvmem, config);
err_put_device:
@@ -1022,7 +931,7 @@ static void nvmem_device_release(struct
@@ -1021,7 +930,7 @@ static void nvmem_device_release(struct
device_remove_bin_file(nvmem->base_dev, &nvmem->eeprom);
nvmem_device_remove_all_cells(nvmem);
@@ -258,7 +258,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
device_unregister(&nvmem->dev);
}
@@ -1324,6 +1233,12 @@ nvmem_cell_get_from_lookup(struct device
@@ -1323,6 +1232,12 @@ nvmem_cell_get_from_lookup(struct device
return cell;
}
@@ -271,7 +271,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
#if IS_ENABLED(CONFIG_OF)
static struct nvmem_cell_entry *
nvmem_find_cell_entry_by_node(struct nvmem_device *nvmem, struct device_node *np)
@@ -1342,6 +1257,18 @@ nvmem_find_cell_entry_by_node(struct nvm
@@ -1341,6 +1256,18 @@ nvmem_find_cell_entry_by_node(struct nvm
return cell;
}
@@ -290,7 +290,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/**
* of_nvmem_cell_get() - Get a nvmem cell from given device node and cell id
*
@@ -1404,16 +1331,29 @@ struct nvmem_cell *of_nvmem_cell_get(str
@@ -1403,16 +1330,29 @@ struct nvmem_cell *of_nvmem_cell_get(str
return ERR_CAST(nvmem);
}
@@ -322,7 +322,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return cell;
}
@@ -1527,6 +1467,7 @@ void nvmem_cell_put(struct nvmem_cell *c
@@ -1526,6 +1466,7 @@ void nvmem_cell_put(struct nvmem_cell *c
kfree(cell);
__nvmem_device_put(nvmem);
@@ -330,7 +330,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
EXPORT_SYMBOL_GPL(nvmem_cell_put);
@@ -2104,11 +2045,22 @@ EXPORT_SYMBOL_GPL(nvmem_dev_name);
@@ -2103,11 +2044,22 @@ EXPORT_SYMBOL_GPL(nvmem_dev_name);
static int __init nvmem_init(void)
{

View File

@@ -111,7 +111,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static struct bin_attribute bin_attr_nvmem_eeprom_compat = {
.attr = {
.name = "eeprom",
@@ -380,6 +427,68 @@ static void nvmem_sysfs_remove_compat(st
@@ -379,6 +426,68 @@ static void nvmem_sysfs_remove_compat(st
device_remove_bin_file(nvmem->base_dev, &nvmem->eeprom);
}
@@ -180,7 +180,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
#else /* CONFIG_NVMEM_SYSFS */
static int nvmem_sysfs_setup_compat(struct nvmem_device *nvmem,
@@ -739,11 +848,25 @@ static int nvmem_add_cells_from_fixed_la
@@ -738,11 +847,25 @@ static int nvmem_add_cells_from_fixed_la
int nvmem_layout_register(struct nvmem_layout *layout)
{
@@ -207,7 +207,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
EXPORT_SYMBOL_GPL(nvmem_layout_register);
@@ -902,10 +1025,20 @@ struct nvmem_device *nvmem_register(cons
@@ -901,10 +1024,20 @@ struct nvmem_device *nvmem_register(cons
if (rval)
goto err_remove_dev;

View File

@@ -44,7 +44,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -854,7 +854,7 @@ int nvmem_layout_register(struct nvmem_l
@@ -853,7 +853,7 @@ int nvmem_layout_register(struct nvmem_l
return -EINVAL;
/* Populate the cells */

View File

@@ -24,7 +24,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -876,19 +876,6 @@ void nvmem_layout_unregister(struct nvme
@@ -875,19 +875,6 @@ void nvmem_layout_unregister(struct nvme
}
EXPORT_SYMBOL_GPL(nvmem_layout_unregister);

View File

@@ -21,7 +21,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -2163,6 +2163,19 @@ const char *nvmem_dev_name(struct nvmem_
@@ -2162,6 +2162,19 @@ const char *nvmem_dev_name(struct nvmem_
}
EXPORT_SYMBOL_GPL(nvmem_dev_name);

View File

@@ -99,7 +99,7 @@ Signed-off-by: Lee Jones <lee@kernel.org>
interval = jiffies_to_msecs(
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -588,6 +588,9 @@ enum led_trigger_netdev_modes {
@@ -586,6 +586,9 @@ enum led_trigger_netdev_modes {
TRIGGER_NETDEV_LINK_10,
TRIGGER_NETDEV_LINK_100,
TRIGGER_NETDEV_LINK_1000,

View File

@@ -19,7 +19,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3668,7 +3668,7 @@ static int mv88e6xxx_mdio_register(struc
@@ -3669,7 +3669,7 @@ static int mv88e6xxx_mdio_register(struc
if (external) {
mv88e6xxx_reg_lock(chip);

View File

@@ -27,7 +27,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3668,7 +3668,10 @@ static int mv88e6xxx_mdio_register(struc
@@ -3669,7 +3669,10 @@ static int mv88e6xxx_mdio_register(struc
if (external) {
mv88e6xxx_reg_lock(chip);

View File

@@ -635,11 +635,11 @@ CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
# CONFIG_BLK_DEV_UBLK is not set
# CONFIG_BLK_DEV_ZONED is not set
# CONFIG_BLK_INLINE_ENCRYPTION is not set
# CONFIG_BLOCK_NOTIFIERS is not set
# CONFIG_BLK_SED_OPAL is not set
# CONFIG_BLK_WBT is not set
CONFIG_BLOCK=y
# CONFIG_BLOCK_LEGACY_AUTOLOAD is not set
# CONFIG_BLOCK_NOTIFIERS is not set
# CONFIG_BMA180 is not set
# CONFIG_BMA220 is not set
# CONFIG_BMA400 is not set
@@ -1015,8 +1015,8 @@ CONFIG_CRC32_SARWATE=y
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC_ITU_T is not set
# CONFIG_CRC_T10DIF is not set
# CONFIG_CROS_HPS_I2C is not set
# CONFIG_CROSS_MEMORY_ATTACH is not set
# CONFIG_CROS_HPS_I2C is not set
CONFIG_CRYPTO=y
# CONFIG_CRYPTO_842 is not set
CONFIG_CRYPTO_ACOMP2=y
@@ -1527,8 +1527,8 @@ CONFIG_DQL=y
# CONFIG_DRM_PANEL_MANTIX_MLAF057WE51 is not set
# CONFIG_DRM_PANEL_MIPI_DBI is not set
# CONFIG_DRM_PANEL_NEC_NL8048HL11 is not set
# CONFIG_DRM_PANEL_NEWVISION_NV3052C is not set
# CONFIG_DRM_PANEL_NEWVISION_NV3051D is not set
# CONFIG_DRM_PANEL_NEWVISION_NV3052C is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35510 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35560 is not set
# CONFIG_DRM_PANEL_NOVATEK_NT35950 is not set
@@ -6182,8 +6182,8 @@ CONFIG_SND_X86=y
# CONFIG_SPI_AXI_SPI_ENGINE is not set
# CONFIG_SPI_BCM2835 is not set
# CONFIG_SPI_BCM63XX_HSSPI is not set
# CONFIG_SPI_BCM_QSPI is not set
# CONFIG_SPI_BCMBCA_HSSPI is not set
# CONFIG_SPI_BCM_QSPI is not set
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_BUTTERFLY is not set
# CONFIG_SPI_CADENCE is not set
@@ -6760,8 +6760,8 @@ CONFIG_USB_BELKIN=y
# CONFIG_USB_CDNS3 is not set
# CONFIG_USB_CDNS3_IMX is not set
# CONFIG_USB_CDNS3_PCI_WRAP is not set
# CONFIG_USB_CDNS_SUPPORT is not set
# CONFIG_USB_CDNSP_PCI is not set
# CONFIG_USB_CDNS_SUPPORT is not set
# CONFIG_USB_CHAOSKEY is not set
# CONFIG_USB_CHIPIDEA is not set
# CONFIG_USB_CHIPIDEA_GENERIC is not set

View File

@@ -23,7 +23,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
{ {0x02, 0x21}, "lz4", unlz4 },
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -456,10 +456,10 @@ quiet_cmd_bzip2_with_size = BZIP2 $@
@@ -460,10 +460,10 @@ quiet_cmd_bzip2_with_size = BZIP2 $@
# ---------------------------------------------------------------------------
quiet_cmd_lzma = LZMA $@

View File

@@ -10,7 +10,7 @@ Subject: [PATCH] Kconfig: add tristate for OID and ASNI string
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1989,7 +1989,7 @@ config PADATA
@@ -1990,7 +1990,7 @@ config PADATA
bool
config ASN1
@@ -21,7 +21,7 @@ Subject: [PATCH] Kconfig: add tristate for OID and ASNI string
that can be interpreted by the ASN.1 stream decoder and used to
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -647,7 +647,7 @@ config LIBFDT
@@ -641,7 +641,7 @@ config LIBFDT
bool
config OID_REGISTRY

View File

@@ -10,7 +10,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1083,12 +1083,18 @@ static const struct usb_device_id produc
@@ -1084,12 +1084,18 @@ static const struct usb_device_id produc
USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7),
.driver_info = (unsigned long)&qmi_wwan_info,
},

View File

@@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2897,6 +2897,8 @@ static const struct seq_operations locks
@@ -2895,6 +2895,8 @@ static const struct seq_operations locks
static int __init proc_locks_init(void)
{
@@ -235,7 +235,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!pe)
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -4447,6 +4447,8 @@ static const struct seq_operations vmall
@@ -4455,6 +4455,8 @@ static const struct seq_operations vmall
static int __init proc_vmalloc_init(void)
{
@@ -341,7 +341,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -3036,11 +3036,13 @@ static const struct seq_operations fib_r
@@ -3037,11 +3037,13 @@ static const struct seq_operations fib_r
int __net_init fib_proc_init(struct net *net)
{
@@ -357,7 +357,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
fib_triestat_seq_show, NULL))
goto out2;
@@ -3051,17 +3053,21 @@ int __net_init fib_proc_init(struct net
@@ -3052,17 +3054,21 @@ int __net_init fib_proc_init(struct net
return 0;
out3:

View File

@@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+MODULE_LICENSE("GPL");
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4487,6 +4487,7 @@ int wake_up_state(struct task_struct *p,
@@ -4483,6 +4483,7 @@ int wake_up_state(struct task_struct *p,
{
return try_to_wake_up(p, state, 0);
}

View File

@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif /* _KOBJECT_H_ */
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -691,6 +691,43 @@ int add_uevent_var(struct kobj_uevent_en
@@ -706,6 +706,43 @@ int add_uevent_var(struct kobj_uevent_en
EXPORT_SYMBOL_GPL(add_uevent_var);
#if defined(CONFIG_NET)

View File

@@ -19,7 +19,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1657,7 +1657,7 @@ static void device_links_purge(struct de
@@ -1658,7 +1658,7 @@ static void device_links_purge(struct de
#define FW_DEVLINK_FLAGS_RPM (FW_DEVLINK_FLAGS_ON | \
DL_FLAG_PM_RUNTIME)

View File

@@ -319,7 +319,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
struct nf_conn *ct = item->ct;
struct sk_buff *skb;
unsigned int type;
@@ -3750,11 +3757,17 @@ static int ctnetlink_stat_exp_cpu(struct
@@ -3751,11 +3758,17 @@ static int ctnetlink_stat_exp_cpu(struct
}
#ifdef CONFIG_NF_CONNTRACK_EVENTS
@@ -337,7 +337,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
static const struct nfnl_callback ctnl_cb[IPCTNL_MSG_MAX] = {
[IPCTNL_MSG_CT_NEW] = {
@@ -3853,8 +3866,12 @@ static int __net_init ctnetlink_net_init
@@ -3854,8 +3867,12 @@ static int __net_init ctnetlink_net_init
static void ctnetlink_net_pre_exit(struct net *net)
{
#ifdef CONFIG_NF_CONNTRACK_EVENTS

View File

@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#define PACKET_FANOUT_LB 1
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1864,6 +1864,7 @@ static int packet_rcv_spkt(struct sk_buf
@@ -1925,6 +1925,7 @@ static int packet_rcv_spkt(struct sk_buf
{
struct sock *sk;
struct sockaddr_pkt *spkt;
@@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* When we registered the protocol we saved the socket in the data
@@ -1871,6 +1872,7 @@ static int packet_rcv_spkt(struct sk_buf
@@ -1932,6 +1933,7 @@ static int packet_rcv_spkt(struct sk_buf
*/
sk = pt->af_packet_priv;
@@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* Yank back the headers [hope the device set this
@@ -1883,7 +1885,7 @@ static int packet_rcv_spkt(struct sk_buf
@@ -1944,7 +1946,7 @@ static int packet_rcv_spkt(struct sk_buf
* so that this procedure is noop.
*/
@@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
goto out;
if (!net_eq(dev_net(dev), sock_net(sk)))
@@ -2129,12 +2131,12 @@ static int packet_rcv(struct sk_buff *sk
@@ -2190,12 +2192,12 @@ static int packet_rcv(struct sk_buff *sk
unsigned int snaplen, res;
bool is_drop_n_account = false;
@@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
@@ -2261,12 +2263,12 @@ static int tpacket_rcv(struct sk_buff *s
@@ -2322,12 +2324,12 @@ static int tpacket_rcv(struct sk_buff *s
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32);
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48);
@@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
@@ -3385,6 +3387,7 @@ static int packet_create(struct net *net
@@ -3451,6 +3453,7 @@ static int packet_create(struct net *net
mutex_init(&po->pg_vec_lock);
po->rollover = NULL;
po->prot_hook.func = packet_rcv;
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (sock->type == SOCK_PACKET)
po->prot_hook.func = packet_rcv_spkt;
@@ -4036,6 +4039,16 @@ packet_setsockopt(struct socket *sock, i
@@ -4118,6 +4121,16 @@ packet_setsockopt(struct socket *sock, i
packet_sock_flag_set(po, PACKET_SOCK_QDISC_BYPASS, val);
return 0;
}
@@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
default:
return -ENOPROTOOPT;
}
@@ -4095,6 +4108,13 @@ static int packet_getsockopt(struct sock
@@ -4177,6 +4190,13 @@ static int packet_getsockopt(struct sock
case PACKET_VNET_HDR_SZ:
val = READ_ONCE(po->vnet_hdr_sz);
break;

View File

@@ -66,7 +66,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
static void rt_fibinfo_free(struct rtable __rcu **rtp)
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -2783,6 +2783,7 @@ static const char *const rtn_type_names[
@@ -2784,6 +2784,7 @@ static const char *const rtn_type_names[
[RTN_THROW] = "THROW",
[RTN_NAT] = "NAT",
[RTN_XRESOLVE] = "XRESOLVE",

View File

@@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -8267,7 +8267,7 @@ static int nft_register_flowtable_net_ho
@@ -8279,7 +8279,7 @@ static int nft_register_flowtable_net_ho
err = flowtable->data.type->setup(&flowtable->data,
hook->ops.dev,
FLOW_BLOCK_BIND);

View File

@@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -6992,6 +6992,7 @@ static int mv88e6xxx_register_switch(str
@@ -6993,6 +6993,7 @@ static int mv88e6xxx_register_switch(str
ds->ops = &mv88e6xxx_switch_ops;
ds->ageing_time_min = chip->info->age_time_coeff;
ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX;

View File

@@ -33,7 +33,7 @@ string.
#include <linux/init.h>
#include <linux/kref.h>
#include <linux/module.h>
@@ -779,6 +782,62 @@ static int nvmem_validate_keepouts(struc
@@ -778,6 +781,62 @@ static int nvmem_validate_keepouts(struc
return 0;
}
@@ -96,7 +96,7 @@ string.
static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)
{
struct device *dev = &nvmem->dev;
@@ -813,6 +872,25 @@ static int nvmem_add_cells_from_dt(struc
@@ -812,6 +871,25 @@ static int nvmem_add_cells_from_dt(struc
if (nvmem->fixup_dt_cell_info)
nvmem->fixup_dt_cell_info(nvmem, &info);

View File

@@ -1,6 +1,6 @@
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1435,6 +1435,9 @@ static const struct usb_device_id produc
@@ -1438,6 +1438,9 @@ static const struct usb_device_id produc
{QMI_QUIRK_SET_DTR(0x1546, 0x1312, 4)}, /* u-blox LARA-R6 01B */
{QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
{QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET */
@@ -12,7 +12,7 @@
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -2310,9 +2310,13 @@ static const struct usb_device_id option
@@ -2322,9 +2322,13 @@ static const struct usb_device_id option
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0a06, 0xff) }, /* Fibocom FM650-CN (RNDIS mode) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0a07, 0xff) }, /* Fibocom FM650-CN (MBIM mode) */
{ USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */

View File

@@ -224,7 +224,7 @@ Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
int (*fw_translate_cs)(struct spi_controller *ctlr, unsigned cs);
/*
@@ -1600,6 +1639,9 @@ spi_register_board_info(struct spi_board
@@ -1601,6 +1640,9 @@ spi_register_board_info(struct spi_board
{ return 0; }
#endif

View File

@@ -37,7 +37,7 @@
* CONFIG_CMDLINE is meant to be a default in case nothing else
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2269,6 +2269,14 @@ config CMDLINE_FORCE
@@ -2307,6 +2307,14 @@ config CMDLINE_FORCE
endchoice

View File

@@ -1,76 +0,0 @@
From b7f824141f4163c64a940f3a69bf6d8b76f77c7f Mon Sep 17 00:00:00 2001
From: Niklas Cassel <cassel@kernel.org>
Date: Wed, 17 Apr 2024 18:42:26 +0200
Subject: [PATCH] PCI: dw-rockchip: Fix initial PERST# GPIO value
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PERST# is active low according to the PCIe specification.
However, the existing pcie-dw-rockchip.c driver does:
gpiod_set_value(..., 0); msleep(100); gpiod_set_value(..., 1);
when asserting + deasserting PERST#.
This is of course wrong, but because all the device trees for this
compatible string have also incorrectly marked this GPIO as ACTIVE_HIGH:
$ git grep -B 10 reset-gpios arch/arm64/boot/dts/rockchip/rk3568*
$ git grep -B 10 reset-gpios arch/arm64/boot/dts/rockchip/rk3588*
The actual toggling of PERST# is correct, and we cannot change it anyway,
since that would break device tree compatibility.
However, this driver does request the GPIO to be initialized as
GPIOD_OUT_HIGH, which does cause a silly sequence where PERST# gets
toggled back and forth for no good reason.
Fix this by requesting the GPIO to be initialized as GPIOD_OUT_LOW (which
for this driver means PERST# asserted).
This will avoid an unnecessary signal change where PERST# gets deasserted
(by devm_gpiod_get_optional()) and then gets asserted (by
rockchip_pcie_start_link()) just a few instructions later.
Before patch, debug prints on EP side, when booting RC:
[ 845.606810] pci: PERST# asserted by host!
[ 852.483985] pci: PERST# de-asserted by host!
[ 852.503041] pci: PERST# asserted by host!
[ 852.610318] pci: PERST# de-asserted by host!
After patch, debug prints on EP side, when booting RC:
[ 125.107921] pci: PERST# asserted by host!
[ 132.111429] pci: PERST# de-asserted by host!
This extra, very short, PERST# assertion + deassertion has been reported to
cause issues with certain WLAN controllers, e.g. RTL8822CE.
Fixes: 0e898eb8df4e ("PCI: rockchip-dwc: Add Rockchip RK356X host controller driver")
Link: https://lore.kernel.org/linux-pci/20240417164227.398901-1-cassel@kernel.org
Tested-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: stable@vger.kernel.org # v5.15+
---
drivers/pci/controller/dwc/pcie-dw-rockchip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
+++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
@@ -240,7 +240,7 @@ static int rockchip_pcie_resource_get(st
return PTR_ERR(rockchip->apb_base);
rockchip->rst_gpio = devm_gpiod_get_optional(&pdev->dev, "reset",
- GPIOD_OUT_HIGH);
+ GPIOD_OUT_LOW);
if (IS_ERR(rockchip->rst_gpio))
return PTR_ERR(rockchip->rst_gpio);

View File

@@ -25,7 +25,7 @@ Subject: [PATCH] r8169: add LED configuration from OF
TxDescStartAddrLow = 0x20,
TxDescStartAddrHigh = 0x24,
TxHDescStartAddrLow = 0x28,
@@ -5407,6 +5409,22 @@ static bool rtl_aspm_is_safe(struct rtl8
@@ -5403,6 +5405,22 @@ static bool rtl_aspm_is_safe(struct rtl8
return false;
}
@@ -48,7 +48,7 @@ Subject: [PATCH] r8169: add LED configuration from OF
static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct rtl8169_private *tp;
@@ -5579,6 +5597,7 @@ static int rtl_init_one(struct pci_dev *
@@ -5575,6 +5593,7 @@ static int rtl_init_one(struct pci_dev *
if (!tp->counters)
return -ENOMEM;

View File

@@ -18,7 +18,7 @@ Subject: [PATCH] net: phy: realtek: add LED configuration from OF for 8211f
#define RTL8211F_PHYCR1 0x18
#define RTL8211F_PHYCR2 0x19
#define RTL8211F_INSR 0x1d
@@ -357,6 +359,7 @@ static int rtl8211f_config_init(struct p
@@ -361,6 +363,7 @@ static int rtl8211f_config_init(struct p
struct rtl821x_priv *priv = phydev->priv;
struct device *dev = &phydev->mdio.dev;
u16 val_txdly, val_rxdly;
@@ -26,7 +26,7 @@ Subject: [PATCH] net: phy: realtek: add LED configuration from OF for 8211f
int ret;
ret = phy_modify_paged_changed(phydev, 0xa43, RTL8211F_PHYCR1,
@@ -423,6 +426,15 @@ static int rtl8211f_config_init(struct p
@@ -427,6 +430,15 @@ static int rtl8211f_config_init(struct p
val_rxdly ? "enabled" : "disabled");
}

View File

@@ -66,7 +66,7 @@
};
usb_host0_ehci: usb@fd800000 {
@@ -989,7 +996,7 @@
@@ -990,7 +997,7 @@
num-ib-windows = <6>;
num-ob-windows = <2>;
max-link-speed = <2>;

View File

@@ -1,6 +1,6 @@
--- a/arch/arm/boot/dts/allwinner/Makefile
+++ b/arch/arm/boot/dts/allwinner/Makefile
@@ -280,6 +280,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
@@ -219,6 +219,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
sun8i-a83t-cubietruck-plus.dtb \
sun8i-a83t-tbs-a711.dtb \
sun8i-h2-plus-bananapi-m2-zero.dtb \

View File

@@ -1,6 +1,6 @@
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-cpu-opp.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-cpu-opp.dtsi
@@ -90,10 +90,9 @@ opp-1416000000 {
@@ -90,10 +90,9 @@
opp-1512000000 {
opp-hz = /bits/ 64 <1512000000>;

View File

@@ -129,15 +129,15 @@ CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_DRM_FBDEV_OVERALLOC=100
CONFIG_DRM_GEM_SHMEM_HELPER=y
# CONFIG_DRM_HYPERV is not set
CONFIG_DRM_I915_FORCE_PROBE=""
CONFIG_DRM_I915_REQUEST_TIMEOUT=20000
CONFIG_DRM_I915_FENCE_TIMEOUT=10000
CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250
CONFIG_DRM_I915_FORCE_PROBE=""
CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500
CONFIG_DRM_I915_PREEMPT_TIMEOUT=640
CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000
CONFIG_DRM_I915_PREEMPT_TIMEOUT=640
CONFIG_DRM_I915_REQUEST_TIMEOUT=20000
CONFIG_DRM_I915_STOP_TIMEOUT=100
CONFIG_DRM_I915_TIMESLICE_DURATION=1
CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250
CONFIG_DRM_KMS_HELPER=y
CONFIG_DRM_MIPI_DSI=y
CONFIG_DRM_NOMODESET=y
@@ -249,8 +249,6 @@ CONFIG_HYPERV_STORAGE=y
# CONFIG_HYPERV_TESTING is not set
CONFIG_HYPERV_TIMER=y
CONFIG_HYPERV_UTILS=y
CONFIG_PTP_1588_CLOCK=y
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
# CONFIG_HYPERV_VSOCKETS is not set
CONFIG_I2C=y
CONFIG_I2C_ALGOBIT=y
@@ -383,6 +381,8 @@ CONFIG_PNP=y
CONFIG_PNPACPI=y
CONFIG_PNP_DEBUG_MESSAGES=y
CONFIG_PROC_EVENTS=y
CONFIG_PTP_1588_CLOCK=y
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
CONFIG_PVH=y
CONFIG_QUEUED_RWLOCKS=y
CONFIG_QUEUED_SPINLOCKS=y

View File

@@ -13,7 +13,7 @@
<br>中文 | [English](README_en.md)
* 仓库里luci-theme-argon 与 luci-app-homeproxy 适配23.05 不适配18.06,切记!
* 仓库里luci-theme-argon 适配23.05 不适配18.06,切记!
* 把openwrt-packages与small仓库重新归类ssr、passwall、vssr以及依赖合并small
@@ -69,7 +69,6 @@ make menuconfig
| luci-theme-mcat | Modify topic name | mcat主题 |
| luci-app-mosdns | mosdns dns offload |DNS 国内外分流解析与广告过滤 |
| luci-app-unblockneteasemusic | Unlock NetEase Cloud Music | 解锁网易云音乐 |
| luci-app-homeproxy | homeproxy proxy | homeproxy 代理 |
![暗黄主题](https://raw.githubusercontent.com/kenzok8/kenzok8/main/screenshot/sshot-9.jpg)
![暗黄主题](https://raw.githubusercontent.com/kenzok8/kenzok8/main/screenshot/sshot-10.jpg)

View File

@@ -6,11 +6,19 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-alist
PKG_VERSION:=1.1.0
PKG_VERSION:=1.0.13
PKG_RELEASE:=1
LUCI_TITLE:=LuCI support for alist
LUCI_DEPENDS:=+alist
LUCI_DEPENDS:=+alist +luci-compat
define Package/$(PKG_NAME)/postinst
#!/bin/sh
[ -n "${IPKG_INSTROOT}" ] || {
( . /etc/uci-defaults/50-luci-alist ) && rm -f /etc/uci-defaults/50-luci-alist
exit 0
}
endef
include $(TOPDIR)/feeds/luci/luci.mk

View File

@@ -1,199 +0,0 @@
'use strict';
'require form';
'require fs';
'require poll';
'require rpc';
'require uci';
'require view';
var callServiceList = rpc.declare({
object: 'service',
method: 'list',
params: ['name'],
expect: { '': {} }
});
function getServiceStatus() {
return L.resolveDefault(callServiceList('alist'), {}).then(function (res) {
var isRunning = false;
try {
isRunning = res['alist']['instances']['alist']['running'];
} catch (e) { }
return isRunning;
});
}
function renderStatus(isRunning, protocol, webport) {
var spanTemp = '<em><span style="color:%s"><strong>%s %s</strong></span></em>';
var renderHTML;
if (isRunning) {
var button = String.format('<input class="cbi-button-reload" type="button" style="margin-left: 50px" value="%s" onclick="window.open(\'%s//%s:%s/\')">',
_('Open Web Interface'), protocol, window.location.hostname, webport);
renderHTML = spanTemp.format('green', 'Alist', _('RUNNING')) + button;
} else {
renderHTML = spanTemp.format('red', 'Alist', _('NOT RUNNING'));
}
return renderHTML;
}
return view.extend({
load: function () {
return Promise.all([
uci.load('alist')
]);
},
handleResetPassword: async function (data) {
var data_dir = uci.get(data[0], '@alist[0]', 'data_dir') || '/etc/alist';
try {
var newpassword = await fs.exec('/usr/bin/alist', ['admin', 'random', '--data', data_dir]);
var new_password = newpassword.stderr.match(/password:\s*(\S+)/)[1];
const textArea = document.createElement('textarea');
textArea.value = new_password;
document.body.appendChild(textArea);
textArea.select();
document.execCommand('copy');
document.body.removeChild(textArea);
alert(_('Username:') + 'admin\n' + _('New Password:') + new_password + '\n\n' + _('New password has been copied to clipboard.'));
} catch (error) {
console.error('Failed to reset password: ', error);
}
},
render: function (data) {
var m, s, o;
var webport = uci.get(data[0], '@alist[0]', 'port') || '5244';
var ssl = uci.get(data[0], '@alist[0]', 'ssl') || '0';
var protocol;
if (ssl === '0') {
protocol = 'http:';
} else if (ssl === '1') {
protocol = 'https:';
}
m = new form.Map('alist', _('Alist'),
_('A file list program that supports multiple storage.') +
'<br><a href="https://alist.nn.ci/zh/guide/drivers/local.html" target="_blank">' +
_('User Manual') +
'</a>');
s = m.section(form.TypedSection);
s.anonymous = true;
s.addremove = false;
s.render = function () {
poll.add(function () {
return L.resolveDefault(getServiceStatus()).then(function (res) {
var view = document.getElementById('service_status');
view.innerHTML = renderStatus(res, protocol, webport);
});
});
return E('div', { class: 'cbi-section', id: 'status_bar' }, [
E('p', { id: 'service_status' }, _('Collecting data...'))
]);
}
s = m.section(form.NamedSection, '@alist[0]', 'alist');
o = s.option(form.Flag, 'enabled', _('Enabled'));
o.default = o.disabled;
o.rmempty = false;
o = s.option(form.Value, 'port', _('Port'));
o.datatype = 'and(port,min(1))';
o.default = '5244';
o.rmempty = false;
o = s.option(form.Flag, 'log', _('Enable Logs'));
o.default = 1;
o.rmempty = false;
o = s.option(form.Flag, 'ssl', _('Enable SSL'));
o.rmempty = false;
o = s.option(form.Value, 'ssl_cert', _('SSL cert'),
_('SSL certificate file path'));
o.rmempty = false;
o.depends('ssl', '1');
o = s.option(form.Value, 'ssl_key', _('SSL key'),
_('SSL key file path'));
o.rmempty = false;
o.depends('ssl', '1');
o = s.option(form.Flag, 'mysql', _('Enable Database'));
o.rmempty = false;
o = s.option(form.ListValue, 'mysql_type', _('Database Type'));
o.default = 'mysql';
o.depends('mysql', '1');
o.value('mysql', _('MySQL'));
o.value('postgres', _('PostgreSQL'));
o = s.option(form.Value, 'mysql_host', _('Database Host'));
o.depends('mysql', '1');
o = s.option(form.Value, 'mysql_port', _('Database Port'));
o.datatype = 'port';
o.default = '3306';
o.depends('mysql', '1');
o = s.option(form.Value, 'mysql_username', _('Database Username'));
o.depends('mysql', '1');
o = s.option(form.Value, 'mysql_password', _('Database Password'));
o.depends('mysql', '1');
o = s.option(form.Value, 'mysql_database', _('Database Name'));
o.depends('mysql', '1');
o = s.option(form.Value, 'mysql_table_prefix', _('Database Table Prefix'));
o.default = 'x_';
o.depends('mysql', '1');
o = s.option(form.Value, 'mysql_ssl_mode', _('Database SSL Mode'));
o.depends('mysql', '1');
o = s.option(form.Value, 'mysql_dsn', _('Database DSN'));
o.depends('mysql', '1');
o = s.option(form.Flag, 'allow_wan', _('Allow Access From Internet'));
o.rmempty = false;
o = s.option(form.Value, 'site_url', _('Site URL'),
_('When the web is reverse proxied to a subdirectory, this option must be filled out to ensure proper functioning of the web. Do not include \'/\' at the end of the URL'));
o = s.option(form.Value, 'max_connections', _('Max Connections'),
_('0 is unlimited, It is recommend to set a low number of concurrency (10-20) for poor performance device'));
o.default = '0';
o.datatype = 'uinteger';
o.rmempty = false;
o = s.option(form.Value, 'token_expires_in', _('Login Validity Period (hours)'));
o.datatype = 'uinteger';
o.default = '48';
o.rmempty = false;
o = s.option(form.Value, 'delayed_start', _('Delayed Start (seconds)'));
o.datatype = 'uinteger';
o.default = '0';
o.rmempty = false;
o = s.option(form.Value, 'data_dir', _('Data directory'));
o.default = '/etc/alist';
o = s.option(form.Value, 'temp_dir', _('Cache directory'));
o.default = '/tmp/alist';
o.rmempty = false;
o = s.option(form.Button, '_newpassword', _('Reset Password'),
_('Generate a new random password.'));
o.inputtitle = _('Reset Password');
o.inputstyle = 'apply';
o.onclick = L.bind(this.handleResetPassword, this, data);
return m.render();
}
});

View File

@@ -1,76 +0,0 @@
'use strict';
'require dom';
'require fs';
'require poll';
'require view';
function pollLog(e) {
return Promise.all([
fs.read_direct('/var/log/alist.log', 'text').then(function (res) {
return res.trim().split(/\n/).join('\n').replace(/\u001b\[33mWARN\u001b\[0m/g, '').replace(/\u001b\[36mINFO\u001b\[0m/g, '');
}),
]).then(function (data) {
var logTextarea = E('textarea', { 'class': 'cbi-input-textarea', 'wrap': 'off', 'readonly': 'readonly', 'style': 'width: calc(100% - 20px);height: 500px;margin: 10px;overflow-y: scroll;' }, [
data[0] || _('No log data.')
]);
// Store the current scroll position
var storedScrollTop = e.querySelector('textarea') ? e.querySelector('textarea').scrollTop : null;
dom.content(e, logTextarea);
// If the storedScrollTop is not null, it means we have a previous scroll position
if (storedScrollTop !== null) {
logTextarea.scrollTop = storedScrollTop;
}
// Add event listener to save the scroll position when scrolling stops
var timer;
logTextarea.addEventListener('scroll', function () {
clearTimeout(timer);
timer = setTimeout(function () {
storeScrollPosition(logTextarea.scrollTop);
}, 150);
});
function storeScrollPosition(scrollPos) {
localStorage.setItem("scrollPosition", JSON.stringify({ "log": scrollPos }));
}
});
};
return view.extend({
handleCleanLogs: function () {
return fs.write('/var/log/alist.log', '')
.catch(function (e) { ui.addNotification(null, E('p', e.message)) });
},
render: function () {
var log_textarea = E('div', { 'id': 'log_textarea' },
E('img', {
'src': L.resource(['icons/loading.gif']),
'alt': _('Loading'),
'style': 'vertical-align:middle'
}, _('Collecting data...'))
);
poll.add(pollLog.bind(this, log_textarea));
var clear_logs_button = E('input', { 'class': 'btn cbi-button-action', 'type': 'button', 'style': 'margin-left: 10px; margin-top: 10px;', 'value': _('Clear logs') });
clear_logs_button.addEventListener('click', this.handleCleanLogs.bind(this));
return E([
E('div', { 'class': 'cbi-map' }, [
E('div', { 'class': 'cbi-section' }, [
clear_logs_button,
log_textarea,
E('div', { 'style': 'text-align:right' },
E('small', {}, _('Refresh every %s seconds.').format(L.env.pollinterval))
)
])])
]);
},
handleSave: null,
handleSaveApply: null,
handleReset: null
});

View File

@@ -0,0 +1,50 @@
module("luci.controller.alist", package.seeall)
function index()
if not nixio.fs.access("/etc/config/alist") then
return
end
local page = entry({"admin", "nas", "alist"}, alias("admin", "nas", "alist", "basic"), _("Alist"), 20)
page.dependent = true
page.acl_depends = { "luci-app-alist" }
entry({"admin", "nas"}, firstchild(), "NAS", 44).dependent = false
entry({"admin", "nas", "alist", "basic"}, cbi("alist/basic"), _("Basic Setting"), 1).leaf = true
entry({"admin", "nas", "alist", "log"}, cbi("alist/log"), _("Logs"), 2).leaf = true
entry({"admin", "nas", "alist", "alist_status"}, call("alist_status")).leaf = true
entry({"admin", "nas", "alist", "get_log"}, call("get_log")).leaf = true
entry({"admin", "nas", "alist", "clear_log"}, call("clear_log")).leaf = true
entry({"admin", "nas", "alist", "admin_info"}, call("admin_info")).leaf = true
end
function alist_status()
local sys = require "luci.sys"
local uci = require "luci.model.uci".cursor()
local port = tonumber(uci:get_first("alist", "alist", "port"))
local status = {
running = (sys.call("pidof alist >/dev/null") == 0),
port = (port or 5244)
}
luci.http.prepare_content("application/json")
luci.http.write_json(status)
end
function get_log()
luci.http.write(luci.sys.exec("cat /var/log/alist.log"))
end
function clear_log()
luci.sys.call("cat /dev/null > /var/log/alist.log")
end
function admin_info()
local random = luci.sys.exec("/usr/bin/alist --data $(uci -q get alist.@alist[0].data_dir) admin random 2>&1")
local username = string.match(random, "username: (%S+)")
local password = string.match(random, "password: (%S+)")
luci.http.prepare_content("application/json")
luci.http.write_json({username = username, password = password})
end

View File

@@ -0,0 +1,113 @@
local m, s
m = Map("alist", translate("Alist"), translate("A file list program that supports multiple storage.") .. "<br/>" .. [[<a href="https://alist.nn.ci/zh/guide/drivers/local.html" target="_blank">]] .. translate("User Manual") .. [[</a>]])
m:section(SimpleSection).template = "alist/alist_status"
s = m:section(TypedSection, "alist")
s.addremove = false
s.anonymous = true
o = s:option(Flag, "enabled", translate("Enabled"))
o.rmempty = false
o = s:option(Value, "port", translate("Port"))
o.datatype = "and(port,min(1))"
o.rmempty = false
o.default = "5244"
o = s:option(Flag, "log", translate("Enable Logs"))
o.default = 1
o.rmempty = false
o = s:option(Flag, "ssl", translate("Enable SSL"))
o.rmempty=false
o = s:option(Value,"ssl_cert", translate("SSL cert"), translate("SSL certificate file path"))
o.datatype = "file"
o:depends("ssl", "1")
o = s:option(Value,"ssl_key", translate("SSL key"), translate("SSL key file path"))
o.datatype = "file"
o:depends("ssl", "1")
o = s:option(Flag, "mysql", translate("Enable Database"))
o.rmempty=false
o = s:option(ListValue, "mysql_type", translate("Database Type"))
o.datatype = "string"
o:value("mysql", translate("MySQL"))
o:value("postgres", translate("PostgreSQL"))
o.default = "mysql"
o:depends("mysql", "1")
o = s:option(Value,"mysql_host", translate("Database Host"))
o.datatype = "string"
o:depends("mysql", "1")
o = s:option(Value,"mysql_port", translate("Database Port"))
o.datatype = "and(port,min(1))"
o.default = "3306"
o:depends("mysql", "1")
o = s:option(Value,"mysql_username", translate("Database Username"))
o.datatype = "string"
o:depends("mysql", "1")
o = s:option(Value,"mysql_password", translate("Database Password"))
o.datatype = "string"
o.password = true
o:depends("mysql", "1")
o = s:option(Value,"mysql_database", translate("Database Name"))
o.datatype = "string"
o:depends("mysql", "1")
o = s:option(Value,"mysql_table_prefix", translate("Database Table Prefix"))
o.datatype = "string"
o.default = "x_"
o:depends("mysql", "1")
o = s:option(Value,"mysql_ssl_mode", translate("Database SSL Mode"))
o.datatype = "string"
o:depends("mysql", "1")
o = s:option(Value,"mysql_dsn", translate("Database DSN"))
o.datatype = "string"
o:depends("mysql", "1")
o = s:option(Flag, "allow_wan", translate("Allow Access From Internet"))
o.rmempty = false
o = s:option(Value, "site_url", translate("Site URL"), translate("When the web is reverse proxied to a subdirectory, this option must be filled out to ensure proper functioning of the web. Do not include '/' at the end of the URL"))
o.datatype = "string"
o = s:option(Value, "max_connections", translate("Max Connections"), translate("0 is unlimited, It is recommend to set a low number of concurrency (10-20) for poor performance device"))
o.datatype = "and(uinteger,min(0))"
o.default = "0"
o.rmempty = false
o = s:option(Value, "token_expires_in", translate("Login Validity Period (hours)"))
o.datatype = "and(uinteger,min(1))"
o.default = "48"
o.rmempty = false
o = s:option(Value, "delayed_start", translate("Delayed Start (seconds)"))
o.datatype = "and(uinteger,min(0))"
o.default = "0"
o.rmempty = false
o = s:option(Value, "data_dir", translate("Data directory"))
o.datatype = "string"
o.default = "/etc/alist"
o = s:option(Value, "temp_dir", translate("Cache directory"))
o.datatype = "string"
o.default = "/tmp/alist"
o.rmempty = false
o = s:option(Button, "admin_info", translate("Reset Password"))
o.rawhtml = true
o.template = "alist/admin_info"
return m

View File

@@ -0,0 +1,5 @@
m = Map("alist")
m:append(Template("alist/alist_log"))
return m

View File

@@ -0,0 +1,26 @@
<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
function admin_info(btn)
{
btn.disabled = true;
btn.value = '<%:Collecting data...%>';
XHR.get('<%=luci.dispatcher.build_url("admin", "nas", "alist", "admin_info")%>',
null,
function(x,rv)
{
var tb = document.getElementById('<%=self.option%>-status');
if (tb)
{
tb.innerHTML = "<%:Username:%>" + "<font color='green'>" + rv.username + "</font>";
tb.innerHTML += "<%:Password:%>" + "<font color='green'>" + rv.password + "</font>";
}
btn.disabled = false;
btn.value = '<%:Reset%>';
}
);
return false;
}
//]]></script>
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Reset%>" onclick="return admin_info(this)" />
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>
<%+cbi/valuefooter%>

View File

@@ -0,0 +1,35 @@
<script type="text/javascript">
//<![CDATA[
function clear_log(btn) {
XHR.get('<%=url([[admin]], [[nas]], [[alist]], [[clear_log]])%>', null,
function(x, data) {
if(x && x.status == 200) {
var log_textarea = document.getElementById('log_textarea');
log_textarea.innerHTML = "";
log_textarea.scrollTop = log_textarea.scrollHeight;
}
location.reload();
}
);
}
var scrolled = false;
XHR.poll(2, '<%=url([[admin]], [[nas]], [[alist]], [[get_log]])%>', null,
function(x, data) {
if(x && x.status == 200) {
var log_textarea = document.getElementById('log_textarea');
var str = x.responseText;
var logs = str.replace(//g, "🔧");
log_textarea.innerHTML = logs;
if (!scrolled) {
log_textarea.scrollTop = log_textarea.scrollHeight;
scrolled = true;
}
}
}
);
//]]>
</script>
<fieldset class="cbi-section" id="_log_fieldset">
<input class="cbi-button cbi-input-remove" type="button" onclick="clear_log()" value="<%:Clear logs%>" style="margin-left: 10px; margin-top: 10px;">
<textarea id="log_textarea" class="cbi-input-textarea" style="width: calc(100% - 20px); height: 500px; margin: 10px;" data-update="change" rows="5" wrap="off" readonly="readonly"></textarea>
</fieldset>

View File

@@ -0,0 +1,36 @@
<%
local uci = require 'luci.model.uci'.cursor()
ssl = uci:get_first('alist', 'alist', 'ssl')
if ssl == '1' then
protocol="https://"
else
protocol="http://"
end
%>
<script type="text/javascript">//<![CDATA[
XHR.poll(5, '<%=url("admin/nas/alist/alist_status")%>', null,
function(x, st)
{
var tb = document.getElementById('alist_status');
if (st && tb)
{
if (st.running)
{
tb.innerHTML = '<em style=\"color:green\"><b>Alist <%:RUNNING%></b></em>' + "<input class=\"cbi-button cbi-button-reload mar-10\" type=\"button\" value=\" <%:Open Web Interface%> \" onclick=\"window.open('<%=protocol%>" + window.location.hostname + ":" + st.port + "/')\"/>";
}
else
{
tb.innerHTML = '<em style=\"color:red\"><b>Alist <%:NOT RUNNING%></b></em>';
}
}
}
);
//]]></script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="alist_status">
<em><b><%:Collecting data...%></b></em>
</p>
</fieldset>

View File

@@ -1 +0,0 @@
zh_Hans

View File

@@ -67,17 +67,14 @@ msgstr "清空日志"
msgid "Reset Password"
msgstr "重置密码"
msgid "Generate a new random password."
msgstr "随机生成一个新密码。"
msgid "Reset"
msgstr "重置"
msgid "Username:"
msgstr "用户名:"
msgid "New Password:"
msgstr "密码:"
msgid "New password has been copied to clipboard."
msgstr "新密码已复制到剪贴板。"
msgid "Password:"
msgstr "密码:"
msgid "Login Validity Period (hours)"
msgstr "登录有效期(小时)"

View File

@@ -0,0 +1 @@
zh-cn

View File

@@ -1,36 +0,0 @@
{
"admin/nas": {
"title": "NAS",
"order": 44,
"action": {
"type": "firstchild"
}
},
"admin/nas/alist": {
"title": "Alist",
"order": 20,
"action": {
"type": "firstchild"
},
"depends": {
"acl": [ "luci-app-alist" ],
"uci": { "alist": true }
}
},
"admin/nas/alist/basic": {
"title": "Basic Setting",
"order": 30,
"action": {
"type": "view",
"path": "alist/basic"
}
},
"admin/nas/alist/logs": {
"title": "Logs",
"order": 40,
"action": {
"type": "view",
"path": "alist/logs"
}
}
}

View File

@@ -2,19 +2,9 @@
"luci-app-alist": {
"description": "Grant UCI access for luci-app-alist",
"read": {
"file": {
"/usr/bin/alist": [ "exec" ],
"/var/log/alist.log": [ "read" ]
},
"ubus": {
"service": [ "list" ]
},
"uci": [ "alist" ]
},
"write": {
"file": {
"/var/log/alist.log": [ "write" ]
},
"uci": [ "alist" ]
}
}

View File

@@ -40,5 +40,12 @@ namespace Ryujinx.HLE.HOS.Services.Nim
return ResultCode.Success;
}
[CommandCmif(5)] // 17.0.0+
// CreateServerInterface2(pid, handle<unknown>, u64) -> object<nn::ec::IshopServiceAccessServer>
public ResultCode CreateServerInterface2(ServiceCtx context)
{
return CreateServerInterface(context);
}
}
}

View File

@@ -46,7 +46,7 @@ jobs:
echo -e "1. 默认ssr与passwall的插件与依赖整合包\n" >> release.txt
echo -e "2. 使用方法将整合包上传到openwrt设备的tmp目录输入命令 \`opkg install *.ipk\`\n" >> release.txt
echo -e "3. 默认压缩包里包含ssr passwall bypass passwall2 插件\n" >> release.txt
echo -e "4. 如果单独安装ssr与依赖\`rm -rf {*passwall*,*bypass*}\`\n" >> release.txt
echo -e "4. 如果单独安装ssr与依赖\`rm -rf {*passwall*,*bypass*,*homeproxy*}\`\n" >> release.txt
- name: Upload packages
uses: ncipollo/release-action@main

View File

@@ -85,7 +85,7 @@ jobs:
echo -e "1. 默认ssr与passwall的插件与依赖整合包\n" >> release.txt
echo -e "2. 使用方法将整合包上传到openwrt设备的tmp目录输入命令 \`opkg install *.ipk\`\n" >> release.txt
echo -e "3. 默认压缩包里包含ssr passwall bypass passwall2 插件\n" >> release.txt
echo -e "4. 如果单独安装ssr与依赖\`rm -rf {*passwall*,*bypass*}\`\n" >> release.txt
echo -e "4. 如果单独安装ssr与依赖\`rm -rf {*passwall*,*bypass*,*homeproxy*}\`\n" >> release.txt
- name: Upload packages
uses: ncipollo/release-action@main

View File

@@ -10,7 +10,7 @@
<img src="https://v2.jinrishici.com/one.svg?font-size=24&spacing=2&color=Black">
* 把openwrt-packages与small仓库重新归类ssr、passwall、vssr以及依赖合并small
* 把openwrt-packages与small仓库重新归类ssr、passwall、homeproxy依赖合并small
#### 使用方式
```yaml
@@ -19,9 +19,9 @@
使用方法将整合包上传到openwrt设备的tmp目录输入命令 opkg install *.ipk
默认压缩包里包含ssr passwall bypass passwall2 插件
默认压缩包里包含ssr passwall bypass passwall2 homeproxy 插件
如果单独安装ssr与依赖rm -rf {*passwall*,*bypass*,*vssr*}
如果单独安装ssr与依赖rm -rf {*passwall*,*bypass*,*homeproxy*}
```
* 喜欢追新的可以去下载small-package该仓库每天自动同步更新

View File

@@ -9,9 +9,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gn.googlesource.com/gn.git
PKG_SOURCE_DATE:=2024-06-10
PKG_SOURCE_VERSION:=b2afae122eeb6ce09c52d63f67dc53fc517dbdc8
PKG_MIRROR_HASH:=825ead46982a44cc2e82fb8bf88d17efea5810a555601c329ac3eef21ecabef7
PKG_SOURCE_DATE:=2024-08-13
PKG_SOURCE_VERSION:=54f5b539df8c4e460b18c62a11132d77b5601136
PKG_MIRROR_HASH:=ac0d44b2f7162be614ac090ef0618ea0f44760e80f5df7acc43b69a492611e0f
PKG_LICENSE:=BSD 3-Clause
PKG_LICENSE_FILES:=LICENSE

View File

@@ -3,7 +3,7 @@
#ifndef OUT_LAST_COMMIT_POSITION_H_
#define OUT_LAST_COMMIT_POSITION_H_
#define LAST_COMMIT_POSITION_NUM 2176
#define LAST_COMMIT_POSITION "2176 (b2afae122eeb)"
#define LAST_COMMIT_POSITION_NUM 2186
#define LAST_COMMIT_POSITION "2186 (54f5b539df8c)"
#endif // OUT_LAST_COMMIT_POSITION_H_

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hysteria
PKG_VERSION:=2.5.0
PKG_VERSION:=2.5.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/apernet/hysteria/tar.gz/app/v$(PKG_VERSION)?
PKG_HASH:=78afca9c9c3f2c1a89c2356c66e70489bba74d3b4ede42f4194d179a09959d8c
PKG_HASH:=6908944c816fa24a4cd291982c5ba76fda5774d713c6c122da8ac2db4a6b13b1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-app-v$(PKG_VERSION)
PKG_LICENSE:=MIT

View File

@@ -1,14 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-mosdns
PKG_VERSION:=1.6.0
PKG_VERSION:=1.5.23
PKG_RELEASE:=1
LUCI_TITLE:=LuCI Support for mosdns
LUCI_PKGARCH:=all
LUCI_DEPENDS:=+mosdns +jsonfilter +curl +v2ray-geoip +v2ray-geosite +v2dat
PKG_MAINTAINER:=sbwml <admin@cooluc.com>
LUCI_DEPENDS:=+mosdns +jsonfilter +luci-compat +curl +v2ray-geoip +v2ray-geosite +v2dat
define Package/$(PKG_NAME)/conffiles
/etc/config/mosdns

View File

@@ -1,369 +0,0 @@
'use strict';
'require form';
'require fs';
'require poll';
'require rpc';
'require uci';
'require ui';
'require view';
var callServiceList = rpc.declare({
object: 'service',
method: 'list',
params: ['name'],
expect: { '': {} }
});
function getServiceStatus() {
return L.resolveDefault(callServiceList('mosdns'), {}).then(function (res) {
var isRunning = false;
try {
isRunning = res['mosdns']['instances']['mosdns']['running'];
} catch (e) { }
return isRunning;
});
}
function renderStatus(isRunning) {
var spanTemp = '<em><span style="color:%s"><strong>%s %s</strong></span></em>';
var renderHTML;
if (isRunning) {
renderHTML = spanTemp.format('green', _('MosDNS'), _('RUNNING'));
} else {
renderHTML = spanTemp.format('red', _('MosDNS'), _('NOT RUNNING'));
}
return renderHTML;
}
return view.extend({
load: function() {
return Promise.all([
L.resolveDefault(fs.exec('/usr/bin/mosdns', ['version']), null),
]);
},
handleFlushCache: function (m, section_id, ev) {
return fs.exec('/usr/share/mosdns/mosdns.sh', ['flush'])
.then(function (lazy_cache) {
var res = lazy_cache.code;
if (res === 0) {
ui.addNotification(null, E('p', _('Flushing DNS Cache Success.')), 'info');
} else {
ui.addNotification(null, E('p', _('Flushing DNS Cache Failed, Please check if MosDNS is running.')), 'error');
}
});
},
render: function (basic) {
var m, s, o, v;
v = '';
if (basic[0] && basic[0].code === 0) {
v = basic[0].stdout.trim();
}
m = new form.Map('mosdns', _('MosDNS') + '&#160;' + v,
_('MosDNS is a plugin-based DNS forwarder/traffic splitter.'));
s = m.section(form.TypedSection);
s.anonymous = true;
s.render = function () {
poll.add(function () {
return L.resolveDefault(getServiceStatus()).then(function (res) {
var view = document.getElementById('service_status');
view.innerHTML = renderStatus(res);
});
});
return E('div', { class: 'cbi-section', id: 'status_bar' }, [
E('p', { id: 'service_status' }, _('Collecting data...'))
]);
}
s = m.section(form.NamedSection, 'config', 'mosdns');
s.tab('basic', _('Basic Options'));
s.tab("advanced", _("Advanced Options"));
s.tab("cloudflare", _("Cloudflare Options"));
s.tab("api", _("API Options"));
s.tab('geodata', _('GeoData Export'));
/* basic */
o = s.taboption('basic', form.Flag, 'enabled', _('Enabled'));
o.default = o.disabled;
o.rmempty = false;
o = s.taboption('basic', form.ListValue, 'configfile', _('Config File'));
o.value('/var/etc/mosdns.json', _('Default Config'));
o.value('/etc/mosdns/config_custom.yaml', _('Custom Config'));
o.default = '/var/etc/mosdns.json';
o = s.taboption('basic', form.Value, 'listen_port', _('Listen port'));
o.default = '5335';
o.datatype = 'port';
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('basic', form.ListValue, 'log_level', _('Log Level'));
o.value('debug', _('Debug'));
o.value('info', _('Info'));
o.value('warn', _('Warning'));
o.value('error', _('Error'));
o.default = 'info';
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('basic', form.Value, 'log_file', _('Log File'));
o.placeholder = '/var/log/mosdns.log';
o.default = '/var/log/mosdns.log';
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('basic', form.Flag, 'redirect', _('DNS Forward'), _('Forward Dnsmasq Domain Name resolution requests to MosDNS'));
o.default = false;
o = s.taboption('basic', form.Flag, 'prefer_ipv4', _('Remote DNS prefer IPv4'),
_('IPv4 is preferred for Remote / Streaming Media DNS resolution of dual-stack addresses, and is not affected when the destination is IPv6 only'));
o.depends('configfile', '/var/etc/mosdns.json');
o.default = false;
o = s.taboption('basic', form.Flag, 'custom_local_dns', _('Custom China DNS'), _('Follow WAN interface DNS if not enabled'));
o.depends('configfile', '/var/etc/mosdns.json');
o.default = false;
o = s.taboption('basic', form.Flag, 'apple_optimization', _('Apple domains optimization'),
_('For Apple domains equipped with Chinese mainland CDN, always responsive to Chinese CDN IP addresses'));
o.depends('custom_local_dns', '1');
o.default = false;
o = s.taboption('basic', form.DynamicList, 'local_dns', _('China DNS server'));
o.value('119.29.29.29', _('Tencent Public DNS (119.29.29.29)'));
o.value('119.28.28.28', _('Tencent Public DNS (119.28.28.28)'));
o.value('223.5.5.5', _('Aliyun Public DNS (223.5.5.5)'));
o.value('223.6.6.6', _('Aliyun Public DNS (223.6.6.6)'));
o.value('180.184.1.1', _('TrafficRoute Public DNS (180.184.1.1)'));
o.value('180.184.2.2', _('TrafficRoute Public DNS (180.184.2.2)'));
o.value('114.114.114.114', _('Xinfeng Public DNS (114.114.114.114)'));
o.value('114.114.115.115', _('Xinfeng Public DNS (114.114.115.115)'));
o.value('180.76.76.76', _('Baidu Public DNS (180.76.76.76)'));
o.value('https://doh.pub/dns-query', _('Tencent Public DNS (DNS over HTTPS)'));
o.value('quic://dns.alidns.com', _('Aliyun Public DNS (DNS over QUIC)'));
o.value('https://dns.alidns.com/dns-query', _('Aliyun Public DNS (DNS over HTTPS)'));
o.value('h3://dns.alidns.com/dns-query', _('Aliyun Public DNS (DNS over HTTPS/3)'));
o.value('https://doh.360.cn/dns-query', _('360 Public DNS (DNS over HTTPS)'));
o.default = '119.29.29.29';
o.depends('custom_local_dns', '1');
o = s.taboption('basic', form.DynamicList, 'remote_dns', _('Remote DNS server'));
o.value('tls://1.1.1.1', _('CloudFlare Public DNS (1.1.1.1)'));
o.value('tls://1.0.0.1', _('CloudFlare Public DNS (1.0.0.1)'));
o.value('tls://8.8.8.8', _('Google Public DNS (8.8.8.8)'));
o.value('tls://8.8.4.4', _('Google Public DNS (8.8.4.4)'));
o.value('tls://9.9.9.9', _('Quad9 Public DNS (9.9.9.9)'));
o.value('tls://149.112.112.112', _('Quad9 Public DNS (149.112.112.112)'));
o.value('tls://208.67.222.222', _('Cisco Public DNS (208.67.222.222)'));
o.value('tls://208.67.220.220', _('Cisco Public DNS (208.67.220.220)'));
o.default = 'tls://8.8.8.8';
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('basic', form.Flag, 'custom_stream_media_dns', _('Custom Stream Media DNS'),
_('Netflix, Disney+, Hulu and streaming media rules list will use this DNS'));
o.depends('configfile', '/var/etc/mosdns.json');
o.default = false;
o = s.taboption('basic', form.DynamicList, 'stream_media_dns', _('Streaming Media DNS server'));
o.value('tls://1.1.1.1', _('CloudFlare Public DNS (1.1.1.1)'));
o.value('tls://1.0.0.1', _('CloudFlare Public DNS (1.0.0.1)'));
o.value('tls://8.8.8.8', _('Google Public DNS (8.8.8.8)'));
o.value('tls://8.8.4.4', _('Google Public DNS (8.8.4.4)'));
o.value('tls://9.9.9.9', _('Quad9 Public DNS (9.9.9.9)'));
o.value('tls://149.112.112.112', _('Quad9 Public DNS (149.112.112.112)'));
o.value('tls://208.67.222.222', _('Cisco Public DNS (208.67.222.222)'));
o.value('tls://208.67.220.220', _('Cisco Public DNS (208.67.220.220)'));
o.default = 'tls://8.8.8.8';
o.depends('custom_stream_media_dns', '1');
o = s.taboption('basic', form.ListValue, 'bootstrap_dns', _('Bootstrap DNS servers'),
_('Bootstrap DNS servers are used to resolve IP addresses of the DoH/DoT resolvers you specify as upstreams'));
o.value('119.29.29.29', _('Tencent Public DNS (119.29.29.29)'));
o.value('119.28.28.28', _('Tencent Public DNS (119.28.28.28)'));
o.value('223.5.5.5', _('Aliyun Public DNS (223.5.5.5)'));
o.value('223.6.6.6', _('Aliyun Public DNS (223.6.6.6)'));
o.value('114.114.114.114', _('Xinfeng Public DNS (114.114.114.114)'));
o.value('114.114.115.115', _('Xinfeng Public DNS (114.114.115.115)'));
o.value('180.76.76.76', _('Baidu Public DNS (180.76.76.76)'));
o.value('8.8.8.8', _('Google Public DNS (8.8.8.8)'));
o.value('1.1.1.1', _('CloudFlare Public DNS (1.1.1.1)'));
o.default = '119.29.29.29';
o.depends('configfile', '/var/etc/mosdns.json');
/* advanced */
o = s.taboption('advanced', form.Value, 'concurrent', _('Concurrent'),
_('DNS query request concurrency, The number of upstream DNS servers that are allowed to initiate requests at the same time'));
o.datatype = 'and(uinteger,min(1),max(3))';
o.default = '2';
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('advanced', form.Value, 'idle_timeout', _('Idle Timeout'),
_('DoH/TCP/DoT Connection Multiplexing idle timeout (default 30 seconds)'))
o.datatype = 'and(uinteger,min(1))';
o.default = '30';
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('advanced', form.Flag, 'enable_pipeline', _('TCP/DoT Connection Multiplexing'),
_('Enable TCP/DoT RFC 7766 new Query Pipelining connection multiplexing mode'))
o.rmempty = false;
o.default = false;
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('advanced', form.Flag, 'insecure_skip_verify', _('Disable TLS Certificate'),
_('Disable TLS Servers certificate validation, Can be useful if system CA certificate expires or the system time is out of order'));
o.rmempty = false;
o.default = false;
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('advanced', form.Flag, 'enable_ecs_remote',
_('Enable EDNS client subnet'));
o.rmempty = false;
o.default = false;
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('advanced', form.Value, 'remote_ecs_ip', _('IP Address'),
_('Please provide the IP address you use when accessing foreign websites. This IP subnet (0/24) will be used as the ECS address for Remote / Streaming Media DNS requests') +
_('This feature is typically used when using a self-built DNS server as an Remote / Streaming Media DNS upstream (requires support from the upstream server)'));
o.datatype = 'ipaddr';
o.depends('enable_ecs_remote', '1');
o = s.taboption('advanced', form.Flag, 'dns_leak', _('Prevent DNS Leaks'),
_('Enable this option fallback policy forces forwarding to remote DNS'));
o.rmempty = false;
o.default = false;
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('advanced', form.Flag, 'cache', _('Enable DNS Cache'));
o.rmempty = false;
o.default = false;
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('advanced', form.Value, 'cache_size', _('DNS Cache Size'),
_('DNS cache size (in piece). To disable caching, please set to 0.'));
o.datatype = 'and(uinteger,min(0))';
o.default = 8000;
o.depends('cache', '1');
o = s.taboption('advanced', form.Value, 'lazy_cache_ttl', _('Lazy Cache TTL'),
_('Lazy cache survival time (in second). To disable Lazy Cache, please set to 0.'));
o.datatype = 'and(uinteger,min(0))';
o.default = 86400;
o.depends('cache', '1');
o = s.taboption('advanced', form.Flag, 'dump_file', _('Cache Dump'),
_('Save the cache locally and reload the cache dump on the next startup'));
o.rmempty = false;
o.default = false;
o.depends('cache', '1');
o = s.taboption('advanced', form.Value, 'dump_interval',
_('Auto Save Cache Interval'));
o.datatype = 'and(uinteger,min(0))';
o.default = 3600;
o.depends('dump_file', '1');
o = s.taboption('advanced', form.Value, 'minimal_ttl', _('Minimum TTL'),
_('Modify the Minimum TTL value (seconds) for DNS answer results, 0 indicating no modification'));
o.datatype = 'and(uinteger,min(0),max(604800))';
o.default = 0;
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('advanced', form.Value, 'maximum_ttl', _('Maximum TTL'),
_('Modify the Maximum TTL value (seconds) for DNS answer results, 0 indicating no modification'));
o.datatype = 'and(uinteger,min(0),max(604800))';
o.default = 0;
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('advanced', form.Flag, 'adblock', _('Enable DNS ADblock'));
o.depends('configfile', '/var/etc/mosdns.json');
o.default = false;
o = s.taboption('advanced', form.DynamicList, 'ad_source', _('ADblock Source'),
_('When using custom rule sources, please use rule types supported by MosDNS (domain lists).') +
'<br>' +
_('Support for local files, such as: file:///var/mosdns/example.txt'));
o.depends('adblock', '1');
o.default = 'geosite.dat';
o.value('geosite.dat', 'v2ray-geosite');
o.value('https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt', 'anti-AD')
o.value('https://raw.githubusercontent.com/Cats-Team/AdRules/main/mosdns_adrules.txt', 'Cats-Team/AdRules')
o.value('https://raw.githubusercontent.com/neodevpro/neodevhost/master/domain', 'NEO DEV HOST')
/* cloudflare */
o = s.taboption('cloudflare', form.Flag, 'cloudflare', _('Enabled'),
_('Match the parsing result with the Cloudflare IP ranges, and when there is a successful match, \
use the \'Custom IP\' as the parsing result (experimental feature)'));
o.rmempty = false;
o.default = false;
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('cloudflare', form.DynamicList, 'cloudflare_ip', _('Custom IP'));
o.datatype = 'ipaddr';
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('cloudflare', form.TextValue, '_cloudflare',
_('Cloudflare IP Ranges'),
_('IPv4 CIDR: <a href="https://www.cloudflare.com/ips-v4" target="_blank">https://www.cloudflare.com/ips-v4</a> <br /> IPv6 CIDR: <a href="https://www.cloudflare.com/ips-v6" target="_blank">https://www.cloudflare.com/ips-v6</a>'));
o.rows = 15;
o.depends('configfile', '/var/etc/mosdns.json');
o.cfgvalue = function (section_id) {
return fs.trimmed('/etc/mosdns/rule/cloudflare-cidr.txt');
};
o.write = function (section_id, formvalue) {
return fs.write('/etc/mosdns/rule/cloudflare-cidr.txt', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
return fs.exec('/etc/init.d/mosdns', ['restart']);
});
};
/* api */
o = s.taboption('api', form.Value, 'listen_port_api', _('API Listen port'));
o.datatype = 'and(port,min(1))';
o.default = 9091;
o.depends('configfile', '/var/etc/mosdns.json');
o = s.taboption('api', form.Button, '_flush_cache', null,
_('Flushing DNS Cache will clear any IP addresses or DNS records from MosDNS cache.'));
o.title = '&#160;';
o.inputtitle = _('Flush DNS Cache');
o.inputstyle = 'apply';
o.onclick = L.bind(this.handleFlushCache, this, m);
o.depends('cache', '1');
/* configuration */
o = s.taboption('basic', form.TextValue, '_custom', _('Configuration Editor'),
_('This is the content of the file \'/etc/mosdns/config_custom.yaml\' from which your MosDNS configuration will be generated. \
Only accepts configuration content in yaml format.'));
o.rows = 25;
o.depends('configfile', '/etc/mosdns/config_custom.yaml');
o.cfgvalue = function (section_id) {
return fs.trimmed('/etc/mosdns/config_custom.yaml');
};
o.write = function (section_id, formvalue) {
return fs.write('/etc/mosdns/config_custom.yaml', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
ui.addNotification(null, E('p', _('Configuration have been saved.')), 'info');
return fs.exec('/etc/init.d/mosdns', ['restart']);
})
.catch(function (e) {
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
};
o = s.taboption('geodata', form.DynamicList, 'geosite_tags', _('GeoSite Tags'),
_('Enter the GeoSite.dat category to be exported, Allow add multiple tags'),
_('Export directory: /var/mosdns'));
o.depends('configfile', '/etc/mosdns/config_custom.yaml');
o = s.taboption('geodata', form.DynamicList, 'geoip_tags', _('GeoIP Tags'),
_('Enter the GeoIP.dat category to be exported, Allow add multiple tags'),
_('Export directory: /var/mosdns'));
o.depends('configfile', '/etc/mosdns/config_custom.yaml');
return m.render();
}
});

View File

@@ -1,77 +0,0 @@
'use strict';
'require dom';
'require fs';
'require poll';
'require view';
function pollLog(e) {
return Promise.all([
fs.exec_direct('/usr/share/mosdns/mosdns.sh', ['printlog']).then(function (res) {
return res.trim().split(/\n/).join('\n')
}),
]).then(function (data) {
var logTextarea = E('textarea', { 'class': 'cbi-input-textarea', 'wrap': 'off', 'readonly': 'readonly', 'style': 'width: calc(100% - 20px);height: 645px;margin: 10px;overflow-y: scroll;' }, [
data[0] || _('No log data.')
]);
// Store the current scroll position
var storedScrollTop = e.querySelector('textarea') ? e.querySelector('textarea').scrollTop : null;
dom.content(e, logTextarea);
// If the storedScrollTop is not null, it means we have a previous scroll position
if (storedScrollTop !== null) {
logTextarea.scrollTop = storedScrollTop;
}
// Add event listener to save the scroll position when scrolling stops
var timer;
logTextarea.addEventListener('scroll', function () {
clearTimeout(timer);
timer = setTimeout(function () {
storeScrollPosition(logTextarea.scrollTop);
}, 150);
});
function storeScrollPosition(scrollPos) {
localStorage.setItem("scrollPosition", JSON.stringify({ "log": scrollPos }));
}
});
};
return view.extend({
handleCleanLogs: function () {
return fs.exec('/usr/share/mosdns/mosdns.sh', ['cleanlog'])
.catch(function (e) { ui.addNotification(null, E('p', e.message)) });
},
render: function () {
var log_textarea = E('div', { 'id': 'log_textarea' },
E('img', {
'src': L.resource(['icons/loading.gif']),
'alt': _('Loading'),
'style': 'vertical-align:middle'
}, _('Collecting data...'))
);
poll.add(pollLog.bind(this, log_textarea));
var clear_logs_button = E('input', { 'class': 'btn cbi-button-action', 'type': 'button', 'style': 'margin-left: 10px; margin-top: 10px;', 'value': _('Clear logs') });
clear_logs_button.addEventListener('click', this.handleCleanLogs.bind(this));
return E([
E('div', { 'class': 'cbi-map' }, [
E('h2', { 'name': 'content' }, '%s - %s'.format(_('MosDNS'), _('Log Data'))),
E('div', { 'class': 'cbi-section' }, [
clear_logs_button,
log_textarea,
E('div', { 'style': 'text-align:right' },
E('small', {}, _('Refresh every %s seconds.').format(L.env.pollinterval))
)
])])
]);
},
handleSave: null,
handleSaveApply: null,
handleReset: null
});

View File

@@ -1,251 +0,0 @@
'use strict';
'require form';
'require fs';
'require ui';
'require view';
return view.extend({
render: function () {
var m, s, o;
m = new form.Map("mosdns", _("Rule Settings"),
_('The list of rules only apply to \'Default Config\' profiles.'));
s = m.section(form.TypedSection);
s.anonymous = true;
s.sortable = true;
s.tab('whitelist', _('White Lists'));
s.tab('blocklist', _('Block Lists'));
s.tab('greylist', _('Grey Lists'));
s.tab('ddnslist', _('DDNS Lists'));
s.tab('hostslist', _('Hosts'));
s.tab('redirectlist', _('Redirect'));
s.tab('localptrlist', _('Block PTR'));
s.tab('streamingmedialist', _('Streaming Media'));
o = s.taboption('whitelist', form.TextValue, '_whitelist',
null,
'<font color=\'red\'>'
+ _('Added domain names always permit resolution using \'local DNS\' with the highest priority (one domain per line, supports domain matching rules).')
+ '</font>'
);
o.rows = 25;
o.cfgvalue = function (section_id) {
return fs.trimmed('/etc/mosdns/rule/whitelist.txt').catch(function (e) {
return "";
});
};
o.write = function (section_id, formvalue) {
return this.cfgvalue(section_id).then(function (value) {
if (value == formvalue) {
return;
}
return fs.write('/etc/mosdns/rule/whitelist.txt', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
ui.addNotification(null, E('p', _('Rules have been saved.')), 'info');
})
.catch(function (e) {
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
});
};
o = s.taboption('blocklist', form.TextValue, '_blocklist',
null,
'<font color=\'red\'>'
+ _('Added domain names will block DNS resolution (one domain per line, supports domain matching rules).')
+ '</font>'
);
o.rows = 25;
o.cfgvalue = function (section_id) {
return fs.trimmed('/etc/mosdns/rule/blocklist.txt').catch(function (e) {
return "";
});
};
o.write = function (section_id, formvalue) {
return this.cfgvalue(section_id).then(function (value) {
if (value == formvalue) {
return;
}
return fs.write('/etc/mosdns/rule/blocklist.txt', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
ui.addNotification(null, E('p', _('Rules have been saved.')), 'info');
})
.catch(function (e) {
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
});
};
o = s.taboption('greylist', form.TextValue, '_greylist',
null,
'<font color=\'red\'>'
+ _('Added domain names will always use \'Remote DNS\' for resolution (one domain per line, supports domain matching rules).')
+ '</font>'
);
o.rows = 25;
o.cfgvalue = function (section_id) {
return fs.trimmed('/etc/mosdns/rule/greylist.txt').catch(function (e) {
return "";
});
};
o.write = function (section_id, formvalue) {
return this.cfgvalue(section_id).then(function (value) {
if (value == formvalue) {
return;
}
return fs.write('/etc/mosdns/rule/greylist.txt', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
ui.addNotification(null, E('p', _('Rules have been saved.')), 'info');
})
.catch(function (e) {
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
});
};
o = s.taboption('ddnslist', form.TextValue, '_ddnslist',
null,
'<font color=\'red\'>'
+ _('Added domain names will always use \'Local DNS\' for resolution, with a forced TTL of 5 seconds, and results will not be cached (one domain per line, supports domain matching rules).')
+ '</font>'
);
o.rows = 25;
o.cfgvalue = function (section_id) {
return fs.trimmed('/etc/mosdns/rule/ddnslist.txt').catch(function (e) {
return "";
});
};
o.write = function (section_id, formvalue) {
return this.cfgvalue(section_id).then(function (value) {
if (value == formvalue) {
return;
}
return fs.write('/etc/mosdns/rule/ddnslist.txt', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
ui.addNotification(null, E('p', _('Rules have been saved.')), 'info');
})
.catch(function (e) {
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
});
};
o = s.taboption('hostslist', form.TextValue, '_hostslist',
null,
'<font color=\'red\'>'
+ _('Custom Hosts rewrite, for example: baidu.com 10.0.0.1 (one rule per line, supports domain matching rules).')
+ '</font>'
);
o.rows = 25;
o.cfgvalue = function (section_id) {
return fs.trimmed('/etc/mosdns/rule/hosts.txt').catch(function (e) {
return "";
});
};
o.write = function (section_id, formvalue) {
return this.cfgvalue(section_id).then(function (value) {
if (value == formvalue) {
return;
}
return fs.write('/etc/mosdns/rule/hosts.txt', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
ui.addNotification(null, E('p', _('Rules have been saved.')), 'info');
})
.catch(function (e) {
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
});
};
o = s.taboption('redirectlist', form.TextValue, '_redirectlist',
null,
'<font color=\'red\'>'
+ _('Redirecting requests for domain names. Request domain A, but return records for domain B, for example: baidu.com qq.com (one rule per line).')
+ '</font>'
);
o.rows = 25;
o.cfgvalue = function (section_id) {
return fs.trimmed('/etc/mosdns/rule/redirect.txt').catch(function (e) {
return "";
});
};
o.write = function (section_id, formvalue) {
return this.cfgvalue(section_id).then(function (value) {
if (value == formvalue) {
return;
}
return fs.write('/etc/mosdns/rule/redirect.txt', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
ui.addNotification(null, E('p', _('Rules have been saved.')), 'info');
})
.catch(function (e) {
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
});
};
o = s.taboption('localptrlist', form.TextValue, '_localptrlist',
null,
'<font color=\'red\'>'
+ _('Added domain names will block PTR requests (one domain per line, supports domain matching rules).')
+ '</font>'
);
o.rows = 25;
o.cfgvalue = function (section_id) {
return fs.trimmed('/etc/mosdns/rule/local-ptr.txt').catch(function (e) {
return "";
});
};
o.write = function (section_id, formvalue) {
return this.cfgvalue(section_id).then(function (value) {
if (value == formvalue) {
return;
}
return fs.write('/etc/mosdns/rule/local-ptr.txt', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
ui.addNotification(null, E('p', _('Rules have been saved.')), 'info');
})
.catch(function (e) {
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
});
};
o = s.taboption('streamingmedialist', form.TextValue, '_streamingmedialist',
null,
'<font color=\'red\'>'
+ _('When enabling \'Custom Stream Media DNS\', added domains will always use the \'Streaming Media DNS server\' for resolution (one domain per line, supports domain matching rules).')
+ '</font>'
);
o.rows = 25;
o.cfgvalue = function (section_id) {
return fs.trimmed('/etc/mosdns/rule/streaming.txt').catch(function (e) {
return "";
});
};
o.write = function (section_id, formvalue) {
return this.cfgvalue(section_id).then(function (value) {
if (value == formvalue) {
return;
}
return fs.write('/etc/mosdns/rule/streaming.txt', formvalue.trim().replace(/\r\n/g, '\n') + '\n')
.then(function (i) {
ui.addNotification(null, E('p', _('Rules have been saved.')), 'info');
})
.catch(function (e) {
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
});
});
};
return m.render();
},
handleSaveApply: function (ev) {
onclick = L.bind(this.handleSave, this, m);
return fs.exec('/etc/init.d/mosdns', ['restart']);
},
handleReset: null
});

View File

@@ -1,65 +0,0 @@
'use strict';
'require form';
'require fs';
'require ui';
'require view';
return view.extend({
handleUpdate: function (m, section_id, ev) {
return fs.exec('/usr/share/mosdns/mosdns.sh', ['geodata'])
.then(function (i) {
var res = i.code;
if (res === 0) {
ui.addNotification(null, E('p', _('Update success')), 'info');
} else {
ui.addNotification(null, E('p', i.stderr + '<br />' + i.stdout), 'warn');
ui.addNotification(null, E('p', _('Update failed, Please check the network status')), 'error');
}
});
},
render: function () {
var m, s, o;
m = new form.Map('mosdns', _('Update GeoIP & GeoSite databases'),
_('Automatically update GeoIP and GeoSite databases as well as ad filtering rules through scheduled tasks.'));
s = m.section(form.TypedSection);
s.anonymous = true;
o = s.option(form.Flag, 'geo_auto_update', _('Enable Auto Database Update'));
o.rmempty = false;
o = s.option(form.ListValue, 'geo_update_week_time', _('Update Cycle'));
o.value('*', _('Every Day'));
o.value('1', _('Every Monday'));
o.value('2', _('Every Tuesday'));
o.value('3', _('Every Wednesday'));
o.value('4', _('Every Thursday'));
o.value('5', _('Every Friday'));
o.value('6', _('Every Saturday'));
o.value('7', _('Every Sunday'));
o.default = 3;
o = s.option(form.ListValue, 'geo_update_day_time', _('Update Time'));
for (let t = 0; t < 24; t++) {
o.value(t, t + ':00');
};
o.default = 3;
o = s.option(form.Value, 'github_proxy', _('GitHub Proxy'),
_('Update data files with GitHub Proxy, leave blank to disable proxy downloads.'));
o.value('https://hub.gitmirror.com', _('https://hub.gitmirror.com'));
o.rmempty = true;
o.default = '';
o = s.option(form.Button, '_udpate', null,
_('Check And Update GeoData.'));
o.title = _('Database Update');
o.inputtitle = _('Check And Update');
o.inputstyle = 'apply';
o.onclick = L.bind(this.handleUpdate, this, m);
return m.render();
}
});

View File

@@ -0,0 +1,53 @@
local sys = require "luci.sys"
local http = require "luci.http"
module("luci.controller.mosdns", package.seeall)
function index()
if not nixio.fs.access("/etc/config/mosdns") then
return
end
local page = entry({"admin", "services", "mosdns"}, alias("admin", "services", "mosdns", "basic"), _("MosDNS"), 30)
page.dependent = true
page.acl_depends = { "luci-app-mosdns" }
entry({"admin", "services", "mosdns", "basic"}, cbi("mosdns/basic"), _("Basic Setting"), 1).leaf = true
entry({"admin", "services", "mosdns", "rule_list"}, cbi("mosdns/rule_list"), _("Rule List"), 2).leaf = true
entry({"admin", "services", "mosdns", "update"}, cbi("mosdns/update"), _("Geodata Update"), 3).leaf = true
entry({"admin", "services", "mosdns", "log"}, cbi("mosdns/log"), _("Logs"), 4).leaf = true
entry({"admin", "services", "mosdns", "status"}, call("act_status")).leaf = true
entry({"admin", "services", "mosdns", "get_log"}, call("get_log")).leaf = true
entry({"admin", "services", "mosdns", "clear_log"}, call("clear_log")).leaf = true
entry({"admin", "services", "mosdns", "geo_update"}, call("geo_update")).leaf = true
entry({"admin", "services", "mosdns", "flush_cache"}, call("flush_cache")).leaf = true
end
function act_status()
local e = {}
e.running = sys.call("pgrep -f mosdns >/dev/null") == 0
http.prepare_content("application/json")
http.write_json(e)
end
function get_log()
http.write(sys.exec("cat $(/usr/share/mosdns/mosdns.sh logfile)"))
end
function clear_log()
sys.call("cat /dev/null > $(/usr/share/mosdns/mosdns.sh logfile)")
end
function geo_update()
local e = {}
e.updating = sys.call("/usr/share/mosdns/mosdns.sh geodata >/dev/null") == 0
http.prepare_content("application/json")
http.write_json(e)
end
function flush_cache()
local e = {}
e.flushing = sys.call("/usr/share/mosdns/mosdns.sh flush >/dev/null") == 0
http.prepare_content("application/json")
http.write_json(e)
end

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