module FTW::Agent::Configuration

Experimentation with an agent configuration similar to Firefox's about:config

Constants

REDIRECTION_LIMIT

The config key for setting how many redirects will be followed before giving up.

SSL_CIPHERS

SSL cipher strings

SSL_CIPHER_DEFAULT
SSL_CIPHER_MAP
SSL_TRUST_STORE

SSL Trust Store

SSL_USE_DEFAULT_CERTS

SSL: Use the system's global default certs?

SSL_VERSION

Public Instance Methods

configuration() click to toggle source

Get the configuration hash

# File lib/ftw/agent/configuration.rb, line 32
def configuration
  return @configuration ||= default_configuration
end

Private Instance Methods

default_configuration() click to toggle source

default configuration

# File lib/ftw/agent/configuration.rb, line 37
def default_configuration
  require "tmpdir"
  home = File.join(ENV.fetch("HOME", tmpdir), ".ftw")
  return {
    REDIRECTION_LIMIT => 20,
    SSL_TRUST_STORE => File.join(home, "ssl-trust.db"),
    SSL_USE_DEFAULT_CERTS => true,
    SSL_CIPHERS => SSL_CIPHER_DEFAULT,
    SSL_VERSION => "TLSv1.1",
  }
end
tmpdir() click to toggle source
# File lib/ftw/agent/configuration.rb, line 49
def tmpdir
  return File.join(Dir.tmpdir, "ftw-#{Process.uid}")
end