-
-
Notifications
You must be signed in to change notification settings - Fork 235
Automatically detect DNS interface when empty in pihole.toml #2456
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
Conversation
Signed-off-by: DL6ER <[email protected]>
yubiuser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave empty for auto-detection.
I'm not sure if I like that. That makes it unpredictable. I think we should have this auto detecting code only for the migration and then write it into pihole.toml. If the user wants to change it, they happily can do this afterwards.
|
I thought about this as well. In the end, it is not unpredictable. You have the Ethernet cable only in one of the sockets so the automatic detection should always return the same. If you happen to use another one (for whatever reason), it may not be that bad that the automatism automatically changes the interface for you. Writing it statically into the file would also make the tests harder because this would make the |
|
Will the API still return an empty string (just like the In this case, the Web Interface will show |
|
Yes. And this is a very good point. So we need to add an additional AJAX call to get the interface in this case from the API (instead of blindly substituting with "eth0") |
We don't need another AJAX call. The API needs to be changed to send the interface FTL is actually using, but I don't know how to change that without messing the other settings pages and Maybe we need another API "virtual value" that doesn't need to be written from (or read to) the config file, like |
Yes, we do need one. This field you are mentioning has to stay empty when it is empty in We can use |
OK. I will try to open a new PR later. |
|
Done. I think "empty is auto" approach is fine.
|
rdwebdesign
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my point of view this PR is approved, unless yubiuser has something else to add.
|
@yubiuser any objections? |
yubiuser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objections to the proposed idea.
Just for the implementation:
We can use network/gateway here and just take gateway.0.interface.
If we have code already at an other place, why not use this directly, but instead create a new function here?
|
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/interfqces-not-shown-can-not-select-wg0/80185/2 |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
|
Conflicts have been resolved. |
|
Did you see my question above?
|
|
Well, that's basically what we do: |
|
I was just asking because this also what Lines 47 to 70 in 632a90d
But it might be more code to extract part of the information from |
|
Yes |
What does this implement/fix?
Follow-up on similar PRs across Pi-hole's repositories, see #2448 (review)
You can use
to get which interface would be used on your particular machine
Related issue or feature (if applicable): #2448 (review)
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase)Checklist:
developmentalbranch.