diff --git a/backend/src/config/auth.config.ts b/backend/src/config/auth.config.ts index bbfd0b659..4e91965f1 100644 --- a/backend/src/config/auth.config.ts +++ b/backend/src/config/auth.config.ts @@ -221,15 +221,30 @@ export default registerAs('authConfig', () => { const gitlabNames = ( toArrayConfig(process.env.HD_AUTH_GITLABS, ',') ?? [] ).map((name) => name.toUpperCase()); + if (gitlabNames.length !== 0) { + throw new Error( + "GitLab auth is currently not yet supported. Please don't configure it", + ); + } const ldapNames = ( toArrayConfig(process.env.HD_AUTH_LDAP_SERVERS, ',') ?? [] ).map((name) => name.toUpperCase()); const samlNames = (toArrayConfig(process.env.HD_AUTH_SAMLS, ',') ?? []).map( (name) => name.toUpperCase(), ); + if (samlNames.length !== 0) { + throw new Error( + "SAML auth is currently not yet supported. Please don't configure it", + ); + } const oauth2Names = ( toArrayConfig(process.env.HD_AUTH_OAUTH2S, ',') ?? [] ).map((name) => name.toUpperCase()); + if (oauth2Names.length !== 0) { + throw new Error( + "OAuth2 auth is currently not yet supported. Please don't configure it", + ); + } const gitlabs = gitlabNames.map((gitlabName) => { return { @@ -334,6 +349,25 @@ export default registerAs('authConfig', () => { }; }); + if ( + process.env.HD_AUTH_GITHUB_CLIENT_ID !== undefined || + process.env.HD_AUTH_GITHUB_CLIENT_SECRET !== undefined + ) { + throw new Error( + "GitHub config is currently not yet supported. Please don't configure it", + ); + } + + if ( + process.env.HD_AUTH_GOOGLE_CLIENT_ID !== undefined || + process.env.HD_AUTH_GOOGLE_CLIENT_SECRET !== undefined || + process.env.HD_AUTH_GOOGLE_APP_KEY !== undefined + ) { + throw new Error( + "Google config is currently not yet supported. Please don't configure it", + ); + } + const authConfig = authSchema.validate( { session: { diff --git a/backend/src/config/csp.config.ts b/backend/src/config/csp.config.ts index 4b9ab222d..054058832 100644 --- a/backend/src/config/csp.config.ts +++ b/backend/src/config/csp.config.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -19,6 +19,15 @@ const cspSchema = Joi.object({ }); export default registerAs('cspConfig', () => { + if ( + process.env.HD_CSP_ENABLE !== undefined || + process.env.HD_CSP_REPORT_URI !== undefined + ) { + throw new Error( + "CSP config is currently not yet supported. Please don't configure it", + ); + } + const cspConfig = cspSchema.validate( { enable: process.env.HD_CSP_ENABLE || true, diff --git a/backend/src/config/external-services.config.ts b/backend/src/config/external-services.config.ts index 457e76d56..22d428c37 100644 --- a/backend/src/config/external-services.config.ts +++ b/backend/src/config/external-services.config.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -29,6 +29,11 @@ const schema = Joi.object({ }); export default registerAs('externalServicesConfig', () => { + if (process.env.HD_IMAGE_PROXY !== undefined) { + throw new Error( + "HD_IMAGE_PROXY is currently not yet supported. Please don't configure it", + ); + } const externalConfig = schema.validate( { plantUmlServer: process.env.HD_PLANTUML_SERVER, diff --git a/docs/content/references/config/integrations.md b/docs/content/references/config/integrations.md index 972351ffe..2dec515f6 100644 --- a/docs/content/references/config/integrations.md +++ b/docs/content/references/config/integrations.md @@ -3,4 +3,6 @@ | environment variable | default | example | description | |------------------------|---------|-------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------| | `HD_PLANTUML_SERVER` | - | `https://www.plantuml.com/plantuml` | The PlantUML server that HedgeDoc uses to render PlantUML diagrams. If this is not configured, PlantUML diagrams won't be rendered. | -| `HD_IMAGE_PROXY` | - | `https://image-proxy.example.com` | **ToDo:** Add description | + \ No newline at end of file