wk2: account management tooling

This commit is contained in:
ari melody 2026-02-05 14:02:32 +00:00
parent 37eeeb2467
commit f864d9c84e
Signed by: ari
GPG key ID: CF99829C92678188
34 changed files with 379 additions and 350 deletions

View file

@ -6,14 +6,24 @@ FROM debian:bookworm-slim AS compile
RUN <<EOF
apt update
apt install -y clang
apt install -y clang golang
apt clean
EOF
# TODO: consider removing if not needed
# COPY target/scripts/build/libpam-pgsql.sh .
# RUN bash libpam-pgsql.sh
WORKDIR /src/
COPY src .
# log
RUN clang -O2 -o /usr/local/bin/log /src/log/log.c
# accounts
WORKDIR /src/account-manager
RUN go build -o /usr/local/bin/accounts .
# ================================
# Build Stage
# ================================
@ -26,8 +36,14 @@ WORKDIR /
COPY target/scripts/build/packages.sh /build/
RUN /bin/bash /build/packages.sh && rm -r /build
# TODO: consider removing if not needed
# COPY --from=compile /pam-pgsql/.libs/pam_pgsql.so /pam-pgsql/.libs/pam_pgsql.la /usr/local/lib/security/
# Install compiled binaries
COPY --from=compile /usr/local/bin/log /usr/local/bin/log
COPY --from=compile \
/usr/local/bin/log \
/usr/local/bin/accounts \
/usr/local/bin/
# Install helper scripts
COPY target/scripts/*.sh /usr/local/bin/
@ -39,7 +55,11 @@ COPY target/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
COPY target/supervisor/conf.d/* /etc/supervisor/conf.d/
# Dovecot
COPY target/dovecot/*.inc target/dovecot/*.conf /etc/dovecot/conf.d/
COPY target/dovecot/*.inc target/dovecot/*.conf target/dovecot/*.ext /etc/dovecot/conf.d/
RUN <<EOF
useradd -u 5000 -d /home/jupiter -s /bin/bash -p "$(echo jupiter | openssl passwd -1 -stdin)" jupiter
EOF
EXPOSE 25/tcp 143/tcp 465/tcp 993/tcp