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

Configuration option URL_PATH should be updated during install #1146

Closed
netniV opened this issue Dec 20, 2017 · 6 comments
Closed

Configuration option URL_PATH should be updated during install #1146

netniV opened this issue Dec 20, 2017 · 6 comments
Labels
enhancement General tag for an enhancement

Comments

@netniV
Copy link
Member

netniV commented Dec 20, 2017

Please note that whilst I refer to URL_PATH in upper case, this is just for ease of viewing, URL_PATH is stored in /include/config.php in lower case:

/* set the $url_path to point to the default URL of your cacti
 * install ex: if your cacti install as at
 * http://serverip/cacti/ this would be set to /cacti/.
*/

$url_path = '/cacti/';

When installing or updating cacti, the URL path should be compared against URL_PATH to ensure that the install is running from the same location as expected. If not, the URL_PATH should be updated such that:

  1. SysAdmin launches the install from http://www.mydomain.com/cacti/install/ which runs /cacti/install/index.php
  2. cacti uses /cacti/ as the URL_PATH so this works fine.
  3. SysAdmin decides to give cacti it's own web address of http://cacti.mydomain.com/
  4. SysAdmin runs http://cacti.mydomain.com/install/ to check there are no issues
  5. cacti incorrect uses /cacti/ as the URL_PATH (currently)
  6. cacti should detect that the /install/ location is no longer at /cacti/ but at / (ie, not /cacti/install/ but /install/ or maybe even query for a static/expected value using the URL_PATH/include/cacti_version)
  7. If unable to update config.php present normal error about unwriteable configuration
  8. Present user with warning about URL_PATH change showing old and new, allowing them to confirm the change.

This is borne from a forum issue Requested URL /cacti was not found on this server

@cigamit
Copy link
Member

cigamit commented Dec 22, 2017

This seems to be more of a packaging issue. Labeling 'enhancement' for now. Pull requests always welcomed.

@cigamit cigamit added the enhancement General tag for an enhancement label Dec 22, 2017
@netniV
Copy link
Member Author

netniV commented Dec 22, 2017

I would disagree about it being at package level since it’s really something that should be set as part of the install/upgrade since an admin can change the url at any point. Especially if they are using the source to install it.

@cigamit
Copy link
Member

cigamit commented Dec 22, 2017

Problem is that we don't want to have to grant write access after initial install to that directory/file. So, it causes a problem.

@netniV
Copy link
Member Author

netniV commented Dec 22, 2017

Hmm, OK I agree with that, maybe just a sanity check then, such as the writable folders have permissions?

@cigamit
Copy link
Member

cigamit commented Dec 22, 2017

Checking for write access would be something good for both technical support and the installer. Feel free to kick the can a bit on this time permitting. Open a feature request or just do a pull when you have it done.

@cigamit cigamit closed this as completed Dec 22, 2017
@netniV
Copy link
Member Author

netniV commented Dec 23, 2017

I am just making a pull request for this. It will display an error if the URL mismatchs with the location of the install/index.php script whilst it is running. Not sure whether to make it cleaner by moving the code into a function but now I'm just testing it with code in the index.php file.

@github-actions github-actions bot locked as resolved 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
enhancement General tag for an enhancement
Projects
None yet
Development

No branches or pull requests

2 participants