From fd0bfc3ac43eb0c0c2ac0b21bc2e0670f546384f Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Thu, 4 Jul 2019 15:03:15 +0200
Subject: [PATCH] peertube auth add wants a URL (and not a host)

---
 server/tools/peertube-auth.ts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/tools/peertube-auth.ts b/server/tools/peertube-auth.ts
index ff5ffb60e9..1035d664aa 100644
--- a/server/tools/peertube-auth.ts
+++ b/server/tools/peertube-auth.ts
@@ -39,7 +39,7 @@ async function setInstance (url: string, username: string, password: string, isD
 }
 
 function isURLaPeerTubeInstance (url: string) {
-  return isHostValid(url) || (url.includes('localhost'))
+  return url.startsWith('http://') || url.startsWith('https://')
 }
 
 program
@@ -61,6 +61,7 @@ program
         url: {
           description: 'instance url',
           conform: (value) => isURLaPeerTubeInstance(value),
+          message: 'It should be an URL (https://peertube.example.com)',
           required: true
         },
         username: {
-- 
GitLab