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:
2026-11-21 11:08:29 +02:00
co-authored by Claude Opus 5.5
parent 0aed4f72b3
commit 0acc61d4d8
18 changed files with 586 additions and 23 deletions
+6 -1
View File
@@ -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>