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

Create versions file before sourcing it #5097

Merged
merged 1 commit into from
Dec 30, 2022
Merged

Conversation

yubiuser
Copy link
Member

What does this PR aim to accomplish?:

We use /etc/pihole/versions to store version, branch and hash information of the Pi-hole components. This file is populated by updatechecker.sh. Other scripts source this file. Among them, is pihole itself.

pi-hole/pihole

Lines 26 to 27 in fe598a0

versionsfile="/etc/pihole/versions"
source "${versionsfile}"

During installation, we call updatecheck as one of the last functions.

# Download and compile the aggregated block list
runGravity
# Update local and remote versions via updatechecker
/opt/pihole/updatecheck.sh

Right before, we run gravity, which itself uses a function provided by pihole, e.g.

"${PIHOLE_COMMAND}" status

This is a issue on fresh installation, as /etc/pihole/versions won't exist yet, leading to errors

  [i] Number of regex whitelist filters: 0
/usr/local/bin/pihole: line 27: /etc/pihole/versions: No such file or directory
  [i] FTL is not running
  [✓] Cleaning up stray matter
/usr/local/bin/pihole: line 27: /etc/pihole/versions: No such file or directory
  [✓] Restarting DNS server

/usr/local/bin/pihole: line 27: /etc/pihole/versions: No such file or directory

How does this PR accomplish the above?:

Simply swap gravity run and updatechecker during the installation.


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>
@yubiuser yubiuser requested a review from a team December 29, 2022 21:08
@yubiuser yubiuser added the PR: Approval Required Open Pull Request, needs approval label Dec 29, 2022
@PromoFaux PromoFaux merged commit d882652 into development Dec 30, 2022
@PromoFaux PromoFaux deleted the fix/versions_file branch December 30, 2022 17:54
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v5-20-1-web-v5-18-1-and-core-v5-15-released/60495/1

@yubiuser
Copy link
Member Author

yubiuser commented Feb 2, 2023

Well done.. only 20 days later I reverted this PR with #5137 without remembering I just changed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Approval Required Open Pull Request, needs approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants