-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(router): enable redis to work with auth (#1563)
- Loading branch information
Showing
10 changed files
with
248 additions
and
48 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 |
---|---|---|
|
@@ -159,13 +159,23 @@ jobs: | |
- name: Setup Redis Cluster (for Cluster tests) | ||
uses: vishnudxb/[email protected] | ||
with: | ||
master1-port: 7000 | ||
master2-port: 7001 | ||
master3-port: 7002 | ||
slave1-port: 7003 | ||
slave2-port: 7004 | ||
slave3-port: 7005 | ||
master1-port: 7001 | ||
master2-port: 7002 | ||
master3-port: 7003 | ||
slave1-port: 7004 | ||
slave2-port: 7005 | ||
slave3-port: 7006 | ||
sleep-duration: 5 | ||
- name: Configure Redis Authentication & ACL | ||
run: | | ||
sudo apt-get install -y redis-tools | ||
docker ps -a | ||
# Set a password for each master node | ||
for port in 7001 7002 7003; do | ||
redis-cli -h 127.0.0.1 -p $port ACL SETUSER cosmo on ">test" "~*" "+@all" | ||
redis-cli -u "redis://cosmo:[email protected]:$port" ping | ||
echo "ACL user 'cosmo' created with full access on port $port" | ||
done | ||
- uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 30 | ||
|
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
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 |
---|---|---|
@@ -1,13 +1,21 @@ | ||
# wait for the docker-compose depends_on to spin up the redis nodes usually takes this long | ||
sleep 10 | ||
|
||
node_0_ip=$(getent hosts redis-cluster-node-0 | awk '{ print $1 }') | ||
node_1_ip=$(getent hosts redis-cluster-node-1 | awk '{ print $1 }') | ||
node_2_ip=$(getent hosts redis-cluster-node-2 | awk '{ print $1 }') | ||
node_3_ip=$(getent hosts redis-cluster-node-3 | awk '{ print $1 }') | ||
|
||
# Set cluster properties dynamically for each node | ||
for ip in $node_1_ip $node_2_ip $node_3_ip; do | ||
echo "Configuring Redis node at $ip" | ||
redis-cli -h $ip -p 6379 CONFIG SET cluster-announce-ip "$ip" | ||
done | ||
|
||
# Create the cluster | ||
redis-cli --cluster create \ | ||
$node_0_ip:6379 \ | ||
$node_1_ip:6379 \ | ||
$node_2_ip:6379 \ | ||
--cluster-replicas 0 --cluster-yes | ||
$node_3_ip:6379 \ | ||
--cluster-replicas 0 --cluster-yes | ||
|
||
echo "Redis Cluster setup complete!" |
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
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
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
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
Oops, something went wrong.