Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: heroku/heroku-buildpack-redis
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: dockwa/heroku-buildpack-redis-stunnel
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 12 commits
  • 2 files changed
  • 1 contributor

Commits on May 17, 2023

  1. Connect to regular URI Port

    micole committed May 17, 2023
    Copy the full SHA
    71d8531 View commit details
  2. Updating readme

    micole committed May 17, 2023
    Copy the full SHA
    6d7a57d View commit details
  3. Debug info

    micole committed May 17, 2023
    Copy the full SHA
    2c03b4e View commit details
  4. point to redis blue

    micole committed May 17, 2023
    Copy the full SHA
    7911b0c View commit details
  5. Copy the full SHA
    b9ee640 View commit details
  6. Copy the full SHA
    f1523f9 View commit details
  7. Copy the full SHA
    aaaa544 View commit details
  8. Strip away all funky stuff

    micole committed May 17, 2023
    Copy the full SHA
    d81f563 View commit details
  9. URI not full url

    micole committed May 17, 2023
    Copy the full SHA
    72579f5 View commit details
  10. testing forcing rediss

    micole committed May 17, 2023
    Copy the full SHA
    6fb0404 View commit details

Commits on May 18, 2023

  1. remove rediss from config

    micole committed May 18, 2023
    Copy the full SHA
    c9d20aa View commit details
  2. don't export url

    micole committed May 18, 2023
    Copy the full SHA
    9983738 View commit details
Showing with 17 additions and 43 deletions.
  1. +1 −1 README.md
  2. +16 −42 bin/stunnel-conf.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ available when using the hobby tier.
Then set this buildpack as your initial buildpack with:

```console
$ heroku buildpacks:add -i 1 heroku/redis
$ heroku buildpacks:add -i 1 https://github.com/dockwa/heroku-buildpack-redis-stunnel.git
```

Then confirm you are using this buildpack as well as your language buildpack like so:
58 changes: 16 additions & 42 deletions bin/stunnel-conf.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env bash
URLS=${REDIS_STUNNEL_URLS:-REDIS_URL `compgen -v HEROKU_REDIS`}
n=1

mkdir -p /app/vendor/stunnel/var/run/stunnel/

@@ -16,48 +14,24 @@ ciphers = HIGH:!ADH:!AECDH:!LOW:!EXP:!MD5:!3DES:!SRP:!PSK:@STRENGTH
debug = ${STUNNEL_LOGLEVEL:-notice}
EOFEOF

for URL in $URLS
do
eval URL_VALUE=\$$URL
PARTS=$(echo $URL_VALUE | perl -lne 'print "$1 $2 $3 $4 $5 $6 $7" if /^([^:]+):\/\/([^:]+):([^@]+)@(.*?):(.*?)(\/(.*?)(\\?.*))?$/')
if [ -z "$PARTS" ]
then
PARTS=$(echo $URL_VALUE | perl -lne 'print "$1 $2 $3 $4 $5 $6 $7" if /^([^:]+):\/\/:([^@]+)@(.*?):(.*?)(\/(.*?)(\\?.*))?$/')
WITHOUT_USERNAME=true
fi
URI=( $PARTS )


if [ "$WITHOUT_USERNAME" = true ] ; then
URI_SCHEME=${URI[0]}
URI_PASS=${URI[1]}
URI_HOST=${URI[2]}
URI_PORT=${URI[3]}
STUNNEL_PORT=$((URI_PORT + 1))

echo "Setting ${URL}_STUNNEL config var"
export ${URL}_STUNNEL=$URI_SCHEME://:$URI_PASS@127.0.0.1:637${n}
else
URI_SCHEME=${URI[0]}
URI_USER=${URI[1]}
URI_PASS=${URI[2]}
URI_HOST=${URI[3]}
URI_PORT=${URI[4]}
STUNNEL_PORT=$((URI_PORT + 1))

echo "Setting ${URL}_STUNNEL config var"
export ${URL}_STUNNEL=$URI_SCHEME://$URI_USER:$URI_PASS@127.0.0.1:637${n}
fi

cat >> /app/vendor/stunnel/stunnel.conf << EOFEOF
[$URL]
REDIS_URL=${HEROKU_REDIS_BLUE_URL/rediss/redis}
REDIS_URL=${REDIS_URL%@*}
REDIS_URL=${REDIS_URL}@127.0.0.1:6371

#export REDIS_URL=$REDIS_URL

STUNNEL_URI=${HEROKU_REDIS_BLUE_URL#*@}
#STUNNEL_URI=rediss://${STUNNEL_URI}
export STUNNEL_URI=${STUNNEL_URI}

cat >> /app/vendor/stunnel/stunnel.conf << EOFEOF
[REDIS_URL]
client = yes
accept = 127.0.0.1:637${n}
connect = $URI_HOST:$STUNNEL_PORT
accept = 127.0.0.1:6371
connect = ${STUNNEL_URI}
retry = ${STUNNEL_CONNECTION_RETRY:-"no"}
EOFEOF

let "n += 1"
done

cat /app/vendor/stunnel/stunnel.conf
env
chmod go-rwx /app/vendor/stunnel/*