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
fix: hong kong locale does not always mean china #1397
Conversation
@@ -452,7 +452,7 @@ func isInChinaWindows() bool { | |||
return false | |||
} | |||
// Check if output contains `zh-cn;` | |||
return strings.Contains(out, "zh-cn;") || strings.Contains(out, "zh-hk;") | |||
return strings.Contains(out, "zh-cn;") |
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.
change
maintainers should observe that the user who changed this originally is a chinese troll, who basically does nothing but submit PRs to projects to undermine the independence of countries and regions that china claims (e.g. saadeghi/daisyui#2150) |
@alexobviously good notes thank you for adding, i do think such behavior would be unexpected for users in hk without other context |
a previous commit set this conditional to return as `true` when the detected windows locale `zh-hk` is detected, and then applies `GOPROXY` setting based on such detection. the flag is supposed to _Set GOPROXY for people in China_. if this flag is truthy, the proxy `goproxy.cn` is used, which would, in effect, redirect HK users traffic.
a1eba9f
to
c46d95f
Compare
@@ -466,7 +466,7 @@ func isInChina() bool { | |||
} | |||
if strings.HasPrefix(out, prefix) { | |||
out = out[len(prefix):] | |||
return strings.HasPrefix(out, "zh_CN") || strings.HasPrefix(out, "zh_HK") | |||
return strings.HasPrefix(out, "zh_CN") |
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.
second pointed out by anonymous help 👍🏻 thank you
for perspective, while hong kong is part of china in an administrative capacity, this pr addresses dependency traffic, not politics; we are the makers of pkgst and other tools which help secure software supply chains, which is why this caught my eye after a friend sent it along. while this redirection of traffic doesn't constitute a vulnerability on its own, it could certainly be a delivery mechanism for injecting software into a supply chain or at least for identifying users when they otherwise wouldn't have made a choice to be visible. the |
if you were physically in hong kong, or abroad with your windows locale set to hong kong, you would expect your traffic to be redirected @mcg-anon ? please, this pr is not about politics. |
@mcg-anon cloudflare has a chinese subsidiary network with in-country dns resolution https://www.cloudflare.com/china-network/ cloudflare does not "sniff" traffic; providers are compelled to operate within the legal framework of their host jurisdiction. this is no different than any chinese CDN or any CDN anywhere. locale is not necessarily a representation of physical location, either, which is why this behavior might be confusing. a windows locale set to hong kong anywhere in the world would see this behavior if i understand the code correctly. |
@mcg-anon it cannot, because cloudflare in front of cloudflare also has nodes local to hong kong, so my intent there is to cover users who might be affected by this change. (as in, they cannot rewrite dependencies without breaking signatures or hashes) |
if this boils down to trust in one operator or another, you're right, people should have a choice. my advocacy of cloudflare here is in the light of presenting non-chinese options for users who may not be located in china. it should be up to users whether their traffic is proxied. |
@mcg-anon i've updated the pr title in order to try to be less inflammatory, i hope you see this (in addition to the code change not installing a preferred provider) as an olive branch |
@mcg-anon Legally speaking Hong Kong is considered extraterritorial by China, so you are wrong even on the technical level. The Great Firewall only applies to mainland China and not Hong Kong, so there’s no need to apply the proxy for the latter. |
@mcg-anon this is the important point with regard to the pr:
|
@mcg-anon Look, Hong Kong is a constitutionally separate jurisdiction with an entirely different legal system where most Chinese laws don’t apply. Facebook, Twitter, Google and most foreign websites are accessible in Hong Kong but not in mainland China. Even the Great Firewall heavily censors Internet traffic from Hong Kong, so I’m not sure why you want them to share a network rule? |
Geopolitics aside, using locale to determine proxy rules doesn’t seem like a good idea to me. Plenty of developers whose first language is not English prefer to use their computer in |
I already explained to you in painstaking details why these two are not even remotely comparable, twice, and you just pretended you didn’t hear any of that. Go read up what people wrote and address their points before further commenting. |
You do not have to, because
If Hong Kong users want to use such a proxy,
|
need many taiwanese guys in conversation |
Codecov ReportPatch coverage has no change and project coverage change:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #1397 +/- ##
==========================================
- Coverage 90.28% 90.27% -0.02%
==========================================
Files 24 24
Lines 9240 9240
==========================================
- Hits 8342 8341 -1
- Misses 730 731 +1
Partials 168 168 ☔ View full report in Codecov by Sentry. |
thank you @xushiwei |
if you do not let the politicals be politicals, this issue must be like this: A vietnam troll undermine the independence of hmong, Khmerkrom,Việt Nam Cộng Hòa, FULRO, that Vietnam claims. just Solve the problem. |
hello, thank you so much for this project 👍🏻
a previous commit by @92hackers set this conditional to return as
true
when the observed windows locale containszh-hk
, and then appliesGOPROXY
setting based on such detection.the flag is supposed to Set GOPROXY for people in China (source code). if this flag is truthy, the proxy
goproxy.cn
is used, which would, in effect, redirect HK users traffic.