aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-07 12:04:06 +0200
committerChocobozzz <me@florianbigard.com>2019-08-07 12:07:59 +0200
commit51c3544718f751dbba4ece9aec39c53fab524c88 (patch)
treebf00c6b0f596642a1db6ac6d61229ae7aaa72bc3
parent0763044f7d11a56dd5c5c424771dd83c76159de2 (diff)
downloadPeerTube-51c3544718f751dbba4ece9aec39c53fab524c88.tar.gz
PeerTube-51c3544718f751dbba4ece9aec39c53fab524c88.tar.zst
PeerTube-51c3544718f751dbba4ece9aec39c53fab524c88.zip
Deprecate Node 8
The support ends on December 2019: https://github.com/nodejs/Release#release-schedule
-rw-r--r--README.md2
-rw-r--r--server.ts4
-rw-r--r--server/initializers/checker-before-init.ts16
-rw-r--r--server/tests/api/ci-3.sh2
-rw-r--r--support/doc/dependencies.md8
-rw-r--r--support/doc/tools.md4
-rw-r--r--support/docker/dev/Dockerfile2
-rw-r--r--support/docker/production/Dockerfile.stretch2
8 files changed, 28 insertions, 12 deletions
diff --git a/README.md b/README.md
index 5de29a067..29478b085 100644
--- a/README.md
+++ b/README.md
@@ -147,7 +147,7 @@ Feel free to reach out if you have any questions or ideas! :speech_balloon:
147 * nginx 147 * nginx
148 * **PostgreSQL >= 9.6** 148 * **PostgreSQL >= 9.6**
149 * **Redis >= 2.8.18** 149 * **Redis >= 2.8.18**
150 * **NodeJS >= 8.x** 150 * **NodeJS >= 10.x**
151 * **yarn >= 1.x** 151 * **yarn >= 1.x**
152 * **FFmpeg >= 3.x** 152 * **FFmpeg >= 3.x**
153 153
diff --git a/server.ts b/server.ts
index abfeeed2e..6896add34 100644
--- a/server.ts
+++ b/server.ts
@@ -26,7 +26,7 @@ process.title = 'peertube'
26const app = express() 26const app = express()
27 27
28// ----------- Core checker ----------- 28// ----------- Core checker -----------
29import { checkMissedConfig, checkFFmpeg } from './server/initializers/checker-before-init' 29import { checkMissedConfig, checkFFmpeg, checkNodeVersion } from './server/initializers/checker-before-init'
30 30
31// Do not use barrels because we don't want to load all modules here (we need to initialize database first) 31// Do not use barrels because we don't want to load all modules here (we need to initialize database first)
32import { CONFIG } from './server/initializers/config' 32import { CONFIG } from './server/initializers/config'
@@ -45,6 +45,8 @@ checkFFmpeg(CONFIG)
45 process.exit(-1) 45 process.exit(-1)
46 }) 46 })
47 47
48checkNodeVersion()
49
48import { checkConfig, checkActivityPubUrls } from './server/initializers/checker-after-init' 50import { checkConfig, checkActivityPubUrls } from './server/initializers/checker-after-init'
49 51
50const errorMessage = checkConfig() 52const errorMessage = checkConfig()
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts
index c94bca2f8..55bc820f5 100644
--- a/server/initializers/checker-before-init.ts
+++ b/server/initializers/checker-before-init.ts
@@ -1,5 +1,6 @@
1import * as config from 'config' 1import * as config from 'config'
2import { promisify0 } from '../helpers/core-utils' 2import { promisify0 } from '../helpers/core-utils'
3import { logger } from '../helpers/logger'
3 4
4// ONLY USE CORE MODULES IN THIS FILE! 5// ONLY USE CORE MODULES IN THIS FILE!
5 6
@@ -109,10 +110,23 @@ async function checkFFmpegEncoders (): Promise<Map<string, boolean>> {
109 return supportedOptionalEncoders 110 return supportedOptionalEncoders
110} 111}
111 112
113function checkNodeVersion () {
114 const v = process.version
115 const majorString = v.split('.')[0].replace('v', '')
116 const major = parseInt(majorString, 10)
117
118 logger.debug('Checking NodeJS version %s.', v)
119
120 if (major < 10) {
121 logger.warn('Your NodeJS version %s is deprecated. Please use Node 10.', v)
122 }
123}
124
112// --------------------------------------------------------------------------- 125// ---------------------------------------------------------------------------
113 126
114export { 127export {
115 checkFFmpeg, 128 checkFFmpeg,
116 checkFFmpegEncoders, 129 checkFFmpegEncoders,
117 checkMissedConfig 130 checkMissedConfig,
131 checkNodeVersion
118} 132}
diff --git a/server/tests/api/ci-3.sh b/server/tests/api/ci-3.sh
index f6bb8a83e..7aeea7fcb 100644
--- a/server/tests/api/ci-3.sh
+++ b/server/tests/api/ci-3.sh
@@ -4,5 +4,5 @@ set -eu
4 4
5videosFiles=$(find server/tests/api/videos -type f | grep -v index.ts | xargs echo) 5videosFiles=$(find server/tests/api/videos -type f | grep -v index.ts | xargs echo)
6 6
7MOCHA_PARALLEL=true npm run mocha -- --timeout 30000 --exit --require ts-node/register --bail \ 7npm run mocha -- --timeout 30000 --exit --require ts-node/register --bail \
8 $videosFiles 8 $videosFiles
diff --git a/support/doc/dependencies.md b/support/doc/dependencies.md
index 6d33f934a..7255f1331 100644
--- a/support/doc/dependencies.md
+++ b/support/doc/dependencies.md
@@ -26,7 +26,7 @@
26 26
27 3. Install certbot (choose instructions for nginx and your distribution) : 27 3. Install certbot (choose instructions for nginx and your distribution) :
28 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) 28 [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
29 4. Install NodeJS 8.x: 29 4. Install NodeJS 10.x:
30 [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) 30 [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)
31 5. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest): 31 5. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest):
32 [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab) 32 [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
66 66
67## CentOS 7 67## CentOS 7
68 68
69 1. Install NodeJS 8.x: 69 1. Install NodeJS 10.x:
70 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) 70 [https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
71 2. Install yarn: 71 2. Install yarn:
72 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) 72 [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
@@ -121,7 +121,7 @@ su my-peertube-user
121``` 121```
1222. (Optional) Install certbot (choose instructions for nginx and your distribution) : 1222. (Optional) Install certbot (choose instructions for nginx and your distribution) :
123[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) 123[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
1243. Install NodeJS 8.x: 1243. Install NodeJS 10.x:
125[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora) 125[https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora)
1264. Install yarn: 1264. Install yarn:
127[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install) 127[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
@@ -155,7 +155,7 @@ sudo systemctl start redis.service
155``` 155```
1568. Firewall 1568. Firewall
157 157
158By default, you cannot acces your server via public IP. To do so, you must configure firewall: 158By default, you cannot access your server via public IP. To do so, you must configure firewall:
159``` 159```
160# Ports used by peertube dev setup 160# Ports used by peertube dev setup
161sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp 161sudo firewall-cmd --permanent --zone=public --add-port=3000/tcp
diff --git a/support/doc/tools.md b/support/doc/tools.md
index e0f02173e..cf427ec84 100644
--- a/support/doc/tools.md
+++ b/support/doc/tools.md
@@ -36,7 +36,7 @@ You need to follow all the following steps even if you are on a PeerTube server
36### Dependencies 36### Dependencies
37 37
38Install the [PeerTube dependencies](dependencies.md) except PostgreSQL and Redis. 38Install the [PeerTube dependencies](dependencies.md) except PostgreSQL and Redis.
39PeerTube only supports NodeJS 8.x or 10.x. 39PeerTube only supports NodeJS 10.x.
40 40
41### Installation 41### Installation
42 42
@@ -280,7 +280,7 @@ To uninstall a plugin or a theme:
280$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin 280$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin
281``` 281```
282 282
283### REPL ([Read Eval Print Loop](https://nodejs.org/docs/latest-v8.x/api/repl.html)) 283### REPL ([Read Eval Print Loop](https://nodejs.org/docs/latest-v10.x/api/repl.html))
284 284
285If you want to interact with the application libraries and objects even when PeerTube is not running, there is a REPL for that. 285If you want to interact with the application libraries and objects even when PeerTube is not running, there is a REPL for that.
286 286
diff --git a/support/docker/dev/Dockerfile b/support/docker/dev/Dockerfile
index 8e049f3f6..991cf05e2 100644
--- a/support/docker/dev/Dockerfile
+++ b/support/docker/dev/Dockerfile
@@ -17,7 +17,7 @@ RUN apt-get update -q && apt-get install -qy \
17 postgresql \ 17 postgresql \
18 postgresql-contrib \ 18 postgresql-contrib \
19 redis-server \ 19 redis-server \
20 && curl -sL https://deb.nodesource.com/setup_8.x | bash - \ 20 && curl -sL https://deb.nodesource.com/setup_10.x | bash - \
21 && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ 21 && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
22 && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ 22 && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
23 && apt-get update \ 23 && apt-get update \
diff --git a/support/docker/production/Dockerfile.stretch b/support/docker/production/Dockerfile.stretch
index c653233b6..b6de4bd9b 100644
--- a/support/docker/production/Dockerfile.stretch
+++ b/support/docker/production/Dockerfile.stretch
@@ -1,4 +1,4 @@
1FROM node:8-stretch 1FROM node:10-stretch
2 2
3# Allow to pass extra options to the npm run build 3# Allow to pass extra options to the npm run build
4# eg: --light --light-fr to not build all client languages 4# eg: --light --light-fr to not build all client languages