mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-01-23 01:06:05 +00:00
AppConfig: Move default for rendererOrigin to config file
As we only use rendererOrigin in the frontend config service, where domain will be used if it is not defined, it makes more sense to move this default behavior to the app config directly. That makes it easier to understand what this variable contains and that it defaults to domain. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
0c2900d1c0
commit
8bf5aa77e3
2 changed files with 5 additions and 4 deletions
|
@ -20,7 +20,10 @@ export interface AppConfig {
|
|||
|
||||
const schema = Joi.object({
|
||||
domain: Joi.string().label('HD_DOMAIN'),
|
||||
rendererOrigin: Joi.string().optional().label('HD_RENDERER_ORIGIN'),
|
||||
rendererOrigin: Joi.string()
|
||||
.default(Joi.ref('domain'))
|
||||
.optional()
|
||||
.label('HD_RENDERER_ORIGIN'),
|
||||
port: Joi.number().default(3000).optional().label('PORT'),
|
||||
loglevel: Joi.string()
|
||||
.valid(...Object.values(Loglevel))
|
||||
|
|
|
@ -133,9 +133,7 @@ export class FrontendConfigService {
|
|||
private getIframeCommunication(): IframeCommunicationDto {
|
||||
return {
|
||||
editorOrigin: new URL(this.appConfig.domain),
|
||||
rendererOrigin: this.appConfig.rendererOrigin
|
||||
? new URL(this.appConfig.rendererOrigin)
|
||||
: new URL(this.appConfig.domain),
|
||||
rendererOrigin: new URL(this.appConfig.rendererOrigin),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue