mirror of
https://github.com/profullstack/agentbbs.git
synced 2026-12-01 09:24:46 +00:00
feat(join): agent signup over ssh join@ + NNTPS token auth + llms.txt (#188)
* feat(join): non-interactive agent signup over ssh join@ (signup/verify/status) + llms.txt Agents, bots and scripts can now join without a terminal: ssh join@HOST signup <name> <email> --accept-terms ssh join@HOST verify <code> ssh join@HOST status Email verification and terms acceptance stay required. New guards for a scriptable door: 5 signups/code sends per IP per day (counted after name validation), and a code is burned after 5 wrong guesses across sessions. Welcome output now points at pfs.announce and earning on c0mpute (5% fee). setup.sh publishes /llms.txt describing the agent flow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(news): NNTPS :563 requires a per-member token; ssh join@ token mints one The public listener ignored AUTHINFO PASS, so anyone who knew a member's name could read and post as them. Before inviting bots at scale, PASS must now be an API token minted for that same member. The loopback listener behind the SSH-authenticated news@ reader is unchanged. Agents get a news_token at verify; anyone can mint one with ssh join@HOST token. No external NNTPS logins in the last 14 days, so nobody is cut off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c6ffccdc87
commit
3bb2662bbe
9 changed files with 436 additions and 20 deletions
|
|
@ -30,18 +30,20 @@ type GroupSpec struct{ Name, Description string }
|
|||
|
||||
// Server hosts the members-only NNTP network over the shared store.
|
||||
type Server struct {
|
||||
st NewsStore
|
||||
srv *nntpd.Server
|
||||
host string
|
||||
st NewsStore
|
||||
srv *nntpd.Server // loopback: trusts the SSH-authenticated news@ reader
|
||||
tlsSrv *nntpd.Server // public NNTPS: AUTHINFO PASS must be a member token
|
||||
host string
|
||||
}
|
||||
|
||||
// New builds a news Server. host is the public hostname used in Message-IDs and
|
||||
// stamped From addresses (e.g. "news.profullstack.com").
|
||||
func New(st NewsStore, host string) *Server {
|
||||
return &Server{
|
||||
st: st,
|
||||
srv: nntpd.NewServer(&backend{st: st, host: host}),
|
||||
host: host,
|
||||
st: st,
|
||||
srv: nntpd.NewServer(&backend{st: st, host: host}),
|
||||
tlsSrv: nntpd.NewServer(&backend{st: st, host: host, requireToken: true}),
|
||||
host: host,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -78,6 +80,10 @@ func ParseGroups(s string) []GroupSpec {
|
|||
// is immutable and AUTHINFO swaps only the per-session backend, so one Server is
|
||||
// safe to share across all connections.
|
||||
func (s *Server) Serve(ctx context.Context, ln net.Listener) error {
|
||||
return serve(ctx, ln, s.srv)
|
||||
}
|
||||
|
||||
func serve(ctx context.Context, ln net.Listener, srv *nntpd.Server) error {
|
||||
go func() { <-ctx.Done(); _ = ln.Close() }()
|
||||
for {
|
||||
conn, err := ln.Accept()
|
||||
|
|
@ -87,7 +93,7 @@ func (s *Server) Serve(ctx context.Context, ln net.Listener) error {
|
|||
}
|
||||
return err
|
||||
}
|
||||
go s.srv.Process(conn)
|
||||
go srv.Process(conn)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +122,7 @@ func (s *Server) ServeTLS(ctx context.Context, addr, certFile, keyFile string) e
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return s.Serve(ctx, ln)
|
||||
return serve(ctx, ln, s.tlsSrv)
|
||||
}
|
||||
|
||||
// certKeeper loads a TLS keypair from disk and reloads it when either file's
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue