Build Service / BuildPackage (push) Canceled after 0s
Update to upstream Spaces 0.3.0 and refresh bundled images (subs v0.1.2c, certrelay v0.2.8, nacho v1.0.0b). Add Create/Show Registry API Keys for registry-server, remove Configure Subspaces and SUBS_PUBLISH_REQUIRE_FINALIZED, and align README/instructions with the new tags. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import { createRegistryApiKeys } from '../actions/createRegistryApiKeys'
|
|
import { storeJson } from '../fileModels/storeJson'
|
|
import { i18n } from '../i18n'
|
|
import { sdk } from '../sdk'
|
|
|
|
// registry-server refuses to start without both keys (and they must differ).
|
|
// Only prompt when Subspaces is enabled so installs that leave it off are not
|
|
// blocked; enabling Subspaces without keys surfaces this critical task.
|
|
export const taskRegistryApiKeys = sdk.setupOnInit(async (effects) => {
|
|
const store = await storeJson.read().once()
|
|
if (store?.enableSubspaces !== true) return
|
|
|
|
const registryApiKey = store?.registryApiKey
|
|
const subsdApiKey = store?.subsdApiKey
|
|
const ready =
|
|
!!registryApiKey &&
|
|
!!subsdApiKey &&
|
|
registryApiKey.length > 0 &&
|
|
subsdApiKey.length > 0 &&
|
|
registryApiKey !== subsdApiKey
|
|
if (ready) return
|
|
|
|
await sdk.action.createOwnTask(effects, createRegistryApiKeys, 'critical', {
|
|
reason: i18n(
|
|
'Subspaces registry-server requires REGISTRY_API_KEY and SUBSD_API_KEY before it can start',
|
|
),
|
|
})
|
|
})
|