diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2018-01-14 21:07:50 +0100 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2018-01-14 21:07:50 +0100 |
commit | c92f592459f30adba22d243d019ffc1498c87626 (patch) | |
tree | 389fb0057facb938d854af92c019cfda5a7c9134 | |
parent | Version must be non-nil to check slot. (diff) | |
download | glsamaker-c92f592459f30adba22d243d019ffc1498c87626.tar.gz glsamaker-c92f592459f30adba22d243d019ffc1498c87626.tar.bz2 glsamaker-c92f592459f30adba22d243d019ffc1498c87626.zip |
Use HTTPS where available
-rw-r--r-- | lib/bugzilla.rb | 2 | ||||
-rw-r--r-- | lib/glsamaker/http.rb | 2 | ||||
-rw-r--r-- | lib/glsamaker/portage.rb | 2 | ||||
-rw-r--r-- | lib/tasks/import.rake | 4 | ||||
-rw-r--r-- | public/xsl/guide.xsl | 58 |
5 files changed, 34 insertions, 34 deletions
diff --git a/lib/bugzilla.rb b/lib/bugzilla.rb index d9b8c44..dd4d714 100644 --- a/lib/bugzilla.rb +++ b/lib/bugzilla.rb @@ -183,7 +183,7 @@ module Bugzilla def xmlrpc_client client = XMLRPC::Client.new(GLSAMAKER_BUGZIE_HOST, '/xmlrpc.cgi', 443, nil, nil, nil, nil, true) - client.http_header_extra = {'User-Agent' => "GLSAMaker/#{GLSAMAKER_VERSION} (http://security.gentoo.org/)"} + client.http_header_extra = {'User-Agent' => "GLSAMaker/#{GLSAMAKER_VERSION} (https://security.gentoo.org/)"} token = '' token_file = File.join(Rails.root, 'tmp', 'bugzie-token.txt') diff --git a/lib/glsamaker/http.rb b/lib/glsamaker/http.rb index be48898..5f63096 100644 --- a/lib/glsamaker/http.rb +++ b/lib/glsamaker/http.rb @@ -24,7 +24,7 @@ module Glsamaker http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true if uri.scheme == "https" res = http.start { - http.request_get(uri.request_uri, {'User-Agent' => "GLSAMaker/#{GLSAMAKER_VERSION} (http://security.gentoo.org/)"}) + http.request_get(uri.request_uri, {'User-Agent' => "GLSAMaker/#{GLSAMAKER_VERSION} (https://security.gentoo.org/)"}) } # Raises an exception if HTTP status suggests something went wrong diff --git a/lib/glsamaker/portage.rb b/lib/glsamaker/portage.rb index bd9e6db..f49e93e 100644 --- a/lib/glsamaker/portage.rb +++ b/lib/glsamaker/portage.rb @@ -33,7 +33,7 @@ module Glsamaker def pgo(atom) raise(ArgumentError, "Invalid package atom") unless Portage.valid_atom?(atom) - n = Nokogiri::XML(Glsamaker::HTTP.get("http://packages.gentoo.org/package/#{atom}")) + n = Nokogiri::XML(Glsamaker::HTTP.get("https://packages.gentoo.org/package/#{atom}")) node = n.css('p.description').first.children.first if node.type == Nokogiri::XML::Node::TEXT_NODE diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 0c120ce..ec34f91 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -113,8 +113,8 @@ namespace :import do glsa_list.push glsa.glsa_id end - GLSA_URL = "http://www.gentoo.org/rdf/en/glsa-index.rdf" - GLSA_URL_BASE = "http://www.gentoo.org/security/en/glsa/glsa-%s.xml?passthru=1" + GLSA_URL = "https://www.gentoo.org/rdf/en/glsa-index.rdf" + GLSA_URL_BASE = "https://www.gentoo.org/security/en/glsa/glsa-%s.xml?passthru=1" default_user = User.first if default_user == nil diff --git a/public/xsl/guide.xsl b/public/xsl/guide.xsl index b23e64f..3264274 100644 --- a/public/xsl/guide.xsl +++ b/public/xsl/guide.xsl @@ -126,7 +126,7 @@ </xsl:when> <xsl:otherwise> <xsl:if test="count(exslt:node-set($doc-struct)//chapter)>1"> - <form name="contents" action="http://www.gentoo.org"> + <form name="contents" action="https://www.gentoo.org"> <b><xsl:value-of select="func:gettext('Content')"/></b>: <select name="url" size="1" OnChange="location.href=form.url.options[form.url.selectedIndex].value" style="font-family:sans-serif,Arial,Helvetica"> <xsl:for-each select="exslt:node-set($doc-struct)//chapter"> @@ -167,11 +167,11 @@ <link REL="shortcut icon" HREF="{concat($ROOT,'favicon.ico')}" TYPE="image/x-icon"/> <!-- Support for opensearch --> - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/> - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/> - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/> - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/> - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/> + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/> + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/> + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/> + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/> + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/> <xsl:if test="//glsaindex or //glsa-latest"> <link rel="alternate" type="application/rss+xml"> @@ -299,11 +299,11 @@ <link REL="shortcut icon" HREF="{concat($ROOT,'favicon.ico')}" TYPE="image/x-icon"/> <!-- Support for opensearch --> - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/> - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/> - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/> - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/> - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/> + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/> + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/> + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/> + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/> + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/> <xsl:if test="/*[1][@redirect]"> <!-- Immediate HTML refresh in case redirect is not supported --> @@ -317,7 +317,7 @@ </xsl:if> <xsl:if test="/mainpage/newsitems"> - <link rel="alternate" type="application/rss+xml" title="Gentoo Linux News RDF" href="http://www.gentoo.org/rdf/en/gentoo-news.rdf" /> + <link rel="alternate" type="application/rss+xml" title="Gentoo Linux News RDF" href="https://www.gentoo.org/rdf/en/gentoo-news.rdf" /> </xsl:if> <xsl:choose> <xsl:when test="/mainpage | /news"> @@ -353,7 +353,7 @@ </xsl:if> <table border="0" width="100%" cellspacing="0" cellpadding="0"> - <xsl:variable name="www"><xsl:if test="$httphost!='www'">http://www.gentoo.org</xsl:if></xsl:variable> + <xsl:variable name="www"><xsl:if test="$httphost!='www'">https://www.gentoo.org</xsl:if></xsl:variable> <tr> <td valign="top" height="125" width="1%" bgcolor="#45347b"> <a href="{concat($www,'/')}"><img border="0" src="{concat($ROOT,'images/gtop-www.jpg')}" alt="Gentoo Logo"/></a> @@ -488,7 +488,7 @@ </xsl:choose> <xsl:value-of select="format-number(number(substring-before(substring-after(pubDate,' '),' ')),'00')"/> </xsl:variable> - <xsl:if test="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'http://www.gentoo.org/news'))]"> + <xsl:if test="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'https://www.gentoo.org/news'))]"> <newsitem date="{$postdate}" planet="{$pubDate}"/> </xsl:if> </xsl:if> @@ -568,7 +568,7 @@ <xsl:variable name="blogentries" xmlns=""> <xsl:for-each select="./newsitem"> <xsl:variable name="pubDate" select="@planet"/> - <xsl:for-each select="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'http://www.gentoo.org/news'))]"> + <xsl:for-each select="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'https://www.gentoo.org/news'))]"> <tr> <xsl:choose> <xsl:when test="contains(title,': ')"> @@ -714,7 +714,7 @@ <xsl:if test="string-length($glang)=0 or $glang='en'">Y</xsl:if> </xsl:variable> <xsl:variable name="www"> - <xsl:if test="$httphost!='www'">http://www.gentoo.org</xsl:if> + <xsl:if test="$httphost!='www'">https://www.gentoo.org</xsl:if> </xsl:variable> <xsl:variable name="contact"> <xsl:choose> @@ -953,8 +953,8 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <xsl:variable name="llink"> <xsl:choose> - <xsl:when test="starts-with(@link,'http://www.gentoo.org/')"> - <xsl:value-of select="concat($ROOT, substring-after(@link, 'http://www.gentoo.org/'))"/> + <xsl:when test="starts-with(@link,'https://www.gentoo.org/')"> + <xsl:value-of select="concat($ROOT, substring-after(@link, 'https://www.gentoo.org/'))"/> </xsl:when> <xsl:when test="starts-with(@link,'/')"> <xsl:value-of select="concat($ROOT, substring-after(@link, '/'))"/> @@ -1001,8 +1001,8 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <xsl:template match="fig"> <xsl:variable name="llink"> <xsl:choose> - <xsl:when test="starts-with(@link,'http://www.gentoo.org/')"> - <xsl:value-of select="concat($ROOT, substring-after(@link, 'http://www.gentoo.org/'))"/> + <xsl:when test="starts-with(@link,'https://www.gentoo.org/')"> + <xsl:value-of select="concat($ROOT, substring-after(@link, 'https://www.gentoo.org/'))"/> </xsl:when> <xsl:when test="starts-with(@link,'/')"> <xsl:value-of select="concat($ROOT, substring-after(@link, '/'))"/> @@ -1343,16 +1343,16 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found </xsl:choose> </xsl:variable> - <!-- Strip http://www.gentoo.org from links if running on www.g.o + <!-- Strip https://www.gentoo.org from links if running on www.g.o Has no effect on actual www.g.o but helps when surfing on a local copy as long as httphost is set to www as well Rewrite http://www.gentoo.org/cgi-bin/viewcvs/ to use sources.gentoo.org/ --> <xsl:variable name="llink"> <xsl:choose> - <xsl:when test="starts-with($thelink, 'http://www.gentoo.org/cgi-bin/viewcvs.cgi')"><xsl:value-of select="concat('http://sources.gentoo.org/viewcvs.py', substring-after($thelink, 'http://www.gentoo.org/cgi-bin/viewcvs.cgi'))" /></xsl:when> - <xsl:when test="starts-with($thelink, '/cgi-bin/viewcvs.cgi')"><xsl:value-of select="concat('http://sources.gentoo.org/viewcvs.py', substring-after($thelink, '/cgi-bin/viewcvs.cgi'))" /></xsl:when> - <xsl:when test="$httphost='www' and starts-with($thelink, 'http://www.gentoo.org/')"><xsl:value-of select="substring-after($thelink, 'http://www.gentoo.org')" /></xsl:when> - <xsl:when test="not($httphost='www') and starts-with($thelink, '/') and not(starts-with($thelink, '/~'))"><xsl:value-of select="concat('http://www.gentoo.org', $thelink)" /></xsl:when> + <xsl:when test="starts-with($thelink, 'https://www.gentoo.org/cgi-bin/viewcvs.cgi')"><xsl:value-of select="concat('https://sources.gentoo.org/viewcvs.py', substring-after($thelink, 'https://www.gentoo.org/cgi-bin/viewcvs.cgi'))" /></xsl:when> + <xsl:when test="starts-with($thelink, '/cgi-bin/viewcvs.cgi')"><xsl:value-of select="concat('https://sources.gentoo.org/viewcvs.py', substring-after($thelink, '/cgi-bin/viewcvs.cgi'))" /></xsl:when> + <xsl:when test="$httphost='www' and starts-with($thelink, 'https://www.gentoo.org/')"><xsl:value-of select="substring-after($thelink, 'https://www.gentoo.org')" /></xsl:when> + <xsl:when test="not($httphost='www') and starts-with($thelink, '/') and not(starts-with($thelink, '/~'))"><xsl:value-of select="concat('https://www.gentoo.org', $thelink)" /></xsl:when> <!-- Add catid to links to /doc/LL/index.xml --> <xsl:when test="$catid != '0' and starts-with($thelink, '/doc/') and (substring-after(substring-after($thelink, '/doc/'), '/')='' or substring-after(substring-after($thelink, '/doc/'), '/')='index.xml')"> <xsl:value-of select="concat($thelink, '?catid=', $catid)"/> @@ -1755,7 +1755,7 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <!-- Source images from www.gentoo.org when on another server to prevent missing images after an update --> <xsl:choose> - <xsl:when test="$httphost != 'www'">http://www.gentoo.org/</xsl:when> + <xsl:when test="$httphost != 'www'">https://www.gentoo.org/</xsl:when> <xsl:otherwise> <xsl:value-of select="$ROOT"/> </xsl:otherwise> @@ -1905,10 +1905,10 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <input type="hidden" name="item_number" value="1000"/> <input type="hidden" name="image_url" value="/images/paypal.png"/> <input type="hidden" name="no_shipping" value="1"/> - <input type="hidden" name="return" value="http://www.gentoo.org"/> - <input type="hidden" name="cancel_return" value="http://www.gentoo.org"/> + <input type="hidden" name="return" value="https://www.gentoo.org"/> + <input type="hidden" name="cancel_return" value="https://www.gentoo.org"/> - <input type="image" src="http://images.paypal.com/images/x-click-but21.gif" name="submit" alt="Donate to Gentoo"/> + <input type="image" src="https://images.paypal.com/images/x-click-but21.gif" name="submit" alt="Donate to Gentoo"/> </form> </td> </tr> |