mirror of
https://github.com/uutils/shadow.git
synced 2026-06-10 16:14:57 -07:00
97130fea20
Cargo workspace with three-layer architecture mirroring uutils conventions: - shadow-core: /etc/passwd and /etc/shadow parsers, atomic file writes, username validation, error types, feature-gated module stubs (PAM, SELinux, group, gshadow, login.defs, subid, nscd, lock, uid_alloc) - uu_passwd: tool skeleton with clap CLI, uumain/uu_app pattern - multicall binary: argv[0] dispatch with --list support Docker test matrix (Debian Trixie, Alpine musl, Fedora SELinux): all three pass clippy -D warnings, 21 tests, and cargo fmt --check. 21 unit tests covering: - passwd/shadow file parsing and roundtrip serialization - atomic file write with fsync + rename + failure rollback - username validation rules (length, charset, edge cases) - clap command definition
56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
# Usage:
|
|
# docker compose run --rm debian # shell on Debian Trixie
|
|
# docker compose run --rm debian cargo test
|
|
# docker compose run --rm alpine cargo test
|
|
# docker compose run --rm fedora cargo test
|
|
# docker compose up --build # build all images
|
|
#
|
|
# The cargo registry cache is shared across Debian/Alpine (same CARGO_HOME path).
|
|
# Fedora uses a separate cache (rustup installs to /root/.cargo).
|
|
# Each distro gets its own target dir (different libc/toolchain = different binaries).
|
|
|
|
x-common: &common
|
|
working_dir: /workspace
|
|
security_opt:
|
|
- seccomp:unconfined
|
|
cap_add:
|
|
- SYS_ADMIN
|
|
|
|
services:
|
|
debian:
|
|
<<: *common
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile.debian
|
|
volumes:
|
|
- .:/workspace
|
|
- cargo-cache:/usr/local/cargo/registry
|
|
- target-debian:/workspace/target
|
|
|
|
alpine:
|
|
<<: *common
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile.alpine
|
|
volumes:
|
|
- .:/workspace
|
|
- cargo-cache:/usr/local/cargo/registry
|
|
- target-alpine:/workspace/target
|
|
|
|
fedora:
|
|
<<: *common
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile.fedora
|
|
volumes:
|
|
- .:/workspace
|
|
- cargo-cache-fedora:/root/.cargo/registry
|
|
- target-fedora:/workspace/target
|
|
|
|
volumes:
|
|
cargo-cache:
|
|
cargo-cache-fedora:
|
|
target-debian:
|
|
target-alpine:
|
|
target-fedora:
|