Skip to content

Commit

Permalink
Add support to bind to a specific IP
Browse files Browse the repository at this point in the history
  • Loading branch information
gmjosack committed Jan 1, 2015
1 parent cee17ea commit e03c21e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
* API Tokens for role accounts
* Setup support for migrations before first preview release
* Pagination
* Allow config to specify ip to bind to
2 changes: 1 addition & 1 deletion bin/nsot-server
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def main(argv):
)

server = tornado.httpserver.HTTPServer(application)
server.bind(port)
server.bind(port, address=settings.bind_address)
server.start()
try:
tornado.ioloop.IOLoop.instance().start()
Expand Down
5 changes: 4 additions & 1 deletion config/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ num_processes: 1
# Type: int
port: 8990

# The address to bind to. By default it listens on all interfaces.
# Type: string
bind_address: "127.0.0.1"

# Passing debug option down tornado. Useful for development to
# automatically reload code.
# Type: bool
Expand All @@ -35,6 +39,5 @@ cdnjs_prefix: "//cdnjs.cloudflare.com"

# Allows you to restrict requests to certain IP addresses and/or IP networks
# specified in CIDR notation.
#
# Type: str or list
restrict_networks: "127.0.0.1"
1 change: 1 addition & 0 deletions nsot/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ def override_restrict_networks(self, values):
"user_auth_header": "X-NSoT-Email",
"cdnjs_prefix": "//cdnjs.cloudflare.com",
"restrict_networks": [],
"bind_address": None,
})

0 comments on commit e03c21e

Please sign in to comment.