mirror of
https://github.com/immich-app/immich.git
synced 2025-11-25 12:00:42 +09:00
feat(server): add IP trust list for reverse proxy (#11286)
* feat(server): add IP trust list for reverse proxy Signed-off-by: hitech95 <nicveronese@gmail.com> * feat(docs): add documentation of `IMMICH_TRUSTED_PROXIES` env Signed-off-by: hitech95 <nicveronese@gmail.com> --------- Signed-off-by: hitech95 <nicveronese@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import { CronExpression } from '@nestjs/schedule';
|
||||
import { QueueOptions } from 'bullmq';
|
||||
import { Request, Response } from 'express';
|
||||
import { RedisOptions } from 'ioredis';
|
||||
import Joi from 'joi';
|
||||
import Joi, { Root } from 'joi';
|
||||
import { CLS_ID, ClsModuleOptions } from 'nestjs-cls';
|
||||
import { ImmichHeader } from 'src/dtos/auth.dto';
|
||||
import { ConcurrentQueueName, QueueName } from 'src/interfaces/job.interface';
|
||||
@@ -388,6 +388,20 @@ export const immichAppConfig: ConfigModuleOptions = {
|
||||
IMMICH_API_METRICS_PORT: Joi.number().optional(),
|
||||
IMMICH_MICROSERVICES_METRICS_PORT: Joi.number().optional(),
|
||||
|
||||
IMMICH_TRUSTED_PROXIES: Joi.extend((joi: Root) => ({
|
||||
type: 'stringArray',
|
||||
base: joi.array(),
|
||||
coerce: (value) => (value.split ? value.split(',') : value),
|
||||
}))
|
||||
.stringArray()
|
||||
.single()
|
||||
.items(
|
||||
Joi.string().ip({
|
||||
version: ['ipv4', 'ipv6'],
|
||||
cidr: 'optional',
|
||||
}),
|
||||
),
|
||||
|
||||
IMMICH_METRICS: Joi.boolean().optional().default(false),
|
||||
IMMICH_HOST_METRICS: Joi.boolean().optional().default(false),
|
||||
IMMICH_API_METRICS: Joi.boolean().optional().default(false),
|
||||
|
||||
Reference in New Issue
Block a user