feat(server): support IPv6 Redis instances

This enables automatic family affinity by using `0`, which overwrites
ioredis' default set to `4`. With this change, Immich will be able to
connect to Redis exposed only via IPv6.

Users will still be able to overwrite the default with `REDIS_IP_FAMILY`
or by adding `?family=4` to `REDIS_URL`.
This commit is contained in:
Szymon Łągiewka 2025-10-11 20:17:38 +02:00
parent 8fe54a4de1
commit 718878cad0
No known key found for this signature in database
4 changed files with 20 additions and 11 deletions

View file

@ -1,5 +1,5 @@
import { Transform, Type } from 'class-transformer';
import { IsEnum, IsInt, IsString, Matches } from 'class-validator';
import { IsEnum, IsIn, IsInt, IsString, Matches } from 'class-validator';
import { DatabaseSslMode, ImmichEnvironment, LogLevel } from 'src/enum';
import { IsIPRange, Optional, ValidateBoolean } from 'src/validation';
@ -195,4 +195,9 @@ export class EnvDto {
@IsString()
@Optional()
REDIS_URL?: string;
@IsIn([0, 4, 6])
@Optional()
@Type(() => Number)
REDIS_IP_FAMILY?: 0 | 4 | 6;
}