Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
31d28a8
feat: refactor DID document handling to use a centralized database re…
Hermann-Core Jun 20, 2025
9e3b349
feat: implement in-memory store for OOB messages and refactor handler…
Hermann-Core Jun 20, 2025
3e65e24
refactor: remove filesystem dependency and update DID document handli…
Hermann-Core Jun 20, 2025
580a210
refactor: remove filesystem module and its dependencies
Hermann-Core Jun 20, 2025
35647ac
refactor: update Dockerfile and docker-compose.yml for improved build…
Hermann-Core Jun 20, 2025
22fa154
refactor: remove filesystem dependency from workspace
Hermann-Core Jun 20, 2025
d926f1a
refactor: move global allocator definition for Jemalloc to improve me…
Hermann-Core Jun 20, 2025
e0dbc10
refactor: update dependencies
Hermann-Core Jun 20, 2025
d8feca7
style: apply code formatting
Hermann-Core Jun 20, 2025
0a691e7
Merge remote-tracking branch 'origin/main' into 399-add-a-centralized…
Hermann-Core Jun 20, 2025
9dd7fab
refactor: remove unused DashMap import
Hermann-Core Jun 20, 2025
8ebf2d0
refactor: remove obsolete version specification from docker-compose.yml
Hermann-Core Jun 20, 2025
5aa44c7
refactor: remove unused dependencies from Cargo.toml files
Hermann-Core Jun 20, 2025
8ce3623
Merge remote-tracking branch 'origin/main' into 399-add-a-centralized…
Hermann-Core Jun 30, 2025
8f1ab89
fix: fix deps conflicts in the lock file
Hermann-Core Jun 30, 2025
5665954
fix: apply clippy suggestions
Hermann-Core Jun 30, 2025
54d560c
docs: update README to clarify project setup and environmental variables
Hermann-Core Jul 4, 2025
b32c407
fix: update docker-compose to add LocalStack service for AWS Secrets …
Hermann-Core Jul 4, 2025
26de86e
fix: update test configuration and encoding for DID keys
Hermann-Core Jul 4, 2025
ef10f63
refactor: add base64 encoding for verification methods and verificati…
Hermann-Core Jul 4, 2025
2026af9
fix: update dotenv-flow loading to handle errors gracefully
Hermann-Core Jul 4, 2025
147a769
style: apply code formatting
Hermann-Core Jul 4, 2025
4963c05
fix: remove base64 dependency from multiple various Cargo.toml files
Hermann-Core Jul 4, 2025
dbdb123
fix: sanitize secret names in AWS Secrets Manager operations
Hermann-Core Jul 4, 2025
7d8ccab
fix: resolve regressions added by the latest changes
Hermann-Core Jul 4, 2025
a9f0b5d
feat: add example environment configuration file
Hermann-Core Jul 4, 2025
86ca689
fix: remove STORAGE_DIRPATH from environment variables in deployment …
Awambeng Jul 11, 2025
65c0953
Merge pull request #413 from adorsys/remove-unused-vars
Awambeng Jul 11, 2025
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
138 changes: 28 additions & 110 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ path = "src/main.rs"
[workspace]
members = [
"crates/database",
"crates/filesystem",
"crates/keystore",
"crates/plugin-api",
"crates/web-plugins/*",
Expand All @@ -31,7 +30,6 @@ members = [

[workspace.dependencies]
database = { path = "./crates/database", version = "0.1.0" }
filesystem = { path = "./crates/filesystem", version = "0.1.0" }
keystore = { path = "./crates/keystore", version = "0.1.0" }
plugin-api = { path = "./crates/plugin-api", version = "0.1.0" }
did-endpoint = { path = "./crates/web-plugins/did-endpoint", version = "0.1.0" }
Expand All @@ -49,6 +47,7 @@ mediator-coordination = { path = "./crates/web-plugins/didcomm-messaging/protoco


# Other common dependencies
bson = { version = "2.7.0", features = ["serde_with"] }
serde = "1.0"
sha2 = "0.10"
cfg-if = "1.0"
Expand Down Expand Up @@ -101,6 +100,7 @@ tower-http = "0.6.2"
aws-config = "1.1"
axum-prometheus = "0.8.0"
prometheus-client = "0.23.1"
tikv-jemallocator = "0.6"
aws-sdk-kms = "1.49"
base64ct = { version = "1.6.0", default-features = false }
zeroize = { version = "1.8.1", default-features = false }
Expand Down Expand Up @@ -128,6 +128,9 @@ did-endpoint = { workspace = true, optional = true }
oob-messages = { workspace = true, optional = true }
didcomm-messaging = { workspace = true, optional = true }

[target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemallocator.workspace = true


[features]
default = [
Expand Down
73 changes: 28 additions & 45 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,33 @@
# syntax=docker/dockerfile:1.4
ARG APP_NAME=didcomm-mediator

# Stage 1: Build
FROM rust:1.85-alpine AS builder
# Use buildx's automatic platform detection
FROM --platform=$BUILDPLATFORM blackdex/rust-musl:x86_64-musl AS builder-amd64
FROM --platform=$BUILDPLATFORM blackdex/rust-musl:aarch64-musl AS builder-arm64

# Select the appropriate builder based on target platform
FROM builder-${TARGETARCH} AS builder
ARG APP_NAME
ARG TARGETPLATFORM
ARG TARGETARCH
WORKDIR /app

# Install required build dependencies, including OpenSSL development files
RUN apk add --no-cache \
build-base \
pkgconf \
openssl-dev \
musl-dev \
ca-certificates \
postgresql-dev \
musl-utils \
llvm-libunwind-dev

# Set environment variables (disable static linking for OpenSSL)
ENV OPENSSL_STATIC=0
ENV OPENSSL_DIR=/usr

# Copy Cargo files separately to optimize caching
COPY Cargo.toml Cargo.lock ./
COPY crates ./crates

# Dummy build to cache dependencies
RUN mkdir src && echo "fn main() {}" > src/main.rs && \
cargo build --release

# Copy the actual source code
COPY src ./src

# Build the project (using the host's default target)
RUN cargo build --release && \
strip target/release/didcomm-mediator

# Stage 2: Runtime using a distroless image
FROM gcr.io/distroless/static-debian12:latest

WORKDIR /app

# Copy the built binary from the builder stage
COPY --from=builder /app/target/release/didcomm-mediator /usr/local/bin/didcomm-mediator

# Expose the port
# Set the Rust target and build the application
RUN --mount=type=bind,source=src,target=src \
--mount=type=bind,source=crates,target=crates \
--mount=type=bind,source=Cargo.toml,target=Cargo.toml \
--mount=type=bind,source=Cargo.lock,target=Cargo.lock \
--mount=type=cache,target=/app/target,id=target-cache-${TARGETPLATFORM} \
--mount=type=cache,target=/root/.cargo/registry,id=registry-cache-${TARGETPLATFORM} \
case "$TARGETARCH" in \
amd64) RUST_TARGET="x86_64-unknown-linux-musl" ;; \
arm64) RUST_TARGET="aarch64-unknown-linux-musl" ;; \
*) echo "Unsupported architecture: $TARGETARCH" && exit 1 ;; \
esac; \
cargo build --locked --release --target=${RUST_TARGET}; \
mv target/${RUST_TARGET}/release/${APP_NAME} .

FROM gcr.io/distroless/static-debian12 AS runtime
ARG APP_NAME
COPY --from=builder --chown=nonroot:nonroot /app/${APP_NAME} /app/${APP_NAME}
EXPOSE 3000

# Set the entrypoint
ENTRYPOINT ["/usr/local/bin/didcomm-mediator"]
ENTRYPOINT ["/app/didcomm-mediator"]
Loading
Loading