diff options
author | Adam Spiers <git@adamspiers.org> | 2015-04-26 15:57:24 +0100 |
---|---|---|
committer | Adam Spiers <git@adamspiers.org> | 2015-04-26 15:57:24 +0100 |
commit | 655f53fa5104bae10591fc18712018af5745cfc3 (patch) | |
tree | 413a3eb32042ad271e065e8c18381ec3e5eaf7f4 | |
parent | 580af24ed990c04ffc967c62a45a2e460f1cf027 (diff) | |
download | git-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-x | git-deps | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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(): |