42 lines
819 B
Text
42 lines
819 B
Text
|
#!/bin/sh
|
||
|
set -eu
|
||
|
|
||
|
group=www-data
|
||
|
config_file='/etc/peertube/production.yaml'
|
||
|
|
||
|
if grep '@@SECRET_KEY@@' "$config_file" >/dev/null; then
|
||
|
echo "* Generating random secret in $config_file" >&2
|
||
|
|
||
|
secret_key="$(openssl rand -hex 32)"
|
||
|
sed -i "s|@@SECRET_KEY@@|$secret_key|" "$config_file"
|
||
|
fi
|
||
|
|
||
|
if [ "${0##*.}" = 'post-upgrade' ]; then
|
||
|
cat >&2 <<-EOF
|
||
|
*
|
||
|
* To finish Peertube upgrade run:
|
||
|
*
|
||
|
*
|
||
|
EOF
|
||
|
else
|
||
|
cat >&2 <<-EOF
|
||
|
*
|
||
|
* 1. Adjust settings in /etc/peertube/production.yaml
|
||
|
*
|
||
|
* 2. Create database for Peertube:
|
||
|
*
|
||
|
* psql -c "CREATE ROLE peertube PASSWORD 'top-secret' INHERIT LOGIN;"
|
||
|
* psql -c "CREATE DATABASE peertube OWNER peertube ENCODING 'UTF-8';"
|
||
|
*
|
||
|
* 3. Start Peertube
|
||
|
*
|
||
|
* service peertube start
|
||
|
*
|
||
|
* 4. Create admin user
|
||
|
*
|
||
|
* peertube-manage reset-password -- -u root
|
||
|
*
|
||
|
EOF
|
||
|
fi
|
||
|
|