Phase 13, part 6: each team's Core
On the server and multi-tenant editions a team's admin enters its Core's domain and account under Settings → Core & Hermes, instead of core.conf; Hermes connects from the team's side with an agent's key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+19
-9
@@ -143,8 +143,8 @@ func (s *Server) dashboard(w http.ResponseWriter, r *http.Request) {
|
||||
Detail: inventorySummary(counts)},
|
||||
{Label: "Social accounts", Done: len(s.postingAccounts()) > 0,
|
||||
Link: "/settings/accounts", Detail: s.connectionSummary(conns)},
|
||||
{Label: "Federated Core", Done: s.Core != nil, Link: "/settings/core",
|
||||
Detail: ifElse(s.Core != nil, coreDomain(s.Core), "No Core found; run `configure core` in CoreDesktop")},
|
||||
{Label: "Federated Core", Done: s.core() != nil, Link: "/settings/core",
|
||||
Detail: ifElse(s.core() != nil, coreDomain(s.core()), "No Core found; run `configure core` in CoreDesktop")},
|
||||
{Label: "Hermes bridge", Done: last != nil, Link: "/settings/core",
|
||||
Detail: ifElse(last != nil, "Last check-in "+ago(atOf(last)), "Hermes hasn't checked in yet")},
|
||||
}
|
||||
@@ -248,16 +248,22 @@ type coreData struct {
|
||||
Prompt string
|
||||
HermesConfig string
|
||||
HermesEnv string
|
||||
Server bool // the server editions: the Core is entered here, Hermes uses an agent key
|
||||
Problem string
|
||||
}
|
||||
|
||||
func (s *Server) corePage(w http.ResponseWriter, r *http.Request) {
|
||||
s.renderCore(w, r, "")
|
||||
}
|
||||
|
||||
func (s *Server) renderCore(w http.ResponseWriter, r *http.Request, problem string) {
|
||||
last, err := bridge.Last(s.DB)
|
||||
if err != nil {
|
||||
s.serverError(w, err)
|
||||
return
|
||||
}
|
||||
d := coreData{
|
||||
Core: s.Core,
|
||||
Core: s.core(),
|
||||
MCPURL: "http://127.0.0.1:" + publicPort(s.PublicURL) + "/mcp",
|
||||
MCPToken: s.MCPToken,
|
||||
MCPSocket: s.MCPSocket,
|
||||
@@ -265,9 +271,9 @@ func (s *Server) corePage(w http.ResponseWriter, r *http.Request) {
|
||||
Prompt: bridge.CheckinPrompt,
|
||||
}
|
||||
hub := "https://mcphub.<your Core's domain>/sse?as_user=<your user name>"
|
||||
if s.Core != nil {
|
||||
d.User = s.Core.User()
|
||||
hub = s.Core.MCPHubURL()
|
||||
if s.core() != nil {
|
||||
d.User = s.core().User()
|
||||
hub = s.core().MCPHubURL()
|
||||
}
|
||||
d.HubURL = hub
|
||||
d.HermesConfig = `mcp_servers:
|
||||
@@ -280,7 +286,11 @@ func (s *Server) corePage(w http.ResponseWriter, r *http.Request) {
|
||||
command: socat
|
||||
args: ["STDIO", "UNIX-CONNECT:` + d.MCPSocket + `"]`
|
||||
d.HermesEnv = `MCPHUB_AUTH=<your own hub token from your Core: the part after "Basic ">`
|
||||
s.render(w, r, "core", page{Title: "Core & Hermes", Nav: "settings/core", Data: d})
|
||||
d.Server, d.Problem = s.signsIn(), problem
|
||||
if d.Server {
|
||||
d.MCPURL = s.mcpURL()
|
||||
}
|
||||
s.render(w, r, "core", page{Title: "Core & Hermes", Nav: "settings/core", Error: problem, Data: d})
|
||||
}
|
||||
|
||||
func publicPort(u string) string {
|
||||
@@ -334,11 +344,11 @@ func probe(ctx context.Context, svc core.Service) serviceCheck {
|
||||
// coreChecks asks each Core service whether it answers. It's an htmx
|
||||
// fragment, loaded after the page so a slow service doesn't hold it up.
|
||||
func (s *Server) coreChecks(w http.ResponseWriter, r *http.Request) {
|
||||
if s.Core == nil {
|
||||
if s.core() == nil {
|
||||
s.fragment(w, r, "core", "checks", nil)
|
||||
return
|
||||
}
|
||||
services := s.Core.Services()
|
||||
services := s.core().Services()
|
||||
checks := make([]serviceCheck, len(services))
|
||||
var wg sync.WaitGroup
|
||||
for i, svc := range services {
|
||||
|
||||
Reference in New Issue
Block a user