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

some static files not found when BASE_PATH is changed #6912

Closed
nolta opened this issue Aug 7, 2021 · 3 comments
Closed

some static files not found when BASE_PATH is changed #6912

nolta opened this issue Aug 7, 2021 · 3 comments
Assignees
Labels
beta Concerns a bug/feature in a beta release status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@nolta
Copy link

nolta commented Aug 7, 2021

NetBox version

v3.0-beta1

Python version

3.8

Steps to Reproduce

  1. Set BASE_PATH = 'netbox/'
  2. Run upgrade.sh.
  3. Load site in browser.

Expected Behavior

All static asset files should be found.

Observed Behavior

Some static files cannot be found (i.e., 404 errors).

For example, the site tries to load /static/netbox.js.map instead of /netbox/static/netbox.js.map. The problem appears to be this line:

//# sourceMappingURL=/static/netbox.js.map

Perhaps due to this?

publicPath: '/static',

Changing sourceMappingURL=/static/netbox.js.map to sourceMappingURL=netbox.js.map appears to work, at least for this particular file.

@nolta nolta added the type: bug A confirmed report of unexpected behavior in the application label Aug 7, 2021
@jeremystretch jeremystretch added the beta Concerns a bug/feature in a beta release label Aug 9, 2021
@jeremystretch
Copy link
Member

I don't have any issues loading Javascript resources using the current feature build with a non-default BASE_PATH, however I do see that the Material Design Icons font is being hard-coded to /static/. It also looks like we're pulling the Inter font from fonts.gstatic.com instead of locally.

@m2martin
Copy link
Contributor

Shouldn't it be avoided to have mixed sources (local statics and external includes)?
In case of the font, this shouldn't cause any problems, as the Open Fonts License for Inter grants copying, embedding and redistributing.
Background: I do have Netbox instances where the clients are not allowed to access external resources.
What's your opinion?

@jeremystretch
Copy link
Member

Shouldn't it be avoided to have mixed sources (local statics and external includes)?

Yes; NetBox is designed to deliver all static assets locally, to support installations with no Internet access.

jeremystretch added a commit that referenced this issue Aug 12, 2021
Fixes #6912: Fix static asset references when BASE_PATH is in use
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beta Concerns a bug/feature in a beta release status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants