Commit 7668569f authored by Boxiang Sun's avatar Boxiang Sun

Try to configure peertube in slapos

parent 8b67a094
# THIS IS NOT A BUILDOUT FILE, despite purposedly using a compatible syntax.
# The only allowed lines here are (regexes):
# - "^#" comments, copied verbatim
# - "^[" section beginings, copied verbatim
# - lines containing an "=" sign which must fit in the following categorie.
# - "^\s*filename\s*=\s*path\s*$" where "path" is relative to this file
# Copied verbatim.
# - "^\s*hashtype\s*=.*" where "hashtype" is one of the values supported
# by the re-generation script.
# Re-generated.
# - other lines are copied verbatim
# Substitution (${...:...}), extension ([buildout] extends = ...) and
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
[instance-profile]
filename = instance.cfg.in
# md5sum = 483b76d8e6bf72d72a38a3f7bf66fe08
[buildout] [buildout]
parts = parts =
directory publish-connection-parameter
[directory] [peertube-instance]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:service}/$${:_buildout_section_name_}
command-line = sh -c "cd $${directory:versions}; cp -r ${peertube-download:location} ./;
# peertube yarn install --production --pure-lockfile"
# cp peertube-latest/config/default.yaml config/default.yaml
# cp peertube-latest/config/production.yaml.example config/production.yaml
# cp /var/www/peertube/peertube-latest/support/nginx/peertube /etc/nginx/sites-available/peertube
# sed -i 's/${WEBSERVER_HOST}/[peertube-domain]/g' /etc/nginx/sites-available/peertube
# sed -i 's/${PEERTUBE_HOST}/127.0.0.1:9000/g' /etc/nginx/sites-available/peertube
[directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
srv = $${buildout:directory}/srv srv = $${buildout:directory}/srv
var = $${:srv}/var var = $${:srv}/var
...@@ -11,3 +22,32 @@ peertube_directory = ${:www}/peertube ...@@ -11,3 +22,32 @@ peertube_directory = ${:www}/peertube
config = $${:peertube_directory}/config config = $${:peertube_directory}/config
storage = $${:peertube_directory}/storage storage = $${:peertube_directory}/storage
versions = $${:peertube_directory}/versions versions = $${:peertube_directory}/versions
[postgresql-password]
recipe = slapos.cookbook:generate.password
bytes = 24
[postgresql]
recipe = slapos.cookbook:postgres
bin = ${postgresql10:location}/bin/
services = $${directory:service}
dbname = peertube_prod
superuser = peertube
password = $${postgresql-password:passwd}
pgdata-directory = $${directory:srv}/postgresql
ipv4 = $${instance-parameter:ipv4-random}
# disable listening on ipv6
ipv6 =
port = 5432
[postgresql-extension]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:bin}/$${:_buildout_section_name_}
command-line =
$${postgresql:bin}/psql -c "CREATE EXTENSION pg_trgm;" $${postgresql:dbname}
$${postgresql:bin}/psql -c "CREATE EXTENSION unaccent;" $${postgresql:dbname}
[publish-connection-parameter]
recipe = slapos.cookbook:publish
url = $${peertube-instance:url}
...@@ -48,26 +48,22 @@ parts = ...@@ -48,26 +48,22 @@ parts =
git git
wget wget
# peetube sections # peetube sections
# peertube-download peertube-download
postgresql-setup # postgresql-setup
[nodejs] [nodejs]
<= nodejs-16.13.2 <= nodejs-16.13.2
[peertube-download] [peertube-download]
recipe = slapos.recipe.build:download 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} # destination = ${directory:versions}
# md5sum = # md5sum =
[instance-profile] [instance-profile]
# The <= is buildout verb to use defined template
<= jinja-template <= jinja-template
rendered = ${buildout:directory}/instance.cfg rendered = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do extensions = jinja2.ext.do
context = context =
section buildout buildout section buildout buildout
raw template_monitor ${monitor2-template:rendered} raw template_monitor ${monitor2-template:rendered}
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