update packages

This commit is contained in:
jb-alvarado 2023-08-08 21:10:30 +02:00
parent 3b59347d71
commit d1716acfc5
6 changed files with 135 additions and 47 deletions

118
Cargo.lock generated
View File

@ -104,20 +104,40 @@ dependencies = [
[[package]]
name = "actix-multipart"
version = "0.5.0"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5011f5be460e35a5b82e1745c0ea0c6293e8f8d38bbaa1f0455afcff5b454ad6"
checksum = "dee489e3c01eae4d1c35b03c4493f71cb40d93f66b14558feb1b1a807671cc4e"
dependencies = [
"actix-multipart-derive",
"actix-utils",
"actix-web",
"bytes",
"derive_more",
"futures-core",
"futures-util",
"httparse",
"local-waker",
"log",
"memchr",
"mime",
"serde",
"serde_json",
"serde_plain",
"tempfile",
"tokio",
]
[[package]]
name = "actix-multipart-derive"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ec592f234db8a253cf80531246a4407c8a70530423eea80688a6c5a44a110e7"
dependencies = [
"darling",
"parse-size",
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
@ -247,16 +267,16 @@ dependencies = [
[[package]]
name = "actix-web-httpauth"
version = "0.6.0"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08c25a48b4684f90520183cd1a688e5f4f7e9905835fa75d02c0fe4f60fcdbe6"
checksum = "6dda62cf04bc3a9ad2ea8f314f721951cfdb4cdacec4e984d20e77c7bb170991"
dependencies = [
"actix-service",
"actix-utils",
"actix-web",
"base64 0.13.1",
"futures-core",
"futures-util",
"log",
"pin-project-lite",
]
@ -400,12 +420,13 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e"
[[package]]
name = "argon2"
version = "0.4.1"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db4ce4441f99dbd377ca8a8f57b698c44d0d6e712d8329b5040da5a64aa1ce73"
checksum = "b2e554a8638bdc1e4eae9984845306cc95f8a9208ba8d49c3859fd958b46774d"
dependencies = [
"base64ct",
"blake2",
"cpufeatures",
"password-hash",
]
@ -910,6 +931,41 @@ dependencies = [
"typenum",
]
[[package]]
name = "darling"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850"
dependencies = [
"darling_core",
"darling_macro",
]
[[package]]
name = "darling_core"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0"
dependencies = [
"fnv",
"ident_case",
"proc-macro2",
"quote",
"strsim",
"syn 1.0.109",
]
[[package]]
name = "darling_macro"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e"
dependencies = [
"darling_core",
"quote",
"syn 1.0.109",
]
[[package]]
name = "dashmap"
version = "5.5.0"
@ -1600,6 +1656,12 @@ dependencies = [
"cc",
]
[[package]]
name = "ident_case"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "idna"
version = "0.3.0"
@ -2197,10 +2259,16 @@ dependencies = [
]
[[package]]
name = "password-hash"
version = "0.4.2"
name = "parse-size"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700"
checksum = "944553dd59c802559559161f9816429058b869003836120e262e8caec061b7ae"
[[package]]
name = "password-hash"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166"
dependencies = [
"base64ct",
"rand_core",
@ -2479,13 +2547,12 @@ dependencies = [
[[package]]
name = "rpassword"
version = "6.0.1"
version = "7.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bf099a1888612545b683d2661a1940089f6c2e5a8e38979b2159da876bfd956"
checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322"
dependencies = [
"libc",
"serde",
"serde_json",
"rtoolbox",
"winapi",
]
@ -2511,6 +2578,16 @@ dependencies = [
"zeroize",
]
[[package]]
name = "rtoolbox"
version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a"
dependencies = [
"libc",
"winapi",
]
[[package]]
name = "rustc-demangle"
version = "0.1.23"
@ -2570,9 +2647,9 @@ dependencies = [
[[package]]
name = "sanitize-filename"
version = "0.3.0"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf18934a12018228c5b55a6dae9df5d0641e3566b3630cb46cc55564068e7c2f"
checksum = "2ed72fbaf78e6f2d41744923916966c4fbe3d7c74e3037a8ee482f1115572603"
dependencies = [
"lazy_static",
"regex",
@ -2653,6 +2730,15 @@ dependencies = [
"serde",
]
[[package]]
name = "serde_plain"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6018081315db179d0ce57b1fe4b62a12a0028c9cf9bbef868c9cf477b3c34ae"
dependencies = [
"serde",
]
[[package]]
name = "serde_urlencoded"
version = "0.7.1"

View File

@ -1,4 +1,4 @@
### This project is taking a summer break, during this time the Issues and Discussions are closed. In October both will be open again. Until then have a good time!
### This project is taking a summer break, during this time the Issues and Discussions are closed. In October both will be open again. Until then have a good time!
**ffplayout**
================
@ -176,14 +176,12 @@ Output from `{"media":"current"}` show:
```JSON
{
"jsonrpc": "2.0",
"result": {
"current_media": {
"category": "",
"duration": 154.2,
"out": 154.2,
"seek": 0.0,
"source": "/opt/tv-media/clip.mp4"
"category": "",
"duration": 154.2,
"out": 154.2,
"seek": 0.0,
"source": "/opt/tv-media/clip.mp4"
},
"index": 39,
"play_mode": "playlist",
@ -191,8 +189,6 @@ Output from `{"media":"current"}` show:
"remaining_sec": 86.39228000699876,
"start_sec": 24713.631999999998,
"start_time": "06:51:53.631"
},
"id": 1
}
```

View File

@ -11,11 +11,11 @@ edition.workspace = true
[dependencies]
ffplayout-lib = { path = "../lib" }
actix-files = "0.6"
actix-multipart = "0.5"
actix-multipart = "0.6"
actix-web = "4"
actix-web-grants = "3"
actix-web-httpauth = "0.6"
argon2 = "0.4"
actix-web-httpauth = "0.8"
argon2 = "0.5"
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
clap = { version = "4.3", features = ["derive"] }
derive_more = "0.99"
@ -23,19 +23,19 @@ faccess = "0.2"
futures-util = { version = "0.3", default-features = false, features = ["std"] }
jsonwebtoken = "8"
lexical-sort = "0.3"
once_cell = "1.10"
once_cell = "1.18"
rand = "0.8"
regex = "1"
relative-path = "1.6"
relative-path = "1.8"
reqwest = { version = "0.11", features = ["blocking", "json"] }
rpassword = "6.0"
sanitize-filename = "0.3"
rpassword = "7.2"
sanitize-filename = "0.5"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
simplelog = { version = "^0.12", features = ["paris"] }
simplelog = { version = "0.12", features = ["paris"] }
sqlx = { version = "0.7", features = ["runtime-tokio", "sqlite"] }
tokio = { version = "1.25", features = ["full"] }
tokio = { version = "1.29", features = ["full"] }
[[bin]]
name = "ffpapi"

View File

@ -3,8 +3,7 @@ use std::{path::Path, process::exit};
use actix_files::Files;
use actix_web::{dev::ServiceRequest, middleware, web, App, Error, HttpMessage, HttpServer};
use actix_web_grants::permissions::AttachPermissions;
use actix_web_httpauth::extractors::bearer::BearerAuth;
use actix_web_httpauth::middleware::HttpAuthentication;
use actix_web_httpauth::{extractors::bearer::BearerAuth, middleware::HttpAuthentication};
use clap::Parser;
use simplelog::*;
@ -29,15 +28,22 @@ use utils::{args_parse::Args, control::ProcessControl, db_path, init_config, run
use ffplayout_lib::utils::{init_logging, PlayoutConfig};
async fn validator(req: ServiceRequest, credentials: BearerAuth) -> Result<ServiceRequest, Error> {
async fn validator(
req: ServiceRequest,
credentials: BearerAuth,
) -> Result<ServiceRequest, (Error, ServiceRequest)> {
// We just get permissions from JWT
let claims = auth::decode_jwt(credentials.token()).await?;
req.attach(vec![Role::set_role(&claims.role)]);
match auth::decode_jwt(credentials.token()).await {
Ok(claims) => {
req.attach(vec![Role::set_role(&claims.role)]);
req.extensions_mut()
.insert(LoginUser::new(claims.id, claims.username));
req.extensions_mut()
.insert(LoginUser::new(claims.id, claims.username));
Ok(req)
Ok(req)
}
Err(e) => Err((e, req)),
}
}
fn public_path() -> &'static str {
@ -49,7 +55,7 @@ fn public_path() -> &'static str {
return "./public/";
}
"./ffplayout-frontend/dist"
"./ffplayout-frontend/.output/public/"
}
#[actix_web::main]

View File

@ -22,7 +22,7 @@ regex = "1"
reqwest = { version = "0.11", features = ["blocking", "json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
simplelog = { version = "^0.12", features = ["paris"] }
simplelog = { version = "0.12", features = ["paris"] }
tiny_http = { version = "0.12", default-features = false }
zeromq = { git = "https://github.com/zeromq/zmq.rs.git", default-features = false, features = [
"async-std-runtime",

View File

@ -12,7 +12,7 @@ edition.workspace = true
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
crossbeam-channel = "0.5"
ffprobe = "0.3"
file-rotate = "0.7.0"
file-rotate = "0.7"
lettre = "0.10"
log = "0.4"
rand = "0.8"
@ -22,7 +22,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
shlex = "1.1"
simplelog = { version = "^0.12", features = ["paris"] }
simplelog = { version = "0.12", features = ["paris"] }
time = { version = "0.3", features = ["formatting", "macros"] }
walkdir = "2"