mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Webpublisher - webserver ip is configurable
In some cases webserver needs to listen on specific ip (because of Docker)
This commit is contained in:
parent
eabfc473ac
commit
a3f1067364
4 changed files with 12 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import threading
|
||||
import asyncio
|
||||
import os
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
|
|
@ -110,7 +111,9 @@ class WebServerThread(threading.Thread):
|
|||
""" Starts runner and TCPsite """
|
||||
self.runner = web.AppRunner(self.manager.app)
|
||||
await self.runner.setup()
|
||||
self.site = web.TCPSite(self.runner, 'localhost', self.port)
|
||||
host_ip = os.environ.get("WEBSERVER_HOST_IP") or 'localhost'
|
||||
log.info("host_ip:: {}".format(os.environ.get("WEBSERVER_HOST_IP")))
|
||||
self.site = web.TCPSite(self.runner, host_ip, self.port)
|
||||
await self.site.start()
|
||||
|
||||
def stop(self):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from .webpublish_routes import (
|
|||
|
||||
from openpype.api import get_system_settings
|
||||
|
||||
SERVER_URL = "http://172.17.0.1:8079" # machine is not listening on localhost
|
||||
# SERVER_URL = "http://172.17.0.1:8079" # machine is not listening on localhost
|
||||
|
||||
log = PypeLogger().get_logger("webserver_gui")
|
||||
|
||||
|
|
@ -129,7 +129,8 @@ def reprocess_failed(upload_dir):
|
|||
}}
|
||||
)
|
||||
continue
|
||||
server_url = "{}/api/webpublish/batch".format(SERVER_URL)
|
||||
server_url = "{}/api/webpublish/batch".format(
|
||||
os.environ["OPENPYPE_WEBSERVER_URL"])
|
||||
|
||||
with open(batch_url) as f:
|
||||
data = json.loads(f.read())
|
||||
|
|
|
|||
|
|
@ -79,7 +79,10 @@ class WebServerModule(PypeModule, ITrayService):
|
|||
self.server_manager.on_stop_callbacks.append(
|
||||
self.set_service_failed_icon
|
||||
)
|
||||
webserver_url = "http://localhost:{}".format(self.port)
|
||||
# in a case that webserver should listen on specific ip (webpublisher)
|
||||
self.log.info("module host_ip:: {}".format(os.environ.get("WEBSERVER_HOST_IP")))
|
||||
host_ip = os.environ.get("WEBSERVER_HOST_IP") or 'localhost'
|
||||
webserver_url = "http://{}:{}".format(host_ip, self.port)
|
||||
os.environ["OPENPYPE_WEBSERVER_URL"] = webserver_url
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ Deploy OP build distribution (Openpype Igniter) on an OS of your choice.
|
|||
```sh
|
||||
#!/usr/bin/env bash
|
||||
export OPENPYPE_DEBUG=3
|
||||
export WEBSERVER_HOST_IP=localhost
|
||||
export FTRACK_BOT_API_KEY=YOUR_API_KEY
|
||||
export PYTHONDONTWRITEBYTECODE=1
|
||||
export OPENPYPE_MONGO=YOUR_MONGODB_CONNECTION
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue