mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -05:00
fix(frontend): do not hardcode example.org, do not prebuild motd
The motd.md is user-supplied and should therefore not be prebuild during the HedgeDoc build process. As that required the presence of the base URL which is also not available in the build context, it fell back to our fallback value example.org, thus breaking offline builds. By removing the example.org domains and disabling the prebuild for the motd, this seems fixed. Co-authored-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
1f1231a730
commit
9cbd78f622
2 changed files with 9 additions and 5 deletions
|
@ -1,9 +1,10 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2024 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { defaultConfig } from '../../../api/common/default-config'
|
||||
import { isBuildTime } from '../../../utils/test-modes'
|
||||
|
||||
export interface MotdApiResponse {
|
||||
motdText: string
|
||||
|
@ -18,6 +19,9 @@ export interface MotdApiResponse {
|
|||
* @return A promise that gets resolved if the motd was fetched successfully.
|
||||
*/
|
||||
export const fetchMotd = async (baseUrl: string): Promise<MotdApiResponse | undefined> => {
|
||||
if (isBuildTime) {
|
||||
return
|
||||
}
|
||||
const motdUrl = `${baseUrl}public/motd.md`
|
||||
const response = await fetch(motdUrl, {
|
||||
...defaultConfig
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2024 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -56,9 +56,9 @@ export class BaseUrlFromEnvExtractor {
|
|||
public extractBaseUrls(): BaseUrls {
|
||||
if (isBuildTime) {
|
||||
return {
|
||||
editor: 'https://example.org/',
|
||||
renderer: 'https://example.org/',
|
||||
internalApiUrl: 'https://example.org/'
|
||||
editor: '',
|
||||
renderer: '',
|
||||
internalApiUrl: ''
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue