Closed webteam-app closed 1 year ago
Can we fix this before rc2? (expected Thursday Dec 15, 2022 - US central timezone). @anthonydillon @ndv99 (Otherwise, we will doc this as a known issue for RC2)
So from my understanding, I think Jack wrote the page for our OpenAPI docs, which is served by the backend, and if I'm not mistaken that relies on being able to connect to https://unpkg.com/ in order to get the SwaggerUI library. To fix this I think I'd need to create a new page in the UI that uses the SwaggerUI lib through an NPM install so it will work offline. This would change the route from /MAAS/api/docs
to /MAAS/r/some-new-page-name
If this sounds like an acceptable solution I should be able to get that together fairly quick, what time is RC2 releasing?
Actually I've had another thought/concern - the YAML output is generated serverside, so we'd need some kind of new endpoint to get that to the frontend, @SK1Y101 what do you think?
I'm under the impression that air-gapped environments have no public internet access but should have full access to the maas instance and API. Sorry if I'm late to this but why would expect the docs to work locally without dynamic dependencies?
Hi, commenting late on this because I only just read my emails.
Unless I misunderstand, this isn't actually a UI issue: MAAS Offline docs has included a local version of the OpenAPI spec built from the local MAAS at http://$(MAAS_ip):5240/MAAS/api/docs/
, which uses the Django template view at maas/src/maasserver/templates/openapi.html
.
There was a note pinned to switch this over to locally storing the dependencies rather than relying on unpkg at some pointâ„¢, but that was considered very low priority at the time.
Fix merged, closing as completed
Bug originally filed by billwear at https://bugs.launchpad.net/bugs/1999579
To reproduce:
Install MAAS 3.3 RC1 or greater.
Take the MAAS server into air-gapped mode (i.e., "localhost" still working, but no ext. N/W).
Access the "local documentation" from the link in the bottom fringe of MAAS.
Click on "API documentation" OR replace the "maas-documentation-25.html" with "../api/docs"
A partial page will come up with some circles and boxes, but no text and no OpenAPI output.
Have confirmed with Peter M. that the OpenAPI docs require swagger components that are not stored locally and must be fetched online. The spec gave no indication that the OpenAPI docs had to work in air-gapped mode.