Unify dependencies

This commit is contained in:
Adrian Woźniak 2021-08-13 12:42:29 +02:00
parent c8730485d0
commit 7047a309d4
No known key found for this signature in database
GPG Key ID: DE43476F72AD3F6C
23 changed files with 369 additions and 282 deletions

544
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@
[workspace] [workspace]
members = [ members = [
"./shared/common",
"./jirs-cli", "./jirs-cli",
"./jirs-server", "./jirs-server",
"./shared/jirs-config", "./shared/jirs-config",

View File

@ -13,12 +13,10 @@ name = "amazon_actor"
path = "./src/lib.rs" path = "./src/lib.rs"
[dependencies] [dependencies]
serde = "*" common = { path = "../../shared/common" }
actix = { version = "0.10.0" } actix = { version = "0.10.0" }
actix-service = { version = "*" }
actix-rt = "1" serde = { version = "*" }
actix-web-actors = "*"
bytes = { version = "0.5.6" } bytes = { version = "0.5.6" }

View File

@ -1,3 +1,4 @@
extern crate common;
use rusoto_s3::{PutObjectRequest, S3Client, S3}; use rusoto_s3::{PutObjectRequest, S3Client, S3};
#[derive(Debug)] #[derive(Debug)]

View File

@ -13,13 +13,13 @@ name = "database_actor"
path = "./src/lib.rs" path = "./src/lib.rs"
[dependencies] [dependencies]
common = { path = "../../shared/common" }
actix = { version = "0.10.0" }
serde = "*" serde = "*"
bincode = "*" bincode = "*"
toml = { version = "*" } toml = { version = "*" }
actix = { version = "0.10.0" }
actix-web = { version = "*" }
futures = { version = "0.3.8" } futures = { version = "0.3.8" }
openssl-sys = { version = "*", features = ["vendored"] } openssl-sys = { version = "*", features = ["vendored"] }
libc = { version = "0.2.0", default-features = false } libc = { version = "0.2.0", default-features = false }
@ -58,5 +58,5 @@ features = ["backend"]
path = "../../derive/derive_db_execute" path = "../../derive/derive_db_execute"
[dependencies.diesel] [dependencies.diesel]
version = "1.4.5" version = "*"
features = ["unstable", "postgres", "numeric", "extras", "uuidv07"] features = ["unstable", "postgres", "numeric", "extras", "uuidv07"]

View File

@ -13,6 +13,7 @@ name = "filesystem_actor"
path = "./src/lib.rs" path = "./src/lib.rs"
[dependencies] [dependencies]
common = { path = "../../shared/common" }
actix = { version = "0.10.0" } actix = { version = "0.10.0" }
futures = { version = "0.3.8" } futures = { version = "0.3.8" }

View File

@ -13,12 +13,14 @@ name = "highlight_actor"
path = "./src/lib.rs" path = "./src/lib.rs"
[dependencies] [dependencies]
common = { path = "../../shared/common" }
actix = { version = "0.10.0" }
serde = "*" serde = "*"
bincode = "*" bincode = "*"
toml = { version = "*" } toml = { version = "*" }
simsearch = { version = "0.2" } simsearch = { version = "0.2" }
actix = { version = "0.10.0" }
flate2 = { version = "*" } flate2 = { version = "*" }
syntect = { version = "*" } syntect = { version = "*" }

View File

@ -13,6 +13,7 @@ name = "mail_actor"
path = "./src/lib.rs" path = "./src/lib.rs"
[dependencies] [dependencies]
common = { path = "../../shared/common" }
actix = { version = "0.10.0" } actix = { version = "0.10.0" }
serde = "*" serde = "*"

View File

@ -18,16 +18,13 @@ aws-s3 = ["amazon-actor"]
default = ["local-storage", "aws-s3"] default = ["local-storage", "aws-s3"]
[dependencies] [dependencies]
common = { path = "../../shared/common" }
actix = { version = "0.10.0" }
serde = "*" serde = "*"
bincode = "*" bincode = "*"
toml = { version = "*" } toml = { version = "*" }
actix = { version = "0.10.0" }
actix-web = { version = "*" }
actix-cors = { version = "*" }
actix-service = { version = "*" }
actix-rt = "1"
actix-web-actors = "*"
actix-multipart = "*" actix-multipart = "*"
bytes = { version = "0.5.6" } bytes = { version = "0.5.6" }

View File

@ -5,6 +5,7 @@ use actix_multipart::{Field, Multipart};
use actix_web::http::header::ContentDisposition; use actix_web::http::header::ContentDisposition;
use actix_web::web::Data; use actix_web::web::Data;
use actix_web::{post, web, Error, HttpResponse}; use actix_web::{post, web, Error, HttpResponse};
use common::*;
use database_actor::authorize_user::AuthorizeUser; use database_actor::authorize_user::AuthorizeUser;
use database_actor::user_projects::CurrentUserProject; use database_actor::user_projects::CurrentUserProject;
use database_actor::users::UpdateAvatarUrl; use database_actor::users::UpdateAvatarUrl;

View File

@ -1,4 +1,5 @@
use actix_web::HttpResponse; use actix_web::HttpResponse;
use common::*;
use jirs_data::msg::WsError; use jirs_data::msg::WsError;
use jirs_data::ErrorResponse; use jirs_data::ErrorResponse;

View File

@ -3,6 +3,7 @@ use actix_multipart::Field;
use actix_web::http::header::ContentDisposition; use actix_web::http::header::ContentDisposition;
use actix_web::web::Data; use actix_web::web::Data;
use actix_web::Error; use actix_web::Error;
use common::*;
use futures::StreamExt; use futures::StreamExt;
use jirs_data::UserId; use jirs_data::UserId;
use tokio::sync::broadcast::{Receiver, Sender}; use tokio::sync::broadcast::{Receiver, Sender};

View File

@ -4,6 +4,7 @@ extern crate log;
use actix::Addr; use actix::Addr;
use actix_web::web::Data; use actix_web::web::Data;
use actix_web::{HttpRequest, HttpResponse}; use actix_web::{HttpRequest, HttpResponse};
use common::*;
use database_actor::authorize_user::AuthorizeUser; use database_actor::authorize_user::AuthorizeUser;
use database_actor::DbExecutor; use database_actor::DbExecutor;
pub use errors::*; pub use errors::*;

View File

@ -1,11 +1,13 @@
use actix_web::http::header::{self}; use actix_web::http::header::{self};
use actix_web::http::HeaderMap; use actix_web::http::HeaderMap;
use common::*;
pub fn token_from_headers( pub fn token_from_headers(
headers: &HeaderMap, headers: &HeaderMap,
) -> std::result::Result<uuid::Uuid, crate::errors::ServiceError> { ) -> std::result::Result<uuid::Uuid, crate::errors::ServiceError> {
headers headers
.get(header::AUTHORIZATION).ok_or(crate::errors::ServiceError::Unauthorized) .get(header::AUTHORIZATION)
.ok_or(crate::errors::ServiceError::Unauthorized)
.map(|h| h.to_str().unwrap_or_default()) .map(|h| h.to_str().unwrap_or_default())
.and_then(|s| parse_bearer(s)) .and_then(|s| parse_bearer(s))
} }

View File

@ -13,13 +13,12 @@ name = "websocket_actor"
path = "./src/lib.rs" path = "./src/lib.rs"
[dependencies] [dependencies]
serde = "*" common = { path = "../../shared/common" }
bincode = "*"
toml = { version = "*" }
actix = { version = "0.10.0" } actix = { version = "0.10.0" }
actix-web = { version = "*" }
actix-web-actors = "*" serde = { version = "*" }
bincode = { version = "*" }
toml = { version = "*" }
futures = { version = "0.3.8" } futures = { version = "0.3.8" }
openssl-sys = { version = "*", features = ["vendored"] } openssl-sys = { version = "*", features = ["vendored"] }

View File

@ -5,6 +5,7 @@ use actix::{Actor, ActorContext, Addr, AsyncContext, Handler, Recipient, StreamH
use actix_web::web::{self, Data}; use actix_web::web::{self, Data};
use actix_web::{get, Error, HttpRequest, HttpResponse}; use actix_web::{get, Error, HttpRequest, HttpResponse};
use actix_web_actors::ws; use actix_web_actors::ws;
use common::{actix_web, actix_web_actors};
use database_actor::projects::LoadCurrentProject; use database_actor::projects::LoadCurrentProject;
use database_actor::user_projects::CurrentUserProject; use database_actor::user_projects::CurrentUserProject;
use database_actor::DbExecutor; use database_actor::DbExecutor;

View File

@ -16,8 +16,8 @@ use crate::components::styled_textarea::StyledTextarea;
use crate::modals::epic_field; use crate::modals::epic_field;
use crate::modals::issues_create::{Model as AddIssueModal, Type}; use crate::modals::issues_create::{Model as AddIssueModal, Type};
use crate::model::Model; use crate::model::Model;
use crate::{FieldId, Msg};
use crate::shared::validate::Validator; use crate::shared::validate::Validator;
use crate::{FieldId, Msg};
pub fn view(model: &Model, modal: &AddIssueModal) -> Node<Msg> { pub fn view(model: &Model, modal: &AddIssueModal) -> Node<Msg> {
let issue_type = modal let issue_type = modal

View File

@ -18,12 +18,8 @@ local-storage = ["filesystem-actor"]
default = ["local-storage"] default = ["local-storage"]
[dependencies] [dependencies]
common = { path = "../shared/common" }
actix = { version = "0.10.0" } actix = { version = "0.10.0" }
actix-web = { version = "*" }
actix-cors = { version = "*" }
actix-service = { version = "*" }
actix-rt = "1"
actix-web-actors = "*"
dotenv = { version = "*" } dotenv = { version = "*" }
@ -42,12 +38,12 @@ bitflags = { version = "1.0" }
serde = { version = "*", features = ["derive"] } serde = { version = "*", features = ["derive"] }
serde_json = { version = ">=0.8.0, <2.0" } serde_json = { version = ">=0.8.0, <2.0" }
toml = "0.5.6" toml = { version = "0.5.6" }
bincode = "1.2.1" bincode = { version = "1.2.1" }
log = "0.4" log = { version = "0.4" }
pretty_env_logger = "0.4" pretty_env_logger = { version = "0.4" }
env_logger = "0.7" env_logger = { version = "0.7" }
async-trait = { version = "*" } async-trait = { version = "*" }

View File

@ -1,4 +1,5 @@
use actix_web::HttpResponse; use actix_web::HttpResponse;
use common::*;
use jirs_data::msg::WsError; use jirs_data::msg::WsError;
use jirs_data::ErrorResponse; use jirs_data::ErrorResponse;

View File

@ -1,8 +1,11 @@
#![feature(async_closure)] #![feature(async_closure)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
extern crate common;
use actix::Actor; use actix::Actor;
use actix_web::{App, HttpServer}; use actix_web::{App, HttpServer};
use common::*;
pub mod errors; pub mod errors;

23
shared/common/Cargo.toml Normal file
View File

@ -0,0 +1,23 @@
[package]
name = "common"
version = "0.1.0"
authors = ["Adrian Wozniak <adrian.wozniak@ita-prog.pl>"]
edition = "2018"
description = "JIRS (Simplified JIRA in Rust) Actix server"
repository = "https://gitlab.com/adrian.wozniak/jirs"
license = "MPL-2.0"
[dependencies]
actix = { version = "0.10.0" }
actix-web = { version = "*" }
actix-cors = { version = "*" }
actix-service = { version = "*" }
actix-rt = { version = "1" }
actix-web-actors = { version = "*" }
actix_derive = { version = "*" }
serde = { version = "*" }
serde_derive = { version = "*" }
reexport-proc-macro = { version = "*" }

7
shared/common/src/lib.rs Normal file
View File

@ -0,0 +1,7 @@
#[macro_use]
extern crate reexport_proc_macro;
pub use {actix_cors, actix_rt, actix_service, actix_web, actix_web_actors, serde};
reexport_proc_macro!(actix_derive);
reexport_proc_macro!(serde_derive);

View File

@ -28,7 +28,7 @@ optional = true
[dependencies.diesel] [dependencies.diesel]
optional = true optional = true
version = "1.4.5" version = "*"
features = ["unstable", "postgres", "numeric", "extras", "uuidv07"] features = ["unstable", "postgres", "numeric", "extras", "uuidv07"]
[dependencies.derive_enum_iter] [dependencies.derive_enum_iter]