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>
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
import { storeJson } from '../fileModels/storeJson'
|
||||
import { i18n } from '../i18n'
|
||||
import { sdk } from '../sdk'
|
||||
|
||||
export const showRegistryApiKeys = sdk.Action.withoutInput(
|
||||
// id
|
||||
'show-registry-api-keys',
|
||||
|
||||
// metadata
|
||||
async ({ effects }) => ({
|
||||
name: i18n('Show Registry API Keys'),
|
||||
description: i18n(
|
||||
'Display the stored REGISTRY_API_KEY and SUBSD_API_KEY used by registry-server. Returns blanks if Create Registry API Keys has not been run yet.',
|
||||
),
|
||||
warning: null,
|
||||
allowedStatuses: 'any',
|
||||
group: null,
|
||||
visibility: 'enabled',
|
||||
}),
|
||||
|
||||
// run
|
||||
async ({ effects }) => {
|
||||
const [registryApiKey, subsdApiKey] = await Promise.all([
|
||||
storeJson.read((s) => s.registryApiKey).once(),
|
||||
storeJson.read((s) => s.subsdApiKey).once(),
|
||||
])
|
||||
|
||||
const ready =
|
||||
!!registryApiKey &&
|
||||
!!subsdApiKey &&
|
||||
registryApiKey.length > 0 &&
|
||||
subsdApiKey.length > 0 &&
|
||||
registryApiKey !== subsdApiKey
|
||||
|
||||
return {
|
||||
version: '1',
|
||||
title: i18n('Show Registry API Keys'),
|
||||
message: ready
|
||||
? i18n(
|
||||
'Paste SUBSD_API_KEY into subs Settings → Registry Server → Auth Token. Use REGISTRY_API_KEY as the Bearer token for POST /register clients.',
|
||||
)
|
||||
: i18n(
|
||||
'No valid registry API keys are stored yet. Run Create Registry API Keys first (both keys must be non-empty and different).',
|
||||
),
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user