Update dependencies, improve startup logging
This commit is contained in:
1287
Cargo.lock
generated
1287
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
18
Cargo.toml
18
Cargo.toml
@@ -14,26 +14,26 @@ actix = "0.13.1"
|
|||||||
actix-web = "4"
|
actix-web = "4"
|
||||||
actix-rt = "2.6"
|
actix-rt = "2.6"
|
||||||
actix-files = "0.6"
|
actix-files = "0.6"
|
||||||
actix-multipart = "0.6.1"
|
actix-multipart = "0.7.2"
|
||||||
futures = "0.3.5"
|
futures = "0.3.5"
|
||||||
jsonwebtoken = "9.2.0"
|
jsonwebtoken = "9.3.0"
|
||||||
serde = "1"
|
serde = "1"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
diesel = { version = "2.0.2", features = ["sqlite"] }
|
diesel = { version = "2.2.5", features = ["sqlite"] }
|
||||||
diesel_migrations = "2.0.0"
|
diesel_migrations = "2.0.0"
|
||||||
hmac = "0.12.1"
|
hmac = "0.12.1"
|
||||||
sha2 = "0.10.8"
|
sha2 = "0.10.8"
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
dotenv = "0.15"
|
dotenv = "0.15"
|
||||||
bcrypt = "0.15.0"
|
bcrypt = "0.16.0"
|
||||||
image = { version = "0.24.7", default-features = false, features = ["jpeg", "png", "jpeg_rayon"] }
|
image = { version = "0.24.9", default-features = false, features = ["jpeg", "png", "jpeg_rayon"] }
|
||||||
walkdir = "2.4.0"
|
walkdir = "2.4.0"
|
||||||
rayon = "1.5"
|
rayon = "1.5"
|
||||||
notify = "6.1.1"
|
notify = "6.1.1"
|
||||||
path-absolutize = "3.0"
|
path-absolutize = "3.1"
|
||||||
log="0.4"
|
log="0.4"
|
||||||
env_logger= "0.10.1"
|
env_logger= "0.11.5"
|
||||||
actix-web-prom = "0.7.0"
|
actix-web-prom = "0.9.0"
|
||||||
prometheus = "0.13"
|
prometheus = "0.13"
|
||||||
lazy_static = "1.1"
|
lazy_static = "1.5"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ impl Handler<RefreshThumbnailsMessage> for StreamActor {
|
|||||||
type Result = ();
|
type Result = ();
|
||||||
|
|
||||||
fn handle(&mut self, _msg: RefreshThumbnailsMessage, _ctx: &mut Self::Context) -> Self::Result {
|
fn handle(&mut self, _msg: RefreshThumbnailsMessage, _ctx: &mut Self::Context) -> Self::Result {
|
||||||
debug!("Refreshing thumbnails after upload");
|
info!("Refreshing thumbnails after upload");
|
||||||
create_thumbnails()
|
create_thumbnails()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
12
src/main.rs
12
src/main.rs
@@ -26,6 +26,7 @@ use actix_web::{
|
|||||||
web::{self, BufMut, BytesMut},
|
web::{self, BufMut, BytesMut},
|
||||||
App, HttpRequest, HttpResponse, HttpServer, Responder,
|
App, HttpRequest, HttpResponse, HttpServer, Responder,
|
||||||
};
|
};
|
||||||
|
use anyhow::Context;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use diesel::sqlite::Sqlite;
|
use diesel::sqlite::Sqlite;
|
||||||
use notify::{Config, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
|
use notify::{Config, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
|
||||||
@@ -139,7 +140,7 @@ async fn upload_image(
|
|||||||
let mut file_path: Option<String> = None;
|
let mut file_path: Option<String> = None;
|
||||||
|
|
||||||
while let Some(Ok(mut part)) = payload.next().await {
|
while let Some(Ok(mut part)) = payload.next().await {
|
||||||
let content_type = part.content_disposition();
|
if let Some(content_type) = part.content_disposition() {
|
||||||
debug!("{:?}", content_type);
|
debug!("{:?}", content_type);
|
||||||
if let Some(filename) = content_type.get_filename() {
|
if let Some(filename) = content_type.get_filename() {
|
||||||
debug!("Name: {:?}", filename);
|
debug!("Name: {:?}", filename);
|
||||||
@@ -156,6 +157,7 @@ async fn upload_image(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let path = file_path.unwrap_or_else(|| app_state.base_path.clone());
|
let path = file_path.unwrap_or_else(|| app_state.base_path.clone());
|
||||||
if !file_content.is_empty() {
|
if !file_content.is_empty() {
|
||||||
@@ -462,7 +464,9 @@ fn is_video(entry: &DirEntry) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> std::io::Result<()> {
|
fn main() -> std::io::Result<()> {
|
||||||
dotenv::dotenv().ok();
|
if let Err(err) = dotenv::dotenv() {
|
||||||
|
println!("Error parsing .env {:?}", err);
|
||||||
|
}
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
||||||
run_migrations(&mut connect()).expect("Failed to run migrations");
|
run_migrations(&mut connect()).expect("Failed to run migrations");
|
||||||
@@ -544,7 +548,9 @@ fn watch_files() {
|
|||||||
let base_str = dotenv::var("BASE_PATH").unwrap();
|
let base_str = dotenv::var("BASE_PATH").unwrap();
|
||||||
let base_path = Path::new(&base_str);
|
let base_path = Path::new(&base_str);
|
||||||
|
|
||||||
watcher.watch(base_path, RecursiveMode::Recursive).unwrap();
|
watcher.watch(base_path, RecursiveMode::Recursive)
|
||||||
|
.context(format!("Unable to watch BASE_PATH: '{}'", base_str))
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let ev = wrx.recv();
|
let ev = wrx.recv();
|
||||||
|
|||||||
Reference in New Issue
Block a user