Merge pull request 'feature/rust-2024-edition' (#41) from feature/rust-2024-edition into master
Reviewed-on: #41
This commit was merged in pull request #41.
This commit is contained in:
1376
Cargo.lock
generated
1376
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
name = "image-api"
|
name = "image-api"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
authors = ["Cameron Cordes <cameronc.dev@gmail.com>"]
|
authors = ["Cameron Cordes <cameronc.dev@gmail.com>"]
|
||||||
edition = "2021"
|
edition = "2024"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
use actix_web::Responder;
|
use actix_web::Responder;
|
||||||
use actix_web::{
|
use actix_web::{
|
||||||
web::{self, Json},
|
|
||||||
HttpResponse,
|
HttpResponse,
|
||||||
|
web::{self, Json},
|
||||||
};
|
};
|
||||||
use chrono::{Duration, Utc};
|
use chrono::{Duration, Utc};
|
||||||
use jsonwebtoken::{encode, EncodingKey, Header};
|
use jsonwebtoken::{EncodingKey, Header, encode};
|
||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
data::{secret_key, Claims, CreateAccountRequest, LoginRequest, Token},
|
data::{Claims, CreateAccountRequest, LoginRequest, Token, secret_key},
|
||||||
database::UserDao,
|
database::UserDao,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
use std::{fs, str::FromStr};
|
use std::{fs, str::FromStr};
|
||||||
|
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{Context, anyhow};
|
||||||
|
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use log::error;
|
use log::error;
|
||||||
|
|
||||||
use actix_web::error::ErrorUnauthorized;
|
use actix_web::error::ErrorUnauthorized;
|
||||||
use actix_web::{dev, http::header, Error, FromRequest, HttpRequest};
|
use actix_web::{Error, FromRequest, HttpRequest, dev, http::header};
|
||||||
use futures::future::{err, ok, Ready};
|
use futures::future::{Ready, err, ok};
|
||||||
use jsonwebtoken::{decode, Algorithm, DecodingKey, Validation};
|
use jsonwebtoken::{Algorithm, DecodingKey, Validation, decode};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
@@ -226,7 +226,8 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_expired_token() {
|
fn test_expired_token() {
|
||||||
let err = Claims::from_str(
|
let err = Claims::from_str(
|
||||||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI5IiwiZXhwIjoxNn0.eZnfaNfiD54VMbphIqeBICeG9SzAtwNXntLwtTBihjY");
|
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI5IiwiZXhwIjoxNn0.eZnfaNfiD54VMbphIqeBICeG9SzAtwNXntLwtTBihjY",
|
||||||
|
);
|
||||||
|
|
||||||
match err.unwrap_err().into_kind() {
|
match err.unwrap_err().into_kind() {
|
||||||
ErrorKind::ExpiredSignature => assert!(true),
|
ErrorKind::ExpiredSignature => assert!(true),
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use bcrypt::{hash, verify, DEFAULT_COST};
|
use bcrypt::{DEFAULT_COST, hash, verify};
|
||||||
use diesel::prelude::*;
|
use diesel::prelude::*;
|
||||||
use diesel::sqlite::SqliteConnection;
|
use diesel::sqlite::SqliteConnection;
|
||||||
use std::ops::DerefMut;
|
use std::ops::DerefMut;
|
||||||
@@ -30,7 +30,7 @@ impl SqliteUserDao {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub mod test {
|
pub mod test {
|
||||||
use diesel::{Connection, SqliteConnection};
|
use diesel::{Connection, SqliteConnection};
|
||||||
use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
|
use diesel_migrations::{EmbeddedMigrations, MigrationHarness, embed_migrations};
|
||||||
|
|
||||||
const DB_MIGRATIONS: EmbeddedMigrations = embed_migrations!();
|
const DB_MIGRATIONS: EmbeddedMigrations = embed_migrations!();
|
||||||
|
|
||||||
|
|||||||
30
src/files.rs
30
src/files.rs
@@ -7,18 +7,18 @@ use std::sync::Mutex;
|
|||||||
|
|
||||||
use ::anyhow;
|
use ::anyhow;
|
||||||
use actix::{Handler, Message};
|
use actix::{Handler, Message};
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{Context, anyhow};
|
||||||
|
|
||||||
use crate::data::{Claims, FilesRequest, FilterMode, PhotosResponse, SortType};
|
use crate::data::{Claims, FilesRequest, FilterMode, PhotosResponse, SortType};
|
||||||
use crate::{create_thumbnails, AppState};
|
use crate::{AppState, create_thumbnails};
|
||||||
use actix_web::web::Data;
|
use actix_web::web::Data;
|
||||||
use actix_web::{
|
use actix_web::{
|
||||||
web::{self, Query},
|
|
||||||
HttpRequest, HttpResponse,
|
HttpRequest, HttpResponse,
|
||||||
|
web::{self, Query},
|
||||||
};
|
};
|
||||||
use log::{debug, error, info, trace};
|
use log::{debug, error, info, trace};
|
||||||
use opentelemetry::trace::{Span, Status, TraceContextExt, Tracer};
|
|
||||||
use opentelemetry::KeyValue;
|
use opentelemetry::KeyValue;
|
||||||
|
use opentelemetry::trace::{Span, Status, TraceContextExt, Tracer};
|
||||||
|
|
||||||
use crate::data::SortType::NameAsc;
|
use crate::data::SortType::NameAsc;
|
||||||
use crate::error::IntoHttpError;
|
use crate::error::IntoHttpError;
|
||||||
@@ -144,7 +144,8 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Ok(files) = file_system.get_files_for_path(search_path) {
|
match file_system.get_files_for_path(search_path) {
|
||||||
|
Ok(files) => {
|
||||||
info!("Found {:?} files in path: {:?}", files.len(), search_path);
|
info!("Found {:?} files in path: {:?}", files.len(), search_path);
|
||||||
|
|
||||||
let photos = files
|
let photos = files
|
||||||
@@ -191,7 +192,9 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
|||||||
|
|
||||||
return !excluded
|
return !excluded
|
||||||
&& match filter_mode {
|
&& match filter_mode {
|
||||||
FilterMode::Any => file_tags.iter().any(|t| tag_ids.contains(&t.id)),
|
FilterMode::Any => {
|
||||||
|
file_tags.iter().any(|t| tag_ids.contains(&t.id))
|
||||||
|
}
|
||||||
FilterMode::All => tag_ids
|
FilterMode::All => tag_ids
|
||||||
.iter()
|
.iter()
|
||||||
.all(|id| file_tags.iter().any(|tag| &tag.id == id)),
|
.all(|id| file_tags.iter().any(|tag| &tag.id == id)),
|
||||||
@@ -235,7 +238,8 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
|||||||
photos: response_files,
|
photos: response_files,
|
||||||
dirs,
|
dirs,
|
||||||
})
|
})
|
||||||
} else {
|
}
|
||||||
|
_ => {
|
||||||
error!("Bad photos request: {}", req.path);
|
error!("Bad photos request: {}", req.path);
|
||||||
span_context
|
span_context
|
||||||
.span()
|
.span()
|
||||||
@@ -243,6 +247,7 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
|||||||
HttpResponse::BadRequest().finish()
|
HttpResponse::BadRequest().finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn sort(mut files: Vec<FileWithTagCount>, sort_type: SortType) -> Vec<String> {
|
fn sort(mut files: Vec<FileWithTagCount>, sort_type: SortType) -> Vec<String> {
|
||||||
match sort_type {
|
match sort_type {
|
||||||
@@ -505,12 +510,12 @@ mod tests {
|
|||||||
|
|
||||||
mod api {
|
mod api {
|
||||||
use super::*;
|
use super::*;
|
||||||
use actix_web::{web::Query, HttpResponse};
|
use actix_web::{HttpResponse, web::Query};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
AppState,
|
||||||
data::{Claims, PhotosResponse},
|
data::{Claims, PhotosResponse},
|
||||||
testhelpers::BodyReader,
|
testhelpers::BodyReader,
|
||||||
AppState,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::database::test::in_memory_db_connection;
|
use crate::database::test::in_memory_db_connection;
|
||||||
@@ -561,14 +566,15 @@ mod tests {
|
|||||||
|
|
||||||
assert!(body.photos.contains(&String::from("photo.jpg")));
|
assert!(body.photos.contains(&String::from("photo.jpg")));
|
||||||
assert!(body.dirs.contains(&String::from("test-dir")));
|
assert!(body.dirs.contains(&String::from("test-dir")));
|
||||||
assert!(body
|
assert!(
|
||||||
.photos
|
body.photos
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|filename| !filename.ends_with(".png")
|
.filter(|filename| !filename.ends_with(".png")
|
||||||
&& !filename.ends_with(".jpg")
|
&& !filename.ends_with(".jpg")
|
||||||
&& !filename.ends_with(".jpeg"))
|
&& !filename.ends_with(".jpeg"))
|
||||||
.collect::<Vec<&String>>()
|
.collect::<Vec<&String>>()
|
||||||
.is_empty());
|
.is_empty()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
|
|||||||
29
src/main.rs
29
src/main.rs
@@ -4,13 +4,13 @@ extern crate rayon;
|
|||||||
|
|
||||||
use actix_web::web::Data;
|
use actix_web::web::Data;
|
||||||
use actix_web_prom::PrometheusMetricsBuilder;
|
use actix_web_prom::PrometheusMetricsBuilder;
|
||||||
use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
|
use diesel_migrations::{EmbeddedMigrations, MigrationHarness, embed_migrations};
|
||||||
use futures::stream::StreamExt;
|
use futures::stream::StreamExt;
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
use prometheus::{self, IntGauge};
|
use prometheus::{self, IntGauge};
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::sync::mpsc::channel;
|
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
use std::sync::mpsc::channel;
|
||||||
use std::{collections::HashMap, io::prelude::*};
|
use std::{collections::HashMap, io::prelude::*};
|
||||||
use std::{env, fs::File};
|
use std::{env, fs::File};
|
||||||
use std::{
|
use std::{
|
||||||
@@ -22,9 +22,8 @@ use walkdir::{DirEntry, WalkDir};
|
|||||||
use actix_files::NamedFile;
|
use actix_files::NamedFile;
|
||||||
use actix_multipart as mp;
|
use actix_multipart as mp;
|
||||||
use actix_web::{
|
use actix_web::{
|
||||||
delete, get, middleware, post, put,
|
App, HttpRequest, HttpResponse, HttpServer, Responder, delete, get, middleware, post, put,
|
||||||
web::{self, BufMut, BytesMut},
|
web::{self, BufMut, BytesMut},
|
||||||
App, HttpRequest, HttpResponse, HttpServer, Responder,
|
|
||||||
};
|
};
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
@@ -36,19 +35,19 @@ use crate::auth::login;
|
|||||||
use crate::data::*;
|
use crate::data::*;
|
||||||
use crate::database::*;
|
use crate::database::*;
|
||||||
use crate::files::{
|
use crate::files::{
|
||||||
is_image_or_video, is_valid_full_path, move_file, RealFileSystem, RefreshThumbnailsMessage,
|
RealFileSystem, RefreshThumbnailsMessage, is_image_or_video, is_valid_full_path, move_file,
|
||||||
};
|
};
|
||||||
use crate::otel::{extract_context_from_request, global_tracer};
|
use crate::otel::{extract_context_from_request, global_tracer};
|
||||||
use crate::service::ServiceBuilder;
|
use crate::service::ServiceBuilder;
|
||||||
use crate::state::AppState;
|
use crate::state::AppState;
|
||||||
use crate::tags::*;
|
use crate::tags::*;
|
||||||
use crate::video::actors::{
|
use crate::video::actors::{
|
||||||
create_playlist, generate_video_thumbnail, ProcessMessage, ScanDirectoryMessage,
|
ProcessMessage, ScanDirectoryMessage, create_playlist, generate_video_thumbnail,
|
||||||
};
|
};
|
||||||
use crate::video::generate_video_gifs;
|
use crate::video::generate_video_gifs;
|
||||||
use log::{debug, error, info, trace, warn};
|
use log::{debug, error, info, trace, warn};
|
||||||
use opentelemetry::trace::{Span, Status, TraceContextExt, Tracer};
|
use opentelemetry::trace::{Span, Status, TraceContextExt, Tracer};
|
||||||
use opentelemetry::{global, KeyValue};
|
use opentelemetry::{KeyValue, global};
|
||||||
|
|
||||||
mod auth;
|
mod auth;
|
||||||
mod data;
|
mod data;
|
||||||
@@ -332,14 +331,19 @@ async fn stream_video(
|
|||||||
span.set_status(Status::error(format!("playlist not valid {}", playlist)));
|
span.set_status(Status::error(format!("playlist not valid {}", playlist)));
|
||||||
|
|
||||||
HttpResponse::BadRequest().finish()
|
HttpResponse::BadRequest().finish()
|
||||||
} else if let Ok(file) = NamedFile::open(playlist) {
|
} else {
|
||||||
|
match NamedFile::open(playlist) {
|
||||||
|
Ok(file) => {
|
||||||
span.set_status(Status::Ok);
|
span.set_status(Status::Ok);
|
||||||
file.into_response(&request)
|
file.into_response(&request)
|
||||||
} else {
|
}
|
||||||
|
_ => {
|
||||||
span.set_status(Status::error(format!("playlist not found {}", playlist)));
|
span.set_status(Status::error(format!("playlist not found {}", playlist)));
|
||||||
HttpResponse::NotFound().finish()
|
HttpResponse::NotFound().finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[get("/video/{path}")]
|
#[get("/video/{path}")]
|
||||||
async fn get_video_part(
|
async fn get_video_part(
|
||||||
@@ -359,10 +363,12 @@ async fn get_video_part(
|
|||||||
file_part.push(app_state.video_path.clone());
|
file_part.push(app_state.video_path.clone());
|
||||||
file_part.push(part);
|
file_part.push(part);
|
||||||
// TODO: Do we need to guard against directory attacks here?
|
// TODO: Do we need to guard against directory attacks here?
|
||||||
if let Ok(file) = NamedFile::open(&file_part) {
|
match NamedFile::open(&file_part) {
|
||||||
|
Ok(file) => {
|
||||||
span.set_status(Status::Ok);
|
span.set_status(Status::Ok);
|
||||||
file.into_response(&request)
|
file.into_response(&request)
|
||||||
} else {
|
}
|
||||||
|
_ => {
|
||||||
error!("Video part not found: {:?}", file_part);
|
error!("Video part not found: {:?}", file_part);
|
||||||
span.set_status(Status::error(format!(
|
span.set_status(Status::error(format!(
|
||||||
"Video part not found '{}'",
|
"Video part not found '{}'",
|
||||||
@@ -371,6 +377,7 @@ async fn get_video_part(
|
|||||||
HttpResponse::NotFound().finish()
|
HttpResponse::NotFound().finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[get("image/favorites")]
|
#[get("image/favorites")]
|
||||||
async fn favorites(
|
async fn favorites(
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
use actix_web::web::Data;
|
use actix_web::web::Data;
|
||||||
use actix_web::{get, web, HttpRequest, HttpResponse, Responder};
|
use actix_web::{HttpRequest, HttpResponse, Responder, get, web};
|
||||||
use chrono::LocalResult::{Ambiguous, Single};
|
use chrono::LocalResult::{Ambiguous, Single};
|
||||||
use chrono::{DateTime, Datelike, FixedOffset, Local, LocalResult, NaiveDate, TimeZone, Utc};
|
use chrono::{DateTime, Datelike, FixedOffset, Local, LocalResult, NaiveDate, TimeZone, Utc};
|
||||||
use log::{debug, trace, warn};
|
use log::{debug, trace, warn};
|
||||||
use opentelemetry::trace::{Span, Status, Tracer};
|
|
||||||
use opentelemetry::KeyValue;
|
use opentelemetry::KeyValue;
|
||||||
|
use opentelemetry::trace::{Span, Status, Tracer};
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
@@ -135,8 +135,7 @@ fn extract_date_from_filename(filename: &str) -> Option<DateTime<FixedOffset>> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 1. Screenshot format: Screenshot_2014-06-01-20-44-50.png
|
// 1. Screenshot format: Screenshot_2014-06-01-20-44-50.png
|
||||||
if let Some(captures) =
|
if let Some(captures) = regex::Regex::new(r"(\d{4})-(\d{2})-(\d{2})-(\d{2})-(\d{2})-(\d{2})")
|
||||||
regex::Regex::new(r"(\d{4})-(\d{2})-(\d{2})-(\d{2})-(\d{2})-(\d{2})")
|
|
||||||
.ok()?
|
.ok()?
|
||||||
.captures(filename)
|
.captures(filename)
|
||||||
.and_then(|c| build_date_from_ymd_capture(&c))
|
.and_then(|c| build_date_from_ymd_capture(&c))
|
||||||
@@ -145,8 +144,7 @@ fn extract_date_from_filename(filename: &str) -> Option<DateTime<FixedOffset>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Screenshot format: Screenshot_20140601[_-]204450.png
|
// Screenshot format: Screenshot_20140601[_-]204450.png
|
||||||
if let Some(captures) =
|
if let Some(captures) = regex::Regex::new(r"(\d{4})(\d{2})(\d{2})[_-](\d{2})(\d{2})(\d{2})")
|
||||||
regex::Regex::new(r"(\d{4})(\d{2})(\d{2})[_-](\d{2})(\d{2})(\d{2})")
|
|
||||||
.ok()?
|
.ok()?
|
||||||
.captures(filename)
|
.captures(filename)
|
||||||
.and_then(|c| build_date_from_ymd_capture(&c))
|
.and_then(|c| build_date_from_ymd_capture(&c))
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
use actix_web::http::header::HeaderMap;
|
|
||||||
use actix_web::HttpRequest;
|
use actix_web::HttpRequest;
|
||||||
|
use actix_web::http::header::HeaderMap;
|
||||||
use opentelemetry::global::{BoxedSpan, BoxedTracer};
|
use opentelemetry::global::{BoxedSpan, BoxedTracer};
|
||||||
use opentelemetry::propagation::TextMapPropagator;
|
use opentelemetry::propagation::TextMapPropagator;
|
||||||
use opentelemetry::trace::{Span, Status, Tracer};
|
use opentelemetry::trace::{Span, Status, Tracer};
|
||||||
use opentelemetry::{global, Context, KeyValue};
|
use opentelemetry::{Context, KeyValue, global};
|
||||||
use opentelemetry_appender_log::OpenTelemetryLogBridge;
|
use opentelemetry_appender_log::OpenTelemetryLogBridge;
|
||||||
use opentelemetry_otlp::WithExportConfig;
|
use opentelemetry_otlp::WithExportConfig;
|
||||||
|
use opentelemetry_sdk::Resource;
|
||||||
use opentelemetry_sdk::logs::{BatchLogProcessor, SdkLoggerProvider};
|
use opentelemetry_sdk::logs::{BatchLogProcessor, SdkLoggerProvider};
|
||||||
use opentelemetry_sdk::propagation::TraceContextPropagator;
|
use opentelemetry_sdk::propagation::TraceContextPropagator;
|
||||||
use opentelemetry_sdk::Resource;
|
|
||||||
|
|
||||||
pub fn global_tracer() -> BoxedTracer {
|
pub fn global_tracer() -> BoxedTracer {
|
||||||
global::tracer("image-server")
|
global::tracer("image-server")
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
use crate::data::GetTagsRequest;
|
use crate::data::GetTagsRequest;
|
||||||
use crate::otel::{extract_context_from_request, global_tracer, trace_db_call};
|
use crate::otel::{extract_context_from_request, global_tracer, trace_db_call};
|
||||||
use crate::{connect, data::AddTagRequest, error::IntoHttpError, schema, Claims, ThumbnailRequest};
|
use crate::{Claims, ThumbnailRequest, connect, data::AddTagRequest, error::IntoHttpError, schema};
|
||||||
use actix_web::dev::{ServiceFactory, ServiceRequest};
|
use actix_web::dev::{ServiceFactory, ServiceRequest};
|
||||||
use actix_web::{web, App, HttpRequest, HttpResponse, Responder};
|
use actix_web::{App, HttpRequest, HttpResponse, Responder, web};
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use diesel::dsl::count_star;
|
use diesel::dsl::count_star;
|
||||||
use diesel::prelude::*;
|
use diesel::prelude::*;
|
||||||
use diesel::sql_types::*;
|
use diesel::sql_types::*;
|
||||||
use log::{debug, info};
|
use log::{debug, info};
|
||||||
use opentelemetry::trace::{Span, Status, TraceContextExt, Tracer};
|
|
||||||
use opentelemetry::KeyValue;
|
use opentelemetry::KeyValue;
|
||||||
|
use opentelemetry::trace::{Span, Status, TraceContextExt, Tracer};
|
||||||
use schema::{tagged_photo, tags};
|
use schema::{tagged_photo, tags};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::borrow::BorrowMut;
|
use std::borrow::BorrowMut;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
use actix_web::{
|
use actix_web::{
|
||||||
body::{BoxBody, MessageBody},
|
|
||||||
HttpResponse,
|
HttpResponse,
|
||||||
|
body::{BoxBody, MessageBody},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::database::{models::User, UserDao};
|
use crate::database::{UserDao, models::User};
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::option::Option;
|
use std::option::Option;
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ use crate::otel::global_tracer;
|
|||||||
use actix::prelude::*;
|
use actix::prelude::*;
|
||||||
use futures::TryFutureExt;
|
use futures::TryFutureExt;
|
||||||
use log::{debug, error, info, trace, warn};
|
use log::{debug, error, info, trace, warn};
|
||||||
use opentelemetry::trace::{Span, Status, Tracer};
|
|
||||||
use opentelemetry::KeyValue;
|
use opentelemetry::KeyValue;
|
||||||
|
use opentelemetry::trace::{Span, Status, Tracer};
|
||||||
use std::io::Result;
|
use std::io::Result;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::process::{Child, Command, ExitStatus, Stdio};
|
use std::process::{Child, Command, ExitStatus, Stdio};
|
||||||
|
|||||||
Reference in New Issue
Block a user