aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2015-04-26 15:57:24 +0100
committerAdam Spiers <git@adamspiers.org>2015-04-26 15:57:24 +0100
commit655f53fa5104bae10591fc18712018af5745cfc3 (patch)
tree413a3eb32042ad271e065e8c18381ec3e5eaf7f4
parent580af24ed990c04ffc967c62a45a2e460f1cf027 (diff)
downloadgit-deps-655f53fa5104bae10591fc18712018af5745cfc3.tar.gz
Allow binding to any address via --bind-ip
We don't default to 0.0.0.0 because that would be a security risk. Closes #48.
-rwxr-xr-xgit-deps5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-deps b/git-deps
index d806e4b..b814e88 100755
--- a/git-deps
+++ b/git-deps
@@ -618,6 +618,9 @@ def parse_args():
parser.add_argument('-s', '--serve', dest='serve', action='store_true',
help='Run a web server for visualizing the '
'dependency graph')
+ parser.add_argument('-b', '--bind-ip', dest='bindaddr', type=str,
+ metavar='IP', default='127.0.0.1',
+ help='IP address for webserver to bind to [%(default)s]')
parser.add_argument('-p', '--port', dest='port', type=int, metavar='PORT',
default=5000,
help='Port number for webserver [%(default)s]')
@@ -767,7 +770,7 @@ def serve(options):
"insecure!")
print("!! Arbitrary code can be executed from browser!")
print()
- webserver.run(port=options.port, debug=options.debug)
+ webserver.run(port=options.port, debug=options.debug, host=options.bindaddr)
def main():