Make onboarding tour install-wide instead of per-browser

Persist onboardingCompleted flag server-side via /api/v1/config so the
tour only auto-starts once per DashCaddy installation, not on every
new browser that connects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 21:58:10 -07:00
parent 2d1944fd55
commit 063bf948b1
5 changed files with 56 additions and 8 deletions

View File

@@ -35,9 +35,10 @@ const SITE = {
configurationType: (_cachedCfg && _cachedCfg.configurationType) || 'homelab',
domain: (_cachedCfg && _cachedCfg.domain) || '',
defaults: (_cachedCfg && _cachedCfg.defaults) || {},
routingMode: (_cachedCfg && _cachedCfg.routingMode) || 'subdomain'
routingMode: (_cachedCfg && _cachedCfg.routingMode) || 'subdomain',
onboardingCompleted: false
};
(async function loadSiteConfig() {
window.__dashcaddySiteConfigLoaded = (async function loadSiteConfig() {
try {
const r = await fetch('/api/v1/config');
if (r.ok) {
@@ -56,6 +57,7 @@ const SITE = {
if (c.domain) SITE.domain = c.domain;
if (c.defaults) SITE.defaults = c.defaults;
if (c.routingMode) SITE.routingMode = c.routingMode;
SITE.onboardingCompleted = c.onboardingCompleted === true;
// Cache only non-sensitive display config (TLD, domain, routing mode)
// DNS IPs and server topology are NOT cached — fetched from API each load
localStorage.setItem('dashcaddy_site_config', JSON.stringify({