Pulp location of CSS etc for API browser (and/or dependancies)

Open
#1,999 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
nginx, python
Domain
api, backend, devops

Research direction

Start by reviewing the asset URLs listed in the issue and the pulp_installer files roles/pulp_webserver/templates/nginx.conf.j2 and roles/pulp_webserver/templates/pulp-vhost.conf.j2. Trace how the API browser’s CSS and JavaScript are served behind the reverse proxy; done means the listed assets load successfully and the API browser renders correctly.

Written by the indexing model from the issue text.

Description

Issue

Author: wibbit (wibbit)

Redmine Issue: 8797, https://pulp.plan.io/issues/8797


While testing the API web interface, I found that it looked "particularly bad" (see attached).

Digging through the web page code, I think this is down to the fact that there are numerous references to "/assets" as a URL,

/assets/rest_framework/css/bootstrap.min.css
/assets/rest_framework/css/bootstrap-tweaks.css
/assets/rest_framework/css/prettify.css
/assets/rest_framework/css/default.css

As well ass
/assets/rest_framework/js/jquery-3.5.1.min.js
/assets/rest_framework/js/ajax-form.js
/assets/rest_framework/js/csrf.js
/assets/rest_framework/js/bootstrap.min.js
/assets/rest_framework/js/prettify-min.js
/assets/rest_framework/js/default.js

I've not used the pulp installer, and am using HAProxy as the reverse proxy, as such I've had to try and reverse engineer the HAProxy settings,

I can see two places where URL destinations appear to be set.
https://github.com/pulp/pulp_installer/blob/a00dfd83c397c4b2074f79431a92c23abaac3b25/roles/pulp_webserver/templates/nginx.conf.j2
and
https://github.com/pulp/pulp_installer/blob/a00dfd83c397c4b2074f79431a92c23abaac3b25/roles/pulp_webserver/templates/pulp-vhost.conf.j2

Neither of which appears to point to an /assets location, aside from the nginx config which has a catch-all of /

However even after setting that, the files are still not accessible.

So the second part of the question, is what supplies the files listed above.

FYI, I have djangorestframework 3.12.4 installed, which looks like it satisfies the file dependencies if nothing else.

Dominant language
Python
Stars
598
Forks
168
Avg merge
1d 4h
Merged PRs (30d)
86

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pulp/pulpcore

All issues in pulp/pulpcore

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.