From 1069d3a4dc322da05866f17755b2d2ecc99fcfe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Niel?= Date: Mon, 19 Mar 2018 22:06:21 +0100 Subject: [PATCH 1/3] Update shebang and date to POSIX format for working on FreeBSD (not tested on Linux) --- scripts/upgrade.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 9baf50932..a0abe7ea6 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash # Strict mode set -e # Backup database -SQL_BACKUP_PATH="/var/www/peertube/backup/sql-peertube_prod-$(date -Im).bak" +SQL_BACKUP_PATH="/var/www/peertube/backup/sql-peertube_prod-$(date +\"%Y%m%d-%h%m\").bak" mkdir -p /var/www/peertube/backup pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH" From f8087a5476ecb4659949794b5c5978481c991cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Niel?= Date: Mon, 19 Mar 2018 22:13:29 +0100 Subject: [PATCH 2/3] Update shebang and date format for working on FreeBSD (fix typo) (not tested on Linux) --- scripts/upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index a0abe7ea6..bd90ce560 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -4,7 +4,7 @@ set -e # Backup database -SQL_BACKUP_PATH="/var/www/peertube/backup/sql-peertube_prod-$(date +\"%Y%m%d-%h%m\").bak" +SQL_BACKUP_PATH="/var/www/peertube/backup/sql-peertube_prod-$(date +\"%Y%m%d-%H%M\").bak" mkdir -p /var/www/peertube/backup pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH" From 6d55bd21a929eb5558dc1dfc3ae6857136496355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Niel?= Date: Mon, 19 Mar 2018 22:48:15 +0100 Subject: [PATCH 3/3] Add FreeBSD startup --- support/doc/production.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/support/doc/production.md b/support/doc/production.md index db0c8d99f..5c21ab772 100644 --- a/support/doc/production.md +++ b/support/doc/production.md @@ -143,6 +143,22 @@ $ sudo systemctl start peertube $ sudo journalctl -feu peertube ``` +### FreeBSD + +Copy the startup script and update rc.conf: + +``` +$ sudo cp /var/www/peertube/peertube-latest/support/freebsd/peertube /usr/local/etc/rc.d/ +$ sudo chmod +x /usr/local/etc/rc.d/peertube +$ sudo echo peertube_enable="YES" >> /etc/rc.conf +``` + +#### Run + +``` +$ sudo service peertube start +``` + ### Administrator The administrator password is automatically generated and can be found in the