Comment-out streamed crontab entry

This commit is contained in:
pepa65 2022-09-18 21:48:17 +07:00
parent fa8b5aea6f
commit d5443e9eaf
3 changed files with 12 additions and 9 deletions

View File

@ -13,9 +13,10 @@
* Move the `streamupload` directory to a place that is accessible to the web * Move the `streamupload` directory to a place that is accessible to the web
server, like: `mv streamupload /var/www` and `cd` to that place. Now the server, like: `mv streamupload /var/www` and `cd` to that place. Now the
output of `pwd` is the value for `$repopath`. output of `pwd` is the value for `$repopath`.
* Copy `_vars` to `vars` and `_mailhash` to `mailhash` and set the variables * Copy `_vars` to `vars`, `_mailhash` to `mailhash` and `_countdown` to
in `vars` (webserver, SMTP-server) and `mailhash` (usernames, emails and `countdown` and set the variables in `vars` (webserver, SMTP-server),
bcrypt-password-hashes). `mailhash` (usernames, emails and bcrypt-password-hashes) and `countdown`
(if any countdown-files can be used).
* Make a crontab-entry: "* * * * * $repopath/encode" (replace `$repopath`!). * Make a crontab-entry: "* * * * * $repopath/encode" (replace `$repopath`!).
* Install the `mailer` binary by downloading it from the repo at * Install the `mailer` binary by downloading it from the repo at
https://https://github.com/pepa65/mailer/releases/latest and moving it to https://https://github.com/pepa65/mailer/releases/latest and moving it to
@ -39,7 +40,7 @@ Make the config file `/root/Caddyfile` like:
:80 { :80 {
log { log {
output file $weblogfile output file $repopath/web.log
} }
php_fastcgi unix//run/php/php-fpm.sock php_fastcgi unix//run/php/php-fpm.sock
root * $repopath/uploadpage root * $repopath/uploadpage
@ -49,8 +50,7 @@ Make the config file `/root/Caddyfile` like:
* If the server IP has an DNS A record pointing to it, `:80` can be replaced * If the server IP has an DNS A record pointing to it, `:80` can be replaced
by the domainname with the A record, and it will be SSL-encrypted. by the domainname with the A record, and it will be SSL-encrypted.
* Replace `$email` with an email for the SSL-certificates. * Replace `$email` with an email for the SSL-certificates.
* Replace `$weblogfile` with a path for a webserver logfile. * Replace `$repopath` in both places (see above in Install).
* Replace `$repopath` (see above in Install).
* The value of `/run/php/php-fpm.sock` might need to be adjusted, depending * The value of `/run/php/php-fpm.sock` might need to be adjusted, depending
on the system used, it needs to be the unix socket for php. on the system used, it needs to be the unix socket for php.
* Caddy can be started at boottime by including `@reboot /root/Caddy` as a * Caddy can be started at boottime by including `@reboot /root/Caddy` as a
@ -82,7 +82,7 @@ In case of a domainname, replace `8080:80` by `443:443`.
## Usage ## Usage
* Get a streamkey for the target by scheduling a stream * Get a streamkey for the target by scheduling a stream
(supported are: Restream.io, YouTube.com, Facebook.com). (supported are: Restream.io, YouTube.com, Facebook.com).
* Go to the server's URL in the browser: `http://$ipaddress:8080` or to the * Go to the server's URL in the browser: `http://$ipaddress:80` or for docker:
domainname if available: `https://$domainname`. `http://$ipaddress:80` or in case of a domainname: `https://$domainname`.
* Log in with the username and passwors as prepared in `mailhash`. * Log in with the username and passwors as prepared in `mailhash`.
* Fill in the form, and click "Schedule Stream". * Fill in the form, and click "Schedule Stream".

2
_vars
View File

@ -8,7 +8,7 @@ tz='Asia/Bangkok'
# Defaults to ':80' # Defaults to ':80'
interface='' interface=''
# Email for registering SSL-certificate # Email for registering SSL-certificates
sslmail='(valid email)' sslmail='(valid email)'
# Variables for mailer # Variables for mailer

3
stream
View File

@ -23,3 +23,6 @@ set -o pipefail # to get ffmpeg's returncode
ffmpeg -re -y -i "$in" -c:v copy -c:a copy -f flv "$rtmp" |tail -n 20 >"$in.log" && ffmpeg -re -y -i "$in" -c:v copy -c:a copy -f flv "$rtmp" |tail -n 20 >"$in.log" &&
rm "$in.log" "$in" "${in%.mp4}" || rm "$in.log" "$in" "${in%.mp4}" ||
echo "Error while streaming $1" >>"$log" echo "Error while streaming $1" >>"$log"
# In any case, comment-out the crontab entry so it's not waiting for next year
crontab -l| sed "/$1/ s/^/#/" |crontab -