Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Add Redis Auth abililty #38

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/Core/Infrastructure/RedisClientManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function connect(RedisInstanceIdentifier $redisInstanceIdentifier): \R
$redis = new \Redis();
$connected = false;
try {
$connected = $redis->connect($instanceConfig['hostname'], $instanceConfig['port'] ?? 6379, $instanceConfig['timeout'] ?? 0) && $redis->select($instanceConfig['database'] ?? 0);
$connected = $redis->connect($instanceConfig['hostname'], $instanceConfig['port'] ?? 6379, $instanceConfig['timeout'] ?? 0) && $redis->auth([$instanceConfig['username'] ?? "default", $instanceConfig['password'] ?? ""]) && $redis->select($instanceConfig['database'] ?? 0);
} catch (\Exception $e) {
throw new Exception(sprintf('Could not connect to Redis server %s:%d. Detailed reason: see nested exception.', $instanceConfig['hostname'], $instanceConfig['port']), 1630323312, $e);
}
Expand Down
2 changes: 2 additions & 0 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Flowpack:
hostname: 127.0.0.1
port: 6379
database: 11
username: ''
password: ''

# How many content releases to keep before cleaning them up.
#
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,15 @@ To enable this feature, do the following:
hostname: my-redis-hostname
port: 6379
database: 11
username: ''
password: ''
staging:
label: 'Staging Site'
hostname: my-staging-redis-hostname
port: 6379
database: 11
username: ''
password: ''
```

2. In `pipelines.yml`, underneath `4) TRANSFER`, comment-in and adjust the `transfer_content` task.
Expand Down