This repository was archived by the owner on Feb 11, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit d81f563
1 parent aaaa544 commit d81f563 Copy full SHA for d81f563
File tree 1 file changed +9
-33
lines changed
1 file changed +9
-33
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- URLS=${HEROKU_REDIS_BLUE_URL}
3
- n=1
4
2
5
3
mkdir -p /app/vendor/stunnel/var/run/stunnel/
6
4
@@ -16,42 +14,20 @@ ciphers = HIGH:!ADH:!AECDH:!LOW:!EXP:!MD5:!3DES:!SRP:!PSK:@STRENGTH
16
14
debug = ${STUNNEL_LOGLEVEL:- notice}
17
15
EOFEOF
18
16
19
- for URL in $URLS
20
- do
21
- eval URL_VALUE=\$ $URL
22
- PARTS=$( echo $URL_VALUE | perl -lne ' print "$1 $2 $3 $4 $5 $6 $7" if /^([^:]+):\/\/([^:]+):([^@]+)@(.*?):(.*?)(\/(.*?)(\\?.*))?$/' )
23
- if [ -z " $PARTS " ]
24
- then
25
- PARTS=$( echo $URL_VALUE | perl -lne ' print "$1 $2 $3 $4 $5 $6 $7" if /^([^:]+):\/\/:([^@]+)@(.*?):(.*?)(\/(.*?)(\\?.*))?$/' )
26
- WITHOUT_USERNAME=true
27
- fi
28
- URI=( $PARTS )
29
-
30
- URI_SCHEME=${URI[0]}
31
- URI_USER=${URI[1]}
32
- URI_PASS=${URI[2]}
33
- URI_HOST=${URI[3]}
34
- URI_PORT=${URI[4]}
35
-
36
- echo " URI PARTS"
37
- echo ${URI}
38
-
39
- echo " Setting REDIS_URL config var"
40
- export REDIS_URL=redis://$URI_USER :$URI_PASS @127.0.0.1:637${n}
41
- # echo "Setting ${URL}_STUNNEL config var"
42
- # export ${URL}_STUNNEL=$URI_SCHEME://$URI_USER:$URI_PASS@127.0.0.1:637${n}
43
-
44
- cat >> /app/vendor/stunnel/stunnel.conf << EOFEOF
17
+ REDIS_URL=${HEROKU_REDIS_BLUE_URL/ rediss/ redis}
18
+ REDIS_URL=${REDIS_URL%@* }
19
+ REDIS_URL=${REDIS_URL} @127.0.0.1:6371
20
+
21
+ export REDIS_URL=$REDIS_URL
22
+
23
+ cat >> /app/vendor/stunnel/stunnel.conf << EOFEOF
45
24
[REDIS_URL]
46
25
client = yes
47
- accept = 127.0.0.1:637 ${n}
48
- connect = $URI_HOST : $URI_PORT
26
+ accept = 127.0.0.1:6371
27
+ connect = ${HEROKU_REDIS_BLUE_URL}
49
28
retry = ${STUNNEL_CONNECTION_RETRY:- " no" }
50
29
EOFEOF
51
30
52
- let " n += 1"
53
- done
54
-
55
31
cat /app/vendor/stunnel/stunnel.conf
56
32
env
57
33
chmod go-rwx /app/vendor/stunnel/*
You can’t perform that action at this time.
0 commit comments