From b32b78271856ee12fdce5fadc7ed0fe81ecaeff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bertron?= Date: Sat, 24 Mar 2018 19:40:48 +0100 Subject: Limit comment length to 1 character, fixes #394 (#399) --- server/initializers/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 705d9b520..481b21bbb 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -226,7 +226,7 @@ const CONSTRAINTS_FIELDS = { COUNT: { min: 0 } }, VIDEO_COMMENTS: { - TEXT: { min: 2, max: 3000 }, // Length + TEXT: { min: 1, max: 3000 }, // Length URL: { min: 3, max: 2000 } // Length }, VIDEO_SHARE: { -- cgit v1.2.3 From f5b611f9ee8b6cb6236cf01c4963eb01bdadb7c9 Mon Sep 17 00:00:00 2001 From: Okhin Date: Sat, 24 Mar 2018 20:11:37 +0100 Subject: Replacing the err being thrown by a gracefull exit.process(1) --- server/tools/import-videos.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/tools/import-videos.ts b/server/tools/import-videos.ts index 433cee652..72223a01a 100644 --- a/server/tools/import-videos.ts +++ b/server/tools/import-videos.ts @@ -53,7 +53,10 @@ async function run () { const options = [ '-j', '--flat-playlist', '--playlist-reverse' ] youtubeDL.getInfo(program['targetUrl'], options, processOptions, async (err, info) => { - if (err) throw err + if (err) { + console.log(err.message); + process.exit(1); + } let infoArray: any[] @@ -157,7 +160,8 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag await uploadVideo(program['url'], accessToken, videoAttributes) } else { - throw err + console.log(err.message); + process.exit(1); } } -- cgit v1.2.3 From 0414ed1066e4d4c24f98e375cd8f14d44401c09a Mon Sep 17 00:00:00 2001 From: Okhin Date: Sat, 24 Mar 2018 20:38:25 +0100 Subject: Improving the CentOS7 specific parts Changing the link for ffmpeg toward a tutorial with an actual mirror of ffmpeg, and with less hassle. Adding the deendencies to devtoolset-6 and centos-release-scl to provide a C++11 compatible G++ --- support/doc/dependencies.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/support/doc/dependencies.md b/support/doc/dependencies.md index 6db8a57d0..ab7fb2e4e 100644 --- a/support/doc/dependencies.md +++ b/support/doc/dependencies.md @@ -46,15 +46,19 @@ $ sudo pacman -S nodejs yarn ffmpeg postgresql openssl redis git wget unzip pyth 2. Install yarn: [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) 3. Install or compile ffmpeg: - * Install - [https://www.webfoobar.com/index.php/node/17](https://www.webfoobar.com/index.php/node/17) + * Install - [https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/](https://linoxide.com/linux-how-to/install-ffmpeg-centos-7/) * Compile - [https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh](https://gist.github.com/mustafaturan/7053900#file-latest-ffmpeg-centos6-sh) 4. Run: ``` $ sudo yum update -$ sudo yum install epel-release +$ sudo yum install epel-release centos-release-scl $ sudo yum update -$ sudo yum install nginx postgresql postgresql-server openssl gcc make redis git +$ sudo yum install nginx postgresql postgresql-server openssl gcc-c++ make redis git devtoolset-6 +``` + + 5. You need to use a more up to date version of G++ in order to run the yarn install command, hence the installation of devtoolset-6. +$ sudo scl devtoolset-6 bash ``` ## Other distributions -- cgit v1.2.3 From 193b12bf8fa7aae3b171fcfe781074b0d23ece58 Mon Sep 17 00:00:00 2001 From: Okhin Date: Sat, 24 Mar 2018 20:41:31 +0100 Subject: Add the activation of a needed SCL for CentOS There's a need to activate the devtool-6 SCL before running the yarn install command, to have node-gyp correctly compiling the needed binaries. --- support/doc/production.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/support/doc/production.md b/support/doc/production.md index 3a58811b0..313b57889 100644 --- a/support/doc/production.md +++ b/support/doc/production.md @@ -51,7 +51,11 @@ $ sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/down $ sudo -u peertube unzip peertube-${VERSION}.zip && sudo -u peertube rm peertube-${VERSION}.zip ``` -Install Peertube +Install Peertube. If you're using CentOS7, do not forget to activate the devtoolset-6 software collection: +``` +$ scl enable devtool-6 bash +``` +And after that, follow the step as usual. Do not forget to exit the environment after installing Peertube. ``` $ cd ../ && sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest $ cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile -- cgit v1.2.3 From 5c5638a062d90a0f0cd5f6e8ccb3589099668e79 Mon Sep 17 00:00:00 2001 From: Okhin Date: Sat, 24 Mar 2018 20:47:42 +0100 Subject: Removing unnecessary semicolons --- server/tools/import-videos.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/tools/import-videos.ts b/server/tools/import-videos.ts index 72223a01a..baaedd329 100644 --- a/server/tools/import-videos.ts +++ b/server/tools/import-videos.ts @@ -54,8 +54,8 @@ async function run () { const options = [ '-j', '--flat-playlist', '--playlist-reverse' ] youtubeDL.getInfo(program['targetUrl'], options, processOptions, async (err, info) => { if (err) { - console.log(err.message); - process.exit(1); + console.log(err.message) + process.exit(1) } let infoArray: any[] @@ -160,8 +160,8 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag await uploadVideo(program['url'], accessToken, videoAttributes) } else { - console.log(err.message); - process.exit(1); + console.log(err.message) + process.exit(1) } } -- cgit v1.2.3