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.
synctv/synctv-api-http/Cargo.toml

203 lines
5.9 KiB
TOML

[package]
name = "synctv-api-http"
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 = ["dep:synctv-web-ui", "synctv-web-ui/embed"]
web-ui-dynamic = ["dep:synctv-web-ui"]
openapi = [
"synctv-api-common/openapi",
"synctv-proto/openapi",
"dep:utoipa",
"dep:utoipa-swagger-ui",
]
k8s = ["synctv-api-common/k8s", "dep:kube", "dep:k8s-openapi", "synctv-cluster/k8s"]
tls-aws-lc = [
"synctv-api-common/tls-aws-lc",
"synctv-core/tls-aws-lc",
"synctv-proxy/tls-aws-lc",
"synctv-cluster/tls-aws-lc",
"synctv-realtime/tls-aws-lc",
"synctv-media-providers/tls-aws-lc",
"synctv-livestream/tls-aws-lc",
"synctv-proto/tls-aws-lc",
"synctv-common/tls-aws-lc",
"tonic/tls-aws-lc",
"sqlx/tls-rustls-aws-lc-rs",
"reqwest/rustls",
"kube?/aws-lc-rs",
]
tls-ring = [
"synctv-api-common/tls-ring",
"synctv-core/tls-ring",
"synctv-proxy/tls-ring",
"synctv-cluster/tls-ring",
"synctv-realtime/tls-ring",
"synctv-media-providers/tls-ring",
"synctv-livestream/tls-ring",
"synctv-proto/tls-ring",
"synctv-common/tls-ring",
"sqlx/tls-rustls-ring-webpki",
"tonic/tls-ring",
"reqwest/rustls-no-provider",
"kube?/ring",
]
tls-webpki-roots = [
"synctv-api-common/tls-webpki-roots",
"synctv-core/tls-webpki-roots",
"synctv-proxy/tls-webpki-roots",
"synctv-cluster/tls-webpki-roots",
"synctv-realtime/tls-webpki-roots",
"synctv-media-providers/tls-webpki-roots",
"synctv-livestream/tls-webpki-roots",
"synctv-proto/tls-webpki-roots",
"synctv-common/tls-webpki-roots",
"tonic/tls-webpki-roots",
"redis/tokio-rustls-comp",
"redis/tls-rustls-webpki-roots",
"tokio-tungstenite/rustls-tls-webpki-roots",
"kube?/rustls-tls",
"kube?/webpki-roots",
]
tls-native-roots = [
"synctv-api-common/tls-native-roots",
"synctv-core/tls-native-roots",
"synctv-proxy/tls-native-roots",
"synctv-cluster/tls-native-roots",
"synctv-realtime/tls-native-roots",
"synctv-media-providers/tls-native-roots",
"synctv-livestream/tls-native-roots",
"synctv-proto/tls-native-roots",
"synctv-common/tls-native-roots",
"tonic/tls-native-roots",
"redis/tokio-rustls-comp",
"tokio-tungstenite/rustls-tls-native-roots",
"kube?/rustls-tls",
]
[dependencies]
# Internal
synctv-api-common = { workspace = true, default-features = false }
synctv-adapter = { workspace = true, default-features = false }
synctv-core = { workspace = true, default-features = false }
synctv-proxy = { workspace = true, default-features = false }
synctv-cluster = { workspace = true, default-features = false }
synctv-realtime = { workspace = true, default-features = false }
synctv-media-providers = { workspace = true, default-features = false }
synctv-livestream = { workspace = true, default-features = false }
synctv-proto = { workspace = true, default-features = false, features = ["main", "providers", "playback-provider"] }
synctv-common = { workspace = true, default-features = false }
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
synctv-web-ui = { workspace = true, optional = true }
webauthn-rs.workspace = true
webauthn-rs-proto.workspace = true
# Async
tokio.workspace = true
tokio-util.workspace = true
tokio-stream.workspace = true
async-trait.workspace = true
futures.workspace = true
# gRPC
tonic.workspace = true
tonic-prost.workspace = true
tonic-web.workspace = true
tonic-reflection.workspace = true
tonic-health.workspace = true
tonic-types.workspace = true
prost.workspace = true
prost-protovalidate.workspace = true
opaque-ke.workspace = true
sha2_010.workspace = true
prost-types.workspace = true
prost-reflect = { workspace = true, features = ["serde"] }
pbjson-types.workspace = true
# HTTP
axum.workspace = true
tower.workspace = true
tower-http.workspace = true
hyper.workspace = true
reqwest.workspace = true
http-body-util.workspace = true
# Serialization
serde.workspace = true
serde_json.workspace = true
utoipa = { workspace = true, optional = true }
utoipa-swagger-ui = { workspace = true, optional = true }
# Database
sqlx.workspace = true
# Redis
redis.workspace = true
# Utilities
anyhow.workspace = true
thiserror.workspace = true
bytes.workspace = true
rand.workspace = true
parking_lot.workspace = true
hostname.workspace = true
base64.workspace = true
uuid.workspace = true
url.workspace = true
percent-encoding.workspace = true
urlencoding.workspace = true
ipnet.workspace = true
dashmap.workspace = true
kube = { workspace = true, optional = true }
k8s-openapi = { workspace = true, optional = true }
# Cryptography (for M3U8 proxy tokens)
aes-gcm.workspace = true
sha2.workspace = true
hmac.workspace = true
hex.workspace = true
subtle.workspace = true
# Time
chrono.workspace = true
# Logging
tracing.workspace = true
tracing-subscriber.workspace = true
clap.workspace = true
regex.workspace = true
ammonia.workspace = true
serde_html_form.workspace = true
serde_path_to_error.workspace = true
# Caching
moka.workspace = true
rayon.workspace = true
[lints]
workspace = true
[dev-dependencies]
tempfile.workspace = true
synctv-api-common = { workspace = true, default-features = false, features = ["test-support"] }
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