feat(api): derive stable placeholder names for hidden profiles (#3224)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-05 16:57:25 +02:00
1 parent 02c82f0038
commit 3093e7334b
30 files changed
+629 -65

No files matched your search

+14
View File
@@ -143,6 +143,7 @@ function defaultConfig(): MasterConfig {
auth: {
sudo_mode_secret: '',
connection_initiation_secret: '',
profile_pseudonym_secret: '',
sso_allow_private_addresses: false,
passkeys: {
rp_name: 'Fluxer',
@@ -302,6 +303,18 @@ function requireString(value: string | undefined, envName: string): void {
}
}
const DEVELOPMENT_PROFILE_PSEUDONYM_SECRET = 'fluxer-dev-profile-pseudonym-secret';
function applyProfilePseudonymSecret(config: MasterConfig): void {
if (config.auth.profile_pseudonym_secret.trim().length > 0) {
return;
}
if (config.env === 'production') {
throw new Error('FLUXER_PROFILE_PSEUDONYM_SECRET is required');
}
config.auth.profile_pseudonym_secret = DEVELOPMENT_PROFILE_PSEUDONYM_SECRET;
}
function validateReplyToEmail(value: string): void {
if (value !== '' && !/^[^\s@<>,;"]+@[^\s@<>,;"]+$/.test(value)) {
throw new Error('FLUXER_EMAIL_REPLY_TO_EMAIL must be a single email address such as [email protected]');
@@ -600,6 +613,7 @@ function normalizeConfig(config: MasterConfig): MasterConfig {
}
requireString(config.auth.sudo_mode_secret, 'FLUXER_SUDO_MODE_SECRET');
requireString(config.auth.connection_initiation_secret, 'FLUXER_CONNECTION_INITIATION_SECRET');
applyProfilePseudonymSecret(config);
validateVapidConfig(config);
requireString(config.s3?.access_key_id, 'FLUXER_S3_ACCESS_KEY_ID');
requireString(config.s3?.secret_access_key, 'FLUXER_S3_SECRET_ACCESS_KEY');