From f96d9dea74f9135c04ae366d15d4f79dd63a7fe3 Mon Sep 17 00:00:00 2001 From: xream Date: Thu, 9 Jan 2025 18:56:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=97=A5=E5=BF=97=E4=B8=AD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E4=BC=A0=E9=85=8D=E7=BD=AE=E7=9A=84=E5=93=8D?= =?UTF-8?q?=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/products/cron-sync-artifacts.js | 8 ++++++++ backend/src/restful/sync.js | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 01b4b9ad7..fe4be9a1f 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.16.7", + "version": "2.16.8", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/products/cron-sync-artifacts.js b/backend/src/products/cron-sync-artifacts.js index 41c8f8b61..bdf1122e1 100644 --- a/backend/src/products/cron-sync-artifacts.js +++ b/backend/src/products/cron-sync-artifacts.js @@ -174,6 +174,14 @@ async function doSync() { const resp = await syncToGist(files); const body = JSON.parse(resp.body); + delete body.history; + delete body.forks; + delete body.owner; + Object.values(body.files).forEach((file) => { + delete file.content; + }); + $.info('上传配置响应:'); + $.info(JSON.stringify(body, null, 2)); for (const artifact of allArtifacts) { if (artifact.sync) { diff --git a/backend/src/restful/sync.js b/backend/src/restful/sync.js index d209091f6..b73e6a8e1 100644 --- a/backend/src/restful/sync.js +++ b/backend/src/restful/sync.js @@ -625,6 +625,15 @@ async function syncArtifacts() { const resp = await syncToGist(files); const body = JSON.parse(resp.body); + delete body.history; + delete body.forks; + delete body.owner; + Object.values(body.files).forEach((file) => { + delete file.content; + }); + $.info('上传配置响应:'); + $.info(JSON.stringify(body, null, 2)); + for (const artifact of allArtifacts) { if (artifact.sync) { artifact.updated = new Date().getTime(); @@ -743,6 +752,16 @@ async function syncArtifact(req, res) { }); artifact.updated = new Date().getTime(); const body = JSON.parse(resp.body); + + delete body.history; + delete body.forks; + delete body.owner; + Object.values(body.files).forEach((file) => { + delete file.content; + }); + $.info('上传配置响应:'); + $.info(JSON.stringify(body, null, 2)); + let files = body.files; let isGitLab; if (Array.isArray(files)) {