refactoring changes from sequpgrade (endReturn, ...) and some modernizations

This commit is contained in:
2023-01-03 15:49:08 +01:00
parent 215135e8aa
commit 3c22d5729f
69 changed files with 553 additions and 654 deletions

View File

@@ -2,24 +2,6 @@
toolName="jitsi-meet"
# Get script working directory
# (when called from a different directory)
WDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >>/dev/null 2>&1 && pwd )"
#CONFIG=0
#CONFIG_FILE_NAME="${toolName}.cfg"
#CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
#step_config() {
#echo "Called once before executing steps."
## e.g. to source a config file manually:
#. "$CONFIG_FILE"
## or to use sequencer api:
#initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
#if [ $? -eq 0 ] ; then
# CONFIG=1
#fi
#}
step_1_info() { echo "Installation of prerequisits"; }
step_1_alias() { echo "prepare"; }
step_1() {
@@ -50,7 +32,7 @@ step_5_info() { echo "Install nginx webserver"; }
step_5_alias() { echo "webserver"; }
step_5() {
exe apt install nginx
endReturn -o $? "Installation of webserver nginx failed"
endReturn "Installation of webserver nginx failed"
exe mkdir -p /etc/nginx/sites-available
exe mkdir -p /etc/nginx/sites-enabled
exe mkdir -p /etc/nginx/modules-enabled
@@ -61,12 +43,12 @@ step_6_info() { echo "Install ufw firewall"; }
step_6_alias() { echo "firewall"; }
step_6() {
exe apt install ufw
endReturn -o $? "Installation of firewall ufw failed"
endReturn "Installation of firewall ufw failed"
}
step_7_info() { echo "Setup ufw firewall to run $toolName"; }
step_7() {
echo " [I] Configure ufw firewall"
info "Configure ufw firewall"
exe ufw allow 22/tcp
exe ufw allow 80/tcp
exe ufw allow 443/tcp
@@ -87,57 +69,61 @@ step_9() {
exe mv /etc/nginx/sites-available/*.conf /etc/nginx/conf.d
exe mv /etc/nginx/conf.d/default.conf /etc/nginx/sites-available
exe service nginx restart
echo " [I] Check /etc/nginx/conf.d for unwanted configurations"
info "Check /etc/nginx/conf.d for unwanted configurations"
}
step_10_info() { echo "WIP post-install tasks"; }
step_10() {
echo " [I] Tasks to be automated"
echo
echo " * Make jitsi installation password protected"
echo " (https://github.com/jitsi/jicofo#secure-domain)"
echo " Creating new rooms will require username and password"
echo
echo " ** /etc/prosody/conf.avail/[your-hostname].cfg.lua"
echo
echo " a) Enable authentication on your main domain:"
echo
echo " VirtualHost \"jitsi-meet.example.com\""
echo " authentication = \"internal_plain\""
echo
echo " b) Add new virtual host with anonymous login method for guests:"
echo
echo " VirtualHost \"guest.jitsi-meet.example.com\""
echo " authentication = \"anonymous\""
echo " c2s_require_encryption = false"
echo
echo " ** /etc/jitsi/meet/[your-hostname]-config.js"
echo
echo " var config = {"
echo " hosts: {"
echo " domain: 'jitsi-meet.example.com',"
echo " anonymousdomain: 'guest.jitsi-meet.example.com',"
echo " ..."
echo " },"
echo " ..."
echo " }"
echo
echo " ** /etc/jitsi/jicofo/sip-communicator.properties"
echo " add new line:"
echo
echo " org.jitsi.jicofo.auth.URL=XMPP:jitsi-meet.example.com"
echo
echo " ** Create prosody user(s):"
echo
echo " prosodyctl register <username> jitsi-meet.example.com <password>"
echo
echo " [I] Use step \"restart\" after these changes"
color green
cat << WIP_END
# Tasks to be automated
* Make jitsi installation password protected
(https://github.com/jitsi/jicofo#secure-domain)
Creating new rooms will require username and password
** /etc/prosody/conf.avail/[your-hostname].cfg.lua
a) Enable authentication on your main domain:
VirtualHost "jitsi-meet.example.com"
authentication = "internal_plain"
b) Add new virtual host with anonymous login method for guests:
VirtualHost "guest.jitsi-meet.example.com"
authentication = "anonymous"
c2s_require_encryption = false
** /etc/jitsi/meet/[your-hostname]-config.js
var config = {
hosts: {
domain: 'jitsi-meet.example.com',
anonymousdomain: 'guest.jitsi-meet.example.com',
...
},
...
}
** /etc/jitsi/jicofo/sip-communicator.properties
add new line:
org.jitsi.jicofo.auth.URL=XMPP:jitsi-meet.example.com
** Create prosody user(s):
prosodyctl register <username> jitsi-meet.example.com <password>
WIP_END
color none
info "Use step \"restart\" after these changes"
}
step_20_info() { echo "Restart all $toolName components"; }
step_20_alias() { echo "restart"; }
step_20() {
echo " [I] Restart jitsi-meet components"
info "Restart jitsi-meet components"
exep "service prosody restart&& service jicofo restart && service jitsi-videobridge2 restart"
}