Skip to content

Commit

Permalink
Rename 'host' to 'bind_address'.
Browse files Browse the repository at this point in the history
Add 'bind_address' to example config
  • Loading branch information
mrichar1 committed Mar 6, 2015
1 parent a26edc3 commit ac64ecd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions etc/flapjack_config.toml.example
Expand Up @@ -166,6 +166,7 @@ daemonize = true
# Browsable web interface
[gateways.web]
enabled = true
#bind_address = "127.0.0.1"
port = 3080
timeout = 300
# Seconds between auto_refresh of entities/checks pages. Set to 0 to disable
Expand All @@ -181,6 +182,7 @@ daemonize = true
# HTTP API server
[gateways.jsonapi]
enabled = true
#bind_address = "127.0.0.1"
port = 3081
timeout = 300
access_log = "/var/log/flapjack/jsonapi_access.log"
Expand Down
6 changes: 3 additions & 3 deletions lib/flapjack/pikelet.rb
Expand Up @@ -163,18 +163,18 @@ def start
@pikelet_class.instance_variable_set('@config', @config)

if @config
host = @config['host']
bind_address = @config['bind_address']
port = @config['port']
port = port.nil? ? nil : port.to_i
timeout = @config['timeout']
timeout = timeout.nil? ? 300 : timeout.to_i
end
host = '127.0.0.1' if (host.nil?)
bind_address = '127.0.0.1' if (bind_address.nil?)
port = 3001 if (port.nil? || port <= 0 || port > 65535)

super do
@pikelet_class.start if @pikelet_class.respond_to?(:start)
@server = ::WEBrick::HTTPServer.new(:Port => port, :BindAddress => host,
@server = ::WEBrick::HTTPServer.new(:Port => port, :BindAddress => bind_address,
:AccessLog => [], :Logger => WEBrick::Log::new("/dev/null", 7))
@server.mount "/", Rack::Handler::WEBrick, @pikelet_class
yield @server if block_given?
Expand Down

0 comments on commit ac64ecd

Please sign in to comment.