From e72745fbcef27d3b6b07576637ffc94d77ed9ff4 Mon Sep 17 00:00:00 2001 From: Peng-YM <1048217874pengym@gmail.com> Date: Sat, 27 Feb 2021 14:47:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B1=E4=BA=8EQX=E8=84=9A=E6=9C=AC=E4=B8=8D?= =?UTF-8?q?=E8=B5=B0Rewrite=EF=BC=8C=E4=BD=BF=E7=94=A8Backend=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/cron-sync-artifacts.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/scripts/cron-sync-artifacts.js b/scripts/cron-sync-artifacts.js index 39f931b..4344c01 100644 --- a/scripts/cron-sync-artifacts.js +++ b/scripts/cron-sync-artifacts.js @@ -1,5 +1,34 @@ +/** + Sub-Store 自动同步配置到gist + 由于机制特殊,注意需要按照说明进行配置! + + 「QX配置」 + [http_backend] +https://raw.githubusercontent.com/Peng-YM/Sub-Store/master/backend/sub-store.min.js, tag=Sub-Store, path=/, enabled=true +[task_local] +0 12 * * * https://raw.githubusercontent.com/Peng-YM/Sub-Store/master/scripts/cron-sync-artifacts.js, tag=Sub-Store, img-url=https://raw.githubusercontent.com/58xinian/icon/master/Sub-Store1.png, enabled=true + +「Surge配置」 +[Script] +Sub-Store 自动同步 = type=cron,cronexp=0 12 * * *, script-path=https://raw.githubusercontent.com/Peng-YM/Sub-Store/master/scripts/cron-sync-artifacts.js + +「Loon配置」 +[Script] +cron "0 12 * * *" script-path=https://raw.githubusercontent.com/Peng-YM/Sub-Store/master/scripts/cron-sync-artifacts.js, tag=Sub-Store 自动同步 + */ + + const $ = API(); -$.http.get('https://sub.store/api/cron/sync-artifacts'); +const { isQX, isLoon, isSurge } = ENV(); +const url = 'https://sub.store/api/cron/sync-artifacts'; +if (isQX) { + $task.fetch({ + url: "http://localhost:9999/api/cron/sync-artifacts" + }); +} else { + $.http.get(url); +} +$.log("同步配置成功!"); $.done(); // prettier ignore