We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be convenient if we could pass an environment variable like HOST=1.2.3.4 to control what IP address skynet binds to.
It would require a small change to skynet/utils.py:
skynet/utils.py
--- a/skynet/utils.py +++ b/skynet/utils.py @@ -1,3 +1,4 @@ +import os import uvicorn from fastapi import APIRouter, Depends, FastAPI from fastapi.middleware.cors import CORSMiddleware @@ -34,9 +35,10 @@ def get_router() -> APIRouter: async def create_webserver(app, port): + host = os.environ.get('HOST', '0.0.0.0') server_config = uvicorn.Config( app, - host='0.0.0.0', + host=host,
The text was updated successfully, but these errors were encountered:
No objection as long as the current default remains!
Sorry, something went wrong.
maybe define another variable as $HOST is kind of taken ;)
LISTEN_IP?
Good point. LISTEN_IP works for me.
No branches or pull requests
It would be convenient if we could pass an environment variable like HOST=1.2.3.4 to control what IP address skynet binds to.
It would require a small change to
skynet/utils.py
:The text was updated successfully, but these errors were encountered: