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".

@glenroy37 glenroy37 added the bug label Sep 6, 2023
@acelaya acelaya added this to the 3.6.4 milestone Sep 6, 2023
@acelaya acelaya moved this to Todo in Shlink Sep 6, 2023
@acelaya acelaya moved this from Todo to In Progress in Shlink Sep 12, 2023
@acelaya acelaya moved this from In Progress to In review in Shlink Sep 12, 2023
@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
@github-project-automation github-project-automation bot moved this from In review to Done in Shlink 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