mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-28 15:20:46 +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
116aa5e022
commit
662d428e3c
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))
|
||||
|
|
|
@ -129,9 +129,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