feat: sign scripts

This commit is contained in:
2025-01-24 00:45:07 +08:00
parent a71227ca60
commit 23f750d8cd
15 changed files with 78 additions and 63 deletions

View File

@@ -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

View File

@@ -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=

View File

@@ -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
}
}

View File

@@ -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"
}
}

View File

@@ -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

View File

@@ -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

View File

@@ -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=

View File

@@ -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=

View File

@@ -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==

View File

@@ -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=

View File

@@ -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

View File

@@ -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==

View File

@@ -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

View File

@@ -73,3 +73,6 @@ fn read_script_meta(file_name: &str, main_rs: &PathBuf) -> XResult<ScriptMeta> {
script_sha256,
})
}
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004350+08:00.MEYCIQDCskkcmrty6QeWCz4U
// hre4LAfP6E4+zV4sj7qOCpUIngIhAPPKuFedqY/vyFLkhfslXsK+99eYCy4278uegA0ba6JX

View File

@@ -243,3 +243,6 @@ fn read_script_meta(
update_time,
})
}
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250124T004356+08:00.MEUCIHzuiug3f0EvwhN16ROH
// 0gs+3pe0YnclC7T+R3IW9qyOAiEAjit5sgfdlBMrqHVZCMgDy90cacw5TDNQ+z4xIKDYSW0=