-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add support for redis sentinel #763
base: MOODLE_39_STABLE
Are you sure you want to change the base?
Add support for redis sentinel #763
Conversation
I know the existing code pollutes the global $CFG to store auth_saml2 specific settings, but we should really migrate those to config_plugins table instead if possible, although we might not block merging based on that for now... I'll see if someone here can PR this properly - thanks! |
SimpleSAML has builtin support for Redis Sentinel - could it be utilised by this patch? https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance.html#configuring-redis-storage |
if (empty($CFG->auth_saml2_redis_server)) { | ||
throw new \coding_exception('Redis connection string is not configured in $CFG->auth_saml2_redis_server'); | ||
} | ||
if (!empty($CFG->auth_saml2_redissentinel_servers) && !empty($CFG->auth_saml2_redissentinel_group)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These really need to be plugin scope config items not globals please, its a very simple change. Get the config using get_config and set it in config.php like:
$CFG->forced_plugin_settings['auth_saml2']['foobar'] = 0;
This also needs to be documented somewhere like the readme file
…9_STABLE_redissentinel
Quick changes to support redis sentinel.
Configuration in moodle/config.php:
$CFG->auth_saml2_store = '\auth_saml2\redis_store';
// OPT 1: Single redis server
$CFG->auth_saml2_redis_server = '{{ moodle_config.redishost }}'; # Required for the redis_store above
// OPT 2: Redis Sentinel
$CFG->auth_saml2_redissentinel_servers = '1.1.1.1:26397,2.2.2.2:26397,3.3.3.3:26397';
$CFG->auth_saml2_redissentinel_group = 'rediscluster';