From edc52b2a1258dcd7a3adeeeea21e7954252bd663 Mon Sep 17 00:00:00 2001 From: szaimen Date: Fri, 4 Sep 2020 09:26:24 +0200 Subject: [PATCH] change all inputboxes to input_box (#1402) Signed-off-by: enoch85 Co-authored-by: enoch85 --- apps/bitwarden-rs.sh | 8 ++++---- apps/bitwarden_mailconfig.sh | 12 ++++++------ apps/collabora_docker.sh | 4 ++-- apps/collabora_integrated.sh | 4 ++-- apps/onlyoffice_docker.sh | 8 ++++---- apps/onlyoffice_integrated.sh | 4 ++-- apps/previewgenerator.sh | 8 ++++---- apps/talk_signaling.sh | 2 +- lib.sh | 6 +++--- network/ddclient-configuration.sh | 6 +++--- static/cookielifetime.sh | 2 +- 11 files changed, 32 insertions(+), 32 deletions(-) diff --git a/apps/bitwarden-rs.sh b/apps/bitwarden-rs.sh index 854364ff..04ecf5b8 100644 --- a/apps/bitwarden-rs.sh +++ b/apps/bitwarden-rs.sh @@ -57,7 +57,7 @@ then exit fi -SUBDOMAIN=$(whiptail --title "T&M Hansson IT - Bitwarden_rs" --inputbox "Please enter the Domain that you want to use for Bitwarden_rs." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) +SUBDOMAIN=$(input_box "Please enter the Domain that you want to use for Bitwarden RS.") # curl the lib another time to get the correct https_conf # shellcheck source=lib.sh @@ -172,7 +172,7 @@ fi # Install docker install_docker -# Create dir for bitwarden_rs +# Create dir for Bitwarden RS mkdir -p /home/bitwarden_rs chown nobody -R /home/bitwarden_rs chmod -R 0770 /home/bitwarden_rs @@ -214,7 +214,7 @@ install_if_not fail2ban systemctl stop fail2ban # Create all needed files -# bitwarden_rs conf +# Bitwarden RS conf cat << BW_CONF > /etc/fail2ban/filter.d/bitwarden_rs.local [INCLUDES] before = common.conf @@ -224,7 +224,7 @@ failregex = ^.*Username or password is incorrect\. Try again\. IP: \. User ignoreregex = BW_CONF -# bitwarden_rs jail +# Bitwarden RS jail cat << BW_JAIL_CONF > /etc/fail2ban/jail.d/bitwarden_rs.local [bitwarden_rs] enabled = true diff --git a/apps/bitwarden_mailconfig.sh b/apps/bitwarden_mailconfig.sh index 851069db..00e7ddf0 100644 --- a/apps/bitwarden_mailconfig.sh +++ b/apps/bitwarden_mailconfig.sh @@ -58,7 +58,7 @@ fi # Enter mailserver while true do - MAIL_SERVER=$(whiptail --inputbox "Please enter the mailserver URL that you want to use.\nE.g. smtp.mail.de\nIf you don't want to change the mailserver, that is already configured inside the global.override.env-file, just leave the box empty." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + MAIL_SERVER=$(input_box "Please enter the mailserver URL that you want to use.\nE.g. smtp.mail.de\nIf you don't want to change the mailserver, that is already configured inside the global.override.env-file, just leave the box empty.") if ! yesno_box "Is this correct? $MAIL_SERVER" then msg_box "OK, please try again." @@ -70,7 +70,7 @@ done # Enter if you want to use ssl while true do - PROTOCOL=$(whiptail --inputbox "Please type in the encryption protocol for your mailserver.\nThe available options are 'SSL', 'STARTTLS' or 'none'.\n\nIf you don't want to change the protocol setting, that are already configured inside the global.override.env-file, just leave the box empty." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + PROTOCOL=$(input_box "Please type in the encryption protocol for your mailserver.\nThe available options are 'SSL', 'STARTTLS' or 'none'.\n\nIf you don't want to change the protocol setting, that are already configured inside the global.override.env-file, just leave the box empty.") if ! yesno_box "Is this correct? $PROTOCOL" then msg_box "OK, please try again." @@ -100,7 +100,7 @@ done # Enter Port or just use standard port (defined by usage of ssl) while true do - SMTP_PORT=$(whiptail --inputbox "Please enter the port for your mailserver. The default port based on your protocol setting is $DEFAULT_PORT?\nPlease type that port into the inputbox, if you want to use it.\n\nIf you don't want to change the port, that is already configured inside the global.override.env-file, just leave the box empty." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + SMTP_PORT=$(input_box "Please enter the port for your mailserver. The default port based on your protocol setting is $DEFAULT_PORT?\nPlease type that port into the inputbox, if you want to use it.\n\nIf you don't want to change the port, that is already configured inside the global.override.env-file, just leave the box empty.") if ! yesno_box "Is this correct? $SMTP_PORT" then msg_box "OK, please try again." @@ -112,7 +112,7 @@ done # Enter your mail username while true do - MAIL_USERNAME=$(whiptail --inputbox "Please enter the username for the login to your mail provider. E.g. mail@example.com\nPlease note: the domain used for your mail username and the mailserver domain have to match!\nIf you don't want to change the mail username that is already configured inside the global.override.env-file, just leave the box empty." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + MAIL_USERNAME=$(input_box "Please enter the username for the login to your mail provider. E.g. mail@example.com\nPlease note: the domain used for your mail username and the mailserver domain have to match!\nIf you don't want to change the mail username that is already configured inside the global.override.env-file, just leave the box empty.") if ! yesno_box "Is this correct? $MAIL_USERNAME" then msg_box "OK, please try again." @@ -124,7 +124,7 @@ done # Enter your mailuser password while true do - MAIL_PASSWORD=$(whiptail --inputbox "Please enter the password for your mailserver user.\nIf you don't want to change the password, that is already configured inside the global.override.env-file, just leave the box empty." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + MAIL_PASSWORD=$(input_box "Please enter the password for your mailserver user.\nIf you don't want to change the password, that is already configured inside the global.override.env-file, just leave the box empty.") if ! yesno_box "Is this correct? $MAIL_PASSWORD" then msg_box "OK, please try again." @@ -136,7 +136,7 @@ done # Enter admin mailadresses while true do - ADMIN_ACCOUNT=$(whiptail --inputbox "Please enter mailaccounts, that should have access to the Bitwarden admin-panel, reachable under https://your-bitwarden-domain/admin/.\nThey don't have to be registered Bitwarden accounts.\nTo make this setting work, your Bitwarden mailserver settings have to be correct.\nYou can enter just one e-mailaddress or enter more than one like so:\n'bitwarden@example.com,bitwarden2@example1.com,bitwarden3@example2.com'\nIf you want to keep the admin accounts that are already configured inside the global.override.env-file, just leave the box empty." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + ADMIN_ACCOUNT=$(input_box "Please enter mailaccounts, that should have access to the Bitwarden admin-panel, reachable under https://your-bitwarden-domain/admin/.\nThey don't have to be registered Bitwarden accounts.\nTo make this setting work, your Bitwarden mailserver settings have to be correct.\nYou can enter just one e-mailaddress or enter more than one like so:\n'bitwarden@example.com,bitwarden2@example1.com,bitwarden3@example2.com'\nIf you want to keep the admin accounts that are already configured inside the global.override.env-file, just leave the box empty.") if ! yesno_box "Is this correct? $ADMIN_ACCOUNT" then msg_box "OK, please try again." diff --git a/apps/collabora_docker.sh b/apps/collabora_docker.sh index 192c0341..20a209a7 100644 --- a/apps/collabora_docker.sh +++ b/apps/collabora_docker.sh @@ -42,7 +42,7 @@ then # If yes, then stop and prune the docker container docker_prune_this 'collabora/code' # Revoke LE - SUBDOMAIN=$(whiptail --title "T&M Hansson IT - Collabora" --inputbox "Please enter the subdomain you are using for Collabora, eg: office.yourdomain.com" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + SUBDOMAIN=$(input_box "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com") if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] then yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" @@ -99,7 +99,7 @@ if does_this_docker_exist 'onlyoffice/documentserver' then docker_prune_this 'onlyoffice/documentserver' # Revoke LE - SUBDOMAIN=$(whiptail --title "T&M Hansson IT - Collabora" --inputbox "Please enter the subdomain you are using for OnlyOffice, eg: office.yourdomain.com" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + SUBDOMAIN=$(input_box "Please enter the subdomain you are using for OnlyOffice, e.g: office.yourdomain.com") if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] then yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" diff --git a/apps/collabora_integrated.sh b/apps/collabora_integrated.sh index 79dd940c..b04246f4 100644 --- a/apps/collabora_integrated.sh +++ b/apps/collabora_integrated.sh @@ -46,7 +46,7 @@ then occ_command app:remove onlyoffice fi # Revoke LE - SUBDOMAIN=$(whiptail --title "T&M Hansson IT - Collabora" --inputbox "Please enter the subdomain you are using for Collabora, eg: office.yourdomain.com" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + SUBDOMAIN=$(input_box "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com") if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] then yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" @@ -111,7 +111,7 @@ then # Remove docker image docker_prune_this 'onlyoffice/documentserver' # Revoke LE - SUBDOMAIN=$(whiptail --title "T&M Hansson IT - Collabora" --inputbox "Please enter the subdomain you are using for Onlyoffice, eg: office.yourdomain.com" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + SUBDOMAIN=$(input_box "Please enter the subdomain you are using for Onlyoffice, e.g: office.yourdomain.com") if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] then yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" diff --git a/apps/onlyoffice_docker.sh b/apps/onlyoffice_docker.sh index 27e90282..06134265 100644 --- a/apps/onlyoffice_docker.sh +++ b/apps/onlyoffice_docker.sh @@ -49,7 +49,7 @@ then # If yes, then stop and prune the docker container docker_prune_this 'onlyoffice/documentserver' # Revoke LE - SUBDOMAIN=$(whiptail --title "T&M Hansson IT - Onlyoffice Docker" --inputbox "Please enter the subdomain you are using for Onlyoffice Docker, eg: office.yourdomain.com" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + SUBDOMAIN=$(input_box "Please enter the subdomain you are using for Onlyoffice Docker, e.g: office.yourdomain.com") if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] then yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" @@ -107,7 +107,7 @@ then # Remove docker image docker_prune_this 'collabora/code' # Revoke LE - SUBDOMAIN=$(whiptail --title "T&M Hansson IT - OnlyOffice Docker" --inputbox "Please enter the subdomain you are using for Collabora, eg: office.yourdomain.com" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + SUBDOMAIN=$(input_box "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com") if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] then yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" @@ -158,9 +158,9 @@ then fi # OnlyOffice URL (onlyoffice.sh) -SUBDOMAIN=$(whiptail --title "T&M Hansson IT - OnlyOffice Docker" --inputbox "OnlyOffice subdomain eg: office.yourdomain.com\n\nNOTE: This domain must be different than your Nextcloud domain. They can however be hosted on the same server, but would require seperate DNS entries." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) +SUBDOMAIN=$(input_box "OnlyOffice subdomain e.g: office.yourdomain.com\n\nNOTE: This domain must be different than your Nextcloud domain. They can however be hosted on the same server, but would require seperate DNS entries.") # Nextcloud Main Domain (onlyoffice.sh) -NCDOMAIN=$(whiptail --title "T&M Hansson IT - OnlyOffice Docker" --inputbox "Nextcloud domain, make sure it looks like this: cloud\\.yourdomain\\.com" "$WT_HEIGHT" "$WT_WIDTH" cloud\\.yourdomain\\.com 3>&1 1>&2 2>&3) +NCDOMAIN=$(input_box "Nextcloud domain, make sure it looks like this: cloud\\.yourdomain\\.com") # shellcheck disable=2034,2059 true diff --git a/apps/onlyoffice_integrated.sh b/apps/onlyoffice_integrated.sh index 98402683..46a78196 100644 --- a/apps/onlyoffice_integrated.sh +++ b/apps/onlyoffice_integrated.sh @@ -46,7 +46,7 @@ then occ_command app:remove onlyoffice fi # Revoke LE - SUBDOMAIN=$(whiptail --title "T&M Hansson IT - OnlyOffice" --inputbox "Please enter the subdomain you are using for OnlyOffice, eg: office.yourdomain.com" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + SUBDOMAIN=$(input_box "Please enter the subdomain you are using for OnlyOffice, e.g: office.yourdomain.com") if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] then yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" @@ -127,7 +127,7 @@ then # Remove docker image docker_prune_this 'collabora/code' # Revoke LE - SUBDOMAIN=$(whiptail --title "T&M Hansson IT - OnlyOffice" --inputbox "Please enter the subdomain you are using for Collabora, eg: office.yourdomain.com" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + SUBDOMAIN=$(input_box "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com") if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ] then yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem" diff --git a/apps/previewgenerator.sh b/apps/previewgenerator.sh index af2c41fe..98eabf27 100644 --- a/apps/previewgenerator.sh +++ b/apps/previewgenerator.sh @@ -59,7 +59,7 @@ then occ_command config:system:delete "enabledPreviewProviders" # reset the cronjob - print_text_in_color "$ICyan" "Resetting the cronjob for the preview-generation" + print_text_in_color "$ICyan" "Resetting the cronjob for the Preview Generation" crontab -u www-data -l | grep -v 'preview:pre-generate' | crontab -u www-data - else exit @@ -209,9 +209,9 @@ occ_command config:system:set preview_max_y --value="2048" occ_command config:system:set jpeg_quality --value="60" occ_command config:app:set preview jpeg_quality --value="60" -msg_box "In the last step you can define a specific Nextcloud user for which will be the user that runs the preview-generation. +msg_box "In the last step you can define a specific Nextcloud user for which will be the user that runs the Preview Generation. -The default behaviour (just hit [ENTER]) is to run with the system user 'www-data' which will generate previews for all users. +The default behaviour (just hit [ENTER]) is to run with the system user 'www-data' which will generate previews for all users. If you on the other hand choose to use a specific user, previews will ONLY be generated for that specific user." if ! yesno_box "Do you want to choose a specific Nextcloud user to generate previews?" @@ -227,7 +227,7 @@ then else while true do - PREVIEW_USER=$(whiptail --inputbox "Enter the Nextcloud user for which you want to run the preview-generation" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + PREVIEW_USER=$(input_box "Enter the Nextcloud user for which you want to run the Preview Generation (as a scheluded task)") if [ -z "$(occ_command user:list | grep "$PREVIEW_USER" | awk '{print $3}')" ] then msg_box "It seems like the user you entered ($PREVIEW_USER) doesn't exist, please try again." diff --git a/apps/talk_signaling.sh b/apps/talk_signaling.sh index 6efb7bb1..eb6471da 100644 --- a/apps/talk_signaling.sh +++ b/apps/talk_signaling.sh @@ -228,7 +228,7 @@ then exit 1 fi -SUBDOMAIN=$(whiptail --title "T&M Hansson IT - Talk Signaling Server" --inputbox "Talk Signaling Server subdomain eg: talk.yourdomain.com\n\nNOTE: This domain must be different than your Nextcloud domain. They can however be hosted on the same server, but would require seperate DNS entries." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) +SUBDOMAIN=$(input_box "Talk Signaling Server subdomain e.g: talk.yourdomain.com\n\nNOTE: This domain must be different than your Nextcloud domain. They can however be hosted on the same server, but would require seperate DNS entries.") # curl the lib another time to get the correct https_conf # shellcheck source=lib.sh diff --git a/lib.sh b/lib.sh index 7fea36c5..3ef7a548 100644 --- a/lib.sh +++ b/lib.sh @@ -117,11 +117,11 @@ AUT_UPDATES_TIME="18" # Keys OpenPGP_fingerprint='28806A878AE423A28372792ED75899B9A724937A' # Collabora Docker URL (collabora.sh -[ -n "$COLLABORA_INSTALL" ] && SUBDOMAIN=$(whiptail --title "T&M Hansson IT - Collabora" --inputbox "Collabora subdomain eg: office.yourdomain.com\n\nNOTE: This domain must be different than your Nextcloud domain. They can however be hosted on the same server, but would require seperate DNS entries." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) +[ -n "$COLLABORA_INSTALL" ] && SUBDOMAIN=$(input_box "Collabora subdomain eg: office.yourdomain.com\n\nNOTE: This domain must be different than your Nextcloud domain. They can however be hosted on the same server, but would require seperate DNS entries.") # Nextcloud Main Domain (collabora.sh) -[ -n "$COLLABORA_INSTALL" ] && NCDOMAIN=$(whiptail --title "T&M Hansson IT - Collabora" --inputbox "Nextcloud domain, make sure it looks like this: cloud\\.yourdomain\\.com" "$WT_HEIGHT" "$WT_WIDTH" cloud\\.yourdomain\\.com 3>&1 1>&2 2>&3) +[ -n "$COLLABORA_INSTALL" ] && NCDOMAIN=$(input_box "Nextcloud domain, make sure it looks like this: cloud\\.yourdomain\\.com") # Nextcloud Main Domain (activate-tls.sh) -[ -n "$TLS_INSTALL" ] && TLSDOMAIN=$(whiptail --title "T&M Hansson IT - Let's Encrypt" --inputbox "Please enter the domain name you will use for Nextcloud.\n\nMake sure it looks like this:\nyourdomain.com, or cloud.yourdomain.com" "$WT_HEIGHT" "$WT_WIDTH" cloud.yourdomain.com 3>&1 1>&2 2>&3) +[ -n "$TLS_INSTALL" ] && TLSDOMAIN=$(input_box "Please enter the domain name you will use for Nextcloud.\n\nMake sure it looks like this:\nyourdomain.com, or cloud.yourdomain.com") # Letsencrypt SITES_AVAILABLE="/etc/apache2/sites-available" LETSENCRYPTPATH="/etc/letsencrypt" diff --git a/network/ddclient-configuration.sh b/network/ddclient-configuration.sh index d1f9fa40..56feaf77 100644 --- a/network/ddclient-configuration.sh +++ b/network/ddclient-configuration.sh @@ -58,7 +58,7 @@ fi # Enter your Hostname while true do - HOSTNAME=$(whiptail --inputbox "Please enter the Host that you want to configure DDNS for.\nE.g. 'example.com'" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + HOSTNAME=$(input_box "Please enter the Host that you want to configure DDNS for.\nE.g. 'example.com'") if ! yesno_box "Is this correct? $HOSTNAME" then msg_box "OK, please try again." @@ -75,7 +75,7 @@ done # Enter your login while true do - LOGIN=$(whiptail --inputbox "Please enter the login for your DDNS provider.\nIt will be most likely the domain or registered email address depending on your DDNS Provider.\nE.g. 'example.com' or 'mail@example.com'\nIf you are not sure, please refer to the documentation of your DDNS provider." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + LOGIN=$(input_box "Please enter the login for your DDNS provider.\nIt will be most likely the domain or registered email address depending on your DDNS Provider.\nE.g. 'example.com' or 'mail@example.com'\nIf you are not sure, please refer to the documentation of your DDNS provider.") if ! yesno_box "Is this correct? $LOGIN" then msg_box "OK, please try again." @@ -92,7 +92,7 @@ done # Enter your password while true do - PASSWORD=$(whiptail --inputbox "Please enter the password or api-key that you've got for DynDNS from your DDNS provider.\nIf you are not sure, please refer to the documentation of your DDNS provider." "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3) + PASSWORD=$(input_box "Please enter the password or api-key that you've got for DynDNS from your DDNS provider.\nIf you are not sure, please refer to the documentation of your DDNS provider.") if ! yesno_box "Is this correct? $PASSWORD" then msg_box "OK, please try again." diff --git a/static/cookielifetime.sh b/static/cookielifetime.sh index b4ad7ea8..a76e90bf 100644 --- a/static/cookielifetime.sh +++ b/static/cookielifetime.sh @@ -50,7 +50,7 @@ case "$choice" in "Custom") while true do - COOKIE_LIFETIME=$(whiptail --inputbox "Configure the logout time (in seconds) which will forcefully logout the Nextcloud user from the web browser when the timeout is reached.\n\nPlease enter the Cookie Lifetime in seconds, so e.g. 1800 for 30 minutes or 3600 for 1 hour\n\n You can not set a value below 30 minutes (1800 seconds)." "$WT_HEIGHT" "$WT_WIDTH" 1800 3>&1 1>&2 2>&3) + COOKIE_LIFETIME=$(input_box "Configure the logout time (in seconds) which will forcefully logout the Nextcloud user from the web browser when the timeout is reached.\n\nPlease enter the Cookie Lifetime in seconds, so e.g. 1800 for 30 minutes or 3600 for 1 hour\n\n You can not set a value below 30 minutes (1800 seconds).") if ! check_if_number "$COOKIE_LIFETIME" then msg_box "The value you entered doesn't seem to be a number between 0-9, please enter a valid number."