79 Commits
Author SHA1 Message Date
Benjamin PrachtandClaude Opus 5 d2ec76a0bf test: fix two data races in the test suites (#4878)
* test: stop registering the global DefaultConfig with the logger

InitLoggerFromConfig hands the pointer to zaputil.ComponentLeveler as its
level resolver, and protocol a879e94 gave logger.Config a
ResolveComponentLevel that takes c.lock. The two test packages passed
&config.DefaultConfig.Logging, so every first-time component level
resolution locked a mutex inside the global DefaultConfig while
config.NewConfig marshalled that same global from another goroutine:

  Read at 0x39baa08  yaml.Marshal -> pkg/config/config.go:633 (NewConfig)
  Write at 0x39baa08 ComponentLeveler.resolve -> zaputil/leveler.go:117

That tripped the race detector in pkg/rtc TestPreferMediaCodecForPublisher
and broke CI on master.

Register a test-local LoggingConfig instead, so the logger never touches
the global that NewConfig reads. DefaultConfig.Logging only ever sets
PionLevel, so behavior is unchanged. A plain struct copy is not an option
here: logger.Config holds a mutex and vet's copylocks would reject it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test: make RTCClient callbacks safe to set while the client runs

The scenario tests assign c2.OnDataReceived after waitUntilConnected, so
the assignment raced the data channel goroutine already reading the field
in handleDataMessage:

  Read  test/client.(*RTCClient).handleDataMessage  client.go:1146
  Write test.scenarioDataPublish.func1              scenarios.go:160

This is what failed TestMultinodeDataPublishing on master.

Replace the three exported callback fields with atomic pointers behind
SetOnConnected/SetOnDataReceived/SetOnDataUnlabeledReceived. OnConnected
and OnDataUnlabeledReceived have no writers today, but they are read from
the same background goroutines and would race the moment one appeared, so
all three move together rather than leaving a split API on one struct.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 22:35:30 -07:00
Benjamin PrachtandClaude Opus 5 7874ce7d51 Track action versions and stop quarantining our own actions (#4877)
helpers:pinGitHubActionDigestsToSemver extends the preset we already used, so
actions stay pinned by digest; it adds an extractVersion/versioning pair that
makes Renovate follow the full vX.Y.Z tag behind the digest instead of the
mutable major, so the comment a reviewer reads carries the exact version and
updates arrive typed as patch/minor with a changelog range.

minimumReleaseAge exists to let a third-party release sit before we adopt it.
Our own actions have nothing to wait out, and the quarantine actively hurts any
referenced by branch: Renovate ages a branch ref against its head commit, so
slack-notifier-action only moves once that repo goes two weeks without a push.
This mirrors the exemption github.com/livekit/** already has under gomod.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 20:45:20 -07:00
Benjamin PrachtandClaude Opus 5 91f33da004 ingress: add opt-in support for udp:// URL pull ingress (#4810)
* ingress: add opt-in support for udp:// URL pull ingress

URL pull ingress previously accepted only http, https and srt source
URLs. Add udp:// as an accepted scheme, gated behind a new
`ingress.enable_udp_url_pull` config option that defaults to false, so
unauthenticated UDP sources are not reachable unless the operator opts
in.

Also add a counterfeiter fake for IngressLauncher and a test covering
the scheme validation matrix.

The ingress handler binds a local socket on the caller supplied address
and port instead of connecting out like the http and srt sources do.
Spell out what that means for operators in both the config field doc
comment and config-sample.yaml: caller controlled local port binding,
unauthenticated and spoofable input, and multicast relaying of traffic
on the handler's local network.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-01 12:11:14 -07:00
Benjamin PrachtandClaude Opus 5 906764691c Group livekit dependency updates in renovate (#4791)
First-party livekit modules are co-released and depend on each other,
so bump them together in a single PR instead of one PR per module.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 14:21:55 -07:00
Benjamin Pracht 2cad1cc936 Update renovate and pinning behavior, run tools from go.mod (#4759)
- Renovate

config:recommended (config:base is deprecated) and matchPackageNames globs instead of the deprecated matchPackagePrefixes.
Vulnerability alerts get a fast path: 2-day quarantine, no concurrency/hourly/schedule limits.
Go modules are no longer grouped into one "go deps" PR — each gets its own, so a bad bump can be reverted alone. The pion modules stay grouped as a documented exception: they're co-released and interdependent, so individual PRs wouldn't build.
First-party github.com/livekit/** skips the 2-week quarantine.
go.mod's go directive is no longer an update target — the build toolchain is pinned in the Dockerfile instead.
Dockerfile deps get pinDigests; the golang image is ungrouped with separateMinorPatch so a patch and a minor bump are each separately approvable.
Custom manager to bump the builder image's -alpineA.B suffix together with its digest, which the stock docker manager holds fixed.

- Pinning

Both Dockerfiles pin golang and alpine by digest alongside the readable tag.
GOTOOLCHAIN=local so a go.mod bump fails loudly instead of silently downloading a different toolchain.
apk upgrade in the runtime stage — a digest pin plus the 2-week quarantine would otherwise ship base-package CVEs Alpine has already fixed. This relies on a cold layer cache, which holds today because the release workflow configures no buildx cache; there's a comment saying so.
Workflows resolve the Go version from the Dockerfile via .github/scripts/go-version.sh, so tests, releases and images share one toolchain.

- Tools

All four code generators now come from the module graph, and tools/tools.go (the pre-Go-1.24 blank-import idiom) is replaced by go.mod tool directives:

tool	how	why
goimports	go tool	lives in x/tools — its own module is the one being selected
gotestfmt	go tool	zero dependencies, nothing to skew
wire	go run	pins x/tools v0.24.1; building it in our graph changes its output
counterfeiter	go run	unchanged, matches its //go:generate directives

The wire distinction is load-bearing. Building wire inside our module raises it from the x/tools v0.24.1 it pins to our v0.48.0, and that module version difference changes what it generates: it falls back to v/v2/v3 instead of deriving real identifiers from the type. wire_gen.go is regenerated here to match the in-module build — a cosmetic rename of 9 lines, with no other change to the generated code.

golangci-lint deliberately keeps its action rather than becoming a tool: it pins its own x/tools (v0.44.0 vs our v0.48.0) for the analyzers it bundles, adding it to go.mod would double our go.mod/go.sum (158→338 / 441→889 lines), and the action supplies caching, only-new-issues and PR annotations that invoking a binary can't. Its version stays manual by request.
2026-08-17 09:25:02 -07:00
Benjamin PrachtandCopilot Autofix powered by AI 14aeeb3c56 Potential fix for code scanning alert no. 42: Incorrect conversion between integer types (#4684)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-07-17 09:56:26 +02:00
Benjamin PrachtandClaude Opus 4.8 2c9eee4c54 Guard against nil TC qdisc stats to prevent SIGSEGV (#4668)
Newer kernels report qdisc stats via TCA_STATS2 (Stats2) while older
kernels only populate the legacy TCA_STATS attribute (Stats). Whichever
is unused is left nil, so unconditionally dereferencing Stats crashed
with a SIGSEGV during telemetry init. Prefer Stats2 and fall back to
Stats, skipping when both are nil.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 14:30:44 +02:00
Benjamin PrachtandClaude Opus 4.8 d1b031a9dd Stop WHIP session notifier when participant leaves (#4637)
The WHIP connection-notify loop kept issuing RPCs after the participant
had left the room. Guard sendConnectionNotify against a closed
participant (returning ErrParticipantNotFound) and treat that error as a
clean loop exit. Also reorder DeleteSession so the participant is removed
before its WHIP OnClose entry is cleared.

Adds tests covering loop termination on participant leave, context
cancellation, and the closed-participant guard.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 14:07:21 +01:00
Benjamin Pracht 675caa208f Add CODEOWNERS (#4583) 2026-06-10 12:16:55 -07:00
Benjamin Pracht 03e90dd762 Fix for some CodeQL reported issues (#4314)
One of the fix is in updated protocol (logging of a request message that includes the turn server settings, including password).
2026-02-11 10:15:12 -08:00
Benjamin PrachtandCopilot Autofix powered by AI 478e486a4b Copilot suggested improvement to Github Actions permissions (#4310)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-10 15:57:31 -08:00
Benjamin PrachtandCopilot Autofix powered by AI cbd2f82d1c Copilot suggested improvement to Github Actions permissions (#4311)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-10 15:57:17 -08:00
Benjamin Pracht be018f97b6 Provide the InputVideo/AudioState to Ingress in WHIPRTCConnectionNotify (#3982) 2025-10-06 14:16:35 -07:00
Benjamin Pracht 146bd9699d Do not panic of redis is not configured (#3981) 2025-10-06 07:47:29 -07:00
Benjamin Pracht dc3a775350 Fix timeout handing in StopEgress (#3876) 2025-08-25 10:34:26 -07:00
Benjamin Pracht 18ce524455 Handle Metadata field from RoomConfig (#3798) 2025-07-18 10:37:23 -07:00
Benjamin Pracht 1f31d430b0 Map ErrNoResponse to ErrRequestTimedOut in StopEgress to avoid returning 503 (#3788) 2025-07-14 13:30:24 -07:00
Benjamin Pracht 28dfac14e0 Use exported GetEgressNotifyOptions (#3604) 2025-04-11 09:45:27 -07:00
Benjamin Pracht e5cbb22777 Allow specifying extra webhooks with egress requests (#3597) 2025-04-09 16:20:21 -07:00
Benjamin Pracht c3e06f0523 Do not attempt to create objects for URL ingresses as the ingress service will do so (#3491) 2025-03-05 15:15:02 -08:00
Benjamin Pracht d751f209d5 Allow requesting a dialtone during call transfer (#3122) 2024-10-21 21:05:31 -07:00
Benjamin Pracht 22c36ef423 Implement SIP TransferParticipant API (#3026) 2024-09-20 12:16:15 -07:00
Benjamin Pracht 64057c3e4d Implement AgentDispatch service (#2919)
This allows listing, adding and deleting agent dispatches on an existing room. Requests go to a new AgentDispatchService, which sends them over RPC to the rtc.Room via the RoomManager. The rtc.Room then does agent job management using RPCs to the agent service.
2024-08-08 22:31:23 +02:00
Benjamin Pracht 0fd09d73c1 Instantiate default agent dispatches in rtc for better backward compatibility (#2886) 2024-07-22 08:44:13 -07:00
Benjamin Pracht 73b3a91a5c Use RoomConfiguration message from protocol (#2882) 2024-07-19 13:54:33 -07:00
Benjamin Pracht a877ba2352 Partial support for agent dispatch management (#2872)
- Store agent dispaches independently of room agents on rtc.Room
- Serialize agent dispatches in rtc.Room
- Support for agent dispatch and job serialization in redis

The agent Job object references denormalized Room and ParticipantInfo object. When storing Jobs, this sets the Room to nil, and only stores the Participant identity field. When read back, these fields need to be set to their current value.
2024-07-18 13:36:43 -07:00
Benjamin Pracht 8605ada485 Update protocol (#2867) 2024-07-16 09:38:59 -07:00
Benjamin Pracht a9aa65fdc6 Remove unused fields from RegisterWorkerRequest (#2866) 2024-07-15 15:22:20 -07:00
Benjamin Pracht 6c1d5e8699 Do not create room in UpdateRoomMetadata (#2854) 2024-07-11 17:50:30 -07:00
Benjamin Pracht a1f8e879cd Allow specifying room configuration in token (#2853) 2024-07-10 20:48:19 -07:00
Benjamin Pracht fb7eb3450e Update agents service to updated protocol (#2837)
- Deprecate namespace field
- Restore former semantic of starting a job for each registered namespace, for a given Agent Name
- Add agentName field
- Use "dispatcher" naming convention
2024-07-08 17:09:11 -07:00
Benjamin Pracht 32a4d03c9e Implement Agents protocol addition (#2786) 2024-06-27 19:20:52 -07:00
Benjamin Pracht eef3cf0f01 Redact egress object in CreateRoom request (#2710) 2024-05-10 10:05:53 -07:00
Benjamin Pracht 15ffb53df9 Version 1.6.1
## Changelog

This release changes the default behavior when creating or updating WHIP
ingress. WHIP ingress will now default to disabling transcoding and
forwarding media unchanged to the LiveKit subscribers. This behavior can
be changed by using the new `enable_transcoding` available in updated
SDKs. The behavior of existing ingresses is unchanged.

 ### Added

- Add support for "abs-capture-time" extension.  (#2640)
- Add PropagationDelay API to sender report data (#2646)
- Add support for EnableTranscoding ingress option (#2681)
- Pass new SIP metadata. Update protocol. (#2683)
- Handle UpdateLocalAudioTrack and UpdateLocalVideoTrack. (#2684)
- Forward transcription data packets to the room (#2687)

 ### Fixed

- backwards compatability for IsRecorder (#2647)
- Reduce RED weight in half. (#2648)
- add disconnected chan to participant (#2650)
- add typed ops queue (#2655)
- ICE config cache module. (#2654)
- use typed ops queue in pctransport (#2656)
- Use the ingress state updated_at field to ensure that out of order RPC do not overwrite state (#2657)
- Log ICE candidates to debug TCP connection issues. (#2658)
- Debug logging addition of ICE candidate (#2659)
- fix participant, ensure room name matches (#2660)
- replace keyframe ticker with timer (#2661)
- fix key frame timer (#2662)
- Disable dynamic playout delay for screenshare track (#2663)
- Don't log dd invalid template index (#2664)
- Do codec munging when munging RTP header. (#2665)
- Connection quality LOST only if RTCP is also not available. (#2670)
- Handle large jumps in RTCP sender report timestamp. (#2674)
- Bump golang.org/x/net from 0.22.0 to 0.23.0 (#2673)
- do not capture pointers in ops queue closures (#2675)
- Fix SubParticipant twice when paticipant left (#2672)
- use ttlcache (#2677)
- Detach subscriber datachannel to save memory (#2680)
- Clean up UpdateVideoLayers (#2685)
- Make datachannel optional for publisher (#2686)
2024-04-26 21:07:55 +02:00
Benjamin Pracht f088730007 Add support for EnableTranscoding ingress option (#2681)
This changes the default WHIP ingress behavior to skipping transcode. Other inputs are still always transcoded.
2024-04-26 14:26:00 +02:00
Benjamin Pracht 6afa63ded3 Use the ingress state updated_at field to ensure that out of order RPC do not overwrite state (#2657) 2024-04-16 18:10:14 +02:00
Benjamin Pracht 8d7257dd19 Move CreateIngress to IOInfoService. Adopt UpdateIngressStare from IOInfoService instead of IngressService (#2485)
When paired with an updated ingress service, this will cause CreateIngress to be called twice for URL pull ingress, with the 2nd call failing.
2024-02-15 14:00:25 -08:00
Benjamin Pracht b659fef8ed Add support for ingress ParticipantMetadata (#2461) 2024-02-08 13:59:26 -08:00
Benjamin Pracht c2549081c8 Allow creating SRT URL pull ingress (#2416) 2024-01-26 14:03:46 -08:00
Benjamin Pracht 4e30e1a86d Send telemetry events when switching to COMPLETE state (#2371) 2024-01-08 16:24:53 -08:00
Benjamin Pracht 4253845505 Create stub for update outputs in egress service (#2132) 2023-10-05 12:00:47 -07:00
Benjamin Pracht ce418dc6b3 Do not generate a stream key for URL pull ingress (#1993) 2023-08-24 12:50:05 -07:00
Benjamin Pracht e3ed9ff53f Validate that url pull ingress are ready to use on creation (#1939) 2023-08-07 15:44:44 -07:00
Benjamin Pracht 98c1fb598c Add support for ingress URL pull (#1938)
Also prevent update of non reusable ingress
2023-08-04 11:41:36 -07:00
Benjamin Pracht 68e5fa8e1c Allow listing ingress by id (#1874) 2023-07-14 09:11:55 +08:00
Benjamin Pracht 1f6efedd31 Send updated events on state updates (#1819) 2023-06-22 09:20:58 -07:00
Benjamin Pracht 552e3758d5 Add IngressUpdated event (#1775) 2023-06-16 10:58:49 -07:00
Benjamin Pracht e7879a46fc Add ingress telemetry support (#1763) 2023-06-02 17:38:19 -07:00
Benjamin Pracht d598e06d9f Add support for bypass_transcoding field in ingress (#1741) 2023-05-30 13:41:12 -07:00
Benjamin Pracht f401c44a46 Move TURNServers back to livekit-server (#1715) 2023-05-17 15:24:17 -07:00
Benjamin Pracht 4244542840 Adopt WebRTCConfig from mediatransportutil (#1707)
This also adds support for inline fields in ToCLIFlagNames
2023-05-10 20:00:34 -07:00
Benjamin Pracht 11749eace9 Add support for creating WHIP ingress (#1674) 2023-05-02 13:26:47 -07:00
Benjamin Pracht a08cd23b6d Adopt pion logging initialization moving to protocol (#1667) 2023-04-28 10:51:41 -07:00
Benjamin Pracht 843328125e Do not use redis transactions for the egress APIs. Make sure all ingress related keys are on the same cluster slot. #1606
This will break existing ingress in redis.
2023-04-13 08:09:00 -10:00
Benjamin Pracht c2f76b79fa Validate IngressInfo, update the info if an ingress is active (#1605) 2023-04-12 13:27:57 -10:00
Benjamin Pracht 17ae1506f5 Chain twirpLogger and twirpRequestStatusHook properly for the Egress server (#1470) 2023-02-25 15:15:50 -07:00
Benjamin Pracht 30adc6ee15 Fix typo in twirp server status code parsing (#1361) 2023-01-31 17:43:59 -08:00
Benjamin Pracht c6e8887ab8 Allow requesting a specific Egress Cluster Id (#1342) 2023-01-30 17:04:26 -08:00
Benjamin Pracht edc39da0b1 Add TwirpRequestStatusReporter twirp server hook to count requests (#1309) 2023-01-18 11:53:20 -08:00
Benjamin Pracht 0ca80a4fa7 Fix log statement in egress service (#1301) 2023-01-11 11:42:47 -08:00
Benjamin Pracht 86bf5cb62e Ensure we create en Egress ID with PsRPC (#1273) 2022-12-30 13:46:45 +13:00
Benjamin Pracht 7778cdf2cd Do not use the egress version stored in redis to decide whether to enable PsRPC. Use a conf entry instead (#1262) 2022-12-30 09:32:55 +13:00
Benjamin Pracht 57ce032cfe Add support for Ingress State Ended At field (#1218) 2022-12-08 11:14:32 -08:00
Benjamin Pracht 2c2c6f9da2 Do not append the stream key to the ingress URL for rtmp (#1167) 2022-11-15 09:19:25 -08:00
Benjamin PrachtandDavid Zhao 18de0f5ab7 Version 1.3.0 (#1152)
Co-authored-by: David Zhao <dz@livekit.io>
2022-11-08 13:37:23 -08:00
Benjamin Pracht c735668f67 Use the redis.UniversalClient interface instead of *redis.Client when interacting with go-redis (#1149)
* Use the redis.UniversalClient interface instead of *redis.Client when interacting with go-redis

* Update protocol to v1.2.1
2022-11-07 17:27:28 -08:00
Benjamin Pracht 9a45b59414 Use ingress specific grants (#1125) 2022-10-26 21:37:36 -07:00
Benjamin Pracht c3120679e6 Make sure CreateIngress returns an empty state (#1069) 2022-10-04 19:23:09 -07:00
Benjamin Pracht 8cf0872ec1 Adopt updated ingress RPC API (#1068) 2022-10-03 11:31:55 -07:00
Benjamin Pracht 932af81f34 Update strored version of an active ingress if no ingress server responds (#1031)
This allows deleting and updating an ingress even if the ingress server that was handling it died. It does however mean that if the ingress responds again later, its state will be inconsistent. To somewhat make this less likely, also keep trying contacting the ingress for 1 min in the background.

Also fixing a race where an active deleted Ingress would get recreated on delete because of the update triggered by the ingress session shutdown
2022-09-26 11:16:27 -07:00
Benjamin Pracht b0eead22b5 Allow specifying a different RTMP url domain for each ingress (#994) 2022-09-12 14:03:15 -07:00
Benjamin Pracht aaeba74402 Import ErrIngressOutOfDate from protocol (#987) 2022-09-06 16:05:17 -07:00
Benjamin Pracht d8edb9b2e7 Adopt Ingress RPC interface changes (#972) 2022-08-31 14:14:40 -07:00
Benjamin Pracht 67d3f21122 Only update an IngressInfo if the StartedAt field is newer or equal to the one currently in storage (#897)
This is meant to ensure that we will not overwrite the state of an ingress that already reconnected to a different server on failure or timeout
2022-08-09 19:07:56 -07:00
Benjamin Pracht 0cffbe69e9 Fix ingress stream key lookup and avoid nil dereference when room in auth claims doesn't match (#869) 2022-08-04 16:22:55 -07:00
Benjamin Pracht c333b7a026 Add support for Ingress service (#868)
Also check for Join permission on ingress API calls
2022-08-04 09:48:53 -07:00
Benjamin Pracht 5558aa5228 Make sure CreateIngest populates the stream_key and URL fields (#861) 2022-08-01 11:35:30 -07:00
Benjamin Pracht 7a2eac8e86 Initial Ingress support in API (#852)
This adds support for the Ingress related endpoints to LiveKit server. This currently doesn't handle reconnections safely.
2022-07-28 09:49:54 -07:00
Benjamin Pracht 188f9c675e Add support for Ingress in store interface (#849) 2022-07-26 16:55:03 -07:00