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

Don't source the install script in webpage.sh #5270

Merged
merged 1 commit into from May 10, 2023
Merged

Conversation

yubiuser
Copy link
Member

@yubiuser yubiuser commented May 7, 2023

What does this PR aim to accomplish?:

While working on the installation script locally, I noticed a sourcing loop which prevents testing certain changes to the install script.
During installation, we source webpage.sh

source "${PI_HOLE_LOCAL_REPO}/advanced/Scripts/webpage.sh"

And one of the first things we do in webpage.sh is to source the install script from the repo
https://github.com/pi-hole/pi-hole/blob/d885e92674e8d8d9a673b35ae706b2c49ea05840/advanced/Scripts/webpage.sh#L27C8-L29

This leads to overwriting any function in the install script that initially called webpage.sh by the functions defined in the repo (which is stock master branch). Hence, downstream modifications to the install script will be reset.


We source the installer script inwebpage.sh for a few variables and valid_ip() and valid_ip6().I tried to move the functions to utils.sh but this does not work because the installer requires the function early and before we download the utils.sh script.

How does this PR accomplish the above?:

Duplicate valid_ip() and valid_ip6() into webpage.sh and remove sourcing of the installer script.


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

Signed-off-by: Christian König <ckoenig@posteo.de>
@PromoFaux
Copy link
Member

Can I suggest that if we're going to be duplicating them, we duplicate them into utils.sh anyway, and source that in webpage.sh? webpage.sh will be disappearing in v6 I think (It's been a while since I worked on the development-v6 branch in anger, so I may not be as up to speed as I remember!)

@yubiuser
Copy link
Member Author

yubiuser commented May 7, 2023

webpage.sh will be disappearing in v6 I think

This is the reason I would not put in utils.sh- it will be gone in v6 "automatically". If it would be in utils.sh we would need to remember to remove it.

Copy link
Member

@DL6ER DL6ER left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file will be largely removed in v6.0, I'm not sure what we will keep else than a convenience CLI wrapper for setting the API password.

@yubiuser yubiuser merged commit 19d50b9 into development May 10, 2023
16 checks passed
@yubiuser yubiuser deleted the no_loop branch May 10, 2023 17:55
@DL6ER DL6ER mentioned this pull request May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants