-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Hardcoded paths #212
Comments
To clarify, do you want to allow the root of the API to be specified via config? So if you set the root as |
@mdlayher The goal would be to be able to run netbox in a subdirectory and also have that subdirectory be named whatever we want. The hardcoded /api/ paths are a good example where this is an issue. We are currently doing this and I've included a diff of all the files we had to edit. I've had to edit out some other changes so the diff line numbers are not 100% accurate. https://gist.github.com/Gelob/0914c3ee5219b70e63d15b2b70b9d9bc My thought would be to have a variable in configuration.py to specify the path like BASE_URL but there may be better ways to handle this with Django or abstract it out so you don't have to specify. |
Seems reasonable to me to have a base path like that prepended to NetBox paths, via a configuration option. |
The upgrade.sh script should also detect the directory it is in and not hardcode paths |
Could we maybe get this roadmapped for 1.6? It's only a few variables which need to reference BASE_DN being either / or /netbox or /whatever_I_chose. |
Found a few more files with hardcoded paths for the API - the below prevent the 'Mark Connected' buttons from working.
And also in netbox/templates/_base.html you need to change this
To this (adjust for your subdirectory as needed) if you want the logo to redirect you to the location
Of course, all this just replaces all the hardcoded paths with new ones. |
Their are paths that are hardcoded in various files, this means if you want to run netbox in a subdirectory on an existing webserver you have to manually edit a lot of files.
The text was updated successfully, but these errors were encountered: