diff --git a/site/app/start/page.tsx b/site/app/start/page.tsx index 269ca44..60dcda3 100644 --- a/site/app/start/page.tsx +++ b/site/app/start/page.tsx @@ -1,9 +1,9 @@ import type { Metadata } from "next"; -import { InstanceForm } from "@/components/InstanceForm"; +import { AccountForm } from "@/components/AccountForm"; export const metadata: Metadata = { title: "Vantage Cloud", - description: "An instance owns its servers, keys, workflows, monitors and secrets. Free for three servers, hosted or self-hosted.", + description: "Your account is where instances, licences and billing live. Free for three servers, hosted or self-hosted.", }; export default function StartPage() { @@ -12,14 +12,13 @@ export default function StartPage() {
Vantage Cloud -

Set up your instance.

+

Create your account.

- An instance owns its servers, keys, workflows, monitors and secrets. Nothing inside it is visible to any other instance. Confirm your email and it is created with you - as its owner. + Your account is where instances, licences and billing live. Confirm your email and you can create a free instance straight away — three servers, hosted by us.

- +
@@ -30,23 +29,21 @@ export default function StartPage() { FIRST

Confirm your email

-

We send a link that works once. Your instance is created when you open it, not before.

+

We send a link that works once. Your account is created when you open it, not before.

THEN
-

Add a key

-

- Paste the contents of ~/.ssh/id_ed25519.pub. Vantage fingerprints it and refuses duplicates. -

+

Create your instance

+

One click in the portal. It gets its own subdomain and a free licence, and you are its owner.

THEN
-

Add a server

-

Run the install command as root. It expires in an hour and works once.

+

Add a key and a server

+

Paste your public key, then run the install command as root. It expires in an hour and works once.

diff --git a/site/components/InstanceForm.tsx b/site/components/AccountForm.tsx similarity index 72% rename from site/components/InstanceForm.tsx rename to site/components/AccountForm.tsx index c736dc7..aea7a49 100644 --- a/site/components/InstanceForm.tsx +++ b/site/components/AccountForm.tsx @@ -2,20 +2,11 @@ import { useState } from "react"; import { Honeypot } from "@/components/Honeypot"; -import { submitSignup, type SubmitResult } from "@/lib/submit"; +import { submitAccountSignup, type SubmitResult } from "@/lib/submit"; const MIN_PASSWORD = 12; -function slugify(value: string) { - return value - .toLowerCase() - .trim() - .replace(/[^a-z0-9]+/g, "-") - .replace(/^-|-$/g, ""); -} - -export function InstanceForm() { - const [slug, setSlug] = useState(""); +export function AccountForm() { const [result, setResult] = useState({ state: "idle" }); const sending = result.state === "sending"; @@ -24,8 +15,8 @@ export function InstanceForm() { const data = new FormData(event.currentTarget); setResult({ state: "sending" }); setResult( - await submitSignup({ - instance_name: String(data.get("instance_name") ?? ""), + await submitAccountSignup({ + name: String(data.get("name") ?? ""), email: String(data.get("email") ?? ""), password: String(data.get("password") ?? ""), website: String(data.get("website") ?? ""), @@ -38,7 +29,7 @@ export function InstanceForm() {

Check your email.

- We sent a confirmation link. Open it and {slug || "your instance"} is created with you as its owner. The link works once and expires in 24 hours. + We sent a confirmation link. Open it and your Vantage account is ready — then you can create your first instance from the portal. The link works once and expires in 24 hours.

Nothing exists until you confirm if the email does not arrive, start again or contact support@hostxtra.co.uk. @@ -54,14 +45,11 @@ export function InstanceForm() {

- - setSlug(slugify(e.target.value))} aria-describedby="o-instance-err" /> - - {slug || "your-instance"}.vantage.hostxtra.co.uk - - {fieldError("instance_name") && ( - - {fieldError("instance_name")} + + + {fieldError("name") && ( + + {fieldError("name")} )}
diff --git a/site/lib/submit.ts b/site/lib/submit.ts index bfc5537..aa6ce43 100644 --- a/site/lib/submit.ts +++ b/site/lib/submit.ts @@ -9,6 +9,7 @@ */ const SITE_API = (process.env.NEXT_PUBLIC_SITE_API ?? "").replace(/\/$/, ""); +const ADMIN_API = (process.env.NEXT_PUBLIC_ADMIN_API_URL ?? "").replace(/\/$/, ""); const FALLBACK_ADDRESS = process.env.NEXT_PUBLIC_CONTACT_EMAIL ?? "support@hostxtra.co.uk"; export type SubmitState = "idle" | "sending" | "sent" | "error"; @@ -56,12 +57,23 @@ export async function submitContact(fields: { name: string; email: string; serve return post(`${SITE_API}/api/contact`, fields); } -export async function submitSignup(fields: { instance_name: string; email: string; password: string; website: string }): Promise { - if (!SITE_API) { +/* + * Account signup posts to the admin service, not sitesvc. The two form targets + * are deliberately separate variables rather than one base URL: contact and + * signup are owned by different services, and an implied shared host is how they + * silently end up pointing at the wrong one. + */ +export async function submitAccountSignup(fields: { + name: string; + email: string; + password: string; + website: string; +}): Promise { + if (!ADMIN_API) { return { state: "error", - message: `Signup is not available from here yet. Email ${FALLBACK_ADDRESS} and we will set you up.`, + message: `Signup is not connected yet. Email ${FALLBACK_ADDRESS} and we will set you up.`, }; } - return post(`${SITE_API}/api/signup`, fields); + return post(`${ADMIN_API}/auth/signup`, fields); }