(content: string)
| 30 | } |
| 31 | |
| 32 | const readEnvSecret = (content: string): string | undefined => { |
| 33 | for (const line of content.split(/\r?\n/)) { |
| 34 | const trimmed = line.trim() |
| 35 | if (!trimmed || trimmed.startsWith('#') || !trimmed.startsWith('SECRET=')) { |
| 36 | continue |
| 37 | } |
| 38 | |
| 39 | const [rawValue] = trimmed.slice('SECRET='.length).split('#', 1) |
| 40 | return rawValue.trim() |
| 41 | } |
| 42 | |
| 43 | return undefined |
| 44 | } |
| 45 | |
| 46 | const needsSecretReplacement = (secret: string | undefined): boolean => { |
| 47 | return !secret || secret === SECRET_PLACEHOLDER |