Skip to content

Conversation

@rdwebdesign
Copy link
Member

What does this PR aim to accomplish?

The flush process needs a FTL restart, but this is not possible inside docker containers (not enough permissions). Currently, if the API endpoint is called inside a container, it returns "success" and FTL logs success messages, but in reality FTL is never restarted and the process is not correctly completed.

This PR effectively disables the flush_logs endpoint when FTL is inside a container. Inside containers the API will respond with 403 forbidden.

This is related to: pi-hole/pi-hole#6391

How does this PR accomplish the above?

FTL checks if it is running inside docker and, if so, returns a 403 error message.


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

@rdwebdesign rdwebdesign requested a review from a team as a code owner October 21, 2025 23:13
@yubiuser
Copy link
Member

Does it really need a restart when triggered via the API? At least on bare metal it does not perfome a restart

2025-10-22 09:02:58.204 CEST [266807/T267169] INFO: Received API request to flush the logs
2025-10-22 09:02:58.473 CEST [266807/T267169] INFO: Log has been flushed due to API request

But as I said in the other PR: we might want to disable FTL restart option via API when running on docker.

@DL6ER
Copy link
Member

DL6ER commented Oct 25, 2025

FTL can restart just fine in docker as the binary is able to restart within itself without the need for an external helper like systemd. It doesn't exit, either, so the docker container should also not think it's dead. When we disable the ability to restart we also remove the ability to all the settings that do need a restart because dnsmasq configuration is changed.

@DL6ER
Copy link
Member

DL6ER commented Oct 25, 2025

Currently, if the API endpoint is called inside a container, it returns "success" and FTL logs success messages, but in reality FTL is never restarted and the process is not correctly completed.

What do the logs show?

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.

4 participants