@le-space/ui 0.6.36 → 0.6.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/ui",
3
- "version": "0.6.36",
3
+ "version": "0.6.37",
4
4
  "description": "Floating Aleph Relay Button UI components for Svelte and React.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -44,8 +44,8 @@
44
44
  "url": "https://github.com/NiKrause/relay-button/issues"
45
45
  },
46
46
  "dependencies": {
47
- "@le-space/browser": "0.6.36",
48
- "@le-space/core": "0.6.36",
47
+ "@le-space/browser": "0.6.37",
48
+ "@le-space/core": "0.6.37",
49
49
  "viem": "^2.53.1"
50
50
  },
51
51
  "peerDependencies": {
package/react/index.d.ts CHANGED
@@ -147,6 +147,15 @@ interface RootfsManifest {
147
147
  version: string;
148
148
  rootfsInstallStrategy?: 'thin' | 'prebaked' | string;
149
149
  requiresBootstrapNetwork?: boolean;
150
+ /**
151
+ * When true, the guest fetches its own bootstrap configuration from the
152
+ * Aleph aggregate (using the deployment token embedded in its SSH key)
153
+ * instead of the browser pushing it to the guest's plain-HTTP setup
154
+ * endpoint. Required to deploy from an HTTPS origin at all: a HTTPS page
155
+ * cannot call `http://<vm-ip>:<port>/configure` (mixed content).
156
+ * Images that predate the guest-side fetch must leave this unset.
157
+ */
158
+ supportsBootstrapConfigAggregate?: boolean;
150
159
  bootstrapSummary?: string;
151
160
  requiredPortForwards?: RootfsRequiredPortForward[];
152
161
  rootfsItemHash: string;
package/react/index.js CHANGED
@@ -43,7 +43,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
43
43
  var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
44
44
 
45
45
  // src/shared/package-version.ts
46
- var UI_PACKAGE_VERSION = "0.6.36";
46
+ var UI_PACKAGE_VERSION = "0.6.37";
47
47
 
48
48
  // src/shared/format.ts
49
49
  function shortHash(value, head = 8, tail = 6) {
@@ -2343,7 +2343,6 @@ async function configureOrbitdbRelaySetup2(args) {
2343
2343
  quic_port: args.quicPort ?? void 0,
2344
2344
  bootstrap_publisher_private_key: args.bootstrapPublisherPrivateKey ?? void 0,
2345
2345
  bootstrap_publisher_libp2p_identity_hex: args.bootstrapPublisherLibp2pIdentityHex ?? void 0,
2346
- bootstrap_owner_private_key: args.bootstrapOwnerPrivateKey ?? void 0,
2347
2346
  bootstrap_owner_authorization_b64: args.bootstrapOwnerAuthorizationBase64 ?? void 0,
2348
2347
  bootstrap_registration_id: args.bootstrapRegistrationId ?? void 0,
2349
2348
  no_start: args.noStart === true ? true : void 0
@@ -3924,6 +3923,10 @@ function deploymentProfileForManifest(manifest) {
3924
3923
  if (manifest?.profile === "ucan-store") return "ucan-store";
3925
3924
  return null;
3926
3925
  }
3926
+ function usesBootstrapConfigAggregate(manifest) {
3927
+ if (deploymentProfileForManifest(manifest) === "uc-go-peer") return true;
3928
+ return manifest?.supportsBootstrapConfigAggregate === true;
3929
+ }
3927
3930
  function bootstrapRelayProfileForManifest(manifest) {
3928
3931
  const profile = deploymentProfileForManifest(manifest);
3929
3932
  if (profile === "uc-go-peer" || profile === "orbitdb-relay") {
@@ -4348,7 +4351,12 @@ var SponsorRelayController = class {
4348
4351
  );
4349
4352
  }
4350
4353
  let bootstrapSignalRelayMetadata = null;
4351
- if (profile === "orbitdb-relay") {
4354
+ if (profile === "orbitdb-relay" && !usesBootstrapConfigAggregate(this.state.manifest)) {
4355
+ if (globalThis.location?.protocol === "https:") {
4356
+ throw new Error(
4357
+ `This rootfs image requires the browser to configure the guest over plain HTTP (http://${runtimeHostIpv4}:${setupPort}/configure), which a page served over HTTPS cannot do (mixed content). Deploy from an HTTP origin, or use a rootfs image that supports the Aleph bootstrap config handoff (manifest: supportsBootstrapConfigAggregate).`
4358
+ );
4359
+ }
4352
4360
  this.emitProgress({
4353
4361
  stage: "deployment-confirmed",
4354
4362
  label: "Configuring relay",
@@ -5449,7 +5457,7 @@ var SponsorRelayController = class {
5449
5457
  try {
5450
5458
  const profile = deploymentProfileForManifest(this.state.manifest);
5451
5459
  attemptProfile = profile;
5452
- const sshPublicKey = profile === "uc-go-peer" ? appendDeploymentTokenToSshPublicKey(
5460
+ const sshPublicKey = usesBootstrapConfigAggregate(this.state.manifest) ? appendDeploymentTokenToSshPublicKey(
5453
5461
  this.state.sshPublicKey.trim(),
5454
5462
  this.state.wallet.address,
5455
5463
  attemptDeploymentToken = createDeploymentToken()
package/shared/index.d.ts CHANGED
@@ -145,6 +145,15 @@ interface RootfsManifest {
145
145
  version: string;
146
146
  rootfsInstallStrategy?: 'thin' | 'prebaked' | string;
147
147
  requiresBootstrapNetwork?: boolean;
148
+ /**
149
+ * When true, the guest fetches its own bootstrap configuration from the
150
+ * Aleph aggregate (using the deployment token embedded in its SSH key)
151
+ * instead of the browser pushing it to the guest's plain-HTTP setup
152
+ * endpoint. Required to deploy from an HTTPS origin at all: a HTTPS page
153
+ * cannot call `http://<vm-ip>:<port>/configure` (mixed content).
154
+ * Images that predate the guest-side fetch must leave this unset.
155
+ */
156
+ supportsBootstrapConfigAggregate?: boolean;
148
157
  bootstrapSummary?: string;
149
158
  requiredPortForwards?: RootfsRequiredPortForward$1[];
150
159
  rootfsItemHash: string;
@@ -332,7 +341,7 @@ declare const STALE_INSTANCE_ALLOCATION_COOLDOWN_MS: number;
332
341
  declare const RECENT_INSTANCE_RUNTIME_GRACE_MS: number;
333
342
  declare const DEPLOYMENT_PENDING_WARNING_MS: number;
334
343
 
335
- declare const UI_PACKAGE_VERSION = "0.6.36";
344
+ declare const UI_PACKAGE_VERSION = "0.6.37";
336
345
 
337
346
  interface RootfsRequiredPortForward {
338
347
  port: number;
package/shared/index.js CHANGED
@@ -42,7 +42,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
42
42
  var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
43
43
 
44
44
  // src/shared/package-version.ts
45
- var UI_PACKAGE_VERSION = "0.6.36";
45
+ var UI_PACKAGE_VERSION = "0.6.37";
46
46
 
47
47
  // src/shared/format.ts
48
48
  function shortHash(value, head = 8, tail = 6) {
@@ -2342,7 +2342,6 @@ async function configureOrbitdbRelaySetup2(args) {
2342
2342
  quic_port: args.quicPort ?? void 0,
2343
2343
  bootstrap_publisher_private_key: args.bootstrapPublisherPrivateKey ?? void 0,
2344
2344
  bootstrap_publisher_libp2p_identity_hex: args.bootstrapPublisherLibp2pIdentityHex ?? void 0,
2345
- bootstrap_owner_private_key: args.bootstrapOwnerPrivateKey ?? void 0,
2346
2345
  bootstrap_owner_authorization_b64: args.bootstrapOwnerAuthorizationBase64 ?? void 0,
2347
2346
  bootstrap_registration_id: args.bootstrapRegistrationId ?? void 0,
2348
2347
  no_start: args.noStart === true ? true : void 0
@@ -3923,6 +3922,10 @@ function deploymentProfileForManifest(manifest) {
3923
3922
  if (manifest?.profile === "ucan-store") return "ucan-store";
3924
3923
  return null;
3925
3924
  }
3925
+ function usesBootstrapConfigAggregate(manifest) {
3926
+ if (deploymentProfileForManifest(manifest) === "uc-go-peer") return true;
3927
+ return manifest?.supportsBootstrapConfigAggregate === true;
3928
+ }
3926
3929
  function bootstrapRelayProfileForManifest(manifest) {
3927
3930
  const profile = deploymentProfileForManifest(manifest);
3928
3931
  if (profile === "uc-go-peer" || profile === "orbitdb-relay") {
@@ -4347,7 +4350,12 @@ var SponsorRelayController = class {
4347
4350
  );
4348
4351
  }
4349
4352
  let bootstrapSignalRelayMetadata = null;
4350
- if (profile === "orbitdb-relay") {
4353
+ if (profile === "orbitdb-relay" && !usesBootstrapConfigAggregate(this.state.manifest)) {
4354
+ if (globalThis.location?.protocol === "https:") {
4355
+ throw new Error(
4356
+ `This rootfs image requires the browser to configure the guest over plain HTTP (http://${runtimeHostIpv4}:${setupPort}/configure), which a page served over HTTPS cannot do (mixed content). Deploy from an HTTP origin, or use a rootfs image that supports the Aleph bootstrap config handoff (manifest: supportsBootstrapConfigAggregate).`
4357
+ );
4358
+ }
4351
4359
  this.emitProgress({
4352
4360
  stage: "deployment-confirmed",
4353
4361
  label: "Configuring relay",
@@ -5448,7 +5456,7 @@ var SponsorRelayController = class {
5448
5456
  try {
5449
5457
  const profile = deploymentProfileForManifest(this.state.manifest);
5450
5458
  attemptProfile = profile;
5451
- const sshPublicKey = profile === "uc-go-peer" ? appendDeploymentTokenToSshPublicKey(
5459
+ const sshPublicKey = usesBootstrapConfigAggregate(this.state.manifest) ? appendDeploymentTokenToSshPublicKey(
5452
5460
  this.state.sshPublicKey.trim(),
5453
5461
  this.state.wallet.address,
5454
5462
  attemptDeploymentToken = createDeploymentToken()