Compare commits

...

29 Commits

Author SHA1 Message Date
Seefs
00ba64d837 Revert "Fork Sync: Update from parent repository" 2025-10-10 20:32:17 +08:00
github-actions[bot]
b9431dace1 Merge pull request #26 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-10 12:30:16 +00:00
github-actions[bot]
268757a670 Merge pull request #25 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-10 09:16:42 +00:00
github-actions[bot]
01135f430e Merge pull request #24 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-10 06:47:11 +00:00
github-actions[bot]
9b1056b13b Merge pull request #23 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-09 09:16:11 +00:00
github-actions[bot]
df243204fd Merge pull request #22 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-09 06:22:59 +00:00
github-actions[bot]
6be574accc Merge pull request #21 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-09 04:24:23 +00:00
LINLI
63f9d11da9 Merge pull request #20 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-08 23:19:31 +08:00
github-actions[bot]
a3e1402df8 Merge pull request #19 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-04 06:59:08 +00:00
github-actions[bot]
de7661ea6d Merge pull request #18 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-03 15:14:37 +00:00
github-actions[bot]
0a6695bbd3 Merge pull request #17 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-03 12:29:24 +00:00
github-actions[bot]
6a933c2e73 Merge pull request #16 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-03 06:54:44 +00:00
github-actions[bot]
fee71c798f Merge pull request #15 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-03 06:21:30 +00:00
github-actions[bot]
8628994acf Merge pull request #14 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-02 12:28:55 +00:00
github-actions[bot]
4a3e233711 Merge pull request #13 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-02 09:15:31 +00:00
github-actions[bot]
7603458c1d Merge pull request #12 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-02 06:44:51 +00:00
github-actions[bot]
0907fc4863 Merge pull request #11 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-01 18:20:55 +00:00
github-actions[bot]
c3c4e9a2fc Merge pull request #10 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-01 09:46:00 +00:00
github-actions[bot]
991ab6440b Merge pull request #9 from QuantumNous/main
Fork Sync: Update from parent repository
2025-10-01 09:16:40 +00:00
github-actions[bot]
2f2e0638d4 Merge pull request #8 from QuantumNous/main
Fork Sync: Update from parent repository
2025-09-30 09:16:35 +00:00
github-actions[bot]
85ecd08e1b Merge pull request #7 from QuantumNous/main
Fork Sync: Update from parent repository
2025-09-30 06:22:41 +00:00
github-actions[bot]
408fff8de8 Merge pull request #6 from QuantumNous/main
Fork Sync: Update from parent repository
2025-09-30 04:48:13 +00:00
linzero
298bc12e51 fix(api): update request forwarding to use environment variable TARGET_URL 2025-09-30 12:44:39 +08:00
github-actions[bot]
dbf20c7967 Merge pull request #5 from QuantumNous/main
Fork Sync: Update from parent repository
2025-09-30 03:28:59 +00:00
github-actions[bot]
b516ca88f2 Merge pull request #4 from QuantumNous/main
Fork Sync: Update from parent repository
2025-09-29 12:30:46 +00:00
github-actions[bot]
fde92a5770 Merge pull request #3 from QuantumNous/main
Fork Sync: Update from parent repository
2025-09-29 09:13:41 +00:00
linzero
714fa11412 feat: update sync workflow owner and add new request forwarding functions 2025-09-29 17:13:02 +08:00
linzero
980108e907 feat: update build script to increase memory limit and add sync workflow 2025-09-29 16:55:22 +08:00
linzero
d20ee1226e fix: add antd dependency to package.json 2025-09-29 16:44:18 +08:00
7 changed files with 129 additions and 16 deletions

17
.github/workflows/sync.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
# .github/workflows/sync.yml
name: Sync Fork
on:
push: # push 时触发, 主要是为了测试配置有没有问题
schedule:
- cron: '* */3 * * *' # 每3小时触发, 对于一些更新不那么频繁的项目可以设置为每天一次, 低碳一点
jobs:
repo-sync:
runs-on: ubuntu-latest
steps:
- uses: TG908/fork-sync@v1.6.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
owner: QuantumNous # fork 的上游仓库 user
head: main # fork 的上游仓库 branch
base: main # 本地仓库 branch

View File

@@ -97,7 +97,6 @@ func updateVideoSingleTask(ctx context.Context, adaptor channel.TaskAdaptor, cha
taskResult.Url = t.FailReason
taskResult.Progress = t.Progress
taskResult.Reason = t.FailReason
task.Data = t.Data
} else if taskResult, err = adaptor.ParseTaskResult(responseBody); err != nil {
return fmt.Errorf("parseTaskResult failed for task %s: %w", taskId, err)
} else {

View File

@@ -362,20 +362,11 @@ func videoFetchByIDRespBodyBuilder(c *gin.Context) (respBody []byte, taskResp *d
}
}()
if len(respBody) != 0 {
return
}
if strings.HasPrefix(c.Request.RequestURI, "/v1/videos/") {
respBody = originTask.Data
return
}
respBody, err = json.Marshal(dto.TaskResponse[any]{
Code: "success",
Data: TaskModel2Dto(originTask),
})
if err != nil {
taskResp = service.TaskErrorWrapper(err, "marshal_response_failed", http.StatusInternalServerError)
if len(respBody) == 0 {
respBody, err = json.Marshal(dto.TaskResponse[any]{
Code: "success",
Data: TaskModel2Dto(originTask),
})
}
return
}

View File

@@ -0,0 +1,35 @@
// functions/Pages_Functions.js
// 该函数会将所有请求转发到环境变量 `TARGET_URL` 指定的地址
export async function onRequest(context) {
// 从上下文中获取原始请求和环境变量
const { request, env } = context;
// 解析原始请求的 URL以获取路径和查询参数
const url = new URL(request.url);
const path = url.pathname;
const search = url.search;
// 从环境变量中获取目标 URL如果未设置则提供一个默认值
const target = env.TARGET_URL || 'http://172.0.0.1';
// 构建目标 URL
const targetUrl = `${target}${path}${search}`;
// 创建一个新的请求以转发到目标地址
// 复制原始请求的方法、头部和主体
const newRequest = new Request(targetUrl, {
method: request.method,
headers: request.headers,
body: request.body,
redirect: 'manual' // 防止 fetch 自动处理重定向
});
// 执行转发请求并返回响应
try {
return await fetch(newRequest);
} catch (error) {
// 如果目标服务器无法访问,返回一个错误信息
return new Response(`Error forwarding request: ${error.message}`, { status: 502 });
}
}

View File

@@ -0,0 +1,35 @@
// functions/Pages_Functions.js
// 该函数会将所有请求转发到环境变量 `TARGET_URL` 指定的地址
export async function onRequest(context) {
// 从上下文中获取原始请求和环境变量
const { request, env } = context;
// 解析原始请求的 URL以获取路径和查询参数
const url = new URL(request.url);
const path = url.pathname;
const search = url.search;
// 从环境变量中获取目标 URL如果未设置则提供一个默认值
const target = env.TARGET_URL || 'http://172.0.0.1';
// 构建目标 URL
const targetUrl = `${target}${path}${search}`;
// 创建一个新的请求以转发到目标地址
// 复制原始请求的方法、头部和主体
const newRequest = new Request(targetUrl, {
method: request.method,
headers: request.headers,
body: request.body,
redirect: 'manual' // 防止 fetch 自动处理重定向
});
// 执行转发请求并返回响应
try {
return await fetch(newRequest);
} catch (error) {
// 如果目标服务器无法访问,返回一个错误信息
return new Response(`Error forwarding request: ${error.message}`, { status: 502 });
}
}

View File

@@ -0,0 +1,35 @@
// functions/Pages_Functions.js
// 该函数会将所有请求转发到环境变量 `TARGET_URL` 指定的地址
export async function onRequest(context) {
// 从上下文中获取原始请求和环境变量
const { request, env } = context;
// 解析原始请求的 URL以获取路径和查询参数
const url = new URL(request.url);
const path = url.pathname;
const search = url.search;
// 从环境变量中获取目标 URL如果未设置则提供一个默认值
const target = env.TARGET_URL || 'http://172.0.0.1';
// 构建目标 URL
const targetUrl = `${target}${path}${search}`;
// 创建一个新的请求以转发到目标地址
// 复制原始请求的方法、头部和主体
const newRequest = new Request(targetUrl, {
method: request.method,
headers: request.headers,
body: request.body,
redirect: 'manual' // 防止 fetch 自动处理重定向
});
// 执行转发请求并返回响应
try {
return await fetch(newRequest);
} catch (error) {
// 如果目标服务器无法访问,返回一个错误信息
return new Response(`Error forwarding request: ${error.message}`, { status: 502 });
}
}

View File

@@ -6,6 +6,7 @@
"dependencies": {
"@douyinfe/semi-icons": "^2.63.1",
"@douyinfe/semi-ui": "^2.69.1",
"antd": "^5.25.2",
"@lobehub/icons": "^2.0.0",
"@visactor/react-vchart": "~1.8.8",
"@visactor/vchart": "~1.8.8",
@@ -44,7 +45,7 @@
},
"scripts": {
"dev": "vite",
"build": "vite build",
"build": "node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build",
"lint": "prettier . --check",
"lint:fix": "prettier . --write",
"eslint": "bunx eslint \"**/*.{js,jsx}\" --cache",