#!/bin/sh # Entry point of the compose service `s3` (SeaweedFS 4.46, one container: master + volume + # filer + S3 gateway). Renders the S3 identities from Docker secrets, then execs `weed`. # # Identities (SeaweedFS s3.json, actions scoped to the bucket): # bootstrap-admin Admin (create bucket) -> only s3-init has these keys # messenger-api Read + Write on S3_BUCKET -> API replicas (no List, no Admin) # messenger-reconciler Read + Write + List on S3_BUCKET -> reconciler CLI (needs the listing) # There is NO anonymous identity, so every unsigned request is refused: the bucket is private. # # Exposure: master (9333), volume (8080), filer (8888) with their web UIs and gRPC listen on # 127.0.0.1 INSIDE the container only (-ip.bind); only the S3 API port 8333 listens on the # container network `storage` (internal, not published on the host). Telemetry is off. set -eu umask 077 secret() { tr -d '\r\n' < "/run/secrets/$1"; } bucket="${S3_BUCKET:?S3_BUCKET is required}" cat > /tmp/s3.json <