Commit 0c2b290b authored by Boxiang Sun's avatar Boxiang Sun

peertube: host fixup

parent 24be540a
......@@ -10,6 +10,7 @@ parts =
nginx-service
peertube-service
publish-connection-parameter
peertube-urlparse
nginx-listen-promise
peertube-listen-promise
......@@ -163,7 +164,7 @@ name = PeerTube Server Frontend
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config-type = websocket
config-websocket-path-list = /socket.io /tracker
config-websocket-path-list = /socket.io /socket /tracker/socket
config-url = https://[$${nginx-configuration:ip}]:$${nginx-configuration:port}
return = domain secure_access
......@@ -194,8 +195,24 @@ init =
options['business_model'] = options['slapparameter-dict'].get('business_model') or ''
options['hardware_information'] = options['slapparameter-dict'].get('hardware_information') or ''
[peertube-urlparse]
recipe = slapos.recipe.build
slapparameter-dict = $${slap-configuration:configuration}
url = $${publish-connection-parameter:frontend-url}
init =
from six.moves.urllib.parse import urlparse
url = urlparse(options.get('url'))
if url.port:
options['host'] = '\'[' + url.hostname + '\']'
options['port'] = url.port
else:
options['host'] = url.hostname
options['port'] = 443
[publish-connection-parameter]
recipe = slapos.cookbook:publish
frontend-url = $${frontend:connection-secure_access}
frontend-hostname = $${frontend:connection-domain}
frontend-port = 9000
ipv4-port = 9000
......@@ -51,7 +51,7 @@ http {
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
upstream backend {
server $${instance-parameter:ipv4-random}:$${publish-connection-parameter:frontend-port};
server $${instance-parameter:ipv4-random}:$${publish-connection-parameter:ipv4-port};
}
server {
......
listen:
hostname: '$${instance-parameter:ipv4-random}'
port: $${publish-connection-parameter:frontend-port}
port: $${publish-connection-parameter:ipv4-port}
# Correspond to your reverse proxy server_name/listen configuration (i.e., your public PeerTube instance URL)
webserver:
https: true
hostname: '$${publish-connection-parameter:frontend-hostname}'
port: 443
hostname: '$${peertube-urlparse:host}'
port: $${peertube-urlparse:port}
# Secrets you need to generate the first time you run PeerTube
secrets:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment