mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00: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:
parent
ea5d6780f2
commit
a3799b3053
3 changed files with 26 additions and 2 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue