Class: Kitsune::Kit::Commands::SetupRedisDocker

Inherits:
Thor
  • Object
show all
Defined in:
lib/kitsune/kit/commands/setup_redis_docker.rb

Instance Method Summary collapse

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/kitsune/kit/commands/setup_redis_docker.rb', line 19

def create
  redis_defaults = Kitsune::Kit::Defaults.redis

  if redis_defaults[:redis_password] == "secret"
    say "⚠️ Warning: You are using the default Redis password ('secret').", :yellow
    if ENV.fetch("KIT_ENV", "development") == "production"
      abort "❌ Production environment requires a secure Redis password!"
    else
      say "🔒 Please change REDIS_PASSWORD in your .env if needed.", :yellow
    end
  end

  filled_options = Kitsune::Kit::OptionsBuilder.build(
    options,
    required: [:server_ip],
    defaults: Kitsune::Kit::Defaults.ssh
  )

  with_ssh_connection(filled_options) do |ssh|
    perform_setup(ssh, redis_defaults, filled_options)
  end
end

#rollbackObject



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/kitsune/kit/commands/setup_redis_docker.rb', line 43

def rollback
  redis_defaults = Kitsune::Kit::Defaults.redis

  filled_options = Kitsune::Kit::OptionsBuilder.build(
    options,
    required: [:server_ip],
    defaults: Kitsune::Kit::Defaults.ssh
  )

  with_ssh_connection(filled_options) do |ssh|
    perform_rollback(ssh, redis_defaults)
  end
end