From 9e7d023f7e54f8f0ee1180c98f4134a76277b4b0 Mon Sep 17 00:00:00 2001 From: grendervill Date: Sun, 20 Sep 2026 18:32:47 +0300 Subject: [PATCH] =?UTF-8?q?feat(voice):=20=D0=B2=D1=80=D0=B5=D0=BC=D1=8F?= =?UTF-8?q?=20=D0=B6=D0=B8=D0=B7=D0=BD=D0=B8=20=D1=82=D0=BE=D0=BA=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20LiveKit=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=B8=D0=B2=D0=B0=D0=B5=D1=82=D1=81=D1=8F=20(=D0=BF=D0=BE=20?= =?UTF-8?q?=D1=83=D0=BC=D0=BE=D0=BB=D1=87=D0=B0=D0=BD=D0=B8=D1=8E=2010=20?= =?UTF-8?q?=D0=BC=D0=B8=D0=BD=D1=83=D1=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AGENT.md 7.14: токен выдаётся на 10 минут и переиздаётся клиентом до истечения. Значение задаётся LIVEKIT_TOKEN_TTL_SECONDS. --- internal/config/config.go | 13 ++++++++----- internal/server/server.go | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 193007f..00c898b 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -41,11 +41,14 @@ type Config struct { LiveKitAPIKey string LiveKitAPISecret string LiveKitURL string - Version string - Commit string - BuildDate string - ShutdownTTL time.Duration - Maintenance time.Duration + // LiveKitTokenTTL — время жизни токена доступа к комнате (AGENT.md 7.14: + // по умолчанию 10 минут, клиент переиздаёт токен до истечения). + LiveKitTokenTTL time.Duration + Version string + Commit string + BuildDate string + ShutdownTTL time.Duration + Maintenance time.Duration } func Load() (Config, error) { diff --git a/internal/server/server.go b/internal/server/server.go index 25dc997..f13519f 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -96,7 +96,7 @@ func New(cfg config.Config, db *database.DB, logger *slog.Logger, deps Deps) *Se slowmode: map[string]time.Time{}, presence: map[uint64]time.Time{}, webhookSeen: map[string]time.Time{}, - voice: voice.NewIssuer(cfg.LiveKitAPIKey, cfg.LiveKitAPISecret, time.Hour), + voice: voice.NewIssuer(cfg.LiveKitAPIKey, cfg.LiveKitAPISecret, cfg.LiveKitTokenTTL), } switch { case deps.Permissions != nil: