feat(setup): add a setup token for first-run setup (#3437)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-13 00:17:24 +02:00
1 parent 8e39380ee6
commit 78272521bb
135 files changed
+3045 -771

No files matched your search

+1
View File
@@ -301,6 +301,7 @@ export interface MasterConfig {
branding: InstanceBrandingConfig;
setup: {
configured: boolean;
token?: string;
};
account_identity: AccountIdentityModeName | null;
tag_style: TagStyleName | null;
@@ -50,6 +50,12 @@ describe('buildNamedFluxerEnvOverrides', () => {
).toEqual({});
});
test('maps the setup token onto the instance setup section', () => {
expect(buildNamedFluxerEnvOverrides({FLUXER_SETUP_TOKEN: 'a-setup-token-of-at-least-32-characters'})).toEqual({
instance: {setup: {token: 'a-setup-token-of-at-least-32-characters'}},
});
});
test('a blank canonical name falls through to its alias', () => {
expect(
buildNamedFluxerEnvOverrides({
@@ -288,6 +288,7 @@ const NAMED_FLUXER_ENV_OVERRIDES: Record<string, NamedEnvOverride> = {
FLUXER_APP_STATUS_PAGE_URL: {path: ['instance', 'branding', 'status_page_url']},
FLUXER_APP_STATUS_PAGE_INCIDENT_HISTORY_URL: {path: ['instance', 'branding', 'status_page_incident_history_url']},
FLUXER_INSTANCE_SETUP_CONFIGURED: {path: ['instance', 'setup', 'configured'], parse: parseBoolean},
FLUXER_SETUP_TOKEN: {path: ['instance', 'setup', 'token']},
FLUXER_ACCOUNT_IDENTITY: {path: ['instance', 'account_identity'], parse: parseAccountIdentity},
FLUXER_TAG_STYLE: {path: ['instance', 'tag_style'], parse: parseTagStyle},
FLUXER_DISCOVERY_ENABLED: {path: ['discovery', 'enabled'], parse: parseBoolean},