-
Notifications
You must be signed in to change notification settings - Fork 3
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
Handle empty array for shadowsocks.dnsServers #2
Open
alexandre-abrioux
wants to merge
3
commits into
predatorray:main
Choose a base branch
from
alexandre-abrioux:quote-dns
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we should probably surround this part with
{{- if .Values.shadowsocks.dnsServers }} ... {{- end }}
. Passing an emptyDNS_ADDRS
value to theshadowsocks/shadowsocks-libev
image would get the following error: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.
@predatorray You are right, there is a bug in the
shadowsocks/shadowsocks-libev
docker image. For the moment you are not able to use an emptyDNS_ADDRS
value, which means you are not able to use Kubernetes's internal DNS server (the one that is already setup in/etc/resolv.conf
). I've submitted a fix on the same day that I've opened this PR, but it hasn't been merged yet: shadowsocks/shadowsocks-libev#2866. I will keep you posted once it's released!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.
I don't quite understand the bug you mentioned in that issue. As I tested on my laptop, the process can be started if we either provide a non-empty
DNS_ADDRS
or just leave it unset. The problem only occurs if we provide an empty string. Maybe the simplest way is the solution I suggested in the previous 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.
The solution you suggested won't work. Let me rephrase: the goal of this PR is to be able to set an empty string for
DNS_ADDRS
in order to use Kubernetes' internal DNS server, instead of the default8.8.8.8
. Doing so will allow shadowsocks proxy users to access any of the cluster's services, like a VPN hosted on the cluster for instance.To use Kubernetes' internal DNS server, I need to set the
DNS_ADDRS
env var as an empty string. That way, the-d
option ofss-server
won't be used, and the DNS server IP address will be fetched from /etc/resolv.conf.See the documentation of ss-server:
The bug is that, as of today, even if you pass an empty string for
DNS_ADDRS
in the docker image, the-d
option is still used, so you getThis will be fixed in shadowsocks/shadowsocks-libev#2866
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.
Thanks for your explanation! Yes, this is indeed a problem. The image does not provide any mechanism to reset the
-d
option to its default behavior but instead using8.8.8.8,8.8.4.4
as its default value. Let's see what is the suggestion from the maintainer.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.
Hi @predatorray! The fix for the Docker image was merged in shadowsocks/shadowsocks-libev#2866. The proposed change for the Helm Chart is now relevant 🙂 I am using it in production, and it works like a charm!
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.
Thanks @alexandre-abrioux for your efforts to push this feature forward. Considering it as an incompatible change, since setting
DNS_ADDRS
to be an empty will fail using the latest stable image, let's wait for the release of a new stable image for this and change theappVersion
in theChart.yaml
accordingly.