Synchronized viewing, theater, live streaming, video, long-distance relationship
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Go to file
zijiren 2445da8630
refactor(metrics): centralize registry and lifecycle tracking (#446)
## Summary

- split Prometheus definitions into domain-owned modules backed by one
registry
- eagerly initialize every metric family and fail startup on invalid or
duplicate definitions
- add reusable RAII guards for gauges and relay durations across
cancellation, panic, and retry paths
- centralize HTTP, WebSocket, gRPC, and relay recording behind
bounded-label helpers
- enforce the 65-metric bilingual catalog from registered descriptors
- persist completed explicit-message deletion and user-ban moderation
steps
- update the pinned Rust toolchain and CI jobs to `nightly-2026-08-25`
- make the CI Clippy job fail on every Rust warning with `-D warnings`
- keep Helm configuration-validation builds visible to avoid silent-run
termination
- separate Rust caches by artifact type and let Helm reuse codegen
artifacts from the Build job
- work around the nightly global next-solver memory regression and
remove obsolete rustc recursion-limit overrides
- preserve workspace Rust flags in Docker builds while applying linker
flags to the final binary

## Compatibility

- preserve all existing metric names, HELP text, label order, and
histogram buckets
- keep route-template and bounded status/error labels
- return HTTP 500 when Prometheus exposition encoding fails
- keep the latest nightly while restoring the previous coherence-only
trait-solver behavior

## Nightly memory regression

The failed CI jobs were terminated by the runner while compiling
`synctv-api-http` (SIGTERM, exit 143). Local peak-RSS measurements for
that crate were:

| Configuration | Peak RSS |
| --- | ---: |
| `nightly-2026-08-21` | 6.62 GB |
| `nightly-2026-08-25`, global next solver | 10.76 GB |
| `nightly-2026-08-25`, `-Znext-solver=coherence` | 6.64 GB |

Rust enabled `-Znext-solver=globally` by default on nightly in
[rust-lang/rust#160619](https://github.com/rust-lang/rust/pull/160619).
The same memory blow-up is tracked in
[rust-lang/rust#161748](https://github.com/rust-lang/rust/issues/161748),
and the official tracking issue documents `-Znext-solver=coherence` as
the temporary opt-out. The workspace now applies that option in
`.cargo/config.toml`.

The Dockerfile previously set `RUSTFLAGS` for linker options, which
overrode the workspace configuration and re-enabled the global solver
inside image builds. It now uses `cargo rustc` to pass linker flags only
to the final binary, preserving the workspace solver setting for every
crate.

All rustc `#![recursion_limit = "256"]` attributes were removed. The
default limit passes with the coherence-only solver, confirming that a
higher recursion limit was unrelated to the CI termination.

## Validation

- `make build-workspace`
- `make clippy-check` (`--workspace --all-targets -- -D warnings`)
- `cargo check --locked -p synctv-api-http`
- `cargo check --locked -p synctv-api-common -p synctv-api-grpc`
- `cargo test -p synctv-api-common --lib` (655 passed, 165 Docker tests
ignored)
- `cargo test -p synctv-core metrics --lib` (9 passed)
- `make fmt-check`
- `docker build --check .`
- `make validate-helm`
- `actionlint .github/workflows/ci.yml .github/workflows/helm-ci.yml`
- `npm run validate` in `docs` (124 pages, 353 links, Astro 0
errors/warnings)
4 weeks ago
.cargo refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
.config chore: replace synctv-org backend with SyncTV v1.0.0 2 months ago
.github refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
.sqlx feat(admin): add async chat moderation cleanup (#445) 4 weeks ago
docs refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
helm/synctv release: prepare v1.0.3 (#430) 1 month ago
migrations feat(admin): add async chat moderation cleanup (#445) 4 weeks ago
scripts refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
synctv feat(admin): add async chat moderation cleanup (#445) 4 weeks ago
synctv-adapter feat(web): add client-aware playback and reproducible UI (#433) 1 month ago
synctv-api feat(admin): add async chat moderation cleanup (#445) 4 weeks ago
synctv-api-common refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
synctv-api-grpc refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
synctv-api-http refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
synctv-cluster refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
synctv-common refactor: remove low-value thin wrappers (#426) 1 month ago
synctv-core refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
synctv-livestream refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
synctv-management feat: add personal user blocking (#429) 1 month ago
synctv-media-providers fix(emby): tolerate hidden browse ancestors (#443) 4 weeks ago
synctv-proto feat(admin): add async chat moderation cleanup (#445) 4 weeks ago
synctv-proto-build feat(web): add client-aware playback and reproducible UI (#433) 1 month ago
synctv-proto-main refactor: remove low-value thin wrappers (#426) 1 month ago
synctv-proto-playback-provider feat(playlist): add browse access controls (#423) 1 month ago
synctv-proto-providers refactor: remove low-value thin wrappers (#426) 1 month ago
synctv-proxy fix(proxy): preserve seek range requests after inconclusive HEAD (#437) 1 month ago
synctv-realtime refactor: remove low-value thin wrappers (#426) 1 month ago
synctv-web-ui feat(web): support runtime UI assets (#440) 1 month ago
synctv-xiu feat(rtmp): add advertised publish workflow (#439) 1 month ago
.dockerignore feat(web): add client-aware playback and reproducible UI (#433) 1 month ago
.env.postgres.example chore: replace synctv-org backend with SyncTV v1.0.0 2 months ago
.env.redis.example chore: replace synctv-org backend with SyncTV v1.0.0 2 months ago
.env.synctv.example feat(web): support runtime UI assets (#440) 1 month ago
.gitattributes feat: add recoverable resource deletion lifecycle (#394) 1 month ago
.gitignore feat(web): add client-aware playback and reproducible UI (#433) 1 month ago
CONTRIBUTING.md chore: replace synctv-org backend with SyncTV v1.0.0 2 months ago
Cargo.lock feat(web): support runtime UI assets (#440) 1 month ago
Cargo.toml feat(web): add client-aware playback and reproducible UI (#433) 1 month ago
Dockerfile refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
LICENSE chore: replace synctv-org backend with SyncTV v1.0.0 2 months ago
Makefile refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
README.md chore: finalize web UI root coverage and docs (#438) 1 month ago
README.zh-CN.md chore: finalize web UI root coverage and docs (#438) 1 month ago
SECURITY.md chore: replace synctv-org backend with SyncTV v1.0.0 2 months ago
deny.toml chore: replace synctv-org backend with SyncTV v1.0.0 2 months ago
docker-compose.dev.yml fix(bilibili): restore subtitles and dynamic live danmaku (#415) 1 month ago
docker-compose.yml fix(webrtc): use public STUN by default (#427) 1 month ago
rust-toolchain.toml refactor(metrics): centralize registry and lifecycle tracking (#446) 4 weeks ago
synctv.example.yaml feat(logging): add structured transport access logs (#436) 1 month ago

README.md

SyncTV

SyncTV

简体中文 · Website

Rust Tokio Axum gRPC PostgreSQL Redis Docker Helm Kubernetes OpenAPI Astro Starlight License

SyncTV is a Rust implementation of a real-time synchronized video watching platform with media provider integration, livestreaming, HTTP/gRPC APIs, and Kubernetes-ready horizontal scaling.

SyncTV synchronized room playback

Highlights

  • Synchronized room playback with real-time state updates.
  • Media providers for Bilibili, Twitch, YouTube, Douyin, TikTok, Huya, Douyu, AcFun, CCTV, Alist, Cloudreve, Emby/Jellyfin, FNOS, QNAP, Synology, Nextcloud, Seafile, TrueNAS, direct URLs, and livestream sources.
  • RTMP push/pull, HLS, and HTTP-FLV livestream support.
  • RTSP external pull with TCP/UDP transport and live HLS/HTTP-FLV remuxing.
  • HTTP REST, public gRPC, WebSocket, management gRPC, metrics, RTMP, and STUN runtime surfaces.
  • PostgreSQL-backed durable storage with optional Redis shared state, cache, rate limiting, and cluster coordination.
  • Docker Compose and Helm deployment templates.
  • Built-in management CLI and optional OpenAPI/Swagger UI.
  • Astro Starlight documentation site with English and Simplified Chinese content.

Discussion and Contributors

Join the SyncTV Telegram discussion to talk with users and contributors about deployment, operations, media providers, client development, and the product roadmap.

SyncTV contributors

Documentation

Read the complete documentation at docs.syncs.tv.

Download the native client from the client downloads guide or SyncTV App releases. Store builds are distributed through the supported app stores.

License

MIT. See LICENSE.