fix(home-server): default configuration variables

This commit is contained in:
Karol Sójko
2023-06-02 12:29:24 +02:00
parent 8237df33a7
commit e6e9a32f03
2 changed files with 15 additions and 15 deletions
-9
View File
@@ -2,15 +2,6 @@ LOG_LEVEL=debug
NODE_ENV=development
VERSION=development
# (Optional) New Relic Setup
NEW_RELIC_ENABLED=false
NEW_RELIC_APP_NAME="Home Server"
CACHE_TYPE=memory
DB_TYPE=sqlite
DB_DATABASE=home_server
JWT_SECRET=
AUTH_JWT_SECRET=
ENCRYPTION_SERVER_KEY=
+15 -6
View File
@@ -30,7 +30,16 @@ export class HomeServer implements HomeServerInterface {
const serviceContainer = new ServiceContainer()
const directCallDomainEventPublisher = new DirectCallDomainEventPublisher()
const env: Env = new Env(configuration?.environment)
const environmentOverrides = {
...configuration?.environment,
NEW_RELIC_ENABLED: 'false',
NEW_RELIC_APP_NAME: 'Home Server',
CACHE_TYPE: 'memory',
DB_TYPE: 'sqlite',
DB_DATABASE: 'home_server',
}
const env: Env = new Env(environmentOverrides)
env.load()
this.configureLoggers(env)
@@ -44,23 +53,23 @@ export class HomeServer implements HomeServerInterface {
const container = Container.merge(
(await apiGatewayService.getContainer({
logger: winston.loggers.get('api-gateway'),
environmentOverrides: configuration?.environment,
environmentOverrides,
})) as Container,
(await authService.getContainer({
logger: winston.loggers.get('auth-server'),
environmentOverrides: configuration?.environment,
environmentOverrides,
})) as Container,
(await syncingService.getContainer({
logger: winston.loggers.get('syncing-server'),
environmentOverrides: configuration?.environment,
environmentOverrides,
})) as Container,
(await revisionsService.getContainer({
logger: winston.loggers.get('revisions-server'),
environmentOverrides: configuration?.environment,
environmentOverrides,
})) as Container,
(await filesService.getContainer({
logger: winston.loggers.get('files-server'),
environmentOverrides: configuration?.environment,
environmentOverrides,
})) as Container,
)