#!/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`. # # Two private buckets (lab 5): S3_STAGING_BUCKET holds originals accepted by the API before 202, # S3_BUCKET holds the published originals and variants written by the worker. # Identities (SeaweedFS s3.json, actions scoped to a bucket): # bootstrap-admin Admin (create buckets) -> only s3-init has these keys # messenger-api Write staging, Read final -> API replicas (no List, no Admin) # messenger-worker Read + Write staging, Read + Write final -> worker (no List, no Admin) # messenger-auditor Read + List both buckets (no Write) -> invariant checker (tools profile) # There is NO anonymous identity, so every unsigned request is refused: the buckets are 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}" staging="${S3_STAGING_BUCKET:?S3_STAGING_BUCKET is required}" cat > /tmp/s3.json <