Skip to content

Commit

Permalink
Backend Depend Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
wyatt-herkamp committed Feb 8, 2024
1 parent 9954195 commit f05834a
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 54 deletions.
28 changes: 2 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
backend/target
backend/test
nrc/target

backend/test/
*.iml
.idea
log
frontend/node_modules
frontend/out
frontend/dist
frontend/frontend
frontend/.env
nitro_repo-api-wrapper/dist
nitro_repo-api-wrapper/node_modules
.next
config.json
target/
.vscode/settings.json
Cargo.lock
node_modules
testInstall.sh
docs/node_modules
docs/docs/.vitepress/dist/
*.log
*.tar.gz
backend/test/
frontend.zip
backend/src/authentication/.vs
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[workspace]
members = ["backend", "nrc"]
resolver = "2"
50 changes: 32 additions & 18 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ name = "nitro_utils"
required-features = ["clap"]
[dependencies]
# Web
actix-web = { version = "4.3", features = ["cookies"] }
actix-cors = "0.6"
actix-web = { version = "4", features = ["cookies"] }
actix-cors = "0.7"
actix-service = "2"
rustls = { version = "0.21.7" ,optional = true}
rustls-pemfile = { version = "1" ,optional = true}
rustls = { version = "0.22", optional = true }
rustls-pemfile = { version = "2", optional = true }
actix-files = "0.6"
# Partly Web
handlebars = "4"
handlebars = "5"
# Database
sea-orm = { version = "0.12.4", features = ["runtime-actix-rustls", "macros"] }
sqlx = "0.7.2"
sea-orm = { version = "0.12", features = ["runtime-actix-rustls", "macros"] }
sqlx = "0.7"
# Serde
serde = { version = "1", features = ["derive"] }
serde_json = "1"
futures = "0.3"
toml = "0.8.2"
toml = "0.8"
# utils
rand = "0.8.5"
rust-embed = { version = "8.0.0", features = ["interpolate-folder-path"] }
Expand All @@ -43,20 +43,27 @@ regex = "1.6.0"
futures-util = "0.3.21"
base64 = "0.21.0"
tokio = { version = "1", features = ["full"] }
uuid = { version = "1.1.2", features = ["serde", "v4"] }
uuid = { version = "1", features = ["serde", "v4"] }
style-term = "1.0.0"
mime_guess = "2.0.4"
paste = "1.0.7"
reqwest = { version = "0.11.11", features = ["stream"] }
bytes = "1.2.0"
tokio-stream = "0.1.9"
lock_freedom = { git = "https://github.com/wyatt-herkamp/lock_freedom.git" }
lock_freedom = { git = "https://github.com/wyatt-herkamp/lock_freedom.git" }
sha2 = "0.10.2"
ahash="0.8"
ahash = "0.8"
parking_lot = { version = "0.12", features = [] }
# Log
nitro_log = { git = "https://github.com/wyatt-herkamp/nitro_log", features = ["chrono", "style-term"] }
log = { version = "0.4.17", features = ["kv_unstable", "kv_unstable_std", "kv_unstable_serde"] }
nitro_log = { git = "https://github.com/wyatt-herkamp/nitro_log", features = [
"chrono",
"style-term",
] }
log = { version = "0.4.17", features = [
"kv_unstable",
"kv_unstable_std",
"kv_unstable_serde",
] }
# Rust Internal
strum = { version = "0.25.0", features = ["derive"] }
strum_macros = "0.25.3"
Expand All @@ -69,23 +76,30 @@ badge-maker = "0.3"
clap = { version = "4", features = ["derive"], optional = true }
semver = { version = "1", features = ["std", "serde"] }
# Cache
comrak = "0.19.0"
comrak = "0.21.0"
# Staging
tempfile = "3.3.0"
git2 = "0.18.1"
schemars = "0.8.10"
# Maven Stuff
maven-rs = { git = "https://github.com/wyatt-herkamp/maven-rs.git" }
this_actix_error = { git = "https://github.com/wyatt-herkamp/this_actix_errors.git" }
zip = { git="https://github.com/zip-rs/zip.git" }
zip = { git = "https://github.com/zip-rs/zip.git" }
typeshare = "1.0.0"
current_semver = {git="https://github.com/wyatt-herkamp/current_semver.git"}
current_semver = { git = "https://github.com/wyatt-herkamp/current_semver.git" }
[build-dependencies]
vergen = { version = "8.1.1",features = ["build", "cargo", "git", "gitcl", "rustc", "si"] }
vergen = { version = "8.1.1", features = [
"build",
"cargo",
"git",
"gitcl",
"rustc",
"si",
] }
[features]
# The latest Updaters will always be under default features
default = ["multi_storage", "postgres", "sqlite", "mysql"]
ssl = ["rustls","rustls-pemfile", "actix-web/rustls-0_21"]
ssl = ["rustls", "rustls-pemfile", "actix-web/rustls-0_22"]
mysql = ["sea-orm/sqlx-mysql"]
sqlite = ["sea-orm/sqlx-sqlite"]
postgres = ["sea-orm/sqlx-postgres"]
Expand Down
36 changes: 26 additions & 10 deletions backend/src/bin/nitro_repo_full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,33 @@ async fn main() -> std::io::Result<()> {
#[cfg(feature = "ssl")]
{
if let Some(private) = application.ssl_private_key {
let cert = application
.ssl_cert_key
.expect("If Private Key is set. CERT Should be set");
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};

let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
builder
.set_private_key_file(private, SslFiletype::PEM)
use rustls::ServerConfig as RustlsServerConfig;
use rustls_pemfile::{certs, pkcs8_private_keys};
use std::fs::File;
use std::io::BufReader;
let mut cert_file = BufReader::new(File::open(
application
.ssl_cert_key
.expect("Private key Provided but not public key"),
)?);
let mut key_file = BufReader::new(File::open(private)?);

let cert_chain = certs(&mut cert_file)
.collect::<Result<Vec<_>, _>>()
.unwrap();
builder.set_certificate_chain_file(cert).unwrap();
return server.bind_openssl(address, builder)?.run().await;
let mut keys = pkcs8_private_keys(&mut key_file)
.collect::<Result<Vec<_>, _>>()
.unwrap();

let config = RustlsServerConfig::builder()
.with_no_client_auth()
.with_single_cert(
cert_chain,
rustls::pki_types::PrivateKeyDer::Pkcs8(keys.remove(0)),
)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
server.bind_rustls_0_22(address, config)?.run().await?;
return Ok(());
}
}

Expand Down

0 comments on commit f05834a

Please sign in to comment.