diff --git a/.config/docker_example.yml b/.config/docker_example.yml index 0a21f2032..b16a44f6b 100644 --- a/.config/docker_example.yml +++ b/.config/docker_example.yml @@ -199,5 +199,7 @@ signToActivityPubGet: true # '127.0.0.1/32' #] +#customMOTD: ['Hello World', 'The sharks rule all', 'Shonks'] + # Upload or download file size limits (bytes) #maxFileSize: 262144000 diff --git a/.config/example.yml b/.config/example.yml index 7cd710f25..219688aa1 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -214,6 +214,8 @@ signToActivityPubGet: true # '127.0.0.1/32' #] +#customMOTD: ['Hello World', 'The sharks rule all', 'Shonks'] + # Upload or download file size limits (bytes) #maxFileSize: 262144000 diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index b25554b22..dceeac469 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -85,6 +85,8 @@ type Source = { proxyRemoteFiles?: boolean; videoThumbnailGenerator?: string; + customMOTD?: string[]; + signToActivityPubGet?: boolean; perChannelMaxNoteCacheCount?: number; @@ -142,6 +144,7 @@ export type Config = { deliverJobMaxAttempts: number | undefined; inboxJobMaxAttempts: number | undefined; proxyRemoteFiles: boolean | undefined; + customMOTD: string[] | undefined; signToActivityPubGet: boolean | undefined; version: string; @@ -248,6 +251,7 @@ export function loadConfig(): Config { deliverJobMaxAttempts: config.deliverJobMaxAttempts, inboxJobMaxAttempts: config.inboxJobMaxAttempts, proxyRemoteFiles: config.proxyRemoteFiles, + customMOTD: config.customMOTD, signToActivityPubGet: config.signToActivityPubGet, mediaProxy: externalMediaProxy ?? internalMediaProxy, externalMediaProxyEnabled: externalMediaProxy !== null && externalMediaProxy !== internalMediaProxy, diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index ea7bfd70b..aa696046e 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -178,6 +178,7 @@ export class ClientServerService { infoImageUrl: meta.infoImageUrl ?? 'https://launcher.moe/nothinghere.png', notFoundImageUrl: meta.notFoundImageUrl ?? 'https://launcher.moe/missingpage.webp', instanceUrl: this.config.url, + randomMOTD: this.config.customMOTD ? this.config.customMOTD[Math.floor(Math.random() * this.config.customMOTD.length)] : undefined, }; } diff --git a/packages/backend/src/server/web/style.css b/packages/backend/src/server/web/style.css index 952be9bf0..171827a52 100644 --- a/packages/backend/src/server/web/style.css +++ b/packages/backend/src/server/web/style.css @@ -44,7 +44,7 @@ html { display: inline-block; width: 28px; height: 28px; - transform: translateY(70px); + transform: translateY(80px); color: var(--accent); } #splashSpinner > .spinner { @@ -74,3 +74,17 @@ html { transform: rotate(360deg); } } + +#splashText { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + margin: auto; + display: inline-block; + width: 70%; + height: 0; + text-align: center; + transform: translateY(40px); +} diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 5e6f6cedd..c15e123a1 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -85,6 +85,9 @@ html | Please turn on your JavaScript div#splash img#splashIcon(src= icon || '/static-assets/splash.png') + span#splashText + block randomMOTD + = randomMOTD div#splashSpinner