Module: WireGuard::Admin::ClassHelpers
Overview
Shared class methods
Instance Method Summary collapse
Instance Method Details
#default_network ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/wire_guard/admin/cli/helpers.rb', line 11 def default_network if repository.networks.size == 1 nw = repository.networks.first ENV.fetch('WG_ADMIN_NETWORK', "#{nw}/#{nw.prefix}") else ENV['WG_ADMIN_NETWORK'] end end |
#path ⇒ Object
20 21 22 |
# File 'lib/wire_guard/admin/cli/helpers.rb', line 20 def path ENV['WG_ADMIN_STORE'] || File.('~/.wg-admin.pstore') end |
#repository ⇒ Object
24 25 26 |
# File 'lib/wire_guard/admin/cli/helpers.rb', line 24 def repository @repository ||= Repository.new(path) end |