1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-21 18:16:55 +02:00

refactor(server): move host env to config repo (#13507)

* refactor(server): access host through repository

* refactor(server): access host through repository
This commit is contained in:
Jason Rasmussen 2024-10-16 18:12:13 -04:00 committed by GitHub
parent e8015dc7d7
commit 51d4899cd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import { VectorExtension } from 'src/interfaces/database.interface';
export const IConfigRepository = 'IConfigRepository';
export interface EnvData {
host?: string;
port: number;
environment: ImmichEnvironment;
configFile?: string;

View File

@ -50,6 +50,7 @@ export class ConfigRepository implements IConfigRepository {
};
return {
host: process.env.IMMICH_HOST,
port: Number(process.env.IMMICH_PORT) || 2283,
environment,
configFile: process.env.IMMICH_CONFIG_FILE,

View File

@ -15,8 +15,6 @@ import { isStartUpError } from 'src/services/storage.service';
import { otelStart } from 'src/utils/instrumentation';
import { useSwagger } from 'src/utils/misc';
const host = process.env.HOST;
function parseTrustedProxy(input?: string) {
if (!input) {
return [];
@ -36,7 +34,7 @@ async function bootstrap() {
const logger = await app.resolve<ILoggerRepository>(ILoggerRepository);
const configRepository = app.get<IConfigRepository>(IConfigRepository);
const { environment, port, resourcePaths } = configRepository.getEnv();
const { environment, host, port, resourcePaths } = configRepository.getEnv();
const isDev = environment === ImmichEnvironment.DEVELOPMENT;
logger.setContext('Bootstrap');