-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support tls redis over wire encryption in 7.0.1 docker
- Loading branch information
1 parent
d9360b0
commit 80b872d
Showing
1 changed file
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,7 +132,7 @@ fi | |
# /root/certs/ldap/ldap-ca (supported) | ||
# /root/certs/ldap/ldap-cert (supported) | ||
# /root/certs/ldap/ldap-key (supported) | ||
# /root/certs/redis/.. (not yet supported) | ||
# /root/certs/redis/redis-ca (supported) | ||
if [ -f /root/certs/mysql/server/mysql-ca ] && | ||
[ ! -f /var/www/localhost/htdocs/openemr/sites/default/documents/certificates/mysql-ca ]; then | ||
echo "copied over mysql-ca" | ||
|
@@ -178,6 +178,11 @@ if [ -f /root/certs/ldap/ldap-key ] && | |
echo "copied over ldap-key" | ||
cp /root/certs/ldap/ldap-key /var/www/localhost/htdocs/openemr/sites/default/documents/certificates/ldap-key | ||
fi | ||
if [ -f /root/certs/redis/redis-ca ] && | ||
[ ! -f /var/www/localhost/htdocs/openemr/sites/default/documents/certificates/redis-ca ]; then | ||
echo "copied over redis-ca" | ||
cp /root/certs/redis/redis-ca /var/www/localhost/htdocs/openemr/sites/default/documents/certificates/redis-ca | ||
fi | ||
|
||
if [ "$AUTHORITY" == "yes" ]; then | ||
if [ "$CONFIG" == "0" ] && | ||
|
@@ -262,19 +267,28 @@ if [ "$REDIS_SERVER" != "" ] && | |
# Only password set (using redis default user and pertinent password) | ||
# NOTE that only username set is not supported (in this case will ignore the username | ||
# and use no username and no password set mode) | ||
REDIS_PATH="tcp://$REDIS_SERVER:6379" | ||
REDIS_PATH="$REDIS_SERVER:6379" | ||
if [ "$REDIS_USERNAME" != "" ] && | ||
[ "$REDIS_PASSWORD" != "" ]; then | ||
echo "redis setup with username and password" | ||
REDIS_PATH="$REDIS_PATH?auth[user]=$REDIS_USERNAME\&auth[pass]=$REDIS_PASSWORD" | ||
GET_CONNECTOR="\&" | ||
elif [ "$REDIS_PASSWORD" != "" ]; then | ||
echo "redis setup with password" | ||
# only a password, thus using the default user which redis has set a password for | ||
REDIS_PATH="$REDIS_PATH?auth[pass]=$REDIS_PASSWORD" | ||
GET_CONNECTOR="\&" | ||
else | ||
# no user or password, thus using the default user which is set to nopass in redis | ||
# so just keeping original REDIS_PATH: REDIS_PATH="$REDIS_PATH" | ||
echo "redis setup" | ||
GET_CONNECTOR="?" | ||
fi | ||
|
||
if [ "$REDIS_TLS" == "yes" ]; then | ||
REDIS_PATH="tls://${REDIS_PATH}${GET_CONNECTOR}stream[verify_peer]=0&stream[local_cert]=file:///var/www/localhost/htdocs/openemr/sites/default/documents/certificates/redis-ca" | ||
else | ||
REDIS_PATH="tcp://$REDIS_PATH" | ||
fi | ||
|
||
sed -i "[email protected]_handler = [email protected]_handler = redis@" /etc/php81/php.ini | ||
|