@supacloud/admin 0.15.2 → 0.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4757,6 +4757,11 @@ var require_utils = __commonJS((exports, module) => {
4757
4757
  };
4758
4758
  });
4759
4759
 
4760
+ // node_modules/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node
4761
+ var require_sshcrypto = __commonJS((exports, module) => {
4762
+ module.exports = __require("./sshcrypto-vd2k5hq9.node");
4763
+ });
4764
+
4760
4765
  // node_modules/ssh2/lib/protocol/crypto/poly1305.js
4761
4766
  var require_poly1305 = __commonJS((exports, module) => {
4762
4767
  var __dirname = "/home/runner/work/supacloud/supacloud/packages/admin/node_modules/ssh2/lib/protocol/crypto", __filename = "/home/runner/work/supacloud/supacloud/packages/admin/node_modules/ssh2/lib/protocol/crypto/poly1305.js";
@@ -5243,7 +5248,7 @@ var require_crypto = __commonJS((exports, module) => {
5243
5248
  var ChaChaPolyDecipher;
5244
5249
  var GenericDecipher;
5245
5250
  try {
5246
- binding = (()=>{throw new Error("Cannot require module "+"./crypto/build/Release/sshcrypto.node");})();
5251
+ binding = require_sshcrypto();
5247
5252
  ({
5248
5253
  AESGCMCipher,
5249
5254
  ChaChaPolyCipher,
@@ -26362,7 +26367,7 @@ function quoteShell(shellText) {
26362
26367
  // src/shared/releases/local-upgrade-bundle.ts
26363
26368
  import { spawn } from "node:child_process";
26364
26369
  import { createHash as createHash2, randomUUID as randomUUID2 } from "node:crypto";
26365
- import { accessSync, chmodSync as chmodSync2, constants as fsConstants, createWriteStream, lstatSync, mkdirSync, mkdtempSync as mkdtempSync2, readFileSync as readFileSync3, readdirSync, rmSync as rmSync2, statSync, writeFileSync as writeFileSync2 } from "node:fs";
26370
+ import { accessSync, chmodSync as chmodSync2, constants as fsConstants, createWriteStream, lstatSync, mkdirSync, mkdtempSync as mkdtempSync2, readFileSync as readFileSync3, readdirSync, renameSync, rmSync as rmSync2, statSync, writeFileSync as writeFileSync2 } from "node:fs";
26366
26371
  import { get } from "node:https";
26367
26372
  import { tmpdir as tmpdir2 } from "node:os";
26368
26373
  import { basename, delimiter, join } from "node:path";
@@ -26376,6 +26381,14 @@ var RELEASE_CHECKSUMS_NAME = "SHA256SUMS";
26376
26381
  var RELEASE_REPOSITORY = "vibeunion/supacloud";
26377
26382
  var RELEASE_SOURCE_REF = "refs/heads/main";
26378
26383
  var RELEASE_SIGNER_WORKFLOW = `${RELEASE_REPOSITORY}/.github/workflows/release-please.yml`;
26384
+ var LEGACY_EDGE_RUNTIME_RELEASE_IDENTITY = {
26385
+ repository: "zuohuadong/supacloud",
26386
+ workflow: "zuohuadong/supacloud/.github/workflows/release-please.yml",
26387
+ component: "edge-runtime",
26388
+ version: "0.18.2",
26389
+ tag: "edge-runtime-v0.18.2",
26390
+ sourceCommit: "c6a3a87cf4e41e0f3dafadb018dd0c7d5b99b7d9"
26391
+ };
26379
26392
  var MEBIBYTE = 1024 * 1024;
26380
26393
  var RELEASE_BUNDLE_SIZE_LIMITS = {
26381
26394
  manifest: MEBIBYTE,
@@ -26482,6 +26495,16 @@ function parseArtifacts(candidate, component) {
26482
26495
  throw new Error(`Release manifest artifact ${oversized.name} exceeds its size limit`);
26483
26496
  return artifacts;
26484
26497
  }
26498
+ function parseIdentity(manifest, source, release) {
26499
+ const current = manifest.repository === RELEASE_REPOSITORY && manifest.workflow === RELEASE_SIGNER_WORKFLOW;
26500
+ const legacyEdgeRuntime = manifest.repository === LEGACY_EDGE_RUNTIME_RELEASE_IDENTITY.repository && manifest.workflow === LEGACY_EDGE_RUNTIME_RELEASE_IDENTITY.workflow && release.component === LEGACY_EDGE_RUNTIME_RELEASE_IDENTITY.component && release.version === LEGACY_EDGE_RUNTIME_RELEASE_IDENTITY.version && release.tag === LEGACY_EDGE_RUNTIME_RELEASE_IDENTITY.tag && source.commit === LEGACY_EDGE_RUNTIME_RELEASE_IDENTITY.sourceCommit;
26501
+ if (!current && !legacyEdgeRuntime)
26502
+ throw new Error("Release manifest identity is invalid");
26503
+ return {
26504
+ repository: manifest.repository,
26505
+ workflow: manifest.workflow
26506
+ };
26507
+ }
26485
26508
  function parseReleaseManifest(text, expected) {
26486
26509
  let candidate;
26487
26510
  try {
@@ -26491,15 +26514,16 @@ function parseReleaseManifest(text, expected) {
26491
26514
  }
26492
26515
  const manifest = manifestObject(candidate, "Release manifest");
26493
26516
  assertExactKeys(manifest, ["schemaVersion", "repository", "source", "workflow", "release", "artifacts"], "Release manifest");
26494
- if (manifest.schemaVersion !== 1 || manifest.repository !== RELEASE_REPOSITORY || manifest.workflow !== RELEASE_SIGNER_WORKFLOW) {
26517
+ if (manifest.schemaVersion !== 1)
26495
26518
  throw new Error("Release manifest identity is invalid");
26496
- }
26519
+ const source = parseSource(manifest.source);
26520
+ const release = parseRelease(manifest.release, expected);
26521
+ const identity = parseIdentity(manifest, source, release);
26497
26522
  return {
26498
26523
  schemaVersion: 1,
26499
- repository: RELEASE_REPOSITORY,
26500
- source: parseSource(manifest.source),
26501
- workflow: RELEASE_SIGNER_WORKFLOW,
26502
- release: parseRelease(manifest.release, expected),
26524
+ ...identity,
26525
+ source,
26526
+ release,
26503
26527
  artifacts: parseArtifacts(manifest.artifacts, expected.component)
26504
26528
  };
26505
26529
  }
@@ -26989,11 +27013,11 @@ function githubAttestationVerificationArguments(request) {
26989
27013
  "--bundle",
26990
27014
  request.bundlePath,
26991
27015
  "--repo",
26992
- RELEASE_REPOSITORY,
27016
+ request.manifest.repository,
26993
27017
  "--signer-workflow",
26994
- RELEASE_SIGNER_WORKFLOW,
27018
+ request.manifest.workflow,
26995
27019
  "--source-ref",
26996
- RELEASE_SOURCE_REF,
27020
+ request.manifest.source.ref,
26997
27021
  "--source-digest",
26998
27022
  request.manifest.source.commit,
26999
27023
  "--deny-self-hosted-runners",
@@ -27036,13 +27060,27 @@ async function downloadReleaseMetadata(component, version, directory) {
27036
27060
  rmSync2(metadataPath, { force: true });
27037
27061
  }
27038
27062
  }
27039
- async function downloadManifestAttestation(manifestPath, destination) {
27063
+ function manifestAttestationDownloadUrl(release, manifest, manifestDigest) {
27064
+ if (manifest.repository === RELEASE_REPOSITORY) {
27065
+ return `${ATTESTATIONS_API}/sha256:${manifestDigest}`;
27066
+ }
27067
+ if (manifest.repository === LEGACY_EDGE_RUNTIME_RELEASE_IDENTITY.repository) {
27068
+ return releaseAssetUrl(release, RELEASE_ATTESTATION_NAME);
27069
+ }
27070
+ throw new Error("Release manifest repository is not supported");
27071
+ }
27072
+ async function downloadManifestAttestation(request) {
27073
+ const { release, manifest, manifestPath, destination } = request;
27040
27074
  const responsePath = `${destination}.response`;
27041
27075
  try {
27042
- await downloadDirect(`${ATTESTATIONS_API}/sha256:${sha256File(manifestPath)}`, responsePath, RELEASE_BUNDLE_SIZE_LIMITS.attestation);
27043
- const bundles = serializeAttestationBundles(parseJsonFile(responsePath, "GitHub attestation response"));
27044
- writeFileSync2(destination, bundles, { mode: 384, flag: "wx" });
27045
- chmodSync2(destination, 384);
27076
+ await downloadDirect(manifestAttestationDownloadUrl(release, manifest, sha256File(manifestPath)), responsePath, RELEASE_BUNDLE_SIZE_LIMITS.attestation);
27077
+ if (manifest.repository === RELEASE_REPOSITORY) {
27078
+ const bundles = serializeAttestationBundles(parseJsonFile(responsePath, "GitHub attestation response"));
27079
+ writeFileSync2(destination, bundles, { mode: 384, flag: "wx" });
27080
+ chmodSync2(destination, 384);
27081
+ } else {
27082
+ renameSync(responsePath, destination);
27083
+ }
27046
27084
  } finally {
27047
27085
  rmSync2(responsePath, { force: true });
27048
27086
  }
@@ -27053,7 +27091,7 @@ async function downloadComponent(request) {
27053
27091
  const attestationPath = directChildPath(request.destination, RELEASE_ATTESTATION_NAME);
27054
27092
  await downloadDirect(releaseAssetUrl(release, RELEASE_MANIFEST_NAME), manifestPath, RELEASE_BUNDLE_SIZE_LIMITS.manifest);
27055
27093
  const manifest = parseReleaseManifest(readFileSync3(manifestPath, "utf8"), request);
27056
- await downloadManifestAttestation(manifestPath, attestationPath);
27094
+ await downloadManifestAttestation({ release, manifest, manifestPath, destination: attestationPath });
27057
27095
  await verifyManifestAttestation({
27058
27096
  artifactPath: manifestPath,
27059
27097
  bundlePath: attestationPath,
@@ -32116,7 +32154,7 @@ Actions: list_releases, get_release, upload_release, activate_release`, {
32116
32154
  // package.json
32117
32155
  var package_default = {
32118
32156
  name: "@supacloud/admin",
32119
- version: "0.15.2",
32157
+ version: "0.15.3",
32120
32158
  description: "Platform administration CLI for SupaCloud operators",
32121
32159
  type: "module",
32122
32160
  main: "./dist/index.js",
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/admin",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "Platform administration CLI for SupaCloud operators",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",