aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-05 11:36:03 +0100
committerChocobozzz <me@florianbigard.com>2021-11-05 11:38:17 +0100
commitdf1db951c512a58110171d046ef367789df02733 (patch)
treea8894b4a4864d9e378923f011b4ca9d206e2ee0b /server/initializers
parent8dd754c76735417305c4b68e2ada6f623e9d7650 (diff)
downloadPeerTube-df1db951c512a58110171d046ef367789df02733.tar.gz
PeerTube-df1db951c512a58110171d046ef367789df02733.tar.zst
PeerTube-df1db951c512a58110171d046ef367789df02733.zip
Support RTMPS
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/checker-after-init.ts14
-rw-r--r--server/initializers/checker-before-init.ts1
-rw-r--r--server/initializers/config.ts8
-rw-r--r--server/initializers/constants.ts4
4 files changed, 26 insertions, 1 deletions
diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts
index 7a9e07482..57ef0d218 100644
--- a/server/initializers/checker-after-init.ts
+++ b/server/initializers/checker-after-init.ts
@@ -151,6 +151,20 @@ function checkConfig () {
151 if (CONFIG.LIVE.ALLOW_REPLAY === true && CONFIG.TRANSCODING.ENABLED === false) { 151 if (CONFIG.LIVE.ALLOW_REPLAY === true && CONFIG.TRANSCODING.ENABLED === false) {
152 return 'Live allow replay cannot be enabled if transcoding is not enabled.' 152 return 'Live allow replay cannot be enabled if transcoding is not enabled.'
153 } 153 }
154
155 if (CONFIG.LIVE.RTMP.ENABLED === false && CONFIG.LIVE.RTMPS.ENABLED === false) {
156 return 'You must enable at least RTMP or RTMPS'
157 }
158
159 if (CONFIG.LIVE.RTMPS.ENABLED) {
160 if (!CONFIG.LIVE.RTMPS.KEY_FILE) {
161 return 'You must specify a key file to enabled RTMPS'
162 }
163
164 if (!CONFIG.LIVE.RTMPS.CERT_FILE) {
165 return 'You must specify a cert file to enable RTMPS'
166 }
167 }
154 } 168 }
155 169
156 // Object storage 170 // Object storage
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts
index 39f0cebf6..1015c5e45 100644
--- a/server/initializers/checker-before-init.ts
+++ b/server/initializers/checker-before-init.ts
@@ -47,6 +47,7 @@ function checkMissedConfig () {
47 'search.remote_uri.users', 'search.remote_uri.anonymous', 'search.search_index.enabled', 'search.search_index.url', 47 'search.remote_uri.users', 'search.remote_uri.anonymous', 'search.search_index.enabled', 'search.search_index.url',
48 'search.search_index.disable_local_search', 'search.search_index.is_default_search', 48 'search.search_index.disable_local_search', 'search.search_index.is_default_search',
49 'live.enabled', 'live.allow_replay', 'live.max_duration', 'live.max_user_lives', 'live.max_instance_lives', 49 'live.enabled', 'live.allow_replay', 'live.max_duration', 'live.max_user_lives', 'live.max_instance_lives',
50 'live.rtmp.enabled', 'live.rtmp.port', 'live.rtmps.enabled', 'live.rtmps.port', 'live.rtmps.key_file', 'live.rtmps.cert_file',
50 'live.transcoding.enabled', 'live.transcoding.threads', 'live.transcoding.profile', 51 'live.transcoding.enabled', 'live.transcoding.threads', 'live.transcoding.profile',
51 'live.transcoding.resolutions.144p', 'live.transcoding.resolutions.240p', 'live.transcoding.resolutions.360p', 52 'live.transcoding.resolutions.144p', 'live.transcoding.resolutions.240p', 'live.transcoding.resolutions.360p',
52 'live.transcoding.resolutions.480p', 'live.transcoding.resolutions.720p', 'live.transcoding.resolutions.1080p', 53 'live.transcoding.resolutions.480p', 'live.transcoding.resolutions.720p', 'live.transcoding.resolutions.1080p',
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index 0d5e29499..1288768d8 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -271,9 +271,17 @@ const CONFIG = {
271 get ALLOW_REPLAY () { return config.get<boolean>('live.allow_replay') }, 271 get ALLOW_REPLAY () { return config.get<boolean>('live.allow_replay') },
272 272
273 RTMP: { 273 RTMP: {
274 get ENABLED () { return config.get<boolean>('live.rtmp.enabled') },
274 get PORT () { return config.get<number>('live.rtmp.port') } 275 get PORT () { return config.get<number>('live.rtmp.port') }
275 }, 276 },
276 277
278 RTMPS: {
279 get ENABLED () { return config.get<boolean>('live.rtmps.enabled') },
280 get PORT () { return config.get<number>('live.rtmps.port') },
281 get KEY_FILE () { return config.get<string>('live.rtmps.key_file') },
282 get CERT_FILE () { return config.get<string>('live.rtmps.cert_file') }
283 },
284
277 TRANSCODING: { 285 TRANSCODING: {
278 get ENABLED () { return config.get<boolean>('live.transcoding.enabled') }, 286 get ENABLED () { return config.get<boolean>('live.transcoding.enabled') },
279 get THREADS () { return config.get<number>('live.transcoding.threads') }, 287 get THREADS () { return config.get<number>('live.transcoding.threads') },
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 3781f9508..fb6bc9a66 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -52,7 +52,8 @@ const WEBSERVER = {
52 WS: '', 52 WS: '',
53 HOSTNAME: '', 53 HOSTNAME: '',
54 PORT: 0, 54 PORT: 0,
55 RTMP_URL: '' 55 RTMP_URL: '',
56 RTMPS_URL: ''
56} 57}
57 58
58// Sortable columns per schema 59// Sortable columns per schema
@@ -998,6 +999,7 @@ function updateWebserverUrls () {
998 WEBSERVER.PORT = CONFIG.WEBSERVER.PORT 999 WEBSERVER.PORT = CONFIG.WEBSERVER.PORT
999 1000
1000 WEBSERVER.RTMP_URL = 'rtmp://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.LIVE.RTMP.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH 1001 WEBSERVER.RTMP_URL = 'rtmp://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.LIVE.RTMP.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH
1002 WEBSERVER.RTMPS_URL = 'rtmps://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.LIVE.RTMPS.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH
1001} 1003}
1002 1004
1003function updateWebserverConfig () { 1005function updateWebserverConfig () {