From 4a50f0ed4679d2a6ad0729f55b03d2665dcf40a6 Mon Sep 17 00:00:00 2001 From: Charlotte Weaver Date: Thu, 29 Nov 2018 17:01:49 -0800 Subject: [PATCH] External host option (#481) * allow specifying host ip instead of listen all * flask serving * Limit to ip addresses only --- server/cli/launch.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/server/cli/launch.py b/server/cli/launch.py index 8276a530..3844676b 100644 --- a/server/cli/launch.py +++ b/server/cli/launch.py @@ -24,14 +24,13 @@ from server.app.util.errors import ScanpyFileError @click.option("--port", "-p", help="Port to run server on.", metavar="", default=5005, show_default=True) @click.option("--obs-names", default=None, metavar="", help="Name of annotation field to use for observations.") @click.option("--var-names", default=None, metavar="", help="Name of annotation to use for variables.") -@click.option("--listen-all", is_flag=True, default=False, show_default=True, - help="Bind to all interfaces (this makes the server accessible beyond this computer).") +@click.option("--host", default="127.0.0.1", help="Host IP address") @click.option("--max-category-items", default=100, metavar="", show_default=True, help="Limits the number of categorical annotation items displayed.") @click.option("--diffexp-lfc-cutoff", default=0.01, show_default=True, help="Relative expression cutoff used when selecting top N differentially expressed genes") def launch(data, layout, diffexp, title, verbose, debug, obs_names, var_names, - open_browser, port, listen_all, max_category_items, diffexp_lfc_cutoff): + open_browser, port, host, max_category_items, diffexp_lfc_cutoff): """Launch the cellxgene data viewer. This web app lets you explore single-cell expression data. Data must be in a format that cellxgene expects, read the @@ -65,11 +64,6 @@ def launch(data, layout, diffexp, title, verbose, debug, obs_names, var_names, file_parts = splitext(basename(data)) title = file_parts[0] - if listen_all: - host = "0.0.0.0" - else: - host = "127.0.0.1" - # Setup app cellxgene_url = f"http://{host}:{port}" api_base = f"{cellxgene_url}/api/"