-
Notifications
You must be signed in to change notification settings - Fork 47
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
Added docker configuration and pihole to smartdns converter #144
Conversation
Thanks for the contributions. Can you move the docker related to the Because these changes include a specific version number, it is unlikely that I will update it every release. Put it in contrib, so that other users who need it can refer to it. |
Which one is better depends on your choice. |
I'll try to change that to 0.0.0.0 and check if that solves the problem that some dns entries can escape the blocklist. |
Concerning the docker part you could add that to the release pipeline. You can override the ARG default value with --args. An example is given here. After the release is published you can trigger that docker build pipeline and push it to your own Dockerhub/Github account registry. |
A more convenient way is putting domain names at a indenpendent file and load it by domains.txt a.com
www.google.com smartdns.conf # load `domains.txt` as `abc`
domain-set -name abc -f domains.txt
# then
address /domain-set:abc/#
# or
address /domain-set:abc/0.0.0.0 |
Let's move over there first. In fact, docker is not necessary for this project. The program itself is also single-file binary, easy to deploy, and only reads one configuration file. For better performance, docker is not recommended. It would be better if github actions can automatically build the image, but I don't have the energy to implement this at the moment. |
Good idea. I'll do that. |
I did change the directory and decided for 0.0.0.0. With that a domain is 100% blocked. |
Hope this is okay now. |
etc/pihole-to-smartdns.sh
Outdated
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.
A very useful script, also moved to contrib.
etc/.gitignore
Outdated
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.
This is? Should it be placed in contrib/docker?
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.
Yes. This is the docker entrypoint script for starting the binary.
I moved everything to contrib/docker. |
The first one solves the problem that I want to host smartdns not on a host and rather in docker-compose/K3S. It is configured by mapping a conf file into the container. This can be done in Kubernetes e.g. with a initContainer
As far as I can see there are only 2 "official" adlists for smartdns. This converter script enables the user to convert a pihole adlist which always has the format 0.0.0.0 address to address /address/# which does not resolve in smartdns.
The output in smartdns-ads.txt can then be copied into your custom smartdns.conf file which then in return can be mounted into the Docker container.