mirror of
https://github.com/ansible/awx.git
synced 2026-03-19 18:07:33 -02:30
Expose websockets on api prefix v2
This commit is contained in:
@@ -63,6 +63,10 @@ websocket_urlpatterns = [
|
|||||||
re_path(r'api/websocket/$', consumers.EventConsumer.as_asgi()),
|
re_path(r'api/websocket/$', consumers.EventConsumer.as_asgi()),
|
||||||
re_path(r'websocket/$', consumers.EventConsumer.as_asgi()),
|
re_path(r'websocket/$', consumers.EventConsumer.as_asgi()),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if settings.OPTIONAL_API_URLPATTERN_PREFIX:
|
||||||
|
websocket_urlpatterns.append(re_path(r'api/{}/v2/websocket/$'.format(settings.OPTIONAL_API_URLPATTERN_PREFIX), consumers.EventConsumer.as_asgi()))
|
||||||
|
|
||||||
websocket_relay_urlpatterns = [
|
websocket_relay_urlpatterns = [
|
||||||
re_path(r'websocket/relay/$', consumers.RelayConsumer.as_asgi()),
|
re_path(r'websocket/relay/$', consumers.RelayConsumer.as_asgi()),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ minikube_container_group: false
|
|||||||
receptor_socket_file: /var/run/awx-receptor/receptor.sock
|
receptor_socket_file: /var/run/awx-receptor/receptor.sock
|
||||||
receptor_image: quay.io/ansible/receptor:devel
|
receptor_image: quay.io/ansible/receptor:devel
|
||||||
ingress_path: /
|
ingress_path: /
|
||||||
|
api_urlpattern_prefix: ''
|
||||||
|
|
||||||
# Keys for signing work
|
# Keys for signing work
|
||||||
receptor_rsa_bits: 4096
|
receptor_rsa_bits: 4096
|
||||||
|
|||||||
@@ -20,6 +20,10 @@
|
|||||||
# The UUID of the system, for HA.
|
# The UUID of the system, for HA.
|
||||||
SYSTEM_UUID = '00000000-0000-0000-0000-000000000000'
|
SYSTEM_UUID = '00000000-0000-0000-0000-000000000000'
|
||||||
|
|
||||||
|
{% if api_urlpattern_prefix | length > 0 %}
|
||||||
|
OPTIONAL_API_URLPATTERN_PREFIX = '{{ api_urlpattern_prefix }}'
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# If set, use -vvv for project updates instead of -v for more output.
|
# If set, use -vvv for project updates instead of -v for more output.
|
||||||
# PROJECT_UPDATE_VVV=True
|
# PROJECT_UPDATE_VVV=True
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,11 @@ location {{ (ingress_path + '/favicon.ico').replace('//', '/') }} {
|
|||||||
alias /awx_devel/awx/public/static/favicon.ico;
|
alias /awx_devel/awx/public/static/favicon.ico;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{% if api_urlpattern_prefix | length > 0 %}
|
||||||
|
location ~ ^({{ (ingress_path + '/websocket/').replace('//', '/') }}|{{ (ingress_path + '/api/websocket/').replace('//', '/') }}|{{ (ingress_path + '/api/' + api_urlpattern_prefix + '/v2/websocket/').replace('//', '/') }}) {
|
||||||
|
{% else %}
|
||||||
location ~ ^({{ (ingress_path + '/websocket/').replace('//', '/') }}|{{ (ingress_path + '/api/websocket/').replace('//', '/') }}) {
|
location ~ ^({{ (ingress_path + '/websocket/').replace('//', '/') }}|{{ (ingress_path + '/api/websocket/').replace('//', '/') }}) {
|
||||||
|
{% endif %}
|
||||||
# Pass request to the upstream alias
|
# Pass request to the upstream alias
|
||||||
proxy_pass http://daphne;
|
proxy_pass http://daphne;
|
||||||
# Require http version 1.1 to allow for upgrade requests
|
# Require http version 1.1 to allow for upgrade requests
|
||||||
|
|||||||
Reference in New Issue
Block a user