Files
spacesopsandCursor 073344d4d1
Build Service / BuildPackage (push) Canceled after 0s
0.3.0:1
Group Actions and Config by category (Space-CLI, Bitcoin, Spaced,
Subspaces, Certrelay, Nacho) and build x86 + arm only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 03:34:34 -04:00

64 lines
2.1 KiB
TypeScript

import { storeJson } from '../fileModels/storeJson'
import { actionGroups } from '../actionGroups'
import { i18n } from '../i18n'
import { sdk } from '../sdk'
import { generateRegistryApiKeys } from '../utils'
export const createRegistryApiKeys = sdk.Action.withoutInput(
// id
'create-registry-api-keys',
// metadata
async ({ effects }) => ({
name: i18n('Create Registry API Keys'),
description: i18n(
'Generate (or rotate) REGISTRY_API_KEY and SUBSD_API_KEY for the embedded registry-server. Both are required and must differ. Put SUBSD_API_KEY in subs Settings → Registry Server → Auth Token. REGISTRY_API_KEY is for intake clients calling POST /register. Saving restarts the service so registry-server picks up the new keys.',
),
warning: null,
allowedStatuses: 'any',
group: actionGroups.subspacesRegistry,
visibility: 'enabled',
}),
// run
async ({ effects }) => {
const { registryApiKey, subsdApiKey } = generateRegistryApiKeys()
await storeJson.merge(effects, { registryApiKey, subsdApiKey })
return {
version: '1',
title: i18n('Success'),
message: i18n(
'Registry API keys saved. Paste SUBSD_API_KEY into subs Settings → Registry Server → Auth Token, then click Test. Use REGISTRY_API_KEY as the Bearer token for POST /register clients. The service is restarting so registry-server picks up the new keys.',
),
result: {
type: 'group',
value: [
{
type: 'single',
name: i18n('REGISTRY_API_KEY'),
description: i18n(
'Bearer secret for intake/POST /register clients.',
),
value: registryApiKey,
masked: true,
copyable: true,
qr: false,
},
{
type: 'single',
name: i18n('SUBSD_API_KEY'),
description: i18n(
'Paste into subs Settings → Registry Server → Auth Token (subs↔registry channel).',
),
value: subsdApiKey,
masked: true,
copyable: true,
qr: false,
},
],
},
}
},
)