mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
fix: enforce 32-character minimum length for APP_SECRET (#702)
* Enforce 32 characters minimum APP_SECRET length * update APP_SECRET comment
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
APP_URL=http://localhost:3000
|
APP_URL=http://localhost:3000
|
||||||
PORT=3000
|
PORT=3000
|
||||||
|
|
||||||
# make sure to replace this.
|
# minimum of 32 characters. Generate one with: openssl rand -hex 32
|
||||||
APP_SECRET=REPLACE_WITH_LONG_SECRET
|
APP_SECRET=REPLACE_WITH_LONG_SECRET
|
||||||
|
|
||||||
JWT_TOKEN_EXPIRES_IN=30d
|
JWT_TOKEN_EXPIRES_IN=30d
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
IsNotIn,
|
IsNotIn,
|
||||||
IsOptional,
|
IsOptional,
|
||||||
IsUrl,
|
IsUrl,
|
||||||
|
MinLength,
|
||||||
validateSync,
|
validateSync,
|
||||||
} from 'class-validator';
|
} from 'class-validator';
|
||||||
import { plainToInstance } from 'class-transformer';
|
import { plainToInstance } from 'class-transformer';
|
||||||
@@ -36,6 +37,7 @@ export class EnvironmentVariables {
|
|||||||
APP_URL: string;
|
APP_URL: string;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
|
@MinLength(32)
|
||||||
@IsNotIn(['REPLACE_WITH_LONG_SECRET'])
|
@IsNotIn(['REPLACE_WITH_LONG_SECRET'])
|
||||||
APP_SECRET: string;
|
APP_SECRET: string;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user