feat: Web Push 비활성 운영 설정을 준비한다
VAPID private key를 Compose secret으로 주입하고 Web Push를 기본 비활성으로 전달한다. 활성화 입력과 Compose 모델 검증, 운영 README를 함께 추가한다.
This commit is contained in:
@@ -108,6 +108,25 @@ export const validateEnvironment = (env) => {
|
||||
errors.push('CORE_SSH_KNOWN_HOSTS_BASE64 must contain valid base64-encoded known_hosts data');
|
||||
}
|
||||
|
||||
const webPushEnabled = env.WEB_PUSH_ENABLED?.trim() === 'true';
|
||||
if (env.WEB_PUSH_ENABLED && !['true', 'false'].includes(env.WEB_PUSH_ENABLED.trim())) {
|
||||
errors.push('WEB_PUSH_ENABLED must be true or false');
|
||||
}
|
||||
if (webPushEnabled) {
|
||||
const subject = env.WEB_PUSH_VAPID_SUBJECT?.trim() ?? '';
|
||||
const publicKey = env.WEB_PUSH_VAPID_PUBLIC_KEY?.trim() ?? '';
|
||||
const privateKeyFile = env.WEB_PUSH_VAPID_PRIVATE_KEY_FILE?.trim() ?? '';
|
||||
if (!/^(?:mailto:|https:\/\/)/i.test(subject) || isPlaceholder(subject)) {
|
||||
errors.push('WEB_PUSH_VAPID_SUBJECT must be a non-placeholder mailto: or HTTPS contact');
|
||||
}
|
||||
if (!publicKey || isPlaceholder(publicKey)) {
|
||||
errors.push('WEB_PUSH_VAPID_PUBLIC_KEY is required when Web Push is enabled');
|
||||
}
|
||||
if (!privateKeyFile || isPlaceholder(privateKeyFile) || privateKeyFile.endsWith('.example')) {
|
||||
errors.push('WEB_PUSH_VAPID_PRIVATE_KEY_FILE is required when Web Push is enabled');
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user