Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 10 additions & 38 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
[package]
name = "defguard"
version = "1.3.0"
[workspace.package]
edition = "2021"
license-file = "LICENSE.md"
homepage = "https://defguard.net/"
repository = "https://github.com/DefGuard/defguard"
rust-version = "1.85.1"

[workspace]
members = ["crates/*"]
resolver = "2"

[dependencies]
[workspace.dependencies]
# internal crates
defguard_core = { path = "./crates/defguard_core", version = "0.0.0" }
model_derive = { path = "./crates/model_derive", version = "0.0.0" }

# external dependencies
anyhow = "1.0"
argon2 = { version = "0.5", features = ["std"] }
axum = "0.8"
Expand All @@ -32,10 +37,6 @@ ldap3 = { version = "0.11", default-features = false, features = ["tls"] }
lettre = { version = "0.11", features = ["tokio1-native-tls"] }
md4 = "0.10"
mime_guess = "2.0"
model_derive = { path = "model-derive" }
openidconnect = { version = "4.0", default-features = false, optional = true, features = [
"reqwest",
] }
parse_link_header = "0.4"
paste = "1.0.15"
pgp = "0.15"
Expand Down Expand Up @@ -99,38 +100,9 @@ webauthn-rs-proto = "0.5"
x25519-dalek = { version = "2.0", features = ["static_secrets"] }

# https://github.com/juhaku/utoipa/issues/1345
[dependencies.zip]
[workspace.dependencies.zip]
version = "=2.4.2"

[dev-dependencies]
bytes = "1.6"
claims = "0.8"
matches = "0.1"
regex = "1.10"
reqwest = { version = "0.12", features = [
"cookies",
"json",
"multipart",
"rustls-tls",
"stream",
], default-features = false }
serde_qs = "0.13"
webauthn-authenticator-rs = { version = "0.5", features = ["softpasskey"] }

[build-dependencies]
prost-build = "0.13"
tonic-build = "0.12"
vergen-git2 = { version = "1.0", features = ["build"] }

[features]
default = ["openid", "wireguard", "worker"]
openid = ["dep:openidconnect"]
worker = []
wireguard = []

[profile.dev.package."model_derive"]
opt-level = 2

[profile.release]
codegen-units = 1
panic = "abort"
Expand Down
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ RUN rustup component add rustfmt
FROM chef AS planner
# prepare recipe
COPY Cargo.toml Cargo.lock ./
COPY src src
COPY model-derive model-derive
COPY crates crates
COPY proto proto
RUN cargo chef prepare --recipe-path recipe.json

Expand All @@ -32,18 +31,14 @@ RUN cargo chef cook --release --recipe-path recipe.json
# build project
COPY --from=web /app/dist ./web/dist
COPY web/src/shared/images/svg ./web/src/shared/images/svg
COPY user_agent_header_regexes.yaml /build/user_agent_header_regexes.yaml
RUN apt-get update && apt-get -y install protobuf-compiler libprotobuf-dev
COPY Cargo.toml Cargo.lock build.rs ./
COPY Cargo.toml Cargo.lock ./
# for vergen
COPY .git .git
COPY .sqlx .sqlx
COPY src src
COPY templates templates
COPY model-derive model-derive
COPY crates crates
COPY proto proto
COPY migrations migrations
RUN cargo install --locked --path . --root /build
RUN cargo install --locked --bin defguard --path ./crates/defguard --root /build

# run
FROM debian:bookworm-slim
Expand Down
20 changes: 20 additions & 0 deletions crates/defguard/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "defguard"
version = "1.3.1"
edition.workspace = true
license-file.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true

[dependencies]
# internal crates
defguard_core = { workspace = true }

# external dependencies
anyhow = { workspace = true }
dotenvy = "0.15"
secrecy = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
2 changes: 1 addition & 1 deletion src/bin/defguard.rs → crates/defguard/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{
sync::{Arc, Mutex},
};

use defguard::{
use defguard_core::{
auth::failed_login::FailedLoginMap,
config::{Command, DefGuardConfig},
db::{
Expand Down
Loading