mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 03:27:05 -04:00
Extend config with various options from 1.x
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
18c6694bcb
commit
286575315e
13 changed files with 686 additions and 32 deletions
24
src/config/csp-config.ts
Normal file
24
src/config/csp-config.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as Joi from 'joi';
|
||||
|
||||
export interface CspConfig {
|
||||
enable: boolean;
|
||||
maxAgeSeconds: number;
|
||||
includeSubdomains: boolean;
|
||||
preload: boolean;
|
||||
}
|
||||
|
||||
export const cspSchema = Joi.object({
|
||||
enable: Joi.boolean().default(true).optional(),
|
||||
reportURI: Joi.string().optional(),
|
||||
});
|
||||
|
||||
export const appConfigCsp = {
|
||||
enable: process.env.HD_CSP_ENABLE || true,
|
||||
reportURI: process.env.HD_CSP_REPORTURI,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue