diff --git a/docs/demo.md b/docs/demo.md index bc59013..961a6d0 100644 --- a/docs/demo.md +++ b/docs/demo.md @@ -29,7 +29,8 @@ Turning `demo_signin` off ends every demo session at its next check. Demo sign-in lets in anyone who can reach the page. Use it only on an obs-beacond whose agents are the simulator. The sign-in providers you configure still work beside it, so you can sign in as yourself to change the -demo's settings. +demo's settings. They're folded under **Sign in as yourself**, so visitors +aren't invited to type real credentials into a demo. ## Shape of a demo host diff --git a/web/src/lib/SignIn.svelte b/web/src/lib/SignIn.svelte index 5e5ccbb..f87b402 100644 --- a/web/src/lib/SignIn.svelte +++ b/web/src/lib/SignIn.svelte @@ -20,6 +20,10 @@ const reason = $derived(MESSAGES[page.url.searchParams.get('signin') ?? ''] ?? ''); const back = $derived(page.url.pathname === '/' ? '' : '?return=' + encodeURIComponent(page.url.pathname + page.url.search)); + // On the demo, the ways to sign in as yourself are folded away, so + // visitors aren't invited to type real credentials (#45). + let yourself = $state(false); + const others = $derived(!demo || yourself); const redirects = $derived(providers.filter((p) => p.kind !== 'passkey')); const local = $derived(providers.find((p) => p.kind === 'passkey')); const passkey = $derived(local && local.passkeys !== false ? local : undefined); @@ -90,8 +94,14 @@ {#if demo}

This is the demo: a simulated enterprise of hosts, clusters, VMs, arrays and IBM i, failing in the ways real ones do. Look at anything, setup included; nothing you do changes it.

-

What Cairn OBS is

+

What Cairn OBS is

+ {#if providers.length && !yourself} + + {:else if providers.length} +
Sign in as yourself
+ {/if} {/if} + {#if others} {#each redirects as p (p.id)} {p.label} {#if p.note}

{p.note}

{/if} @@ -109,6 +119,7 @@ {/if} + {/if} {#if !providers.length && !demo}

No sign-in provider is configured.

{/if} {#if dev}
@@ -134,7 +145,10 @@ .dev p { font-size: 12px; color: var(--muted-fg); margin: 0 0 10px; } .err { color: var(--critical); font-size: 13px; } .demo { font-size: 13.5px; line-height: 1.55; text-align: center; margin: 0 0 6px; } - .fine a { color: inherit; } + .more { text-align: center; margin: 2px 0 6px; font-size: 13.5px; } + .more a { color: var(--primary); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--primary) 40%, transparent); } + .more a:hover { text-decoration-color: var(--primary); } + .yours { justify-self: center; height: 32px; font-size: 12.5px; color: var(--muted-fg); margin-top: 6px; background: none; } .or { display: flex; align-items: center; gap: 10px; color: var(--muted-fg); font-size: 12px; margin: 6px 0; } .or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--border); } .pw { display: grid; gap: 10px; }