Files
ilkerandClaude Opus 5 5d398c9429 hpcod: sign up on the site, and nobody gets in until someone says so
The front page asked people to send an email, which is not a process - it
is a hope that somebody reads their inbox. Anyone can register now, nobody
is let in by registering, and an administrator decides.

Accounts move from the htpasswd-style file into the database, because a
file read once at startup cannot take a registration. The file stays as
the bootstrap: an account in it is an administrator, which is how the
portal is brought up at all, and someone who can write that file has the
machine anyway.

The safety rests on two column defaults rather than on care in a handler.
A new row is 'pending' and is not an administrator, and the signup INSERT
names neither column - so no mistake in the code above can produce a live
account. The handler checks anyway and disables anything that comes back
usable, which is for the day someone changes the defaults.

What the tests pin down, because these are the parts that would be quietly
wrong:

  - a registration yields state=pending, is_admin=false, no decision
  - a pending or disabled account cannot sign in, even with the right password
  - a wrong password says exactly what it says for an unknown username, so
    the "awaiting approval" message cannot be used to find out who exists
  - only a verified password ever gets a specific reason
  - approving does not also grant administrator rights; they are separate
    decisions and conflating them is how someone gets more than was meant
  - an administrator cannot decide on their own account, which would either
    do nothing or lock the last one out
  - the admin page 404s for a signed-in non-admin rather than 403, and its
    link is not rendered for them either
  - the password column refuses anything that is not a bcrypt hash, so a
    caller that forgot to hash cannot store a plaintext password
  - a decision without a name is refused by a CHECK, because an audit trail
    with holes in it is not one

The password hash is not a field on Account. Everything that renders an
account would carry it; only the code comparing a password has a reason to
see it, so only that call returns it.

hpcod account is the way in when the portal is not: the first administrator
has to come from somewhere, and an operator who has locked themselves out
still has a shell.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 08:13:34 +02:00

83 lines
3.9 KiB
HTML

{{define "welcome.html"}}<!doctype html>
<html lang="en"><head>{{template "head" .}}
<title>HPC on Demand</title>
<meta name="description" content="Private HPC clusters, built on request and returned when the work is done.">
<style>
.hero{padding:56px 0 40px;border-bottom:1px solid var(--rule);margin-bottom:34px}
.hero h1{font-size:34px;line-height:1.15;max-width:18ch;margin:0 0 14px}
.hero p{font-size:16px;color:var(--muted);max-width:56ch;margin:0 0 24px}
.cta{display:inline-block;background:var(--accent);color:#fff;text-decoration:none;
border-radius:4px;padding:10px 20px;font-weight:600}
.cta:hover{filter:brightness(1.08)}
.cta.ghost{background:transparent;color:var(--accent);border:1px solid var(--accent);margin-left:8px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;margin-bottom:34px}
.grid h3{font-size:14px;margin:0 0 6px}
.grid p{margin:0;color:var(--muted);font-size:13.5px}
ol.steps{counter-reset:s;list-style:none;padding:0;margin:0}
ol.steps li{counter-increment:s;position:relative;padding:0 0 16px 38px;margin:0}
ol.steps li:before{content:counter(s);position:absolute;left:0;top:0;width:24px;height:24px;
border-radius:50%;background:var(--accent-soft);color:var(--accent);font-family:var(--mono);
font-size:12px;font-weight:600;display:grid;place-items:center}
ol.steps strong{display:block;font-weight:600}
ol.steps span{color:var(--muted);font-size:13.5px}
footer{border-top:1px solid var(--rule);margin-top:40px;padding-top:16px;
color:var(--muted);font-size:12.5px}
</style>
</head>
<body>
<main>
<div class="hero">
<h1>A cluster of your own, for as long as the work takes.</h1>
<p>Ask for the machine your job needs. It is built on hardware that can
actually run it, it is yours alone while you have it, and it goes back
when you are done — so the next person can have the hardware.</p>
<a class="cta" href="/login">Sign in</a>
<a class="cta ghost" href="/signup">Request access</a>
</div>
<div class="grid">
<div class="card"><div class="card-b">
<h3>Yours, not shared</h3>
<p>Your own scheduler, your own network, your own login node. Nobody
else's job queues behind yours and nobody else sees your data.</p>
</div></div>
<div class="card"><div class="card-b">
<h3>The hardware you asked for</h3>
<p>Say you need GPUs or a fast fabric and the cluster is placed on a
machine that has them. If nothing can satisfy the request, you are
told why rather than handed something that will not run.</p>
</div></div>
<div class="card"><div class="card-b">
<h3>Software that travels</h3>
<p>Applications arrive as signed containers and run unprivileged, so
what you test is what runs on every node.</p>
</div></div>
<div class="card"><div class="card-b">
<h3>A browser is enough</h3>
<p>Submit jobs, watch them, open a shell or a desktop from the web
portal. Plain SSH still works if you prefer it.</p>
</div></div>
</div>
<h2>How it works</h2>
<ol class="steps">
<li><strong>Describe the work</strong><span>How many nodes, how much
memory, which applications, and how long you need them.</span></li>
<li><strong>It is placed</strong><span>The control plane finds hardware
that meets the requirement and reserves it, so two requests cannot be
promised the same card.</span></li>
<li><strong>It is built</strong><span>Scheduler, shared storage,
applications and the portal, ready to use.</span></li>
<li><strong>It is returned</strong><span>At the end of the lease the
cluster is released and the hardware goes back into the pool. Ask for
more time before then and the lease is extended.</span></li>
</ol>
<footer>
Operators sign in above. This page is the only part of the portal that is
public, and it deliberately says nothing about what the estate is running.
</footer>
</main>
</body></html>
{{end}}