Hub 2.11.0: ports checked on both servers before an install; frp config on each server's page
- A new install reserves candidate ports, asks the central and church servers which are free (probe-ports), and runs on the first pair free on both (3 rounds, then called off). - Each server's page reads and changes frps's / frpc's config (agent 1.4.0): secrets stay on the server, two-factor, verify, backup, restart, put back if frp doesn't start. - Alerts name the config file the agent uses; a missing config gets its own alert. - Vendors contracts 1.15.0. Migration 20261121110000_server_frp_config. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ const FILTERS = [
|
||||
{ key: "cancelled", label: "Cancelled" },
|
||||
];
|
||||
|
||||
const TYPES = ["", "install", "add-product", "deploy", "adopt", "adopt-undo", "export", "uninstall", "purge", "seed-demo", "env-read", "env-set", "restart", "status", "check-ports", "update-agent"];
|
||||
const TYPES = ["", "install", "add-product", "deploy", "adopt", "adopt-undo", "export", "uninstall", "purge", "seed-demo", "env-read", "env-set", "restart", "status", "check-ports", "probe-ports", "frp-read", "frp-write", "update-agent"];
|
||||
const PRODUCTS = [{ key: "", label: "Every product" }, { key: "events", label: "Cross Events" }, { key: "accounts", label: "Accounts" }];
|
||||
|
||||
/** Every job sent to a server's agent, newest first, a page at a time (§11: the full report is on each job). */
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ago, bytes, fmtDate } from "@/lib/format";
|
||||
import { useServerPaged } from "@/lib/paging";
|
||||
import { Loading, Message, PageTitle, Pager } from "@/components/ui";
|
||||
import { PercentChart, ServersNav, StatusPill, pct, type Deployment, type Job, type ServerSummary } from "@/components/servers";
|
||||
import { FrpConfig, type FrpState } from "@/components/FrpConfig";
|
||||
|
||||
type Msg = { type: "ok" | "err"; text: string } | null;
|
||||
type Detail = {
|
||||
@@ -20,6 +21,7 @@ type Detail = {
|
||||
jobs: Job[];
|
||||
alerts: { id: string; type: string; level: string; message: string; createdAt: string; resolvedAt: string | null }[];
|
||||
ports: { port: number; role: string; note: string | null; releasedAt: string | null }[];
|
||||
frp: FrpState;
|
||||
};
|
||||
|
||||
/** The settings a church server's jobs need (§5); others can be added. */
|
||||
@@ -125,7 +127,8 @@ export default function ServerPage() {
|
||||
<p className="mt-2">{s.versions?.os}</p>
|
||||
<p>Node {s.versions?.node} · PostgreSQL {s.versions?.postgres || "–"} · frpc {s.versions?.frpc || "–"}</p>
|
||||
{s.mode === "church" && <p>frpc {s.frpcRunning === null ? "unknown" : s.frpcRunning ? "running" : <b className="text-red-700">not running</b>}</p>}
|
||||
{s.central && <p>frps.ini: proxy_bind_addr {s.central.proxyBindAddr || <b className="text-red-700">not set</b>}, allow_ports {s.central.allowPorts || "any"}</p>}
|
||||
{s.frpConfigPath !== undefined && <p>{s.mode === "central" ? "frps" : "frpc"} config: {s.frpConfigPath ? <span className="font-mono">{s.frpConfigPath}</span> : <b className="text-red-700">not found</b>}</p>}
|
||||
{s.central && <p>proxy_bind_addr {s.central.proxyBindAddr || <b className="text-red-700">not set</b>}, allow_ports {s.central.allowPorts || "any"}</p>}
|
||||
</div>
|
||||
<div className="card space-y-2 text-sm">
|
||||
<h2 className="font-medium">Actions</h2>
|
||||
@@ -138,6 +141,8 @@ export default function ServerPage() {
|
||||
|
||||
{s.mode === "church" && <ConfigEditor key={JSON.stringify(d.config)} id={s.id} config={d.config} onSaved={m => { setMsg(m); load(); }} />}
|
||||
|
||||
{d.frp && <FrpConfig serverId={s.id} agentVersion={s.agentVersion} frp={d.frp} onChange={m => { setMsg(m); load(); }} />}
|
||||
|
||||
{s.mode === "church" && (
|
||||
<div className="card overflow-x-auto">
|
||||
<h2 className="font-medium">Sites on this server</h2>
|
||||
|
||||
@@ -51,9 +51,14 @@ export default function InstallsPage() {
|
||||
setBusy(true);
|
||||
setMsg(null);
|
||||
try {
|
||||
const r = await api<{ deployment: Deployment; warnings: string[]; alsoInstalling?: { product: string; domain: string; version: string } }>("/api/admin/deployments", { method: "POST", body: { ...form, version: form.version || undefined, accountsDomain: form.accountsDomain || undefined } });
|
||||
const r = await api<{ deployment: Deployment; warnings: string[]; checkingPorts?: boolean; alsoInstalling?: { product: string; domain: string; version: string } }>("/api/admin/deployments", { method: "POST", body: { ...form, version: form.version || undefined, accountsDomain: form.accountsDomain || undefined } });
|
||||
// Hub 2.5.0: Cross Events 3.x for a church without Accounts installs Accounts first.
|
||||
const notes = [...(r.alsoInstalling ? [`Accounts ${r.alsoInstalling.version} is installed first at ${r.alsoInstalling.domain}; Cross Events follows when it has finished.`] : []), ...r.warnings];
|
||||
const notes = [
|
||||
// Hub 2.11.0: the ports are checked on the central server and this one first.
|
||||
...(r.checkingPorts ? ["The ports are being checked on the central server and this server first; the install starts on ports free on both (about a minute)."] : []),
|
||||
...(r.alsoInstalling ? [`Accounts ${r.alsoInstalling.version} is installed first at ${r.alsoInstalling.domain}; Cross Events follows when it has finished.`] : []),
|
||||
...r.warnings,
|
||||
];
|
||||
router.push(`/servers/installs/${r.deployment.id}${notes.length ? `?warn=${encodeURIComponent(notes.join(" "))}` : ""}`);
|
||||
} catch (err) { setMsg({ type: "err", text: errorText(err) }); }
|
||||
setBusy(false);
|
||||
|
||||
Reference in New Issue
Block a user