Skip to content

Use external file to show always up-to-date pihole.toml content - #1215

Closed
rdwebdesign wants to merge 2 commits into
masterfrom
import_pihole_toml
Closed

rdwebdesign wants to merge 2 commits into
masterfrom
import_pihole_toml

Conversation

@rdwebdesign

Copy link
Copy Markdown
Member

What does this PR aim to accomplish?

As title says.

How does this PR accomplish the above?

Using snippets (already used) to import an external URL with the most recent pihole.toml.


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: RD WebDesign <github@rdwebdesign.com.br>
@netlify

netlify Bot commented Mar 19, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for pihole-docs ready!

Name Link
🔨 Latest commit 7897c47
🔍 Latest deploy log https://app.netlify.com/projects/pihole-docs/deploys/6847509a03b7e50008601ad2
😎 Deploy Preview https://deploy-preview-1215--pihole-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@yubiuser

Copy link
Copy Markdown
Member

Mkdocs generates a static site. I guess it will include the toml file once it builds but does not dynamically updates the content when the toml changes.

Additionally, the page looks very long now, maybe it's enough to to show the first 50-100 lines or so.

@rdwebdesign

Copy link
Copy Markdown
Member Author

maybe it's enough to to show the first 50-100 lines or so.

I thought the idea was to show all options in a single place. Showing just part of the file doesn't make sense.

@rdwebdesign

Copy link
Copy Markdown
Member Author

I guess it will include the toml file once it builds but does not dynamically updates the content when the toml changes.

Yes. We need to update the docs when a new version is released, but the most recent toml file will be automatically imported every time.

@pralor-bot

Copy link
Copy Markdown
Collaborator

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

https://discourse.pi-hole.net/t/quick-reference-for-v6-settings/78925/2

@mwoolweaver

Copy link
Copy Markdown
Contributor

would it be better to just link this page?

https://github.com/pi-hole/FTL/blob/master/test/pihole.toml

it would require no fancy shenanigans to keep updated as it would always be the latest release version

@rdwebdesign

rdwebdesign commented Apr 6, 2025 •

Copy link
Copy Markdown
Member Author

I don't think using this file is the best option.

This file is used for tests and if, in the future, we decide to add invalid values in this file to test some functions, the docs example will show invalid values.

I still think the best approach is to generate a pihole.toml file using the default values.

Comment thread docs/ftldns/configfile.md
## Pi-hole configuration file example - `pihole.toml`:

```toml
--8<-- "https://raw.githubusercontent.com/pi-hole/FTL/refs/heads/master/test/pihole.toml"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@rdwebdesign it does look like that file is all that is being embedded, though - how could one generate it to include here otherwise without spinning up a container or similar?

@rdwebdesign rdwebdesign Apr 7, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't understand your question.

Embed a file is exactly the intention of this PR, but the file above was used just as an example. This PR is not finished (it's a draft).

As explained, we (Pi-hole team) need to create a process (probably during the build process) to generate/update a file with the default values and host this file in our server (the URL is not defined yet).

When this is done, this new file will be used to generate the Docs Page.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Understood, thanks. Had missed that this PR was draft and intending to embed something more "true" than the test file.

@rdwebdesign

rdwebdesign commented Jun 9, 2025 •

Copy link
Copy Markdown
Member Author

@DL6ER

Is it possible to copy the pihole.toml file to https://ftl.pi-hole.net/master/pihole.toml (or https://ftl.pi-hole.net/development/pihole.toml or any other place) during the build process?

If this is too complex, I think we can use the current file, used on the tests.

@rdwebdesign
rdwebdesign marked this pull request as ready for review June 22, 2025 19:25
@rdwebdesign
rdwebdesign requested a review from a team as a code owner June 22, 2025 19:25
@yubiuser yubiuser mentioned this pull request Jun 22, 2025
1 task done
@yubiuser

yubiuser commented Jun 22, 2025 •

Copy link
Copy Markdown
Member

I tried with pi-hole/FTL#2537

Add
It works and once it reaches master the file is accessible at https://ftl.pi-hole.net/master/pihole.toml

The remaining question would be how to trigger the re-build once the file updates?

@rdwebdesign

rdwebdesign commented Jun 22, 2025 •

Copy link
Copy Markdown
Member Author

To be honest, I don't think we need to trigger a Docs re-build every time FTL is updated.

Adding the link to the uploaded pihole.toml file will assure the most up-to-date file will always be used every time the docs are updated. I think this is enough.

Comment thread docs/ftldns/configfile.md
## Pi-hole configuration file example - `pihole.toml`:

```toml
--8<-- "https://raw.githubusercontent.com/pi-hole/FTL/refs/heads/master/test/pihole.toml"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
--8<-- "https://raw.githubusercontent.com/pi-hole/FTL/refs/heads/master/test/pihole.toml"
--8<-- "https://ftl.pi-hole.net/master/pihole.toml"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm just waiting for pi-hole/FTL#2537 to be merged into master. If I change the URL now, the build here will fail because there is nothing there.

@rdwebdesign

Copy link
Copy Markdown
Member Author

pi-hole/FTL#2540 was already merged in development. Just waiting for the code to be merged into master.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@yubiuser

Copy link
Copy Markdown
Member

I think this PR has been superseded by pi-hole/FTL#2558 which will update the config file whenever changes are made in the FTL repo modifying the config file.

@rdwebdesign

Copy link
Copy Markdown
Member Author

Superseded by: pi-hole/FTL#2558 and #1258

@rdwebdesign
rdwebdesign deleted the import_pihole_toml branch October 26, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants