From 042ac1ff7139f6e3abd7212a243900a3054e6848 Mon Sep 17 00:00:00 2001 From: "gitlab.com/pepa65" Date: Sun, 4 Sep 2022 21:33:12 +0700 Subject: [PATCH] vars --- .gitignore | 2 +- README.md | 2 +- _mailvars | 6 ------ _vars | 23 +++++++++++++++++++++++ encode | 3 ++- 5 files changed, 27 insertions(+), 9 deletions(-) delete mode 100644 _mailvars create mode 100644 _vars diff --git a/.gitignore b/.gitignore index 0c3d87c..558e183 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -mailvars +vars process.log uploadpage/streams/* diff --git a/README.md b/README.md index 5033331..e031ea0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ systems: `apt install git php-fpm ffmpeg`). * Clone repo: `git clone https://gitlab.com/pepa65/streamupload`. * `cd streamupload`. Now the output of `pwd` is the value for `$repopath`. -* Copy `_mailvars` to `mailvars` and set the variables +* Copy `_vars` to `vars` and set the variables `to`, `user`, `password`, `smtp` and `port` in it in order to receive mail notifications when the encodes are finished. * Make a crontab-entry: "* * * * * $repopath/encode" (replace `$repopath`!). diff --git a/_mailvars b/_mailvars deleted file mode 100644 index 5377853..0000000 --- a/_mailvars +++ /dev/null @@ -1,6 +0,0 @@ -# Variables for mailer -to='' -user='' -password='' -smtp='' -port='' diff --git a/_vars b/_vars new file mode 100644 index 0000000..2a6e9a7 --- /dev/null +++ b/_vars @@ -0,0 +1,23 @@ +## Variables for the install script +# All have to be filled in, except if they have a default + +# Interface for serving the page: ':80' or 'domain.name' +# Defaults to ':80' +interface='' + +# Timezone for local user +tz='UTC' + +# Usersnames/passwords (multiple pairs allowed) +# Defaults to none (no authentication required) +declare -A userpw +userpw['password1']='xxxxxxxxxx' + +# Variables for mailer +to='(recipient of notifications)' +user='(smtp login)' +password='(smtp password)' +# Defaults to 'mail.gmail.com' +smtp='' +# Defaults to: '587' +port='' diff --git a/encode b/encode index 73dcf98..ace5a5b 100755 --- a/encode +++ b/encode @@ -18,10 +18,11 @@ Log(){ # 1:message 2:returncode(empty: no exit) I:file } Mail(){ # 1:kind(0:done, 1:wrong type, 2:encoding error) 2:logline I:repopath,email,name,type,start,finish - source "$repopath/mailvars" # I:to,user,password,smtp,port + source "$repopath/vars" # I:to,user,password,smtp,port local sbj msg from="Stream Upload server" # Strip the '_' if email set [[ $email ]] && to=${email:1} + [[ $port ]] || port=587 sbj[0]="Stream Upload encoding done for ${name##*@}" sbj[1]="Stream Upload file wrong type: $type" sbj[2]="Stream Upload error encoding"