mirror of
https://github.com/truespar/sentio.git
synced 2026-11-17 16:17:37 +00:00
Relicensed so a recipient may take whichever terms suit them. That is
strictly more permissive than either alone: MIT for the simplest terms
and GPLv2 compatibility, Apache-2.0 for the explicit patent grant some
adopters require. It also matches the Rust norm - 255 of the 517
dependencies are exactly this pair.
Distributing binaries is what makes attribution an obligation rather
than a courtesy. The repository alone redistributes nothing, since
dependencies are fetched at build time, but the container image and the
release tarballs contain compiled third-party code, and MIT and BSD both
require their notices to travel with it. 76 crates are MIT-only.
THIRD-PARTY-NOTICES.md is generated by cargo-about from the resolved
graph for the two targets actually shipped, and now lands in
/usr/share/doc/sentio in the image and inside each tarball.
deny.toml existed but nothing ran it, and it would have failed
immediately: the allow list omitted licences already present (0BSD,
MIT-0, Unlicense, CDLA-Permissive-2.0, BSD-1-Clause) and it used the
pre-2.0 schema. Rewritten against what the graph actually contains, and
wired into CI alongside a staleness check on the notices.
Running it surfaced six advisories, none of which appear exploitable
here, all recorded with reasons rather than silenced:
- rsa 0.9 carries Marvin (RUSTSEC-2023-0071), a timing sidechannel in
private-key operations. The crate is used in one place, generating a
DKIM keypair. No decryption, no oracle. There is no fixed release.
- h2 0.3 and rustls-webpki 0.101 come through aws-smithy-http-client's
legacy hyper 0.14 stack, so they sit on the path to the object
store. Sentio's own listeners and delivery client are on rustls
0.23. Getting the AWS SDK off its legacy client is follow-up work.
- rustls-pemfile is unmaintained, not vulnerable.
66 lines
2.6 KiB
Docker
66 lines
2.6 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
|
|
# ── Builder ──────────────────────────────────────────────────────────────
|
|
FROM rust:1-bookworm AS builder
|
|
|
|
WORKDIR /build
|
|
|
|
# aws-lc-rs (rustls backend) needs cmake + a C toolchain; build-essential is
|
|
# already present in the rust: image. libclang is only needed by some crates
|
|
# in the tree - install here rather than debugging a rebuild later.
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
cmake \
|
|
libclang-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY . .
|
|
|
|
# Use the committed .sqlx/ offline cache so the build doesn't need a live DB.
|
|
ENV SQLX_OFFLINE=true
|
|
|
|
RUN cargo build --release --bin sentio-smtp \
|
|
&& strip target/release/sentio-smtp
|
|
|
|
# ── Runtime ──────────────────────────────────────────────────────────────
|
|
FROM debian:bookworm-slim AS runtime
|
|
|
|
LABEL org.opencontainers.image.title="Sentio SMTP" \
|
|
org.opencontainers.image.description="Email inbox API for AI agents: a multi-tenant mail server in Rust" \
|
|
org.opencontainers.image.source="https://github.com/truespar/sentio" \
|
|
org.opencontainers.image.licenses="MIT OR Apache-2.0"
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
libcap2-bin \
|
|
tzdata \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& groupadd --system --gid 1000 sentio \
|
|
&& useradd --system --uid 1000 --gid sentio \
|
|
--home-dir /var/lib/sentio --shell /usr/sbin/nologin sentio \
|
|
&& mkdir -p /etc/sentio /var/lib/sentio \
|
|
&& chown -R sentio:sentio /etc/sentio /var/lib/sentio
|
|
|
|
COPY --from=builder /build/target/release/sentio-smtp /usr/local/bin/sentio-smtp
|
|
COPY --from=builder /build/migrations /usr/share/sentio/migrations
|
|
COPY config/oss.toml /etc/sentio/oss.toml
|
|
# Licence obligations travel with the binary, not just the repo.
|
|
COPY LICENSE LICENSE-MIT LICENSE-APACHE THIRD-PARTY-NOTICES.md \
|
|
/usr/share/doc/sentio/
|
|
|
|
# Allow the non-root user to bind :25/465/587 without full root.
|
|
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/sentio-smtp
|
|
|
|
USER sentio
|
|
WORKDIR /var/lib/sentio
|
|
|
|
EXPOSE 25 465 587 8080 9090
|
|
|
|
HEALTHCHECK --interval=10s --timeout=5s --start-period=30s --retries=6 \
|
|
CMD curl -fsS http://localhost:8080/health/ready || exit 1
|
|
|
|
ENTRYPOINT ["/usr/local/bin/sentio-smtp"]
|
|
CMD ["--config", "/etc/sentio/oss.toml", "serve"]
|