mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 13:35:42 +09:00
refactor(self-hosting): forward every setting, drop dead config (#3047)
This commit is contained in:
1 parent
39f9beda5a
commit
2b8a743dc5
96 files changed
+1743
-2391
No files matched your search
@@ -1,6 +1,12 @@
|
||||
import {readEnvValue} from '@fluxer/config/src/config_loader/EnvironmentOverrides';
|
||||
|
||||
export function readOptionalEnv(name: string): string | undefined {
|
||||
return readEnvValue(process.env, name);
|
||||
}
|
||||
|
||||
export function readOptionalIntegerEnv(name: string): number | undefined {
|
||||
const raw = process.env[name]?.trim();
|
||||
if (raw === undefined || raw === '') return undefined;
|
||||
const raw = readOptionalEnv(name)?.trim();
|
||||
if (raw === undefined) return undefined;
|
||||
const value = Number(raw);
|
||||
if (!/^-?\d+$/.test(raw) || !Number.isSafeInteger(value)) {
|
||||
throw new Error(`${name} must be a safe integer`);
|
||||
|
||||
Reference in new issue
Block a user