2022-02-03 17:06:44 +01:00
|
|
|
import { ConfigModuleOptions } from '@nestjs/config';
|
|
|
|
import Joi from 'joi';
|
|
|
|
|
|
|
|
export const immichAppConfig: ConfigModuleOptions = {
|
|
|
|
envFilePath: '.env',
|
|
|
|
isGlobal: true,
|
|
|
|
validationSchema: Joi.object({
|
|
|
|
NODE_ENV: Joi.string().required().valid('development', 'production', 'staging').default('development'),
|
|
|
|
DB_USERNAME: Joi.string().required(),
|
|
|
|
DB_PASSWORD: Joi.string().required(),
|
2022-02-03 21:42:27 +01:00
|
|
|
DB_DATABASE_NAME: Joi.string().required(),
|
2022-02-03 17:06:44 +01:00
|
|
|
JWT_SECRET: Joi.string().required(),
|
2022-03-10 23:09:03 +01:00
|
|
|
ENABLE_MAPBOX: Joi.boolean().required().valid(true, false),
|
|
|
|
MAPBOX_KEY: Joi.any().when('ENABLE_MAPBOX', {
|
2022-03-19 16:42:32 +01:00
|
|
|
is: false,
|
|
|
|
then: Joi.string().optional().allow(null, ''),
|
|
|
|
otherwise: Joi.string().required(),
|
2022-03-10 23:09:03 +01:00
|
|
|
}),
|
2022-09-13 19:09:57 +02:00
|
|
|
LOG_LEVEL: Joi.string().optional().valid('simple', 'verbose').default('simple'),
|
2022-02-03 17:06:44 +01:00
|
|
|
}),
|
|
|
|
};
|