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

Retreives maxlogage calling api_FTL.php #2107

Merged
merged 1 commit into from Feb 3, 2022
Merged

Conversation

rdwebdesign
Copy link
Member

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide, as well as this entire template.
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes.
  • I am willing to help maintain this change if there are issues with it later.
  • I give this submission freely and claim no ownership.
  • It is compatible with the EUPL 1.2 license
  • I have squashed any insignificant commits. (git rebase)
  • I have Signed Off all commits. (git commit --signoff)

What does this PR aim to accomplish?:

Fixes #1825, even if the user compiles FTL with a custom MAXLOGAGE.

How does this PR accomplish the above?:

Javascript calls the API to update the title, using the FTL defined value.

What documentation changes (if any) are needed to support this PR?:

none.

PRE-REQUISITES:

This PR needs pi-hole/FTL#1295

Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

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

FTL is returning the limit in seconds. I don't see any calculation to hours in your PR...

index.php Show resolved Hide resolved
@rdwebdesign
Copy link
Member Author

FTL is returning the limit in seconds. I don't see any calculation to hours in your PR...

I did't know that.
The MAXLOGAGE variable is set as 24 in FTL here.

@yubiuser
Copy link
Member

yubiuser commented Feb 1, 2022

See the terminal output of the PR description of pi-hole/FTL#1295

But best would be to try different config settings and compare to the API output.

@rdwebdesign
Copy link
Member Author

You're right:

MAXLOGAGE is set to 24, but
config.maxlogage = MAXLOGAGE*3600 (https://github.com/pi-hole/FTL/blob/development/src/config.c#L249)

and API returns this second value (https://github.com/pi-hole/FTL/blob/development/src/api/api.c#L1499-L1503).

FTL defines MAXLOGAGE value.
PHP retrieves the value and converts seconds to hours
Javascript calls the API to update the value.

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

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

Setting MAXLOGAGE=6.5 in pihole-FTL.conf, restarted pihole-FTL unset MAXLOGAGE and reloaded the web interface.

Bildschirmfoto zu 2022-02-02 21-44-29

@PromoFaux PromoFaux merged commit 24bf323 into devel Feb 3, 2022
@PromoFaux PromoFaux deleted the maxlogage_via_API branch February 3, 2022 18:05
@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-14-web-v5-11-and-core-v5-9-released/53529/1

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

4 participants