From 88d94b1bd6e38fd2af002641298697e6689b6468 Mon Sep 17 00:00:00 2001 From: frju365 Date: Thu, 30 Aug 2018 13:24:44 +0200 Subject: [PATCH 01/10] [fix] Try something to be independent from github --- src/js/yunohost/controllers/apps.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index b1fe4cab..3b2ab0d0 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -444,7 +444,6 @@ } }); - // Install custom app from github app.post('#/apps/install/custom', function(c) { var params = { @@ -461,10 +460,23 @@ // Force trailing slash params.app = params.app.replace(/\/?$/, '/'); - - // Get manifest.json to get additional parameters + var rawpath = ""; + if(function() { + var xhr_object = new XMLHttpRequest(); + xhr_object.open("GET", params.app + "raw/master/manifest.json", false); + xhr_object.send(null); + } == true) { + rawpath = 'raw/master/manifest.json'; + } // Install custom app from github + else if (params.app.indexOf("github.com") !== "-1") { + params.app = params.app.replace('github.com', 'raw.githubusercontent.com'); + rawpath = 'master/manifest.json'; + } + else { + console.log("You git host is not supported"); + } jQuery.ajax({ - url: params.app.replace('github.com', 'raw.githubusercontent.com') + 'master/manifest.json', + url: params.app + rawpath, type: 'GET', }) .done(function(manifest) { From 7d650e8e82ca7187626856e053a86842da396545 Mon Sep 17 00:00:00 2001 From: frju365 Date: Thu, 30 Aug 2018 13:43:42 +0200 Subject: [PATCH 02/10] Update apps.js --- src/js/yunohost/controllers/apps.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 3b2ab0d0..d49cf574 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -465,7 +465,8 @@ var xhr_object = new XMLHttpRequest(); xhr_object.open("GET", params.app + "raw/master/manifest.json", false); xhr_object.send(null); - } == true) { + return xhr_object.status + } === 200) { rawpath = 'raw/master/manifest.json'; } // Install custom app from github else if (params.app.indexOf("github.com") !== "-1") { From 35f812ab72164ec4e328b667039e3526a252f135 Mon Sep 17 00:00:00 2001 From: frju365 Date: Thu, 30 Aug 2018 13:44:21 +0200 Subject: [PATCH 03/10] Update apps.js --- src/js/yunohost/controllers/apps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index d49cf574..5d969922 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -465,7 +465,7 @@ var xhr_object = new XMLHttpRequest(); xhr_object.open("GET", params.app + "raw/master/manifest.json", false); xhr_object.send(null); - return xhr_object.status + return xhr_object.status; } === 200) { rawpath = 'raw/master/manifest.json'; } // Install custom app from github From 3d382c4fcdb089c85a20c02b3f47c896d3afeb6b Mon Sep 17 00:00:00 2001 From: frju365 Date: Thu, 30 Aug 2018 15:00:29 +0200 Subject: [PATCH 04/10] typo and try to unset params.app --- src/js/yunohost/controllers/apps.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 5d969922..0c4e4992 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -467,17 +467,18 @@ xhr_object.send(null); return xhr_object.status; } === 200) { - rawpath = 'raw/master/manifest.json'; + rawpath = 'raw/master/manifest.json'; + var giturl = params.app + rawpath; } // Install custom app from github else if (params.app.indexOf("github.com") !== "-1") { - params.app = params.app.replace('github.com', 'raw.githubusercontent.com'); rawpath = 'master/manifest.json'; + var giturl = params.app.replace('github.com', 'raw.githubusercontent.com') + rawpath; } else { console.log("You git host is not supported"); } jQuery.ajax({ - url: params.app + rawpath, + url: giturl, type: 'GET', }) .done(function(manifest) { From 4eb887152737b0f7849d81de56282ac8430694c0 Mon Sep 17 00:00:00 2001 From: frju365 Date: Thu, 30 Aug 2018 15:15:51 +0200 Subject: [PATCH 05/10] Update apps.js --- src/js/yunohost/controllers/apps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 0c4e4992..852f7d76 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -470,7 +470,7 @@ rawpath = 'raw/master/manifest.json'; var giturl = params.app + rawpath; } // Install custom app from github - else if (params.app.indexOf("github.com") !== "-1") { + else if (params.app.indexOf("github.com") !== -1) { rawpath = 'master/manifest.json'; var giturl = params.app.replace('github.com', 'raw.githubusercontent.com') + rawpath; } From a9d55004f0fca6273ac0d84091ef129e7efdbbb9 Mon Sep 17 00:00:00 2001 From: frju365 Date: Thu, 30 Aug 2018 17:59:14 +0200 Subject: [PATCH 06/10] [fix] regex Template --- src/views/app/app_list_install.ms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index 93595d6d..0be52682 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -52,7 +52,7 @@
- +

{{t 'custom_app_url_only_github'}}

From b0b9a59b9cc168958669079e5771cfdae60209ec Mon Sep 17 00:00:00 2001 From: frju365 Date: Thu, 30 Aug 2018 18:04:09 +0200 Subject: [PATCH 07/10] Update apps.js --- src/js/yunohost/controllers/apps.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 852f7d76..1abf1a8d 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -461,6 +461,7 @@ // Force trailing slash params.app = params.app.replace(/\/?$/, '/'); var rawpath = ""; + var giturl = params.app; if(function() { var xhr_object = new XMLHttpRequest(); xhr_object.open("GET", params.app + "raw/master/manifest.json", false); @@ -468,11 +469,11 @@ return xhr_object.status; } === 200) { rawpath = 'raw/master/manifest.json'; - var giturl = params.app + rawpath; + giturl = params.app + rawpath; } // Install custom app from github else if (params.app.indexOf("github.com") !== -1) { rawpath = 'master/manifest.json'; - var giturl = params.app.replace('github.com', 'raw.githubusercontent.com') + rawpath; + giturl = params.app.replace('github.com', 'raw.githubusercontent.com') + rawpath; } else { console.log("You git host is not supported"); From e7e295ff1f65da89c1c6891380245dd191247c78 Mon Sep 17 00:00:00 2001 From: frju365 Date: Fri, 14 Dec 2018 23:27:48 +0100 Subject: [PATCH 08/10] test --- src/views/app/app_list_install.ms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index 0be52682..f0c35d7a 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -52,7 +52,7 @@
- +

{{t 'custom_app_url_only_github'}}

From 7e385af846885fd304f19541a1aee03f62f3968d Mon Sep 17 00:00:00 2001 From: frju365 Date: Sun, 29 Sep 2019 19:59:25 +0200 Subject: [PATCH 09/10] Final test --- src/js/yunohost/controllers/apps.js | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 1abf1a8d..ca534849 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -460,24 +460,7 @@ // Force trailing slash params.app = params.app.replace(/\/?$/, '/'); - var rawpath = ""; - var giturl = params.app; - if(function() { - var xhr_object = new XMLHttpRequest(); - xhr_object.open("GET", params.app + "raw/master/manifest.json", false); - xhr_object.send(null); - return xhr_object.status; - } === 200) { - rawpath = 'raw/master/manifest.json'; - giturl = params.app + rawpath; - } // Install custom app from github - else if (params.app.indexOf("github.com") !== -1) { - rawpath = 'master/manifest.json'; - giturl = params.app.replace('github.com', 'raw.githubusercontent.com') + rawpath; - } - else { - console.log("You git host is not supported"); - } + var giturl = params.app + "raw/master/manifest.json"; jQuery.ajax({ url: giturl, type: 'GET', From 67abfc488570243ccee31674b1b90484ee024abd Mon Sep 17 00:00:00 2001 From: frju365 Date: Sun, 29 Sep 2019 20:00:07 +0200 Subject: [PATCH 10/10] Correct placeholder --- src/views/app/app_list_install.ms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index f0c35d7a..a6310f2f 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -52,7 +52,7 @@
- +

{{t 'custom_app_url_only_github'}}