diff --git a/.gitignore b/.gitignore index 3e8fa64..4b48f3d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,3 @@ -Makefile -/Makefile.am -Makefile.in -aclocal.m4 -autom4te.cache -config.cache -config.guess -config.h -config.h.in -config.log -config.status -config.sub -configure -configure.ac /coverage/ depcomp doc/autodocs @@ -27,6 +13,4 @@ Makefile.am.common .yardoc/ *.ami *.bz2 -.dep -tmp.* -*.log +/.yardoc/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e2e012..c68864d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ Bug Reports If you find a problem, please report it either using [Bugzilla](https://bugzilla.suse.com/enter_bug.cgi?format=guided&product=openSUSE+Factory&component=YaST2) or [GitHub issues](../../issues). (For Bugzilla, use the [simplified -registration](https://secure-www.novell.com/selfreg/jsp/createSimpleAccount.jsp) +registration](https://www.suse.com/selfreg/jsp/createSimpleAccount.jsp) if you don't have an account yet.) When creating a bug report, please follow our [bug reporting diff --git a/package/yast2-proxy.changes b/package/yast2-proxy.changes index b932f7c..c379c24 100644 --- a/package/yast2-proxy.changes +++ b/package/yast2-proxy.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Fri Jul 19 12:59:49 UTC 2019 - Knut Alejandro Anderssen González + +- Replace novel urls by SUSE ones (bsc#1100366) +- 3.1.8 + +------------------------------------------------------------------- +Thu May 10 09:18:19 UTC 2018 - mvidner@suse.com + +- Clean up the no_proxy value: not all clients ignore spaces + (bsc#1089796) +- 3.1.7 + ------------------------------------------------------------------- Fri Jun 12 16:13:53 UTC 2015 - mvidner@suse.com diff --git a/package/yast2-proxy.spec b/package/yast2-proxy.spec index 1644203..a6ca24e 100644 --- a/package/yast2-proxy.spec +++ b/package/yast2-proxy.spec @@ -17,7 +17,7 @@ Name: yast2-proxy -Version: 3.1.6 +Version: 3.1.8 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/modules/Proxy.rb b/src/modules/Proxy.rb index b193f54..50d9a18 100644 --- a/src/modules/Proxy.rb +++ b/src/modules/Proxy.rb @@ -29,6 +29,28 @@ def main @pass = "" end + # domains that should not be proxied; reader + # @return [String] + def no_proxy_domains + clean_up_no_proxy(@no) + end + + # domains that should not be proxied; writer + # @param value [String] + def no_proxy_domains=(value) + @no = clean_up_no_proxy(value) + end + + # Compatibility: + publish :variable => :no, :type => "string" + + # we need "publish :variable" but it defines an attr_accessor + # so let's undefine it + remove_method :no + remove_method :"no=" + alias_method :no, :no_proxy_domains + alias_method :"no=", :"no_proxy_domains=" + # Display popup at the end of the proxy configuration # @param [Boolean] modified true if proxy settings have been modified def ProxyFinishPopup(modified) @@ -71,8 +93,7 @@ def Read @https = "" if @https == nil @ftp = Convert.to_string(SCR.Read(path(".sysconfig.proxy.FTP_PROXY"))) @ftp = "" if @ftp == nil - @no = Convert.to_string(SCR.Read(path(".sysconfig.proxy.NO_PROXY"))) - @no = "" if @no == nil + self.no_proxy_domains = SCR.Read(path(".sysconfig.proxy.NO_PROXY")) || "" @enabled = Convert.to_string( SCR.Read(path(".sysconfig.proxy.PROXY_ENABLED")) ) == "yes" @@ -108,7 +129,7 @@ def WriteSysconfig SCR.Write(path(".sysconfig.proxy.HTTP_PROXY"), @http) SCR.Write(path(".sysconfig.proxy.HTTPS_PROXY"), @https) SCR.Write(path(".sysconfig.proxy.FTP_PROXY"), @ftp) - SCR.Write(path(".sysconfig.proxy.NO_PROXY"), @no) + SCR.Write(path(".sysconfig.proxy.NO_PROXY"), no_proxy_domains) SCR.Write(path(".sysconfig.proxy"), nil) end @@ -132,7 +153,7 @@ def WriteCurlrc # bnc#305163 "--proxy" => @http, # bsc#923788 - "--noproxy" => @no + "--noproxy" => no_proxy_domains } # proxy is used, write /root/.curlrc @@ -210,7 +231,7 @@ def Import(settings) @http = Ops.get_string(settings, "http_proxy", "") @https = Ops.get_string(settings, "https_proxy", "") @ftp = Ops.get_string(settings, "ftp_proxy", "") - @no = Ops.get_string(settings, "no_proxy", "localhost") + self.no_proxy_domains = Ops.get_string(settings, "no_proxy", "localhost") @user = Ops.get_string(settings, "proxy_user", "") @pass = Ops.get_string(settings, "proxy_password", "") @@ -251,8 +272,8 @@ def RunTestProxy(http_proxy, https_proxy, ftp_proxy, proxy_user, proxy_password) # /usr/bin/curl --verbose # --proxy http://server_name:port_number # --proxy-user user:password - # --url http://www.novell.com or ftp://ftp.novell.com | suggested for HTTP or FTP test - # --url https://secure-www.novell.com --insecure + # --url http://www.suse.com or ftp://ftp.suse.com | suggested for HTTP or FTP test + # --url https://www.suse.com --insecure ret = {} test_http = http_proxy != "" && http_proxy != "http://" ? true : false @@ -306,7 +327,7 @@ def RunTestProxy(http_proxy, https_proxy, ftp_proxy, proxy_user, proxy_password) http_proxy, user_pass, timeout_sec, - "http://www.novell.com" + "http://www.suse.com" ) # adding option --insecure to accept the certificate without asking https_command = Builtins.sformat( @@ -314,14 +335,14 @@ def RunTestProxy(http_proxy, https_proxy, ftp_proxy, proxy_user, proxy_password) https_proxy, user_pass, timeout_sec, - "https://secure-www.novell.com --insecure" + "https://www.suse.com --insecure" ) ftp_command = Builtins.sformat( command, ftp_proxy, user_pass, timeout_sec, - "ftp://ftp.novell.com" + "ftp://ftp.suse.com" ) Builtins.y2milestone("Running HTTP_PROXY test...") @@ -401,7 +422,7 @@ def Export "http_proxy" => @http, "https_proxy" => @https, "ftp_proxy" => @ftp, - "no_proxy" => @no, + "no_proxy" => no_proxy_domains, "proxy_user" => @user, "proxy_password" => @pass } @@ -480,7 +501,7 @@ def GetEnvironment "http_proxy" => @http, "HTTPS_PROXY" => @https, "FTP_PROXY" => @ftp, - "NO_PROXY" => @no + "NO_PROXY" => no_proxy_domains } end @@ -491,7 +512,6 @@ def GetEnvironment publish :variable => :http, :type => "string" publish :variable => :https, :type => "string" publish :variable => :ftp, :type => "string" - publish :variable => :no, :type => "string" publish :variable => :user, :type => "string" publish :variable => :pass, :type => "string" publish :function => :Read, :type => "boolean ()" @@ -503,6 +523,13 @@ def GetEnvironment publish :function => :GetModified, :type => "boolean ()" publish :function => :SetModified, :type => "void ()" publish :function => :GetEnvironment, :type => "map ()" + + private + + # Clean up the no_proxy value: not all clients ignore spaces (bsc#1089796) + def clean_up_no_proxy(v) + v.gsub(" ", "") + end end Proxy = ProxyClass.new diff --git a/test/write_test.rb b/test/write_test.rb index d920580..1e1dfeb 100755 --- a/test/write_test.rb +++ b/test/write_test.rb @@ -93,6 +93,22 @@ expect(subject.WriteCurlrc).to be true end + it "writes a no-proxy setting without spaces" do + subject.Import({ "enabled" => true, + "http_proxy" => "proxy.example.org:3128", + "no_proxy" => "example.org, example.com, localhost" }) + expect(Yast::SCR).to receive(:Write). + with(path(".root.curlrc.\"--noproxy\""), + "example.org,example.com,localhost"). + once.and_return true + + allow(Yast::SCR).to receive(:Write). + with(path_matching(/^\.root\.curlrc/), anything). + and_return true + + expect(subject.WriteCurlrc).to be true + end + it "escapes user name" do subject.Import({ "enabled" => true, "http_proxy" => "proxy.example.org:3128",