Sha256: 648eda95d4bdb05a9dfc7591ccf4855fcbe668bc1979cb939a163d1695f70d77

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

module Legion
  module Crypt
    module Settings
      def self.default
        {
          vault:            vault,
          cs_encrypt_ready: false,
          dynamic_keys:     true,
          cluster_secret:   nil
        }
      end

      def self.vault
        {
          enabled:             !Gem::Specification.find_by_name('vault').nil?,
          protocol:            'http',
          address:             'localhost',
          port:                8200,
          token:               ENV['VAULT_DEV_ROOT_TOKEN_ID'] || ENV['VAULT_TOKEN_ID'] || nil,
          connected:           false,
          renewer_time:        5,
          renewer:             true,
          push_cluster_secret: true,
          read_cluster_secret: true
        }
      end
    end
  end
end

begin
  Legion::Settings.merge_settings('crypt', Legion::Crypt::Settings.default) if Legion.const_defined?('Settings')
rescue StandardError => e
  Legion::Logging.fatal(e.message) if Legion::Logging.method_defined?(:fatal)
  Legion::Logging.fatal(e.backtrace) if Legion::Logging.method_defined?(:fatal)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
legion-crypt-0.2.1 lib/legion/crypt/settings.rb