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

netbox in subfolder: api search is not working for tags #3019

Closed
lwillek opened this issue Mar 19, 2019 · 1 comment
Closed

netbox in subfolder: api search is not working for tags #3019

lwillek opened this issue Mar 19, 2019 · 1 comment
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@lwillek
Copy link

lwillek commented Mar 19, 2019

Environment

  • Python version: 2.7.16rc1
  • NetBox version: 2.5.8

If you install netbox as usual, but configure a subfolder like https://mydomain.org/netbox to access your installation, then you have to set the BASE_PATH in configuration.py and nearly everything works like a charm.

Unfortunately working with tags is difficult, because the Ajax results could not be loaded if you try to search or modify tags with help of the ui.
The reason is that within the static javascript, the var netbox_api_path is not used. Instead, the api url is hardcoded: https://github.com/digitalocean/netbox/blob/develop/netbox/project-static/js/forms.js#L253

The solution is easy: just use the variable, i.e url: netbox_api_path + 'extras/tags/', instead of url: "/api/extras/tags/",

A quick workaround without adapting the code is to rewrite the incoming requests. For Apache this config will do the job:

        RewriteEngine  on
        RewriteRule    ^/api/(.*)      /netbox/api/$1 [R=permanent]

I will write a small patch to avoid the "rewrite" workaround.

@lampwins lampwins added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation labels Mar 21, 2019
@lampwins
Copy link
Contributor

Thanks for this. I noticed you opened a PR in your fork with the fix, would you mind opening one here?

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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

2 participants