aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2022-03-01 13:37:34 +0100
committerGitHub <noreply@github.com>2022-03-01 13:37:34 +0100
commit8d07888728bc5aabc7d0cd6211bc49fc45fd0353 (patch)
tree11b25f2a922f53d5c7f2273ebe5a56afaff96cd3
parentb5c00b9b67efee77a3476f31403e196fedfc7c99 (diff)
downloadPeerTube-8d07888728bc5aabc7d0cd6211bc49fc45fd0353.tar.gz
PeerTube-8d07888728bc5aabc7d0cd6211bc49fc45fd0353.tar.zst
PeerTube-8d07888728bc5aabc7d0cd6211bc49fc45fd0353.zip
Possibility to set custom RTMP/RTMPS hostname (#4811)
* live: set custom RTMP/RTMPS hostname closes #4786 * dont use webserver.hostname as default * check that rtmp/s.hostname is set
-rw-r--r--config/default.yaml2
-rw-r--r--config/production.yaml.example2
-rw-r--r--server/initializers/checker-before-init.ts3
-rw-r--r--server/initializers/config.ts4
-rw-r--r--server/initializers/constants.ts4
5 files changed, 11 insertions, 4 deletions
diff --git a/config/default.yaml b/config/default.yaml
index 1e7fb9e5b..3588a5ec9 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -396,6 +396,7 @@ live:
396 rtmp: 396 rtmp:
397 enabled: true 397 enabled: true
398 port: 1935 398 port: 1935
399 hostname: 'localhost'
399 400
400 rtmps: 401 rtmps:
401 enabled: false 402 enabled: false
@@ -404,6 +405,7 @@ live:
404 key_file: '' 405 key_file: ''
405 # Absolute path 406 # Absolute path
406 cert_file: '' 407 cert_file: ''
408 hostname: 'localhost'
407 409
408 # Allow to transcode the live streaming in multiple live resolutions 410 # Allow to transcode the live streaming in multiple live resolutions
409 transcoding: 411 transcoding:
diff --git a/config/production.yaml.example b/config/production.yaml.example
index d1f18ecde..73d1ead66 100644
--- a/config/production.yaml.example
+++ b/config/production.yaml.example
@@ -404,6 +404,7 @@ live:
404 rtmp: 404 rtmp:
405 enabled: true 405 enabled: true
406 port: 1935 406 port: 1935
407 hostname: 'localhost'
407 408
408 rtmps: 409 rtmps:
409 enabled: false 410 enabled: false
@@ -412,6 +413,7 @@ live:
412 key_file: '' 413 key_file: ''
413 # Absolute path 414 # Absolute path
414 cert_file: '' 415 cert_file: ''
416 hostname: 'localhost'
415 417
416 # Allow to transcode the live streaming in multiple live resolutions 418 # Allow to transcode the live streaming in multiple live resolutions
417 transcoding: 419 transcoding:
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts
index d9d90d4b4..fe7006083 100644
--- a/server/initializers/checker-before-init.ts
+++ b/server/initializers/checker-before-init.ts
@@ -49,7 +49,8 @@ function checkMissedConfig () {
49 'search.remote_uri.users', 'search.remote_uri.anonymous', 'search.search_index.enabled', 'search.search_index.url', 49 'search.remote_uri.users', 'search.remote_uri.anonymous', 'search.search_index.enabled', 'search.search_index.url',
50 'search.search_index.disable_local_search', 'search.search_index.is_default_search', 50 'search.search_index.disable_local_search', 'search.search_index.is_default_search',
51 'live.enabled', 'live.allow_replay', 'live.max_duration', 'live.max_user_lives', 'live.max_instance_lives', 51 'live.enabled', 'live.allow_replay', 'live.max_duration', 'live.max_user_lives', 'live.max_instance_lives',
52 'live.rtmp.enabled', 'live.rtmp.port', 'live.rtmps.enabled', 'live.rtmps.port', 'live.rtmps.key_file', 'live.rtmps.cert_file', 52 'live.rtmp.enabled', 'live.rtmp.port', 'live.rtmp.hostname',
53 'live.rtmps.enabled', 'live.rtmps.port', 'live.rtmps.hostname', 'live.rtmps.key_file', 'live.rtmps.cert_file',
53 'live.transcoding.enabled', 'live.transcoding.threads', 'live.transcoding.profile', 54 'live.transcoding.enabled', 'live.transcoding.threads', 'live.transcoding.profile',
54 'live.transcoding.resolutions.144p', 'live.transcoding.resolutions.240p', 'live.transcoding.resolutions.360p', 55 'live.transcoding.resolutions.144p', 'live.transcoding.resolutions.240p', 'live.transcoding.resolutions.360p',
55 'live.transcoding.resolutions.480p', 'live.transcoding.resolutions.720p', 'live.transcoding.resolutions.1080p', 56 '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 c1b82d12f..63056b41d 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -297,12 +297,14 @@ const CONFIG = {
297 297
298 RTMP: { 298 RTMP: {
299 get ENABLED () { return config.get<boolean>('live.rtmp.enabled') }, 299 get ENABLED () { return config.get<boolean>('live.rtmp.enabled') },
300 get PORT () { return config.get<number>('live.rtmp.port') } 300 get PORT () { return config.get<number>('live.rtmp.port') },
301 get HOSTNAME () { return config.get<number>('live.rtmp.hostname') }
301 }, 302 },
302 303
303 RTMPS: { 304 RTMPS: {
304 get ENABLED () { return config.get<boolean>('live.rtmps.enabled') }, 305 get ENABLED () { return config.get<boolean>('live.rtmps.enabled') },
305 get PORT () { return config.get<number>('live.rtmps.port') }, 306 get PORT () { return config.get<number>('live.rtmps.port') },
307 get HOSTNAME () { return config.get<number>('live.rtmps.hostname') },
306 get KEY_FILE () { return config.get<string>('live.rtmps.key_file') }, 308 get KEY_FILE () { return config.get<string>('live.rtmps.key_file') },
307 get CERT_FILE () { return config.get<string>('live.rtmps.cert_file') } 309 get CERT_FILE () { return config.get<string>('live.rtmps.cert_file') }
308 }, 310 },
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 2367e7689..3069e2353 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -1046,8 +1046,8 @@ function updateWebserverUrls () {
1046 WEBSERVER.HOSTNAME = CONFIG.WEBSERVER.HOSTNAME 1046 WEBSERVER.HOSTNAME = CONFIG.WEBSERVER.HOSTNAME
1047 WEBSERVER.PORT = CONFIG.WEBSERVER.PORT 1047 WEBSERVER.PORT = CONFIG.WEBSERVER.PORT
1048 1048
1049 WEBSERVER.RTMP_URL = 'rtmp://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.LIVE.RTMP.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH 1049 WEBSERVER.RTMP_URL = 'rtmp://' + CONFIG.LIVE.RTMP.HOSTNAME + ':' + CONFIG.LIVE.RTMP.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH
1050 WEBSERVER.RTMPS_URL = 'rtmps://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.LIVE.RTMPS.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH 1050 WEBSERVER.RTMPS_URL = 'rtmps://' + CONFIG.LIVE.RTMPS.HOSTNAME + ':' + CONFIG.LIVE.RTMPS.PORT + '/' + VIDEO_LIVE.RTMP.BASE_PATH
1051} 1051}
1052 1052
1053function updateWebserverConfig () { 1053function updateWebserverConfig () {