Skip to content

Removed empty log and set polling to false. - #129

Open
adaudon wants to merge 18 commits into
mainfrom
116-Stop_Polling_Config
Open

adaudon wants to merge 18 commits into
mainfrom
116-Stop_Polling_Config

Conversation

@adaudon

@adaudon adaudon commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #116

Changed polling from 500ms to false so it doesn't poll automatically for new values unless specifically requested. Instead, it now refetches values every time there's a change by pressing one of the OAV buttons.

@adaudon
adaudon requested a review from a team as a code owner February 24, 2026 16:26
@adaudon
adaudon marked this pull request as draft February 24, 2026 18:01
@adaudon
adaudon force-pushed the 116-Stop_Polling_Config branch from 5891d60 to 83ec738 Compare February 25, 2026 17:34
@adaudon
adaudon marked this pull request as ready for review March 4, 2026 12:14
@adaudon
adaudon force-pushed the 116-Stop_Polling_Config branch from 1921d15 to 1c2dadd Compare July 20, 2026 15:43
ndevenish and others added 9 commits September 1, 2026 14:59
These headings sit on the page and card backgrounds, not on a primary
coloured surface, so primary.contrastText was wrong: it resolves to #ffffff
in both schemes, leaving white text on the #fff paper of the light scheme.
text.primary is scheme aware, so the headings stay readable in both.
* Pinning pnpm version

* Pinned

---------

Co-authored-by: Tamoor Shahid <tamoor.shahid@diamond.ac.uk>
* Pinning pnpm version

* Pinned

* Added pnpm workspace to docker

---------

Co-authored-by: Tamoor Shahid <tamoor.shahid@diamond.ac.uk>
The blueapi base URL is the origin-relative /api, so in dev it resolved
against the dev server itself (localhost:5173/api/...) and 404'd. Proxy it
to VITE_BLUEAPI_SOCKET_DEV instead, stripping the /api prefix. Production
is unchanged and still relies on upstream routing.

The config becomes a function so loadEnv can read .env, which is not
otherwise visible as process.env inside a vite config.

The README still described the arrangement that predates all of this -
set VITE_BLUEAPI_SOCKET, which nothing has read since blueapi.ts was
pointed at /api - so say instead what each variable in .env is read by,
and which one is now inert.
The IOC advertises its MJPG stream over http, and a page served over
https will not load an image over http - the browser blocks it as mixed
content, so the viewer is blank wherever the app is deployed behind TLS,
which is every deployment on the cluster.

So ask for the stream at /oav-stream on our own origin, and proxy it on
to the MJPG server: nginx does it in the built image, the dev server does
it otherwise. MJPG_URL_RBV still chooses which stream is shown; only the
server it is fetched from is named by the proxies.

nginx has no way to read the environment itself, but the entrypoint of
the image we deploy runs envsubst over /etc/nginx/templates at start up,
so the location block is a template with the upstream left in it.
OAV_STREAM_SERVER defaults, in the Dockerfile, to i24's MJPG server, and
a deployment that wants another one now says so rather than needing its
own image. Unset or empty, nginx refuses to start.

The upstream is named through a variable rather than written into
proxy_pass literally, because a literal is resolved while the
configuration is read: an OAV server that was down, or whose name would
not resolve, stopped nginx starting at all - taking the whole UI with it
over a video stream. Deferring the lookup to the request needs a
resolver, which the entrypoint reads from the container's own
/etc/resolv.conf when NGINX_ENTRYPOINT_LOCAL_RESOLVERS is set. A stream
from a server that is down is now a 502 and a broken image, and starts
working when the server does, without a restart. Since a proxy_pass with
a variable in it passes the URI on untouched, the location's prefix is
stripped by an explicit rewrite.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only call the config server when needed

2 participants