diff options
Diffstat (limited to 'lib/leap_cli')
-rw-r--r-- | lib/leap_cli/config/macros.rb | 36 | ||||
-rw-r--r-- | lib/leap_cli/version.rb | 4 |
2 files changed, 29 insertions, 11 deletions
diff --git a/lib/leap_cli/config/macros.rb b/lib/leap_cli/config/macros.rb index 59453b0..66f1318 100644 --- a/lib/leap_cli/config/macros.rb +++ b/lib/leap_cli/config/macros.rb @@ -272,6 +272,23 @@ module LeapCli; module Config ## # + # About stunnel + # -------------------------- + # + # The network looks like this: + # + # From the client's perspective: + # + # |------- stunnel client --------------| |---------- stunnel server -----------------------| + # consumer app -> localhost:accept_port -> connect:connect_port -> ?? + # + # From the server's perspective: + # + # |------- stunnel client --------------| |---------- stunnel server -----------------------| + # ?? -> *:accept_port -> localhost:connect_port -> service + # + + # # stunnel configuration for the client side. # # +node_list+ is a ObjectList of nodes running stunnel servers. @@ -279,18 +296,12 @@ module LeapCli; module Config # +port+ is the real port of the ultimate service running on the servers # that the client wants to connect to. # - # About ths stunnel puppet names: - # # * accept_port is the port on localhost to which local clients # can connect. it is auto generated serially. + # # * connect_port is the port on the stunnel server to connect to. # it is auto generated from the +port+ argument. # - # The network looks like this: - # - # |------ stunnel client ---------------| |--------- stunnel server -----------------------| - # consumer app -> localhost:accept_port -> server:connect_port -> server:port -> service app - # # generates an entry appropriate to be passed directly to # create_resources(stunnel::service, hiera('..'), defaults) # @@ -307,7 +318,8 @@ module LeapCli; module Config result["#{node.name}_#{port}"] = Config::Object[ 'accept_port', @next_stunnel_port, 'connect', node.domain.internal, - 'connect_port', stunnel_port(port) + 'connect_port', stunnel_port(port), + 'original_port', port ] @next_stunnel_port += 1 end @@ -320,8 +332,14 @@ module LeapCli; module Config # # +port+ is the real port targeted service. # + # * `accept_port` is the publicly bound port + # * `connect_port` is the port that the local service is running on. + # def stunnel_server(port) - {"accept" => stunnel_port(port), "connect" => "127.0.0.1:#{port}"} + { + "accept_port" => stunnel_port(port), + "connect_port" => port + } end # diff --git a/lib/leap_cli/version.rb b/lib/leap_cli/version.rb index df0f87a..f8a725b 100644 --- a/lib/leap_cli/version.rb +++ b/lib/leap_cli/version.rb @@ -1,7 +1,7 @@ module LeapCli unless defined?(LeapCli::VERSION) - VERSION = '1.5.7' - COMPATIBLE_PLATFORM_VERSION = '0.5.2'..'1.99' + VERSION = '1.5.8' + COMPATIBLE_PLATFORM_VERSION = '0.5.3'..'1.99' SUMMARY = 'Command line interface to the LEAP platform' DESCRIPTION = 'The command "leap" can be used to manage a bevy of servers running the LEAP platform from the comfort of your own home.' LOAD_PATHS = ['lib', 'vendor/certificate_authority/lib', 'vendor/rsync_command/lib'] |