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

When URL_PATH is blank, it should assume that it is '/' #2908

Closed
ibatten opened this issue Aug 22, 2019 · 2 comments
Closed

When URL_PATH is blank, it should assume that it is '/' #2908

ibatten opened this issue Aug 22, 2019 · 2 comments
Assignees
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@ibatten
Copy link

ibatten commented Aug 22, 2019

Describe the bug

Consider a configuration where nginx is set up with:

server {
...
server_name cacti.dom.ain;
...
root /usr/share/cacti/site;
}

Under <= 1.1.38 (I believe) you could do upgrades with $url_path set to ''. It now appears to need '/', and goes badly wrong (extensive attempts to fetch cacti.domain/install/install/thing.js, note double install) unless this is corrected.

[[ I have been trying to get onto the 1.2 train for some months, on and off. I finally built a replica system and systematically fixed all the load problems I was seeing with symlinks, until I could get to a stage where it was more obvious what the problem was ]]

To Reproduce

Set url_path to '' in config.php. Attempt to perform an upgrade.

Expected behavior

A better error message, or simply set it to '/' if it is ''.

Screenshots

Desktop (please complete the following information):

Desktop Safari latest or Chrome latest on MacOS. Server is Debian 10 out of the box. I doubt either matters much.

@netniV
Copy link
Member

netniV commented Aug 22, 2019

Part of me wonders on the reprocussions of setting it to / when blank if the site is in a subdirectory, such as /cacti/. With the blank, most web-based main folder pages would include based on the current directory of the url which would be right. Making that a / suddenly changes that functionality.

However, I think i am going to implement it since the URL path should ALWAYS be defined to properly identify the root location of the website.

@netniV netniV changed the title Installer is too sensitive to value of $url_path When URL_PATH is blank, it should assume that it is '/' Aug 22, 2019
@netniV netniV self-assigned this Aug 22, 2019
@netniV netniV added bug Undesired behaviour resolved A fixed issue labels Aug 22, 2019
@netniV
Copy link
Member

netniV commented Aug 22, 2019

So, I have now changed this to obey the following rules:

  • Default to '/cacti/' [existing]
  • Allow override from config.php [existing]
  • If now blank assume '/' [new]

So, this keeps existing functionality whilst correcting a misconfiguration in the config.php. If no urlpath is defined in the config.php then '/config/' is still retained as the default and as long as you set it, then the path will be used.

@netniV netniV closed this as completed Aug 22, 2019
@netniV netniV added this to the v1.2.6 milestone Aug 22, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants