v0.16.2 PGN site, web client panel update
test / test (push) Canceled after 0s
test / e2e (push) Canceled after 0s

This commit is contained in:
lixen committed 2026-10-20 01:39:53 -04:00
1 parent 0461020c46
commit a012d07cd8
12 files changed
+84 -45

No files matched your search

+1 -1
View File
@@ -79,7 +79,7 @@ func (s *Service) GetGamePGN(gameID string, ply int) (*replay.PGN, error) {
if err != nil {
return nil, err
}
pgn, err := replay.BuildPGN(record, moves, ply)
pgn, err := replay.BuildPGN(record, moves, ply, s.site)
if errors.Is(err, replay.ErrNotation) {
slog.Warn("stored game cannot be exported as PGN", "game_id", gameID, "error", err)
}
+7
View File
@@ -43,6 +43,7 @@ type Service struct {
integrityCursor string // last game ID the integrity sweep verified; cleanup goroutine only
mail *mailer // password recovery; nil when no transport is configured
site string // Site tag of exported games played here; empty is PGN's "?"
}
// New creates a service with optional storage. jwtSecret signs session tokens
@@ -93,6 +94,12 @@ func (s *Service) SetAnonymousGameTTL(ttl time.Duration) {
s.mu.Unlock()
}
// SetSite names this server in the Site tag of the games it exports, from
// the web client's public address; call it before serving.
func (s *Service) SetSite(site string) {
s.site = site
}
// SetMaxUsers caps the number of accounts public registration may create;
// zero removes the cap. Accounts created through the CLI are not limited.
func (s *Service) SetMaxUsers(limit int) {