CluPilotCloud/app/Console/Commands
nexxo 006ce3568b Manage hostnames and watch their certificates from the console
files.clupilot.com is why this exists. DNS pointed at the right machine, the
env var was set, the release was deployed — and there was still no certificate,
because /etc/caddy/Caddyfile is maintained by hand and nobody thought of it as a
second, separate step. Nothing in the console would have said so. Three settings
looked correct and the address did not answer.

So the page holds two things side by side. The WISH — which names should be
served — and the REALITY: whether the name has a certificate and for how much
longer. The second is measured by opening a TLS connection and reading the
expiry, not by reading configuration, because the configuration is exactly what
looked right while the address was dead. verify_peer stays on: a certificate
that fails validation is not a certificate for this question, and a display that
called it valid would be the fake R19 records.

Applying goes through the existing agent, not a new channel. The console writes
a request, the path unit wakes the agent within a second, and the agent calls one
fixed command line of the root-owned helper.

What that helper is allowed to do is the careful part. It fetches the list
ITSELF rather than being handed one, and the list is HOSTNAMES, never Caddy
blocks — `php artisan clupilot:proxy-hosts` prints `<name> <purpose>` and nothing
else. Each name is matched against a strict pattern before it is used, and the
template around it lives in the helper, which the service account cannot touch.
install-agent.sh already states the principle for the sudoers grant: a grant is
only worth anything if the holder cannot change what it grants. A service account
that could write proxy configuration would have everything the proxy can do —
redirects anywhere, files from any directory.

Purpose is a column rather than a habit. A console name gets the network lock,
a public one does not, and a console name published without it looks exactly
like a working page.

Removing takes the name out of the list and NOT out of the running proxy. Two
decisions in one click, and the second one takes a site off the air.

There is deliberately no "renew" button. Caddy renews on its own at two thirds
of the lifetime; what an operator actually needs is a second attempt after an
issuance has failed, and that is a reload — which is what Apply does. Thirty days
is treated as a problem rather than a warning: at ninety days' lifetime, a
renewal should long since have run, so anything under it is not a tight
certificate but a renewal that is not happening.

The ACME contact falls back to the owner's address, because a contact nobody
reads is the step before expired customer certificates.

CONTRACT and HOST_STEP_NEEDS both move to 2, which is what tells a server
carrying the older helper to run the installer again — caught by the guard test
that compares the two halves.

2035 tests pass, assets build.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 22:55:55 +02:00
..
ApplyDuePlanChanges.php Book a downgrade for a date that cannot move, and sell a module once 2026-07-29 17:51:37 +02:00
ApplyStorageQuotas.php Fix nine defects in the provisioning pipelines 2026-07-30 01:34:55 +02:00
ArchiveUnexportedInvoices.php Let the export have as many destinations as somebody wants 2026-07-29 02:43:15 +02:00
AutoUpdate.php Update on a schedule if the owner wants one, and say where incidents go 2026-07-29 15:01:54 +02:00
CheckDnsZone.php Put customer instances on their own domain, and say which domains are ours 2026-07-29 16:03:13 +02:00
CheckPlanCatalogue.php feat(billing): the plan catalogue becomes three tables, and config stops selling 2026-07-26 12:05:56 +02:00
ConsoleAccess.php Make the private hostnames look like nothing is there, and close the way past the proxy 2026-07-27 11:26:48 +02:00
CreateAdmin.php Check users directly for the reverse operator-identity collision, not just customers 2026-07-28 15:36:29 +02:00
EndCancelledAddons.php Bill a booked module every month, and put it on the invoice 2026-07-29 20:22:02 +02:00
EndDueServices.php Restart a machine, enforce the quota that was sold, end a route that ended 2026-07-29 18:28:28 +02:00
FetchInboundMail.php Read the support mailbox into the console 2026-07-29 21:41:29 +02:00
ProxyHostList.php Manage hostnames and watch their certificates from the console 2026-07-30 22:55:55 +02:00
PruneDormantAccounts.php Accept terms instead of a start date, and fix the sender no server accepts 2026-07-30 15:22:35 +02:00
PruneExportFolders.php Let a destination say how it is laid out and how long anything stays 2026-07-29 03:08:27 +02:00
PruneHostDns.php Move host DNS names off the public zone into vpn-dns's internal hostsdir 2026-07-28 23:44:31 +02:00
PruneUnverifiedAccounts.php Discard an unconfirmed registration, and sweep the abandoned ones 2026-07-30 14:08:02 +02:00
PublishProcessingAgreement.php Stop asking for a signature the law does not want, and lay out the tab 2026-07-30 17:30:55 +02:00
RepriceStripeSubscriptions.php Stop charging VAT to the customers who owe us none 2026-07-30 02:15:41 +02:00
SampleServiceStatus.php Rebuild the status page as a status page 2026-07-29 12:45:18 +02:00
SweepOrphanStripePrices.php Name the recurring filter, and stop the spec contradicting itself 2026-07-30 19:24:18 +02:00
SyncStripeCatalogue.php Merge main into the host-takeover branch 2026-07-30 21:21:45 +02:00
SyncStripeSubscriptions.php Bill a booked module every month, and put it on the invoice 2026-07-29 20:22:02 +02:00
VerifyCustomDomains.php Serve the custom domain, not just announce it 2026-07-29 16:44:52 +02:00
VerifyVatIds.php Stop charging for a service that has ended 2026-07-30 00:52:19 +02:00