]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Deprecate Node 8
authorChocobozzz <me@florianbigard.com>
Wed, 7 Aug 2019 10:04:06 +0000 (12:04 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 7 Aug 2019 10:07:59 +0000 (12:07 +0200)
The support ends on December 2019: https://github.com/nodejs/Release#release-schedule

README.md
server.ts
server/initializers/checker-before-init.ts
server/tests/api/ci-3.sh
support/doc/dependencies.md
support/doc/tools.md
support/docker/dev/Dockerfile
support/docker/production/Dockerfile.stretch

index 5de29a0678bf2288ff41dee5c118d1de294aec83..29478b085faf7d2c8228cc8dfb2a10771191ea21 100644 (file)
--- a/README.md
+++ b/README.md
@@ -147,7 +147,7 @@ Feel free to reach out if you have any questions or ideas! :speech_balloon:
   * nginx
   * **PostgreSQL >= 9.6**
   * **Redis >= 2.8.18**
-  * **NodeJS >= 8.x**
+  * **NodeJS >= 10.x**
   * **yarn >= 1.x**
   * **FFmpeg >= 3.x**
 
index abfeeed2e02ad5a2f17b2f56a347bdebbdc88570..6896add34fb582ee5208e8cd6cdaf0d1fe7b3299 100644 (file)
--- a/server.ts
+++ b/server.ts
@@ -26,7 +26,7 @@ process.title = 'peertube'
 const app = express()
 
 // ----------- Core checker -----------
-import { checkMissedConfig, checkFFmpeg } from './server/initializers/checker-before-init'
+import { checkMissedConfig, checkFFmpeg, checkNodeVersion } from './server/initializers/checker-before-init'
 
 // Do not use barrels because we don't want to load all modules here (we need to initialize database first)
 import { CONFIG } from './server/initializers/config'
@@ -45,6 +45,8 @@ checkFFmpeg(CONFIG)
     process.exit(-1)
   })
 
+checkNodeVersion()
+
 import { checkConfig, checkActivityPubUrls } from './server/initializers/checker-after-init'
 
 const errorMessage = checkConfig()
index c94bca2f89b501a279867d455dad3f982037369a..55bc820f5e32e5c62e9b4b518e2787e5dd54648d 100644 (file)
@@ -1,5 +1,6 @@
 import * as config from 'config'
 import { promisify0 } from '../helpers/core-utils'
+import { logger } from '../helpers/logger'
 
 // ONLY USE CORE MODULES IN THIS FILE!
 
@@ -109,10 +110,23 @@ async function checkFFmpegEncoders (): Promise<Map<string, boolean>> {
   return supportedOptionalEncoders
 }
 
+function checkNodeVersion () {
+  const v = process.version
+  const majorString = v.split('.')[0].replace('v', '')
+  const major = parseInt(majorString, 10)
+
+  logger.debug('Checking NodeJS version %s.', v)
+
+  if (major < 10) {
+    logger.warn('Your NodeJS version %s is deprecated. Please use Node 10.', v)
+  }
+}
+
 // ---------------------------------------------------------------------------
 
 export {
   checkFFmpeg,
   checkFFmpegEncoders,
-  checkMissedConfig
+  checkMissedConfig,
+  checkNodeVersion
 }
index f6bb8a83e7ea6b707c3b63d3551d07d3f3d9980d..7aeea7fcba5deb77352619e10789b39fe1e5590c 100644 (file)
@@ -4,5 +4,5 @@ set -eu
 
 videosFiles=$(find server/tests/api/videos -type f | grep -v index.ts | xargs echo)
 
-MOCHA_PARALLEL=true npm run mocha -- --timeout 30000 --exit --require ts-node/register --bail \
+npm run mocha -- --timeout 30000 --exit --require ts-node/register --bail \
     $videosFiles
index 6d33f934af05456d32fa5d8201f725e0444f337f..7255f1331d186b2e6b00263110a96c8d31abcde6 100644 (file)
@@ -26,7 +26,7 @@
 
   3. Install certbot (choose instructions for nginx and your distribution) :
      [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
-  4. Install NodeJS 8.x:
+  4. Install NodeJS 10.x:
      [https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)
   5. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
      [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
@@ -66,7 +66,7 @@ $ sudo systemctl start redis postgresql
 
 ## CentOS 7
 
-  1. Install NodeJS 8.x:
+  1. Install NodeJS 10.x:
      [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
   2. Install yarn:
      [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
@@ -121,7 +121,7 @@ su my-peertube-user
 ```
 2. (Optional) Install certbot (choose instructions for nginx and your distribution) :
 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
-3. Install NodeJS 8.x:
+3. Install NodeJS 10.x:
 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
 4. Install yarn:
 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
@@ -155,7 +155,7 @@ sudo systemctl start redis.service
 ```
 8. Firewall
 
-By default, you cannot acces your server via public IP. To do so, you must configure firewall:
+By default, you cannot access your server via public IP. To do so, you must configure firewall:
 ```
 # Ports used by peertube dev setup
 sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
index e0f02173ed3ee0a6e8c3868a2a36866d27015e75..cf427ec845d6ceb23b695745c9604bf7d1de57d9 100644 (file)
@@ -36,7 +36,7 @@ You need to follow all the following steps even if you are on a PeerTube server
 ### Dependencies
 
 Install the [PeerTube dependencies](dependencies.md) except PostgreSQL and Redis.
-PeerTube only supports NodeJS 8.x or 10.x.
+PeerTube only supports NodeJS 10.x.
 
 ### Installation
 
@@ -280,7 +280,7 @@ To uninstall a plugin or a theme:
 $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin
 ```
 
-### REPL ([Read Eval Print Loop](https://nodejs.org/docs/latest-v8.x/api/repl.html))
+### REPL ([Read Eval Print Loop](https://nodejs.org/docs/latest-v10.x/api/repl.html))
 
 If you want to interact with the application libraries and objects even when PeerTube is not running, there is a REPL for that.
 
index 8e049f3f6a1390ba9214d646ddff35df044ce177..991cf05e288049bb15e730e6c4b4ff9eee0f94ab 100644 (file)
@@ -17,7 +17,7 @@ RUN apt-get update -q && apt-get install -qy \
       postgresql \
       postgresql-contrib \
       redis-server \
-    && curl -sL https://deb.nodesource.com/setup_8.x | bash - \
+    && curl -sL https://deb.nodesource.com/setup_10.x | bash - \
     && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
     && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
     && apt-get update \
index c653233b6930f05a07a4ba381714f56579d34f80..b6de4bd9b883e8d2f9d8c3d67158ffa008db7380 100644 (file)
@@ -1,4 +1,4 @@
-FROM node:8-stretch
+FROM node:10-stretch
 
 # Allow to pass extra options to the npm run build
 # eg: --light --light-fr to not build all client languages