CluPilotCloud/tests/Feature/Admin
nexxo 903ebdd2b2 Give the operator one line to copy and three steps around it
The console could describe a takeover it had no way to start. This is the
vertical slice that closes that: a one-time code, the archive the rescue system
fetches, and the page that says what to do with both.

The command carries EVERYTHING the script needs before the tunnel exists,
because there is nothing to fetch — that is the whole point of spec §5. Which
means CluPilot generates the WireGuard keypair and admits the peer at the hub
before the machine has ever booted, and hands the private half over in the line.
It is worthless within minutes: task 9 of the script replaces it with one
generated on the machine.

Shown exactly once. The database holds only the code's hash and never the
private key, so leaving the page does not bring it back — it mints a new code,
which invalidates the old one. That is deliberate: a glance at somebody's screen
should be worth nothing an hour later.

Which is also why save() no longer redirects. Sending the operator to the host
detail page sends them away from the only value they need, and an existing test
asserted that redirect — it now asserts the opposite, with the reason written
next to it.

SHA-256 rather than bcrypt for the code, and the reason is not speed. Both
endpoints have to FIND the host by the code; with bcrypt that means trying every
row. The code is 32 characters of CSPRNG output, so it has the entropy that
stretching exists to manufacture.

resolve() and claim() are separate because progress reports arrive BEFORE
registration. If reporting consumed the code, a host could never register after
its first message.

The archive URL is always the public hostname. The console runs under admin.…,
but this line executes on a machine that must not reach the admin area — it is
locked down for exactly that reason — so route() from the console would emit a
hostname that 404s on a server only reachable through the provider's console.

The page warns about missing tunnel settings BEFORE the host is created, not
after. An empty hub key produces a line that looks clean, copies fine, runs, and
ends in a tunnel that never handshakes — discovered on the machine, after
somebody has already paid for it.

The three steps lead with the rescue system, because that is the one nobody
knows by heart, and it says enabling is not the same as booting into it — the
script refuses a running production machine, which is what a half-done switch
looks like from the inside.

1986 tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 20:40:19 +02:00
..
AdminConsoleTest.php Send a guest bounced off the console to the console's own sign-in 2026-07-28 13:32:05 +02:00
AdminHostRestrictionTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
AdminSettingsTest.php Check users directly for the reverse operator-identity collision, not just customers 2026-07-28 15:36:29 +02:00
BroadcastAuthTest.php Authorize the console's live feed on the operator guard, not the default 2026-07-28 13:31:50 +02:00
CapacityQueueTest.php Fix nine defects in the provisioning pipelines 2026-07-30 01:34:55 +02:00
ConsoleHostSeparationTest.php Match the logout exemption through AdminArea, not a bare route check 2026-07-28 15:27:06 +02:00
ConsoleNetworkTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
ConsoleReportsRealDataTest.php Merge main into the operating-mode branch 2026-07-30 17:53:20 +02:00
CustomerDetailTabsTest.php Put the open tab in the address bar, including the first one 2026-07-29 23:46:13 +02:00
CustomerRevenueTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
DatacenterTest.php Let a datacenter code be corrected while nothing depends on it, and say which building 2026-07-28 22:25:21 +02:00
EditCustomerTest.php Take the address by field, fix the customer type, ask why they leave 2026-07-30 16:41:32 +02:00
EnvFileEditorTest.php Add a raw .env editor to the Integrations page, with a net under it 2026-07-29 01:51:27 +02:00
EnvRestartTest.php Let the customer buy it themselves, and tab the integrations page 2026-07-29 19:42:28 +02:00
GrantPlanTest.php Grant a package or module from the customer's row in the console 2026-07-29 12:42:21 +02:00
HostCapacityTest.php Warn that a package cannot be placed, before somebody pays for it 2026-07-29 18:20:51 +02:00
HostManagementTest.php Give the operator one line to copy and three steps around it 2026-07-30 20:40:19 +02:00
HostTakeoverPageTest.php Give the operator one line to copy and three steps around it 2026-07-30 20:40:19 +02:00
HostVpnStateTest.php Read VPN host state from the synced peer table, not a live hub call 2026-07-29 00:18:21 +02:00
InboundMailTest.php Read the mailbox password where it actually is, and let the console test it 2026-07-30 13:12:29 +02:00
IncidentConsoleTest.php Rebuild the status page as a status page 2026-07-29 12:45:18 +02:00
IncidentDeleteTest.php Let an incident be deleted, and start measuring whether the hosts answer 2026-07-29 15:16:48 +02:00
InstanceAdminAccessTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
IntegrationsPageTest.php Name the server variable under a credential, not the internal key 2026-07-30 13:20:29 +02:00
MailPreviewTest.php Accept terms instead of a start date, and fix the sender no server accepts 2026-07-30 15:22:35 +02:00
MailRegisterTest.php Stop inventing a package, and rebuild the booking page 2026-07-30 14:29:22 +02:00
MailTemplateTest.php Say that a click landed, and make moving one actually move it 2026-07-29 23:06:30 +02:00
MaintenanceTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
OperatorLogoutTest.php Stop the console logout from destroying a shared portal session 2026-07-28 13:58:42 +02:00
OperatorModelTest.php Give the people who run CluPilot a table of their own 2026-07-28 09:20:54 +02:00
OperatorTwoFactorEnrollmentTest.php Give the two-factor page a way back, and a shape 2026-07-28 22:25:42 +02:00
OperatorTwoFactorPolicyTest.php Move operator two-factor enrolment off admin.settings onto its own page 2026-07-28 15:11:20 +02:00
PasswordConfirmationGuardTest.php Merge credentials and infrastructure into one Integrations page 2026-07-29 01:49:39 +02:00
PlanAdminTest.php Sell the year as well as the month, and say what it saves 2026-07-30 15:44:35 +02:00
ProvisioningActionsTest.php Fix nine defects in the provisioning pipelines 2026-07-30 01:34:55 +02:00
RbacMoveTest.php Deliver the processing agreement, and hold the proof it was accepted 2026-07-30 16:56:57 +02:00
RbacTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
RevenueGrantedTest.php Skip the invoice for a full gift, keep it out of revenue, hide its price 2026-07-29 12:41:32 +02:00
SecretCipherTest.php Make isUsable() apply the same 32-byte rule encrypter() does 2026-07-28 05:09:09 +02:00
SecretVaultTest.php Make source() respect strict entries like get() does 2026-07-30 11:21:07 +02:00
ServiceInvoiceTest.php Write an invoice for work that came off no price list 2026-07-29 20:12:26 +02:00
SettingsTabsTest.php Put the open tab in the address bar, including the first one 2026-07-29 23:46:13 +02:00
UpdateButtonTest.php Show that the update is running, and stop showing the rsync log 2026-07-29 20:33:02 +02:00
UpdateWindowTest.php Update on a schedule if the owner wants one, and say where incidents go 2026-07-29 15:01:54 +02:00
VpnTest.php Replace native confirm() dialogs with the app's own modal pattern 2026-07-28 19:34:27 +02:00