adding added ad slot support for adddss

This commit is contained in:
legop3
2026-08-01 01:58:34 -04:00
parent 7fdcb53041
commit 3ebd1c7f9c
16 changed files with 198 additions and 73 deletions
@@ -9,6 +9,20 @@ const discordInvite = config.discord?.invite || null;
const kofiLink = config.kofi?.link || null;
const serverTimezone = config.timezone || null;
const configuredSocials = getConfiguredSocials(config);
/*
The driver ad is trusted deployment content supplied by the server operator.
Normalize both values at the server boundary so every browser receives a
predictable string-only contract, even when the YAML keys are absent or were
accidentally configured with another scalar type.
Keep the title and markup together because they describe one optional card.
An empty HTML string disables the card; the title alone must never leave an
empty panel at the bottom of the driver layout.
*/
const driverAd = {
title: typeof config.driverAd?.title === 'string' ? config.driverAd.title.trim() : '',
html: typeof config.driverAd?.html === 'string' ? config.driverAd.html.trim() : '',
};
const ACTIVITY_SYNC_COOLDOWN_MS = 3000;
const GPIO_TOGGLE_SYNC_COOLDOWN_MS = 1000;
@@ -19,6 +33,7 @@ module.exports = {
kofiLink,
serverTimezone,
configuredSocials,
driverAd,
ACTIVITY_SYNC_COOLDOWN_MS,
GPIO_TOGGLE_SYNC_COOLDOWN_MS,
PERIODIC_SYNC_MS,
@@ -61,6 +61,7 @@ const {
kofiLink,
serverTimezone,
configuredSocials,
driverAd,
ACTIVITY_SYNC_COOLDOWN_MS,
GPIO_TOGGLE_SYNC_COOLDOWN_MS,
PERIODIC_SYNC_MS,
@@ -209,6 +210,13 @@ function buildSession(socket) {
adminReason: getAdminReason(),
users,
socials,
/*
This is intentionally raw, operator-authored HTML. The browser only
mounts it on the desktop driver page, but keeping it in the ordinary
session payload makes the server configuration the single source of
truth and avoids a separate endpoint for one small optional card.
*/
driverAd,
discord: {
invite: discordInvite,
},