Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAAS OpenAPI docs are not available in air-gapped mode #4648

Closed
webteam-app opened this issue Dec 13, 2022 · 7 comments
Closed

MAAS OpenAPI docs are not available in air-gapped mode #4648

webteam-app opened this issue Dec 13, 2022 · 7 comments
Assignees
Labels
Priority: High Review: Core +1 MAAS core team have approved this in QA

Comments

@webteam-app
Copy link

Bug originally filed by billwear at https://bugs.launchpad.net/bugs/1999579

To reproduce:

  1. Install MAAS 3.3 RC1 or greater.

  2. Take the MAAS server into air-gapped mode (i.e., "localhost" still working, but no ext. N/W).

  3. Access the "local documentation" from the link in the bottom fringe of MAAS.

  4. Click on "API documentation" OR replace the "maas-documentation-25.html" with "../api/docs"

  5. 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.

@amylily1011
Copy link
Contributor

amylily1011 commented Dec 14, 2022

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)

@ndv99
Copy link
Contributor

ndv99 commented Dec 14, 2022

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?

@ndv99
Copy link
Contributor

ndv99 commented Dec 14, 2022

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?

@anthonydillon
Copy link
Contributor

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?

@SK1Y101
Copy link
Member

SK1Y101 commented Dec 14, 2022

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.

@SK1Y101
Copy link
Member

SK1Y101 commented Dec 15, 2022

Fix in progress, should work as expected now

@ndv99
Copy link
Contributor

ndv99 commented Dec 16, 2022

Fix merged, closing as completed

@ndv99 ndv99 closed this as completed Dec 16, 2022
@ndv99 ndv99 added the Review: Core +1 MAAS core team have approved this in QA label Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High Review: Core +1 MAAS core team have approved this in QA
Projects
None yet
Development

No branches or pull requests

5 participants