v0.16.2 PGN site, web client panel update
This commit is contained in:
1 parent
0461020c46
commit
a012d07cd8
12 files changed
+84
-45
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user