Packaging: the binary and package are inbuxa, INBUXA_* settings with STALWART_* fallback
- crates/main: package and [[bin]] renamed to inbuxa; homepage inbuxa.org; license AGPL-3.0-only (upstream is dual; the fork takes the AGPL). - types::branding::env_var reads INBUXA_<name>, falling back to STALWART_<name> with a warning, for all nine server settings. STALWART_APP_ and STALWART_SPAM_* storage keys are unchanged. - New-install default paths /var/lib/inbuxa and /var/log/inbuxa. - Dockerfiles, systemd unit, launchd plist and AppArmor profile renamed. - Upstream's .github moved to .github-upstream so none of it runs. - install.sh stubbed: upstream's would install Stalwart. - Two missed brand strings: the SMTP Received header and the utils user agent.
This commit is contained in:
+32
-32
@@ -108,7 +108,7 @@ RUN \
|
||||
--mount=type=cache,target=/usr/local/cargo/git \
|
||||
source /env-cargo && \
|
||||
if [ ! -z "${FDB_ARCH}" ]; then \
|
||||
RUSTFLAGS="-L /usr/lib" cargo chef cook --recipe-path recipe.json --zigbuild --release --target ${TARGET} -p stalwart --no-default-features --features "foundationdb s3 redis nats"; \
|
||||
RUSTFLAGS="-L /usr/lib" cargo chef cook --recipe-path recipe.json --zigbuild --release --target ${TARGET} -p inbuxa --no-default-features --features "foundationdb s3 redis nats"; \
|
||||
fi
|
||||
RUN \
|
||||
--mount=type=secret,id=ACTIONS_RESULTS_URL,env=ACTIONS_RESULTS_URL \
|
||||
@@ -116,7 +116,7 @@ RUN \
|
||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||
--mount=type=cache,target=/usr/local/cargo/git \
|
||||
source /env-cargo && \
|
||||
cargo chef cook --recipe-path recipe.json --zigbuild --release --target ${TARGET} -p stalwart --no-default-features --features "sqlite postgres mysql rocks s3 redis azure nats"
|
||||
cargo chef cook --recipe-path recipe.json --zigbuild --release --target ${TARGET} -p inbuxa --no-default-features --features "sqlite postgres mysql rocks s3 redis azure nats"
|
||||
# Copy the source code
|
||||
COPY . .
|
||||
ENV RUSTC_WRAPPER="sccache" \
|
||||
@@ -129,8 +129,8 @@ RUN \
|
||||
--mount=type=cache,target=/usr/local/cargo/git \
|
||||
source /env-cargo && \
|
||||
if [ ! -z "${FDB_ARCH}" ]; then \
|
||||
RUSTFLAGS="-L /usr/lib" cargo zigbuild --release --target ${TARGET} -p stalwart --no-default-features --features "foundationdb s3 redis nats" && \
|
||||
mv /app/target/${TARGET}/release/stalwart /app/artifact/stalwart-foundationdb; \
|
||||
RUSTFLAGS="-L /usr/lib" cargo zigbuild --release --target ${TARGET} -p inbuxa --no-default-features --features "foundationdb s3 redis nats" && \
|
||||
mv /app/target/${TARGET}/release/inbuxa /app/artifact/inbuxa-foundationdb; \
|
||||
fi
|
||||
# Build generic version
|
||||
RUN \
|
||||
@@ -139,8 +139,8 @@ RUN \
|
||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||
--mount=type=cache,target=/usr/local/cargo/git \
|
||||
source /env-cargo && \
|
||||
cargo zigbuild --release --target ${TARGET} -p stalwart --no-default-features --features "sqlite postgres mysql rocks s3 redis azure nats" && \
|
||||
mv /app/target/${TARGET}/release/stalwart /app/artifact/stalwart
|
||||
cargo zigbuild --release --target ${TARGET} -p inbuxa --no-default-features --features "sqlite postgres mysql rocks s3 redis azure nats" && \
|
||||
mv /app/target/${TARGET}/release/inbuxa /app/artifact/inbuxa
|
||||
|
||||
# *****************
|
||||
# Binary stage
|
||||
@@ -156,21 +156,21 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
|
||||
apt-get update && \
|
||||
apt-get install -yq --no-install-recommends ca-certificates curl tzdata libcap2-bin && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
groupadd -r -g 2000 stalwart && \
|
||||
useradd -r -u 2000 -g 2000 -s /usr/sbin/nologin -M stalwart && \
|
||||
mkdir -p /etc/stalwart /var/lib/stalwart && \
|
||||
chown stalwart:stalwart /etc/stalwart /var/lib/stalwart
|
||||
COPY --from=builder --chmod=0755 /app/artifact/stalwart /usr/local/bin/stalwart
|
||||
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/stalwart
|
||||
USER stalwart
|
||||
WORKDIR /var/lib/stalwart
|
||||
VOLUME ["/etc/stalwart", "/var/lib/stalwart"]
|
||||
groupadd -r -g 2000 inbuxa && \
|
||||
useradd -r -u 2000 -g 2000 -s /usr/sbin/nologin -M inbuxa && \
|
||||
mkdir -p /etc/inbuxa /var/lib/inbuxa && \
|
||||
chown inbuxa:inbuxa /etc/inbuxa /var/lib/inbuxa
|
||||
COPY --from=builder --chmod=0755 /app/artifact/inbuxa /usr/local/bin/inbuxa
|
||||
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/inbuxa
|
||||
USER inbuxa
|
||||
WORKDIR /var/lib/inbuxa
|
||||
VOLUME ["/etc/inbuxa", "/var/lib/inbuxa"]
|
||||
EXPOSE 443 25 110 587 465 143 993 995 4190 8080
|
||||
ENV STALWART_HEALTHCHECK_URL=https://127.0.0.1:443/healthz/live
|
||||
ENV INBUXA_HEALTHCHECK_URL=https://127.0.0.1:443/healthz/live
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
||||
CMD curl -fsSk -H "X-Forwarded-For: 127.0.0.1" "$STALWART_HEALTHCHECK_URL" || curl -fsS -H "X-Forwarded-For: 127.0.0.1" http://127.0.0.1:8080/healthz/live || exit 1
|
||||
ENTRYPOINT ["/usr/local/bin/stalwart"]
|
||||
CMD ["--config", "/etc/stalwart/config.json"]
|
||||
CMD curl -fsSk -H "X-Forwarded-For: 127.0.0.1" "$INBUXA_HEALTHCHECK_URL" || curl -fsS -H "X-Forwarded-For: 127.0.0.1" http://127.0.0.1:8080/healthz/live || exit 1
|
||||
ENTRYPOINT ["/usr/local/bin/inbuxa"]
|
||||
CMD ["--config", "/etc/inbuxa/config.json"]
|
||||
|
||||
# *****************
|
||||
# Runtime image for musl targets
|
||||
@@ -178,18 +178,18 @@ CMD ["--config", "/etc/stalwart/config.json"]
|
||||
FROM --platform=$TARGETPLATFORM alpine AS musl
|
||||
RUN apk add --update --no-cache ca-certificates curl tzdata libcap && \
|
||||
rm -rf /var/cache/apk/* && \
|
||||
addgroup -S -g 2000 stalwart && \
|
||||
adduser -S -D -H -u 2000 -G stalwart -s /sbin/nologin stalwart && \
|
||||
mkdir -p /etc/stalwart /var/lib/stalwart && \
|
||||
chown stalwart:stalwart /etc/stalwart /var/lib/stalwart
|
||||
COPY --from=builder --chmod=0755 /app/artifact/stalwart /usr/local/bin/stalwart
|
||||
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/stalwart
|
||||
USER stalwart
|
||||
WORKDIR /var/lib/stalwart
|
||||
VOLUME ["/etc/stalwart", "/var/lib/stalwart"]
|
||||
addgroup -S -g 2000 inbuxa && \
|
||||
adduser -S -D -H -u 2000 -G inbuxa -s /sbin/nologin inbuxa && \
|
||||
mkdir -p /etc/inbuxa /var/lib/inbuxa && \
|
||||
chown inbuxa:inbuxa /etc/inbuxa /var/lib/inbuxa
|
||||
COPY --from=builder --chmod=0755 /app/artifact/inbuxa /usr/local/bin/inbuxa
|
||||
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/inbuxa
|
||||
USER inbuxa
|
||||
WORKDIR /var/lib/inbuxa
|
||||
VOLUME ["/etc/inbuxa", "/var/lib/inbuxa"]
|
||||
EXPOSE 443 25 110 587 465 143 993 995 4190 8080
|
||||
ENV STALWART_HEALTHCHECK_URL=https://127.0.0.1:443/healthz/live
|
||||
ENV INBUXA_HEALTHCHECK_URL=https://127.0.0.1:443/healthz/live
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
||||
CMD curl -fsSk -H "X-Forwarded-For: 127.0.0.1" "$STALWART_HEALTHCHECK_URL" || curl -fsS -H "X-Forwarded-For: 127.0.0.1" http://127.0.0.1:8080/healthz/live || exit 1
|
||||
ENTRYPOINT ["/usr/local/bin/stalwart"]
|
||||
CMD ["--config", "/etc/stalwart/config.json"]
|
||||
CMD curl -fsSk -H "X-Forwarded-For: 127.0.0.1" "$INBUXA_HEALTHCHECK_URL" || curl -fsS -H "X-Forwarded-For: 127.0.0.1" http://127.0.0.1:8080/healthz/live || exit 1
|
||||
ENTRYPOINT ["/usr/local/bin/inbuxa"]
|
||||
CMD ["--config", "/etc/inbuxa/config.json"]
|
||||
|
||||
Reference in New Issue
Block a user