Skip to content

Feature: Backend/cache: Allow to use redis cache instead as memory #832

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

Merged
merged 2 commits into from
May 25, 2025

Conversation

JulesdeCube
Copy link
Contributor

Context

I am currently deploying Pingvin on kubernetes in high availability (multiple instance of the backend and frontend).

Issue

You are using cache to store OIDC nouce.
You are ussing memory cache.

This work well when you have only one instance of the backend.

But for obvious reason it break when you more that 1 instance.
If the oidc callback arrive to a different backend that pre OIDC request the nonce will not be available and therefore the backend will throw an error because it's nonce is undefined.

PR

This PR introduce the possibility to enable/configure share Redis cache (disable by default).

Note

Thank you for this amazing project ❤️

There will also be an other related PR for PostgreSQL db backend and Kubernetes helm deployment.

@JulesdeCube JulesdeCube closed this May 9, 2025
@JulesdeCube JulesdeCube deleted the redis-cache branch May 9, 2025 18:01
@JulesdeCube JulesdeCube restored the redis-cache branch May 9, 2025 18:01
@JulesdeCube JulesdeCube reopened this May 9, 2025
Copy link
Owner

@stonith404 stonith404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, the implementation looks good to me.

Please also add the configuration variables to the admin settings page.

You have to add the "cache" category to the Sidebar and add the name and description to the translations file.

@JulesdeCube
Copy link
Contributor Author

Fixed

@stonith404
Copy link
Owner

Could you please enable "Maintainers are allowed to edit this pull request." in the PR? I have some minor improvements.

@JulesdeCube
Copy link
Contributor Author

Could you please enable "Maintainers are allowed to edit this pull request." in the PR? I have some minor improvements.

This is a organization repo so I can't enable "Maintainers are allowed to edit this pull request". But i invite you as a developer so you can modify it

@JulesdeCube JulesdeCube changed the title Feature: Backend/cache: Allow to use redis cache instead as memory Draft: Feature: Backend/cache: Allow to use redis cache instead as memory May 21, 2025
@JulesdeCube
Copy link
Contributor Author

JulesdeCube commented May 21, 2025

Putting into draft as the configuration dont seems to work. ServiceConfiguration.get Return undefined for every keys

@JulesdeCube JulesdeCube changed the title Draft: Feature: Backend/cache: Allow to use redis cache instead as memory Feature: Backend/cache: Allow to use redis cache instead as memory May 21, 2025
@JulesdeCube
Copy link
Contributor Author

Should be fix and ready

@stonith404
Copy link
Owner

Thanks. I still can't push to the repo even though you gave me access. Can you apply the following patches manually and commit them?

5a30fc.patch
077e8b.patch
aecfcf.patch

You can apply them with git apply <patch_file.patch>.

@JulesdeCube
Copy link
Contributor Author

Hello,

I apply your patchs and cleanup git history (amend and squash commits).

Jules Lefebvre added 2 commits May 24, 2025 21:25
@stonith404
Copy link
Owner

Great, thank you :)

@stonith404 stonith404 merged commit 85f5143 into stonith404:main May 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants