diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7025ee9..a22f242 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -16,5 +16,5 @@ jobs: - heroku-22 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: bash support/test.sh ${{ matrix.stack }} diff --git a/Dockerfile b/Dockerfile index 5632d0c..7571fba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ FROM $BUILD_IMAGE AS builder ARG STACK # Emulate the platform where root access is not available +USER root RUN useradd -d /app non-root-user RUN mkdir -p /app /cache /env RUN chown non-root-user /app /cache /env @@ -20,6 +21,7 @@ RUN env -i PATH=$PATH HOME=$HOME STACK=$STACK /buildpack/bin/compile /app /cache FROM $RUNTIME_IMAGE +USER root RUN useradd -d /app non-root-user USER non-root-user COPY --from=builder --chown=non-root-user /app /app diff --git a/README.md b/README.md index 92bcce4..c67a80c 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,10 @@ This is a [Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks) th allows an application to use an [stunnel](http://stunnel.org) to connect securely to Heroku Redis. It is meant to be used in conjunction with other buildpacks. -**This buildpack is only for use with Heroku Redis 4 and 5. For Heroku Redis 6 and newer, use its built-in TLS support instead.** - -**For more information, see [Securing Heroku Redis](https://devcenter.heroku.com/articles/securing-heroku-redis).** +> [!WARNING] +> This buildpack isn’t compatible with the `heroku-24` [stack](https://devcenter.heroku.com/articles/stack) and later. You don’t need this buildpack for Redis 6+, which supports native TLS. +> +> For more information, see [Securing Heroku Redis](https://devcenter.heroku.com/articles/heroku-redis#security-and-compliance). ## Usage diff --git a/bin/compile b/bin/compile index 6119d12..40e43a6 100755 --- a/bin/compile +++ b/bin/compile @@ -13,6 +13,17 @@ unset GIT_DIR BUILD_DIR=$1 BUILDPACK_DIR="$(dirname $(dirname $0))" +if ! command -v stunnel4 > /dev/null; then + + echo "! This buildpack uses stunnel, which isn’t supported on heroku-24 and later." >&2 + echo "! You don’t need this buildpack for Redis 6+. Remove it with the command:" >&2 + echo "! $ heroku buildpacks:remove heroku/redis" >&2 + echo "! To use Redis’ native TLS support, see https://devcenter.heroku.com/articles/heroku-redis#security-and-compliance:" >&2 + echo "! https://devcenter.heroku.com/articles/heroku-redis#security-and-compliance" >&2 + + exit 1 +fi + echo "-----> Moving the configuration generation script into app/bin" mkdir -p $BUILD_DIR/bin cp "$BUILDPACK_DIR/bin/stunnel-conf.sh" $BUILD_DIR/bin/stunnel-conf.sh