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

Not all Redis keys are prefixed with "Shlink:" resulting in issues with ACL on Redis cluster #1870

Closed
glenroy37 opened this issue Sep 6, 2023 · 2 comments
Labels
Milestone

Comments

@glenroy37
Copy link

glenroy37 commented Sep 6, 2023

Shlink version

3.6.3

PHP version

docker

How do you serve Shlink

Openswoole Docker image

Database engine

PostgreSQL

Database version

12

Current behavior

When using shlink-api with a Redis-Cluster only allowing keys with "Shlink:"-Prefix locks from AbstractLockedCommand won't work, because they use the command name (e.g. "db:create") as key without prefix.

Expected behavior

Redis keys created by locks should be prefixed with "Shlink:" as all other Redis keys are.

A possible fix we've already tried is adding "Shlink:" to the lock configuration in AbstractDatabaseCommand.php and LocateVisistsCommand.php. That fixes the lock names for those commands, but Shlink still has permissions errors upon startup. So there are most probably still other keys created in Redis without the prefix

How to reproduce

Start a Redis cluster with following ACL:

user default on >redacted ~oeamtc:lms:lms-totara* &* +@all
user shlink on >redacted ~Shlink* &* +@all

The Shlink API will fail on startup when started with user "shlink", because it can't create the key "db:create".

@acelaya
Copy link
Member

acelaya commented Sep 12, 2023

This is now fixed, and will be included with Shlink 3.6.4, which will potentially release at some point this week.

@acelaya acelaya closed this as completed Sep 12, 2023
@acelaya
Copy link
Member

acelaya commented Sep 23, 2023

Shlink 3.6.4 has just been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants