Commit 227b3a70 authored by Boxiang Sun's avatar Boxiang Sun

software/peertube: fixup

parent 74c1df9a
...@@ -3,7 +3,8 @@ extends = ...@@ -3,7 +3,8 @@ extends =
${monitor-template:output} ${monitor-template:output}
parts = parts =
peertube-instance postgresql
postgresql-extension
nginx-service nginx-service
nginx-listen-promise nginx-listen-promise
...@@ -30,8 +31,8 @@ ssl = $${:etc}/ssl ...@@ -30,8 +31,8 @@ ssl = $${:etc}/ssl
[peertube-instance] [peertube-instance]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_} wrapper-path = $${directory:services}/$${:_buildout_section_name_}
command-line = cd $${directory:versions} && cp -r ${peertube-download:location} ./ command-line = echo "Hello!"
# echo "Hello!" # Change config/production.yaml
# ehco $${directory:versions} # ehco $${directory:versions}
environment = environment =
PATH=${unzip:location}/bin:${vim:location}/bin:${nodejs:location}/bin:${yarn:location}/bin:${python3:location}/bin:${nginx:location}/sbin:${postgresql:location}/sbin:${gcc-10.2:location}/bin:${redis:location}/bin:{git:location}/bin:{wget:location}/bin:%(PATH)s PATH=${unzip:location}/bin:${vim:location}/bin:${nodejs:location}/bin:${yarn:location}/bin:${python3:location}/bin:${nginx:location}/sbin:${postgresql:location}/sbin:${gcc-10.2:location}/bin:${redis:location}/bin:{git:location}/bin:{wget:location}/bin:%(PATH)s
...@@ -40,7 +41,6 @@ environment = ...@@ -40,7 +41,6 @@ environment =
[postgresql-password] [postgresql-password]
recipe = slapos.cookbook:generate.password recipe = slapos.cookbook:generate.password
bytes = 24
[postgresql] [postgresql]
recipe = slapos.cookbook:postgres recipe = slapos.cookbook:postgres
...@@ -63,6 +63,11 @@ command-line = ...@@ -63,6 +63,11 @@ command-line =
$${postgresql:bin}/psql -c "CREATE EXTENSION pg_trgm;" $${postgresql:dbname} $${postgresql:bin}/psql -c "CREATE EXTENSION pg_trgm;" $${postgresql:dbname}
$${postgresql:bin}/psql -c "CREATE EXTENSION unaccent;" $${postgresql:dbname} $${postgresql:bin}/psql -c "CREATE EXTENSION unaccent;" $${postgresql:dbname}
[service-postgresql]
recipe = slapos.cookbook:postgres
bin = {{ postgresql_location }}/bin
services= ${directory:service}
################################# #################################
# Nginx service # Nginx service
################################# #################################
...@@ -75,10 +80,11 @@ virtual-depends = ...@@ -75,10 +80,11 @@ virtual-depends =
[nginx-listen-promise] [nginx-listen-promise]
<= monitor-promise-base <= monitor-promise-base
promise = check_socket_listening promise = check_url_available
name = nginx_listen.py name = nginx_listen.py
config-host = $${nginx-configuration:ip} config-host = [$${nginx-configuration:ip}]
config-port = $${nginx-configuration:port} config-port = $${nginx-configuration:port}
config-url = https://$${:config-host}/$${:config-port}
[nginx-configuration] [nginx-configuration]
recipe = slapos.recipe.template recipe = slapos.recipe.template
...@@ -86,12 +92,24 @@ url = ${template-nginx-configuration:output} ...@@ -86,12 +92,24 @@ url = ${template-nginx-configuration:output}
output = $${directory:etc}/nginx.cfg output = $${directory:etc}/nginx.cfg
access_log = $${directory:log}/nginx-access.log access_log = $${directory:log}/nginx-access.log
error_log = $${directory:log}/nginx-error.log error_log = $${directory:log}/nginx-error.log
ip = {{ partition_ipv6 }} ip = $${instance-parameter:ipv6-random}
port = 9443 port = 9443
ssl_key = $${directory:ssl}/nginx.key ssl_key = $${directory:ssl}/nginx.key
ssl_csr = $${directory:ssl}/nginx.csr ssl_csr = $${directory:ssl}/nginx.csr
ssl_crt = $${directory:ssl}/nginx.crt ssl_crt = $${directory:ssl}/nginx.crt
#################################
# SlapOS service
#################################
[instance-parameter]
recipe = slapos.cookbook:slapconfiguration
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
configuration._ = {}
[publish-connection-parameter] [publish-connection-parameter]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
url = $${peertube-instance:url} # url = $${peertube-instance:url}
...@@ -50,19 +50,31 @@ parts = ...@@ -50,19 +50,31 @@ parts =
git git
wget wget
# peetube sections # peetube sections
peertube-download peertube
peertube-build
instance-profile instance-profile
# postgresql-setup # postgresql-setup
[nodejs] [nodejs]
<= nodejs-16.13.2 <= nodejs-16.13.2
[peertube-download] [peertube]
recipe = slapos.recipe.build:download-unpacked recipe = slapos.recipe.build:download-unpacked
url = https://github.com/Chocobozzz/PeerTube/releases/download/v4.2.2/peertube-v4.2.2.zip url = https://github.com/Chocobozzz/PeerTube/releases/download/v4.2.2/peertube-v4.2.2.zip
# destination = ${directory:versions}
# md5sum = # md5sum =
[peertube-build]
recipe = slapos.recipe.cmmi
path = ${peertube:location}
environment =
PATH=${unzip:location}/bin:${vim:location}/bin:${nodejs:location}/bin:${yarn:location}/bin:${python3:location}/bin:${nginx:location}/sbin:${postgresql:location}/sbin:${gcc-10.2:location}/bin:${redis:location}/bin:{git:location}/bin:{wget:location}/bin:%(PATH)s
CPPFLAGS=-I${openssl:location}/include
LDFLAGS=-L${curl:location}/lib -Wl,-rpath -Wl,${openssl:location}/lib -Wl,-rpath -Wl
pre-configure =
${yarn:location}/bin/yarn install --production --pure-lockfile
configure-command = true
make-binary = cd %(location)s && ${yarn:location}/bin/yarn
[instance-profile] [instance-profile]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
......
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