# frozen_string_literal: true require "thor" require_relative "ssl_mode" require_relative "min_tls_version" require_relative "always_use_https" require_relative "dns_proxy_status" require_relative "ensure_cloudflare_cdn" require_relative "bot_fight_mode" module Neetob class CLI module Cloudflare class Commands < Thor desc "ssl_mode", "Check the value of SSL Mode for your domain in Cloudflare" option :domain, type: :string, aliases: "-d", required: true, description: "Domain name" def ssl_mode SSLMode.new(options[:domain]).process end desc "min_tls_version", "Check the value of the minimum TLS version for your domain in Cloudflare" option :domain, type: :string, aliases: "-d", required: true, description: "Domain name" def min_tls_version MinTlsVersion.new(options[:domain]).process end desc "always_use_https", "Check if always use HTTPS setting is turned on for your domain in Cloudflare" option :domain, type: :string, aliases: "-d", required: true, description: "Domain name" def always_use_https AlwaysUseHttps.new(options[:domain]).process end desc "dns_proxy_status", "Check if DNS proxy status is enabled for all DNS records of your domain in Cloudflare" option :domain, type: :string, aliases: "-d", required: true, description: "Domain name" def dns_proxy_status DnsProxyStatus.new(options[:domain]).process end desc "ensure_cloudflare_cdn", "Check if an app is using Cloudflare CDN. App name is the app name in NeetoDeploy (Example: neeto-replay-web-production)" option :app, type: :string, aliases: "-a", required: true, description: "App name (neeto-replay-web)" def ensure_cloudflare_cdn EnsureCloudflareCdn.new(options[:app]).process end desc "bot_fight_mode", "Check if a domain has bot fight mode turned on or not." option :domain, type: :string, aliases: "-d", required: true, description: "Domain name" def bot_fight_mode BotFightMode.new(options[:domain]).process end end end end end