From 23f750d8cd0b90af227c09991ea19c4038fc9bd6 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Fri, 24 Jan 2025 00:45:07 +0800 Subject: [PATCH] feat: sign scripts --- access-guard-ts/main.ts | 3 ++ helloworld-ts/main.ts | 3 ++ script-meta-v2.json | 66 ++++++++++++++++++------------------ script-meta.json | 12 +++---- sigstore-verify-ts/main.ts | 3 ++ single-scripts/cal.ts | 6 ++-- single-scripts/hjson.ts | 6 ++-- single-scripts/kpxcenv.ts | 6 ++-- single-scripts/post-note.ts | 6 ++-- single-scripts/print-env.ts | 6 ++-- single-scripts/publickey.ts | 6 ++-- single-scripts/ssh-verify.ts | 6 ++-- single-scripts/wget.ts | 6 ++-- update-meta-v1.rs | 3 ++ update-meta-v2.rs | 3 ++ 15 files changed, 78 insertions(+), 63 deletions(-) diff --git a/access-guard-ts/main.ts b/access-guard-ts/main.ts index 785baa4..69b5130 100755 --- a/access-guard-ts/main.ts +++ b/access-guard-ts/main.ts @@ -203,3 +203,6 @@ Deno.serve(listen, async (req) => { notFoundHandler; return await req_handler(url, req); }); + +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004321+08:00.MEYCIQCymxaZsiML7bkV8GHM +// ebW8aPxf5Iz/cc5d9HwAvvNbBQIhAOXCxdXyKJjTDNWv/IIZukzdO+nb1NXLPnBiwCfRpTiy diff --git a/helloworld-ts/main.ts b/helloworld-ts/main.ts index 0ecbdc4..02c4eed 100755 --- a/helloworld-ts/main.ts +++ b/helloworld-ts/main.ts @@ -1,3 +1,6 @@ #!/usr/bin/env -S deno run --allow-env console.log("Hello world."); + +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004330+08:00.MEUCIQD3wHWOwtg4eEJrgN/N +// 3Con8UzzTlghdpkINDUFIWPXmwIgHStBP9tHt14U288kKHhmcQoLOvrBmwLOsh8XhJkgjiY= diff --git a/script-meta-v2.json b/script-meta-v2.json index cdf95cd..b875525 100644 --- a/script-meta-v2.json +++ b/script-meta-v2.json @@ -1,98 +1,98 @@ { "access-guard.ts": { "script_name": "access-guard.ts", - "script_length": 5756, - "script_sha256": "ecd11481f6182a5db14008c981a2ebba42a4851d656043c79498e83c95521c7b", + "script_length": 5917, + "script_sha256": "2b7efec1c473856e156bea9c8c9ce526c217138b8813b8706600808e895ce0f5", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/access-guard-ts/main.ts", "publish_time": 1737272626138, - "update_time": 1737272626138 + "update_time": 1737650670432 }, "cal.ts": { "script_name": "cal.ts", - "script_length": 388, - "script_sha256": "7491add6856cb74e816bbe9d6e4cc2687692ae19e73937670f8f9b42d2c44b63", + "script_length": 385, + "script_sha256": "36b3a573c37736bdbbbeb853d0eb89027bd48d96813e9ce9871aa1cdb0aa6d53", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/cal.ts", "single_script_file": true, "publish_time": 1737306227061, - "update_time": 1737563250084 + "update_time": 1737650670435 }, "helloworld.ts": { "script_name": "helloworld.ts", - "script_length": 69, - "script_sha256": "b301944e64def6c3a1ada4e327a7b2c2e37c576a65da5f797998355c51686f76", + "script_length": 230, + "script_sha256": "84dd625baedc59e2040f445b43743567f8079b809590f79cf74c7c9c4a71092e", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/helloworld-ts/main.ts", "publish_time": 1737272626138, - "update_time": 1737272626138 + "update_time": 1737650670431 }, "hjson.ts": { "script_name": "hjson.ts", - "script_length": 452, - "script_sha256": "f49faa7a5b6eeb6e040074648cc8882d7a59ab54645df240d85a06a1aa5b195b", + "script_length": 449, + "script_sha256": "0ff4ae6601124b92936d76d32d27c882edfbb3af1613362e3c3d13cbde5cbed8", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/hjson.ts", "single_script_file": true, "publish_time": 1737375737613, - "update_time": 1737563250083 + "update_time": 1737650670433 }, "kpxcenv.ts": { "script_name": "kpxcenv.ts", - "script_length": 3712, - "script_sha256": "32c65c8141c55389ada5d12387a6d1739350036a47cec1724565bc5ce049acf8", + "script_length": 3709, + "script_sha256": "18285d82451f07e4d4406cf210d3ff580a275f5bdad329fe46cf3a32f7f69bc7", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/kpxcenv.ts", "single_script_file": true, "publish_time": 1737272626141, - "update_time": 1737563250084 + "update_time": 1737650670434 }, "post-note.ts": { "script_name": "post-note.ts", - "script_length": 1907, - "script_sha256": "e7acce01af8918287367cd24f166c7db1baf618613e42e4b17de9ee77d84aeaf", + "script_length": 1904, + "script_sha256": "fade16a1898e6b0dc9239159e1c21a08ffcb480e823d8f26285b4056300828ba", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/post-note.ts", "single_script_file": true, "publish_time": 1737475603673, - "update_time": 1737563250084 + "update_time": 1737650670435 }, "print-env.ts": { "script_name": "print-env.ts", - "script_length": 317, - "script_sha256": "b73d8251a0f650090cb16292d43e14df99c53618d248884200891d64d84e3a5a", + "script_length": 314, + "script_sha256": "f18ee0414979b396fb21594db737b2dfdadf78cd4d55a4c157bbf8e52433dc4a", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/print-env.ts", "single_script_file": true, "publish_time": 1737272626140, - "update_time": 1737563250084 + "update_time": 1737650670434 }, "publickey.ts": { "script_name": "publickey.ts", - "script_length": 1863, - "script_sha256": "35067d083a5247a4b5401db94c1347fa86a0b0d73913fe8fb52757d4f48f89ab", + "script_length": 1860, + "script_sha256": "e218d3ad8b95e9c0b2fb04c54e12c4f6e12034e26e403b7fa3929ce441cfd954", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/publickey.ts", "single_script_file": true, "publish_time": 1737272626140, - "update_time": 1737563250083 + "update_time": 1737650670433 }, "sigstore-verify.ts": { "script_name": "sigstore-verify.ts", - "script_length": 3515, - "script_sha256": "0371be7620d5aa2607a5ed1a9b45e2664b5c27ee163966a681e630d568c4a445", + "script_length": 3676, + "script_sha256": "8ae7f0027c94c1f706fe22da0e5978bef4d4f2c49a310e03e635da95dd1fdb19", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/sigstore-verify-ts/main.ts", "publish_time": 1737272626138, - "update_time": 1737272626138 + "update_time": 1737650670432 }, "ssh-verify.ts": { "script_name": "ssh-verify.ts", - "script_length": 2836, - "script_sha256": "5cc3043a765eac8d422e4633a579fb3ae3b491ad04056070686ce2f99a02aacc", + "script_length": 2833, + "script_sha256": "2bef5eda489cd612f05fb09fe9b481d40c282bc732362c6f8dd6e5e8dba1ecf7", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/ssh-verify.ts", "single_script_file": true, "publish_time": 1737272626141, - "update_time": 1737563250084 + "update_time": 1737650670435 }, "wget.ts": { "script_name": "wget.ts", - "script_length": 3989, - "script_sha256": "62abfaa7df86eadf39cf3b6e089e415e6692cf5fb5f02f7811b5dd05f242a374", + "script_length": 3986, + "script_sha256": "84239c527ed1edae70b36bebd0ad5f6a808e8e6b84c04b403ebf21248cb76d7c", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/wget.ts", "single_script_file": true, "publish_time": 1737272626139, - "update_time": 1737563250083 + "update_time": 1737650670433 } } \ No newline at end of file diff --git a/script-meta.json b/script-meta.json index 82d1375..b6b1acd 100644 --- a/script-meta.json +++ b/script-meta.json @@ -1,17 +1,17 @@ { "access-guard-ts": { "script_name": "access-guard-ts", - "script_length": 5756, - "script_sha256": "ecd11481f6182a5db14008c981a2ebba42a4851d656043c79498e83c95521c7b" + "script_length": 5917, + "script_sha256": "2b7efec1c473856e156bea9c8c9ce526c217138b8813b8706600808e895ce0f5" }, "helloworld-ts": { "script_name": "helloworld-ts", - "script_length": 69, - "script_sha256": "b301944e64def6c3a1ada4e327a7b2c2e37c576a65da5f797998355c51686f76" + "script_length": 230, + "script_sha256": "84dd625baedc59e2040f445b43743567f8079b809590f79cf74c7c9c4a71092e" }, "sigstore-verify-ts": { "script_name": "sigstore-verify-ts", - "script_length": 3515, - "script_sha256": "0371be7620d5aa2607a5ed1a9b45e2664b5c27ee163966a681e630d568c4a445" + "script_length": 3676, + "script_sha256": "8ae7f0027c94c1f706fe22da0e5978bef4d4f2c49a310e03e635da95dd1fdb19" } } \ No newline at end of file diff --git a/sigstore-verify-ts/main.ts b/sigstore-verify-ts/main.ts index 2026be7..f4b08ae 100755 --- a/sigstore-verify-ts/main.ts +++ b/sigstore-verify-ts/main.ts @@ -143,3 +143,6 @@ sigstore-verify.ts [--attest sigstore-attest.json] } await main(); + +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004337+08:00.MEYCIQCSBQGBhGqHm/bJry8Q +// ofuv67JRT4MEb58+Gq5SK5XM9gIhANqP0aQrQZaeLlE0jDMEY7GlspCgYPwJ4XsnOsqBGbNe diff --git a/single-scripts/cal.ts b/single-scripts/cal.ts index d53a1f9..1d09b3c 100755 --- a/single-scripts/cal.ts +++ b/single-scripts/cal.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env -S deno run --allow-env --allow-run +#!/usr/bin/env runts -- --allow-env --allow-run // or: cal -A 1 -B 1 const command = new Deno.Command("cal", { @@ -9,5 +9,5 @@ const command = new Deno.Command("cal", { }); const _child = command.spawn(); -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250123T002650+08:00.MEQCIDZcQT+YcvuLLJaF2GmA -// SxwAraNOQcxTaum4I8pG0N+GAiARnrxf+efeaqpjz4N2fMoExTE9kJ38gNY3STodJZe43A== +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T003842+08:00.MEYCIQDOIAYDYaui9kWbw0nG +// cpUgj1LiAFgH0Jjf76GVNmX4vwIhAL6kz1piBA7i1SBB9tEQrJ1wrtTCJg7kqkbeYtKoKUMK diff --git a/single-scripts/hjson.ts b/single-scripts/hjson.ts index 46abb40..6834084 100755 --- a/single-scripts/hjson.ts +++ b/single-scripts/hjson.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env -S deno run --allow-env +#!/usr/bin/env runts -- --allow-env import hjson from "npm:hjson"; import { toArrayBuffer } from "https://deno.land/std@0.203.0/streams/mod.ts"; @@ -7,5 +7,5 @@ const input = new TextDecoder().decode(await toArrayBuffer(Deno.stdin.readable)) console.log(JSON.stringify(hjson.parse(input), null, 4)); -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250123T002653+08:00.MEQCIC+E64MomdWUEPQNhQ3B -// xlLi29D6LLTVBzrbxFlT/KO2AiBvIuAqbA+YzWqNHHCCfG60iE3ZpazAMmXLzKuvC1OzvQ== +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004244+08:00.MEUCIQCmHkkAiwvLHOZpwb+M +// WLEa/guITGU2HD6ZD51SP/vwlgIgAIa/Pudrns1WkKMqn5VsR4/a6vDj1J52CUR/aN+bK8A= diff --git a/single-scripts/kpxcenv.ts b/single-scripts/kpxcenv.ts index f653964..162175b 100755 --- a/single-scripts/kpxcenv.ts +++ b/single-scripts/kpxcenv.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env -S deno run --allow-env --allow-run --allow-import +#!/usr/bin/env runts -- --allow-env --allow-run --allow-import // Reference: // - https://github.com/nwwdles/kpxcpc @@ -123,5 +123,5 @@ const command = new Deno.Command(shellCommand, { }); const _child = command.spawn(); -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250123T002653+08:00.MEUCIQC3RT5y3G8E891QVcnO -// Ooarh+NtpuAjHHWskZ0Pu48FegIgB/ybIyjpyW5VjpHKY3arLcw4rOOf1KGFIpkWJP6kF1U= +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004246+08:00.MEUCIAiAJhDERg+lCsFI6nn6 +// 1vlppaV09v13lkXAMH5J2emTAiEA2KrxMqkHp4UXGw5GMz3Ft97RBPcuefbDJZ1HmufZQB0= diff --git a/single-scripts/post-note.ts b/single-scripts/post-note.ts index c8becdf..0752d4b 100755 --- a/single-scripts/post-note.ts +++ b/single-scripts/post-note.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env -S deno run --allow-env --allow-import --allow-net +#!/usr/bin/env runts -- --allow-env --allow-import --allow-net import { parseArgs } from "jsr:@std/cli/parse-args"; import { encryptEcdhP256 } from "https://hatter.ink/script/get/@0/deno-wrapkey-mod.ts"; @@ -56,5 +56,5 @@ const response = await fetchWithTimoutAndAutoProxy( console.info(response.status, await response.json()); -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250123T002653+08:00.MEYCIQCL51hGkl0Vcq+vb16J -// eyZd4vPAJ22t1Jizxrz6G/zA5QIhAJLrrggF4UFu3xbpch3c2tfaKlv5n+1k0Xl2R/OZi4Fp +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004246+08:00.MEQCIAISKWEn9Tw0XxS/vEIV +// 8FwzpEz4DspoEiRiYYSgicbJAiAG6yY8pQsclOUX6wytN6W6ia+UGM4CLheMvtF3fkIiGQ== diff --git a/single-scripts/print-env.ts b/single-scripts/print-env.ts index 4541a32..5206b15 100755 --- a/single-scripts/print-env.ts +++ b/single-scripts/print-env.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env -S deno run --allow-env +#!/usr/bin/env runts -- --allow-env const envs = Deno.env.toObject(); @@ -6,5 +6,5 @@ for (const envKey in envs) { console.log(`${envKey} --> ${envs[envKey]}`); } -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250123T002653+08:00.MEUCICtgje2TPYxa/+mb23o4 -// styMR0J2ahTh02HjPQ6vyYBEAiEA7a2Ft07MxMVG0hIrl9LsB/gZ0C/xM7oiJ+hGPymBVto= +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004246+08:00.MEUCIGdhlhPTjmPruFQIpjKw +// /AxrlSahyYYXp5bg6nrGqH/iAiEAqocETl4t7l4izJUcszZ3ZI3lsjlJXSouzJX3OfiI+Kw= diff --git a/single-scripts/publickey.ts b/single-scripts/publickey.ts index 9864fb6..55c2773 100755 --- a/single-scripts/publickey.ts +++ b/single-scripts/publickey.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env -S deno run --allow-env --allow-import +#!/usr/bin/env runts -- --allow-env --allow-import // Reference: // - https://docs.deno.com/examples/command_line_arguments/ @@ -52,5 +52,5 @@ try { Deno.exit(1); } -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250123T002653+08:00.MEYCIQDEZ6yTqWRQct3V0nOY -// yBHWFTZCMuKzXYAQp/OETEpmlQIhANnCSv7U4du/w5c+46GJ2XHqRih+pQFIVxsy2sGYqsgJ +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004246+08:00.MEYCIQCxYN3lJQBKtoO/gjpY +// Rqtzv6Ioj0xket0BjSRRRtsbeAIhAOfG9pIdbcKONHhNNvSfIFs7/Lf0rEoP9SgnXHAhI/9D diff --git a/single-scripts/ssh-verify.ts b/single-scripts/ssh-verify.ts index 3f4635f..143660d 100755 --- a/single-scripts/ssh-verify.ts +++ b/single-scripts/ssh-verify.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env -S deno run --allow-env --allow-import --allow-read --allow-net +#!/usr/bin/env runts -- --allow-env --allow-import --allow-read --allow-net import { parseArgs } from "jsr:@std/cli/parse-args"; import { log } from "https://hatter.ink/script/get/@1/deno-commons-mod.ts"; @@ -97,5 +97,5 @@ if (flags.username) { log.warn("GitHub user is not assigned, user is not verified."); } -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250123T002653+08:00.MEUCIA7TUuSXIYZ3quw28p+j -// udOTEKC4E2rThWcBhNVE9IcFAiEAwKcZkIHNQGIh/tqvu1+VdVJALLNH9sZl55KL1hhRXfw= +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004247+08:00.MEQCIH3nWGP1ZcLnmNrulS6r +// KmiV0xdtDVtiAFYUzrjtwMy9AiAhzXvxwHL0xkF5an9/B70s8SsdoXYbKqX1rZ7wbyYXVw== diff --git a/single-scripts/wget.ts b/single-scripts/wget.ts index a4060a8..1f93f0c 100755 --- a/single-scripts/wget.ts +++ b/single-scripts/wget.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env -S deno run --allow-env --allow-import --allow-read --allow-write --allow-net +#!/usr/bin/env runts -- --allow-env --allow-import --allow-read --allow-write --allow-net // Reference: // - https://docs.deno.com/examples/command_line_arguments/ @@ -137,5 +137,5 @@ log.success( }`, ); -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250123T002653+08:00.MEQCIDsAcL6n8DZPCZDI6BmA -// CHQlG7TQUeiEQOdW3fLBVMYnAiBG+nkmtzSb1/xwUl0MOrrk2ffvcPCi3BpQS6Ziz3BXFw== +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004247+08:00.MEYCIQCsT/Zzt0SJxCiKOC3a +// 9bQrIKB/ACboAmYBKI/J3NFxaQIhAP4QhCiNBuW8VmCt3vcLtR9j5dEAifR8dpJFeloUXCWb diff --git a/update-meta-v1.rs b/update-meta-v1.rs index a9bdc9d..097f3aa 100755 --- a/update-meta-v1.rs +++ b/update-meta-v1.rs @@ -73,3 +73,6 @@ fn read_script_meta(file_name: &str, main_rs: &PathBuf) -> XResult { script_sha256, }) } + +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004350+08:00.MEYCIQDCskkcmrty6QeWCz4U +// hre4LAfP6E4+zV4sj7qOCpUIngIhAPPKuFedqY/vyFLkhfslXsK+99eYCy4278uegA0ba6JX diff --git a/update-meta-v2.rs b/update-meta-v2.rs index 58b61c1..93d7248 100755 --- a/update-meta-v2.rs +++ b/update-meta-v2.rs @@ -243,3 +243,6 @@ fn read_script_meta( update_time, }) } + +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004356+08:00.MEUCIHzuiug3f0EvwhN16ROH +// 0gs+3pe0YnclC7T+R3IW9qyOAiEAjit5sgfdlBMrqHVZCMgDy90cacw5TDNQ+z4xIKDYSW0=