Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docker/gateway_docker_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ ros2_medkit_gateway:
host: "0.0.0.0"
port: 8080
refresh_interval_ms: 2000
# The web UI runs as a separate origin (its own host/port), so the
# documented "run the web UI next to the gateway" path needs CORS. Without
# it the browser gets "Failed to fetch". These are the default web UI
# origins; a wildcard is deliberately NOT used - with auth disabled and
# write methods enabled it would let any site drive cross-origin writes.
# Add your own UI origin(s) here, and enable JWT auth for production.
cors:
allowed_origins:
- "http://localhost:3000"
- "http://localhost:5173"
12 changes: 8 additions & 4 deletions docs/tutorials/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ Test the gateway:
Custom Configuration
--------------------

The default configuration listens on ``0.0.0.0:8080`` with CORS disabled.
To use a custom configuration, mount a params file:
The default configuration listens on ``0.0.0.0:8080``. CORS is enabled for the
default web UI origins (``http://localhost:3000`` and ``http://localhost:5173``)
so the web UI works out of the box; add your own UI origin(s) as needed (see
`CORS for Web UI`_ below). To use a custom configuration, mount a params file:

.. code-block:: bash

Expand Down Expand Up @@ -211,8 +213,10 @@ For containers to discover each other's ROS 2 nodes, use the same ``ROS_DOMAIN_I
CORS for Web UI
---------------

When the Web UI runs in a separate container or host, enable CORS in your
custom params file. CORS is disabled by default for production safety:
The image enables CORS for the default web UI origins (``http://localhost:3000``
and ``http://localhost:5173``). A wildcard is deliberately not used: with auth
disabled and write methods enabled it would let any site drive cross-origin
writes. Add your own UI origin(s):

.. code-block:: yaml

Expand Down
Loading