mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-01-30 16:06:00 -05:00
update Rust dependencies
This pulls in a duplicate version of `thiserror` for now, but oh well.
This commit is contained in:
parent
cbb2c30b56
commit
dd30d5bcf8
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
name: Rust ${{ matrix.rust }}
|
name: Rust ${{ matrix.rust }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
rust: [ "stable", "1.81", "nightly" ]
|
rust: [ "stable", "1.82", "nightly" ]
|
||||||
include:
|
include:
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
extra_args: "--features nightly --benches"
|
extra_args: "--features nightly --benches"
|
||||||
|
@ -10,7 +10,7 @@ even on minor releases, e.g. `v0.7.5` -> `v0.7.6`.
|
|||||||
|
|
||||||
## unreleased
|
## unreleased
|
||||||
|
|
||||||
* bump minimum Rust version to 1.81.
|
* bump minimum Rust version to 1.82.
|
||||||
* improve error message on timeout opening stream.
|
* improve error message on timeout opening stream.
|
||||||
* use `jiff` for time manipulations.
|
* use `jiff` for time manipulations.
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ following command:
|
|||||||
$ brew install node
|
$ brew install node
|
||||||
```
|
```
|
||||||
|
|
||||||
Next, you need Rust 1.81+ and Cargo. The easiest way to install them is by
|
Next, you need Rust 1.82+ and Cargo. The easiest way to install them is by
|
||||||
following the instructions at [rustup.rs](https://www.rustup.rs/). Avoid
|
following the instructions at [rustup.rs](https://www.rustup.rs/). Avoid
|
||||||
your Linux distribution's Rust packages, which tend to be too old.
|
your Linux distribution's Rust packages, which tend to be too old.
|
||||||
(At least on Debian-based systems; Arch and Gentoo might be okay.)
|
(At least on Debian-based systems; Arch and Gentoo might be okay.)
|
||||||
|
909
server/Cargo.lock
generated
909
server/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,7 @@ authors = ["Scott Lamb <slamb@slamb.org>"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
license-file = "../LICENSE.txt"
|
license-file = "../LICENSE.txt"
|
||||||
rust-version = "1.81"
|
rust-version = "1.82"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
@ -30,7 +30,7 @@ jiff = "0.1.8"
|
|||||||
nix = "0.27.0"
|
nix = "0.27.0"
|
||||||
pretty-hex = "0.4.0"
|
pretty-hex = "0.4.0"
|
||||||
ring = "0.17.0"
|
ring = "0.17.0"
|
||||||
rusqlite = "0.32.1"
|
rusqlite = "0.33.0"
|
||||||
tracing = { version = "0.1" }
|
tracing = { version = "0.1" }
|
||||||
tracing-core = "0.1.30"
|
tracing-core = "0.1.30"
|
||||||
tracing-futures = { version = "0.2.5", features = ["futures-03", "std-future"] }
|
tracing-futures = { version = "0.2.5", features = ["futures-03", "std-future"] }
|
||||||
@ -41,7 +41,7 @@ tracing-subscriber = { version = "0.3.16" }
|
|||||||
base = { package = "moonfire-base", path = "base" }
|
base = { package = "moonfire-base", path = "base" }
|
||||||
base64 = { workspace = true }
|
base64 = { workspace = true }
|
||||||
blake3 = "1.0.0"
|
blake3 = "1.0.0"
|
||||||
bpaf = { version = "0.9.1", features = ["autocomplete", "bright-color", "derive"]}
|
bpaf = { version = "0.9.15", features = ["autocomplete", "bright-color", "derive"]}
|
||||||
bytes = "1"
|
bytes = "1"
|
||||||
byteorder = "1.0"
|
byteorder = "1.0"
|
||||||
cursive = { version = "0.21.1", default-features = false, features = ["termion-backend"] }
|
cursive = { version = "0.21.1", default-features = false, features = ["termion-backend"] }
|
||||||
@ -69,7 +69,7 @@ serde = { version = "1.0", features = ["derive"] }
|
|||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
smallvec = { version = "1.7", features = ["union"] }
|
smallvec = { version = "1.7", features = ["union"] }
|
||||||
tokio = { version = "1.24", features = ["macros", "rt-multi-thread", "signal", "sync", "time"] }
|
tokio = { version = "1.24", features = ["macros", "rt-multi-thread", "signal", "sync", "time"] }
|
||||||
tokio-tungstenite = "0.23.1"
|
tokio-tungstenite = "0.26.1"
|
||||||
toml = "0.8"
|
toml = "0.8"
|
||||||
tracing = { workspace = true, features = ["log"] }
|
tracing = { workspace = true, features = ["log"] }
|
||||||
tracing-subscriber = { version = "0.3.16", features = ["env-filter", "json"] }
|
tracing-subscriber = { version = "0.3.16", features = ["env-filter", "json"] }
|
||||||
@ -80,7 +80,6 @@ ulid = "1.0.0"
|
|||||||
url = "2.1.1"
|
url = "2.1.1"
|
||||||
uuid = { version = "1.1.2", features = ["serde", "std", "v4"] }
|
uuid = { version = "1.1.2", features = ["serde", "std", "v4"] }
|
||||||
flate2 = "1.0.26"
|
flate2 = "1.0.26"
|
||||||
git-version = "0.3.5"
|
|
||||||
hyper-util = { version = "0.1.7", features = ["server-graceful", "tokio"] }
|
hyper-util = { version = "0.1.7", features = ["server-graceful", "tokio"] }
|
||||||
http-body = "1.0.1"
|
http-body = "1.0.1"
|
||||||
http-body-util = "0.1.2"
|
http-body-util = "0.1.2"
|
||||||
|
@ -6,6 +6,7 @@ readme = "../README.md"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
license-file = "../../LICENSE.txt"
|
license-file = "../../LICENSE.txt"
|
||||||
publish = false
|
publish = false
|
||||||
|
rust-version = "1.82"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
nightly = []
|
nightly = []
|
||||||
|
@ -5,7 +5,7 @@ authors = ["Scott Lamb <slamb@slamb.org>"]
|
|||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license-file = "../../LICENSE.txt"
|
license-file = "../../LICENSE.txt"
|
||||||
rust-version = "1.81"
|
rust-version = "1.82"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
@ -23,13 +23,12 @@ cstr = "0.2.5"
|
|||||||
diff = "0.1.12"
|
diff = "0.1.12"
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
h264-reader = { workspace = true }
|
h264-reader = { workspace = true }
|
||||||
hashlink = "0.9.1"
|
hashlink = "0.10.0"
|
||||||
itertools = { workspace = true }
|
itertools = { workspace = true }
|
||||||
jiff = { workspace = true }
|
jiff = { workspace = true }
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
nix = { workspace = true, features = ["dir", "feature", "fs", "mman"] }
|
nix = { workspace = true, features = ["dir", "feature", "fs", "mman"] }
|
||||||
num-rational = { version = "0.4.0", default-features = false, features = ["std"] }
|
num-rational = { version = "0.4.0", default-features = false, features = ["std"] }
|
||||||
odds = { version = "0.4.0", features = ["std-vec"] }
|
|
||||||
pretty-hex = { workspace = true }
|
pretty-hex = { workspace = true }
|
||||||
protobuf = "3.0"
|
protobuf = "3.0"
|
||||||
ring = { workspace = true }
|
ring = { workspace = true }
|
||||||
|
@ -13,7 +13,6 @@ use crate::coding;
|
|||||||
use crate::db::CompositeId;
|
use crate::db::CompositeId;
|
||||||
use crate::schema;
|
use crate::schema;
|
||||||
use base::{bail, err, Error};
|
use base::{bail, err, Error};
|
||||||
use cstr::cstr;
|
|
||||||
use nix::sys::statvfs::Statvfs;
|
use nix::sys::statvfs::Statvfs;
|
||||||
use nix::{
|
use nix::{
|
||||||
fcntl::{FlockArg, OFlag},
|
fcntl::{FlockArg, OFlag},
|
||||||
@ -134,7 +133,7 @@ impl Fd {
|
|||||||
/// Reads `dir`'s metadata. If none is found, returns an empty proto.
|
/// Reads `dir`'s metadata. If none is found, returns an empty proto.
|
||||||
pub(crate) fn read_meta(dir: &Fd) -> Result<schema::DirMeta, Error> {
|
pub(crate) fn read_meta(dir: &Fd) -> Result<schema::DirMeta, Error> {
|
||||||
let mut meta = schema::DirMeta::default();
|
let mut meta = schema::DirMeta::default();
|
||||||
let mut f = match crate::fs::openat(dir.0, cstr!("meta"), OFlag::O_RDONLY, Mode::empty()) {
|
let mut f = match crate::fs::openat(dir.0, c"meta", OFlag::O_RDONLY, Mode::empty()) {
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
if e == nix::Error::ENOENT {
|
if e == nix::Error::ENOENT {
|
||||||
return Ok(meta);
|
return Ok(meta);
|
||||||
@ -184,7 +183,7 @@ pub(crate) fn write_meta(dirfd: RawFd, meta: &schema::DirMeta) -> Result<(), Err
|
|||||||
data.resize(FIXED_DIR_META_LEN, 0); // pad to required length.
|
data.resize(FIXED_DIR_META_LEN, 0); // pad to required length.
|
||||||
let mut f = crate::fs::openat(
|
let mut f = crate::fs::openat(
|
||||||
dirfd,
|
dirfd,
|
||||||
cstr!("meta"),
|
c"meta",
|
||||||
OFlag::O_CREAT | OFlag::O_WRONLY,
|
OFlag::O_CREAT | OFlag::O_WRONLY,
|
||||||
Mode::S_IRUSR | Mode::S_IWUSR,
|
Mode::S_IRUSR | Mode::S_IWUSR,
|
||||||
)
|
)
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
use crate::db::SqlUuid;
|
use crate::db::SqlUuid;
|
||||||
use crate::{dir, schema};
|
use crate::{dir, schema};
|
||||||
use base::{bail, err, Error};
|
use base::{bail, err, Error};
|
||||||
use cstr::cstr;
|
|
||||||
use nix::fcntl::{FlockArg, OFlag};
|
use nix::fcntl::{FlockArg, OFlag};
|
||||||
use nix::sys::stat::Mode;
|
use nix::sys::stat::Mode;
|
||||||
use protobuf::Message;
|
use protobuf::Message;
|
||||||
@ -24,8 +23,8 @@ const FIXED_DIR_META_LEN: usize = 512;
|
|||||||
|
|
||||||
/// Maybe upgrades the `meta` file, returning if an upgrade happened (and thus a sync is needed).
|
/// Maybe upgrades the `meta` file, returning if an upgrade happened (and thus a sync is needed).
|
||||||
fn maybe_upgrade_meta(dir: &dir::Fd, db_meta: &schema::DirMeta) -> Result<bool, Error> {
|
fn maybe_upgrade_meta(dir: &dir::Fd, db_meta: &schema::DirMeta) -> Result<bool, Error> {
|
||||||
let tmp_path = cstr!("meta.tmp");
|
let tmp_path = c"meta.tmp";
|
||||||
let meta_path = cstr!("meta");
|
let meta_path = c"meta";
|
||||||
let mut f = crate::fs::openat(
|
let mut f = crate::fs::openat(
|
||||||
dir.as_fd().as_raw_fd(),
|
dir.as_fd().as_raw_fd(),
|
||||||
meta_path,
|
meta_path,
|
||||||
|
@ -94,7 +94,7 @@ fn main() {
|
|||||||
{
|
{
|
||||||
Ok(a) => a,
|
Ok(a) => a,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
e.print_mesage(100);
|
e.print_message(100);
|
||||||
std::process::exit(e.exit_code())
|
std::process::exit(e.exit_code())
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use base::{bail, err, Error};
|
use base::{bail, err, Error};
|
||||||
|
use bytes::Bytes;
|
||||||
use futures::SinkExt;
|
use futures::SinkExt;
|
||||||
use http::header;
|
use http::header;
|
||||||
use tokio::sync::broadcast::error::RecvError;
|
use tokio::sync::broadcast::error::RecvError;
|
||||||
@ -97,7 +98,7 @@ impl Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_ = keepalive.tick() => {
|
_ = keepalive.tick() => {
|
||||||
if ws.send(tungstenite::Message::Ping(Vec::new())).await.is_err() {
|
if ws.send(tungstenite::Message::Ping(Bytes::new())).await.is_err() {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,6 +155,9 @@ impl Service {
|
|||||||
);
|
);
|
||||||
let mut v = hdr.into_bytes();
|
let mut v = hdr.into_bytes();
|
||||||
mp4.append_into_vec(&mut v).await?;
|
mp4.append_into_vec(&mut v).await?;
|
||||||
Ok(ws.send(tungstenite::Message::Binary(v)).await.is_ok())
|
Ok(ws
|
||||||
|
.send(tungstenite::Message::Binary(v.into()))
|
||||||
|
.await
|
||||||
|
.is_ok())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,9 @@ where
|
|||||||
if let Err(err) = handler(&mut ws).await {
|
if let Err(err) = handler(&mut ws).await {
|
||||||
// TODO: use a nice JSON message format for errors.
|
// TODO: use a nice JSON message format for errors.
|
||||||
tracing::error!(%err, "closing with error");
|
tracing::error!(%err, "closing with error");
|
||||||
let _ = ws.send(tungstenite::Message::Text(err.to_string())).await;
|
let _ = ws
|
||||||
|
.send(tungstenite::Message::Text(err.to_string().into()))
|
||||||
|
.await;
|
||||||
} else {
|
} else {
|
||||||
tracing::info!("closing");
|
tracing::info!("closing");
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user