diff --git a/lib/galaxy/webapps/galaxy/script.py b/lib/galaxy/webapps/galaxy/script.py new file mode 100644 index 000000000000..59708d945924 --- /dev/null +++ b/lib/galaxy/webapps/galaxy/script.py @@ -0,0 +1,30 @@ +import os +from argparse import ArgumentParser + +import uvicorn + + +def main() -> None: + parser = ArgumentParser( + prog="galaxy-web", + description="Run Galaxy Web Server", + ) + parser.add_argument("--config", "-c", help="Galaxy config file") + parser.add_argument("--single-user", "-s", help="Single user mode as user SINGLE_USER") + parser.add_argument("--bind", "-b", default="localhost:8080", help="Bind to :") + parser.add_argument( + "--client-path", "-n", default="node_modules/@galaxyproject/galaxy-client", help="Path to Galaxy client" + ) + args = parser.parse_args() + env = os.environ.copy() + if args.config: + env["GALAXY_CONFIG_FILE"] = args.config + if args.single_user: + env["GALAXY_CONFIG_SINGLE_USER"] = args.single_user + env["GALAXY_CONFIG_ADMIN_USERS"] = args.single_user + uvicorn.run( + "galaxy.webapps.galaxy.fast_factory:factory", + factory=True, + host=args.bind.split(":")[0], + port=int(args.bind.split(":")[1]), + ) diff --git a/packages/web_apps/setup.cfg b/packages/web_apps/setup.cfg index 914d43a895d2..bcf88a282c43 100644 --- a/packages/web_apps/setup.cfg +++ b/packages/web_apps/setup.cfg @@ -68,6 +68,10 @@ install_requires = packages = find: python_requires = >=3.8 +[options.entry_points] +console_scripts = + galaxy-web = galaxy.webapps.galaxy.script:main + [options.packages.find] exclude = tests*