Only reload pihole.toml if changed#1778
Conversation
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
Can we use hashing also when comparing |
|
We'd anyway have to read line-by-line to be able to skip the first
The core of the SHA algorithm is called the compression function and consists of 4 cycles of 20 steps each (=80 steps). The loops are very similar in structure except that they use a different primitive logic function. Each block is taken as an input parameter by all 4 loops along with a constant K and the values of the eight registers. At the end of the computation new values will be obtained for edit FIPS PUB 180-4 has all the details, look at Scn. 6.2 in particular. |
yubiuser
left a comment
There was a problem hiding this comment.
Something is not right. Changing settings from the web interface is fine, but manually editing pihole.toml does not log the writing and does not backup the log
The first line of the log is a setting changed from the web interface, the second via manual editing.
2023-11-23 21:14:39.657 [43543/T43800] INFO: Config file written to /etc/pihole/pihole.toml
2023-11-23 21:15:34.556 [43543/T43793] INFO: Reloading config due to pihole.toml change
I think this is because the recent bugfix #1775 was not included here. I just merged |
What does this implement/fix?
Currently, we always reload
pihole.tomlif it was touched by anyone, even if nothing got changed. This PR changes this to only reloadpihole.tomlif the content really changed. Internally, we usesha256sumto memorize a checksum of the file.Due to a cache-optimal design, we can even outperform the system-provided
sha256sum:(
oci.taris a 550 MB file)I ran the commands several times to ensure the file was cached in memory to rule out possible disk influences.
Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase)Checklist:
developmentalbranch.