1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

rake mastodon:setup: Restore Redis config prior to creating an admin user

This commit is contained in:
Dave MacDonald 2022-12-04 18:32:08 -05:00
parent 05d4c50f64
commit 5ee2d98b40
No known key found for this signature in database
GPG key ID: 5425DE3500551488

View file

@ -470,6 +470,15 @@ namespace :mastodon do
require_relative '../../config/environment' require_relative '../../config/environment'
disable_log_stdout! disable_log_stdout!
# With the environment now reloaded, update Sidekiq to use the Redis config that was provided earlier interactively, in case it differs from the default localhost:6379.
# When the admin user is created, User dispatches an 'account.created' event to Sidekiq, which connects to Redis.
Sidekiq.configure_client do |config|
new_params = REDIS_SIDEKIQ_PARAMS.dup
new_params['url'] = "redis://:#{env['REDIS_PASSWORD']}@#{env['REDIS_HOST']}:#{env['REDIS_PORT']}/0"
new_params.freeze
config.redis = new_params
end
username = prompt.ask('Username:') do |q| username = prompt.ask('Username:') do |q|
q.required true q.required true
q.default 'admin' q.default 'admin'