diff --git a/.env.dist b/.env.dist index a9afdb7b9..da04f713c 100644 --- a/.env.dist +++ b/.env.dist @@ -4,8 +4,8 @@ AZURITE_ACCOUNT_NAME=flowphpaccount01 AZURITE_ACCOUNT_KEY=flowphpkey01 S3_ENDPOINT=http://localhost:9000 S3_REGION=us-east-1 -S3_ACCESS_KEY_ID=minioadmin -S3_SECRET_ACCESS_KEY=minioadmin +S3_ACCESS_KEY_ID=flowphpaccess01 +S3_SECRET_ACCESS_KEY=flowphpsecret01 S3_BUCKET=flowphpbucket01 SFTP_HOST=localhost SFTP_PORT=2222 diff --git a/.github/workflows/job-tests.yml b/.github/workflows/job-tests.yml index 528c16134..02d2ee97b 100644 --- a/.github/workflows/job-tests.yml +++ b/.github/workflows/job-tests.yml @@ -83,17 +83,18 @@ jobs: sleep 2 done - - name: "Start MinIO and create bucket" + - name: "Start RustFS" run: | - docker run -d --name minio -p 9000:9000 \ - -e MINIO_ROOT_USER=minioadmin \ - -e MINIO_ROOT_PASSWORD=minioadmin \ - quay.io/minio/minio:latest server /data - timeout 30 sh -c 'until curl -fs http://localhost:9000/minio/health/live > /dev/null; do sleep 1; done' - docker run --rm --network=host --entrypoint sh quay.io/minio/mc:latest -c " - mc alias set local http://localhost:9000 minioadmin minioadmin && - mc mb local/flowphpbucket01 --ignore-existing - " + docker run -d --name rustfs -p 9000:9000 \ + -e RUSTFS_ACCESS_KEY=flowphpaccess01 \ + -e RUSTFS_SECRET_KEY=flowphpsecret01 \ + -e RUSTFS_ADDRESS=:9000 \ + -e RUSTFS_CONSOLE_ENABLE=false \ + -e RUSTFS_REGION=us-east-1 \ + -e RUSTFS_VOLUMES=/data \ + rustfs/rustfs:1.0.0 + timeout 90 sh -c 'until curl -fs http://localhost:9000/health/ready > /dev/null; do sleep 1; done' \ + || { echo "RustFS did not become ready"; docker logs rustfs; exit 1; } - name: "Start SFTP server" run: | @@ -154,8 +155,8 @@ jobs: AZURITE_ACCOUNT_KEY: "flowphpkey01" S3_ENDPOINT: "http://localhost:9000" S3_REGION: "us-east-1" - S3_ACCESS_KEY_ID: "minioadmin" - S3_SECRET_ACCESS_KEY: "minioadmin" + S3_ACCESS_KEY_ID: "flowphpaccess01" + S3_SECRET_ACCESS_KEY: "flowphpsecret01" SFTP_HOST: "localhost" SFTP_PORT: "2222" SFTP_USER: "flow" @@ -183,8 +184,8 @@ jobs: AZURITE_ACCOUNT_KEY: "flowphpkey01" S3_ENDPOINT: "http://localhost:9000" S3_REGION: "us-east-1" - S3_ACCESS_KEY_ID: "minioadmin" - S3_SECRET_ACCESS_KEY: "minioadmin" + S3_ACCESS_KEY_ID: "flowphpaccess01" + S3_SECRET_ACCESS_KEY: "flowphpsecret01" OTEL_RECEIVER_HTTP_ENDPOINT: "http://localhost:4318" OTEL_RECEIVER_GRPC_ENDPOINT: "localhost:4317" OTEL_COLLECTOR_METRICS_ENDPOINT: "http://localhost:8888/metrics" diff --git a/compose.yml.dist b/compose.yml.dist index b063fede2..6047b0609 100644 --- a/compose.yml.dist +++ b/compose.yml.dist @@ -60,31 +60,26 @@ services: - "6379:6379" networks: - flow-php - minio: - image: minio/minio:latest - container_name: flow-php-minio - command: server /data --console-address ":9001" + rustfs: + image: rustfs/rustfs:1.0.0 + container_name: flow-php-rustfs ports: - "9000:9000" - "9001:9001" environment: - - MINIO_ROOT_USER=minioadmin - - MINIO_ROOT_PASSWORD=minioadmin - volumes: - - "./var/minio:/data" - networks: - - flow-php - minio-init: - image: minio/mc - container_name: flow-php-minio-init - depends_on: - - minio - entrypoint: > - /bin/sh -c " - until mc alias set flow http://minio:9000 minioadmin minioadmin; do sleep 1; done; - mc mb flow/flowphpbucket01 --ignore-existing; - exit 0; - " + - RUSTFS_ACCESS_KEY=flowphpaccess01 + - RUSTFS_SECRET_KEY=flowphpsecret01 + - RUSTFS_ADDRESS=:9000 + - RUSTFS_CONSOLE_ENABLE=true + - RUSTFS_CONSOLE_ADDRESS=:9001 + - RUSTFS_REGION=us-east-1 + - RUSTFS_VOLUMES=/data + healthcheck: + test: ["CMD-SHELL", "curl -fs http://127.0.0.1:9000/health/ready || exit 1"] + interval: 5s + timeout: 3s + retries: 12 + start_period: 20s networks: - flow-php sftp: diff --git a/documentation/components/bridges/symfony-filesystem-bundle.md b/documentation/components/bridges/symfony-filesystem-bundle.md index 348cf72b5..606dfd243 100644 --- a/documentation/components/bridges/symfony-filesystem-bundle.md +++ b/documentation/components/bridges/symfony-filesystem-bundle.md @@ -252,7 +252,7 @@ flow_filesystem: region: '%env(AWS_REGION)%' access_key_id: '%env(AWS_ACCESS_KEY_ID)%' access_key_secret: '%env(AWS_SECRET_ACCESS_KEY)%' - endpoint: ~ # optional, MinIO/R2/Scaleway/LocalStack + endpoint: ~ # optional, RustFS/R2/Scaleway/LocalStack path_style_endpoint: false profile: ~ debug: false diff --git a/documentation/contributing/environment.md b/documentation/contributing/environment.md index 08a4d2a58..3397359dc 100644 --- a/documentation/contributing/environment.md +++ b/documentation/contributing/environment.md @@ -23,6 +23,19 @@ copy `.env.dist` to `.env` (gitignored) and set the shifted values there - `.env cp .env.dist .env ``` +> **Upgrading from an older checkout** - the local S3 service moved from MinIO to +> [RustFS](https://rustfs.com/) (MinIO deleted its community images from Docker Hub) and the S3 credentials changed from +> `minioadmin` to `flowphpaccess01` / `flowphpsecret01`. Refresh **both** files, otherwise every S3 request fails with +> `SignatureDoesNotMatch`: +> +> ```shell +> docker compose down -v +> rm -rf var/minio +> cp compose.yml.dist compose.yml +> cp .env.dist .env # or update S3_ACCESS_KEY_ID / S3_SECRET_ACCESS_KEY in your existing .env +> docker compose up -d +> ``` + > If you keep a personal gitignored `phpunit.xml`, regenerate it from `phpunit.xml.dist` after pulling this change: the > new `.dist` uses `bootstrap="bootstrap.php"` and no longer carries the `` block (env now comes from `.env.dist` > / `.env`). A stale `phpunit.xml` keeps the old bootstrap and env, bypassing the shared config.