Class: Heighliner::Cmds::Set
- Inherits:
-
Heighliner::Cli
- Object
- Heighliner::Cli
- Heighliner::Cmds::Set
- Defined in:
- lib/heighliner/cmds/set.rb
Instance Attribute Summary
Attributes inherited from Heighliner::Cli
Instance Method Summary collapse
- #execute(_opts) ⇒ Object
-
#initialize ⇒ Set
constructor
A new instance of Set.
- #usage ⇒ Object
Methods inherited from Heighliner::Cli
all_subcommands_usage, #define_options, register, run_command, #set_config, #start_services, #stop_app, #stop_services
Methods included from Heighliner::CliOptions
Constructor Details
#initialize ⇒ Set
Returns a new instance of Set.
30 31 32 33 |
# File 'lib/heighliner/cmds/set.rb', line 30 def initialize super @use_steerfile = false end |
Instance Method Details
#execute(_opts) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/heighliner/cmds/set.rb', line 35 def execute(_opts) cmd = ARGV.shift case cmd when 'cert-url' Config.config[:cert_source] = { url: ARGV.shift } when 'cert-folder' Config.config[:cert_source] = { folder: ARGV.shift } when 'cert-1password' handle_cert_1password when 'cert-1password-fields' Config.config[:cert_source]['1password-fields'] = JSON.parse(ARGV.shift) when 'http-suffix' Config.config[:http_suffix] = ARGV.shift when 'help-https' puts help_https else Optimist.die "Unknown subcommand: '#{cmd}'" end save_config end |
#usage ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/heighliner/cmds/set.rb', line 8 def usage <<~EOS This command lets you set up special variables that configure heighliner's behavior for you. Available subcommands: http-suffix - Sets the domain suffix for the reverse proxy to use (defaults to lvh.me) cert-url - Sets up a URL from which HTTPS certificates can be downloaded. cert-folder - Sets up a folder from which HTTPS certificates can be copied. cert-1password - Sets up a 1Password item from which HTTPS certificates can be downloaded. cert-1password-fields - Sets custom 1Password field names (JSON object) help-https - Shows the HTTPS notes. USAGE: heighliner set cert-url heighliner set cert-folder heighliner set cert-1password heighliner set cert-1password-fields heighliner set http-suffix heighliner set help-https EOS end |