|
|
|
|
[package]
|
|
|
|
|
name = "synctv-api"
|
|
|
|
|
version.workspace = true
|
|
|
|
|
edition.workspace = true
|
|
|
|
|
authors.workspace = true
|
|
|
|
|
license.workspace = true
|
|
|
|
|
|
|
|
|
|
[features]
|
|
|
|
|
default = ["tls-aws-lc", "tls-webpki-roots"]
|
feat(web): add client-aware playback and reproducible UI (#433)
## Summary
- add a versioned playback client profile for browser/runtime protocol,
container, codec, header, proxy, insecure-media, and P2P-loader
capabilities
- generate compatible direct and proxy resources inside each provider
and return a structured incompatibility error when route policy leaves
no viable result
- force provider proxy delivery for browser-forbidden headers, including
affected Bilibili variants, while preserving explicit direct-only
failures
- keep legacy clients compatible and isolate capability-aware playback
cache entries
- serve `/oauth2/callback` through the same Flutter SPA entry point and
keep public discovery anonymous
## Reproducible Web UI
- move Flutter acquisition/build, source configuration, asset manifests,
Brotli/gzip compression, and compile-time embedding into the independent
`synctv-web-ui` crate
- support prebuilt distributions, local projects, and Git sources pinned
to an immutable full commit, with an ignored local override
- fingerprint source, Flutter version, build arguments, dart-defines,
builder generation, output, and compression settings
- validate cached Git repository/revision/commit identity, support
offline cache reuse, and rebuild only when relevant inputs change
- pin and checksum the Flutter SDK in the Docker Web asset stage;
backend-only builds require no Flutter, Git fetch, or network
- serve embedded assets with ETags, compression negotiation, CSP, cache
policy, Origin/CORS handling, and SPA fallback outside API/media routes
## Verification
- `cargo fmt --all -- --check`
- workspace `cargo check`, test/doc-test, and all-targets Clippy with
warnings denied
- provider tests: 200 passed, 1 ignored
- OAuth core/API tests: 72 + 16 passed
- `synctv-web-ui`: 10 passed
- `synctv-api-http --features web-ui`: 12 passed
- default Git source cold build from the pinned App commit, followed by
offline hot-cache reuse in about 1.1 seconds
- `cargo check -p synctv --features web-ui` and `docker buildx build
--check .`
- real Chrome playback, P2P, OAuth/Casdoor, multi-user sync, chat,
media, playlist, upload, settings, and playback-history flows
Companion frontend PR: https://github.com/synctv-org/synctv-app/pull/52
Release pin validation:
https://github.com/synctv-org/synctv-release/pull/9
1 month ago
|
|
|
web-ui = ["synctv-api-http/web-ui"]
|
|
|
|
|
openapi = ["synctv-api-common/openapi", "synctv-api-http/openapi"]
|
|
|
|
|
k8s = [
|
|
|
|
|
"synctv-api-common/k8s",
|
|
|
|
|
"synctv-api-http/k8s",
|
|
|
|
|
"synctv-api-grpc/k8s",
|
|
|
|
|
]
|
|
|
|
|
tls-aws-lc = [
|
|
|
|
|
"synctv-api-common/tls-aws-lc",
|
|
|
|
|
"synctv-api-http/tls-aws-lc",
|
|
|
|
|
"synctv-api-grpc/tls-aws-lc",
|
|
|
|
|
]
|
|
|
|
|
tls-ring = [
|
|
|
|
|
"synctv-api-common/tls-ring",
|
|
|
|
|
"synctv-api-http/tls-ring",
|
|
|
|
|
"synctv-api-grpc/tls-ring",
|
|
|
|
|
]
|
|
|
|
|
tls-webpki-roots = [
|
|
|
|
|
"synctv-api-common/tls-webpki-roots",
|
|
|
|
|
"synctv-api-http/tls-webpki-roots",
|
|
|
|
|
"synctv-api-grpc/tls-webpki-roots",
|
|
|
|
|
]
|
|
|
|
|
tls-native-roots = [
|
|
|
|
|
"synctv-api-common/tls-native-roots",
|
|
|
|
|
"synctv-api-http/tls-native-roots",
|
|
|
|
|
"synctv-api-grpc/tls-native-roots",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
[dependencies]
|
|
|
|
|
synctv-api-common = { workspace = true, default-features = false }
|
|
|
|
|
synctv-api-http = { workspace = true, default-features = false }
|
|
|
|
|
synctv-api-grpc = { workspace = true, default-features = false }
|
|
|
|
|
|
|
|
|
|
[lints]
|
|
|
|
|
workspace = true
|
|
|
|
|
|
|
|
|
|
[dev-dependencies]
|
|
|
|
|
wiremock.workspace = true
|
|
|
|
|
serde_urlencoded.workspace = true
|
|
|
|
|
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "test-util"] }
|
|
|
|
|
tower = { workspace = true, features = ["util"] }
|
|
|
|
|
http-body-util.workspace = true
|
|
|
|
|
futures.workspace = true
|
|
|
|
|
synctv-proto = { workspace = true, default-features = false, features = ["main", "providers", "playback-provider"] }
|
|
|
|
|
synctv-core = { workspace = true, default-features = false, features = ["test-support"] }
|
|
|
|
|
synctv-core-testing.workspace = true
|
|
|
|
|
synctv-cluster = { workspace = true, default-features = false }
|
|
|
|
|
synctv-realtime = { workspace = true, default-features = false }
|
|
|
|
|
serde_json.workspace = true
|
|
|
|
|
chrono.workspace = true
|
|
|
|
|
axum = { workspace = true, features = ["ws"] }
|
|
|
|
|
tokio-tungstenite.workspace = true
|
|
|
|
|
prost.workspace = true
|
|
|
|
|
async-trait.workspace = true
|
|
|
|
|
sqlx.workspace = true
|
|
|
|
|
tonic.workspace = true
|
|
|
|
|
synctv-common = { workspace = true, default-features = false }
|
|
|
|
|
tokio-util.workspace = true
|
|
|
|
|
uuid.workspace = true
|
|
|
|
|
redis.workspace = true
|
|
|
|
|
opaque-ke.workspace = true
|
|
|
|
|
sha2_010.workspace = true
|
|
|
|
|
serde.workspace = true
|
|
|
|
|
synctv-proxy = { workspace = true, default-features = false }
|