You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
665 B

  1. # frozen_string_literal: true
  2. require_relative '../../config/boot'
  3. require_relative '../../config/environment'
  4. require_relative 'cli_helper'
  5. module Mastodon
  6. class RegistrationsCLI < Thor
  7. def self.exit_on_failure?
  8. true
  9. end
  10. desc 'open', 'Open registrations'
  11. def open
  12. Setting.registrations_mode = 'open'
  13. say('OK', :green)
  14. end
  15. desc 'close', 'Close registrations'
  16. def close
  17. Setting.registrations_mode = 'none'
  18. say('OK', :green)
  19. end
  20. end
  21. class SettingsCLI < Thor
  22. desc 'registrations SUBCOMMAND ...ARGS', 'Manage state of registrations'
  23. subcommand 'registrations', RegistrationsCLI
  24. end
  25. end