From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roel Janssen Subject: Re: HTTPS for Hydra Date: Tue, 15 Mar 2016 22:47:49 +0100 Message-ID: <8737rrv2ey.fsf@gnu.org> References: <8760y4ythn.fsf@gnu.org> <87d1qvs9un.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afwon-0001le-4x for guix-devel@gnu.org; Tue, 15 Mar 2016 17:47:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afwom-00027K-6K for guix-devel@gnu.org; Tue, 15 Mar 2016 17:47:57 -0400 In-reply-to: <87d1qvs9un.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-website-packages-Support-both-http-and-https-request.patch >From 28cfe3d56d2139fc4a50ac9b20b2a73fe12f5a6c Mon Sep 17 00:00:00 2001 From: Roel Janssen Date: Tue, 15 Mar 2016 22:45:32 +0100 Subject: [PATCH] website: packages: Support both http and https requests to hydra.gnu.org. * website/static/base/js/packages.js (set_build_status): Use the protocol of the current URL. --- website/static/base/js/packages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/static/base/js/packages.js b/website/static/base/js/packages.js index 246d828..12b827f 100644 --- a/website/static/base/js/packages.js +++ b/website/static/base/js/packages.js @@ -17,7 +17,7 @@ function set_build_status (pkg_string) pkgIcon.src = "../static/base/img/status-icons/"+ pkgInfo[0]["buildstatus"] + ".png"; } } - xhttp.open("GET", "http://hydra.gnu.org/api/latestbuilds?nr=1&project=gnu&jobset=master&job="+ pkg_string, true); + xhttp.open("GET", window.location.href.split(":")[0] + "://hydra.gnu.org/api/latestbuilds?nr=1&project=gnu&jobset=master&job="+ pkg_string, true); xhttp.send(); } } -- 2.6.3 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hello Ludo, Here's the patch. Kind regards, Roel Janssen Ludovic Courtès writes: > Hello! > > It took a while, but finally hydra.gnu.org has its own Let’s Encrypt > certificate and is available over https, woohoo! > > Back to the initial problem, we (i.e., you ;-)) can now modify > packages.js so that it uses either http or https to use Hydra’s API, > depending on the current URL. > > Thoughts? > > Ludo’. --=-=-=--