feat(license): the paste form is self-hosted only
Server Deploy / deploy (push) Successful in 2m14s

A cloud instance's licence is issued in HQ and written into the control
plane by admin/internal/inject, straight to the database. The customer has
nothing to paste, so /settings/license offered them a form that could only
ever fail — and on an expired cloud instance, failed at the exact moment
they were looking for a way out.

GET /license now reports `deployment`, and the page swaps the paste form
for a short panel saying where the licence comes from, with a link to the
portal when HQ_URL is set. That is the same treatment hq-managed members
already get in the members table: read-only here, and a pointer to where
it is actually managed.

POST /license refuses with 409 cloud_managed on a cloud deployment. Hiding
a form is a courtesy; this codebase's rule is that the API is the boundary,
and the endpoint was reachable regardless of what the page rendered. It
cannot break injection, which never goes through HTTP at all.

Verified: server builds and vets clean, web builds clean.
This commit is contained in:
mrhid6
2026-07-26 20:42:53 +01:00
parent fa75d70475
commit dd306e4757
4 changed files with 50 additions and 0 deletions
+2
View File
@@ -808,6 +808,8 @@ export interface LicenseInfo {
features: Record<string, boolean>;
usage: { servers: number; secret_groups: number; channels: number };
source: string;
/** "cloud" | "self_hosted". A cloud instance's licence is managed in HQ. */
deployment: string;
}
// `request` already prefixes /api, so these paths do not repeat it.