Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/vm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hansson <github@hanssonit.se>2020-09-07 17:06:19 +0300
committerGitHub <noreply@github.com>2020-09-07 17:06:19 +0300
commit1857c63ec5496c4a2b33d35fa456e9f818a84306 (patch)
tree71d338b540c58dcfb5da64f12170444c578da195
parent20dd9543c3d9dbe0b43e52a76a708e4022d09bd2 (diff)
ask if the domain is correct (#1418)
-rw-r--r--apps/bitwarden-rs.sh10
-rw-r--r--apps/bitwarden_mailconfig.sh12
-rw-r--r--apps/collabora_docker.sh15
-rw-r--r--apps/collabora_integrated.sh9
-rw-r--r--apps/onlyoffice_docker.sh25
-rw-r--r--apps/onlyoffice_integrated.sh9
-rw-r--r--apps/previewgenerator.sh2
-rw-r--r--apps/smbmount.sh14
-rw-r--r--apps/talk.sh2
-rw-r--r--apps/talk_signaling.sh13
-rw-r--r--lets-encrypt/activate-tls.sh2
-rw-r--r--network/ddclient-configuration.sh6
-rw-r--r--network/static_ip.sh10
-rw-r--r--nextcloud-startup-script.sh4
-rw-r--r--static/adduser.sh2
-rw-r--r--static/cookielifetime.sh2
-rw-r--r--static/static_ip.sh10
17 files changed, 101 insertions, 46 deletions
diff --git a/apps/bitwarden-rs.sh b/apps/bitwarden-rs.sh
index 1bcc306d..d29dd3b8 100644
--- a/apps/bitwarden-rs.sh
+++ b/apps/bitwarden-rs.sh
@@ -57,7 +57,15 @@ then
exit
fi
-SUBDOMAIN=$(input_box "Please enter the Domain that you want to use for Bitwarden RS.")
+# Ask for domain
+while :
+do
+ SUBDOMAIN=$(input_box "Please enter the Domain that you want to use for Bitwarden RS.")
+ if yesno_box_yes "Is this correct? $SUBDOMAIN"
+ then
+ break
+ fi
+done
# curl the lib another time to get the correct https_conf
# shellcheck source=lib.sh
diff --git a/apps/bitwarden_mailconfig.sh b/apps/bitwarden_mailconfig.sh
index fa42bbd6..2480aa3e 100644
--- a/apps/bitwarden_mailconfig.sh
+++ b/apps/bitwarden_mailconfig.sh
@@ -56,7 +56,7 @@ then
fi
# Enter mailserver
-while true
+while :
do
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_yes "Is this correct? $MAIL_SERVER"
@@ -68,7 +68,7 @@ do
done
# Enter if you want to use ssl
-while true
+while :
do
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_yes "Is this correct? $PROTOCOL"
@@ -98,7 +98,7 @@ do
done
# Enter Port or just use standard port (defined by usage of ssl)
-while true
+while :
do
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_yes "Is this correct? $SMTP_PORT"
@@ -110,7 +110,7 @@ do
done
# Enter your mail username
-while true
+while :
do
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_yes "Is this correct? $MAIL_USERNAME"
@@ -122,7 +122,7 @@ do
done
# Enter your mailuser password
-while true
+while :
do
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_yes "Is this correct? $MAIL_PASSWORD"
@@ -134,7 +134,7 @@ do
done
# Enter admin mailadresses
-while true
+while :
do
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_yes "Is this correct? $ADMIN_ACCOUNT"
diff --git a/apps/collabora_docker.sh b/apps/collabora_docker.sh
index a70a4a12..e9d76069 100644
--- a/apps/collabora_docker.sh
+++ b/apps/collabora_docker.sh
@@ -42,7 +42,14 @@ then
# If yes, then stop and prune the docker container
docker_prune_this 'collabora/code'
# Revoke LE
- SUBDOMAIN=$(input_box "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com")
+ while :
+ do
+ SUBDOMAIN=$(input_box "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com")
+ if yesno_box_yes "Is this correct? $SUBDOMAIN"
+ then
+ break
+ fi
+ done
if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ]
then
yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem"
@@ -142,10 +149,10 @@ then
occ_command app:remove onlyoffice
fi
-# Ask for the domain for OnlyOffice
-while true
+# Ask for the domain for Collabora
+while :
do
- # OnlyOffice URL (onlyoffice.sh)
+ # Collabora URL
SUBDOMAIN=$(input_box "Collabora 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.")
if yesno_box_yes "Is this correct? $SUBDOMAIN"
then
diff --git a/apps/collabora_integrated.sh b/apps/collabora_integrated.sh
index 1dd4c70e..92d77549 100644
--- a/apps/collabora_integrated.sh
+++ b/apps/collabora_integrated.sh
@@ -46,7 +46,14 @@ then
occ_command app:remove onlyoffice
fi
# Revoke LE
- SUBDOMAIN=$(input_box "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com")
+ while :
+ do
+ SUBDOMAIN=$(input_box "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com")
+ if yesno_box_yes "Is this correct? $SUBDOMAIN"
+ then
+ break
+ fi
+ done
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 7902350e..8189ec36 100644
--- a/apps/onlyoffice_docker.sh
+++ b/apps/onlyoffice_docker.sh
@@ -49,7 +49,14 @@ then
# If yes, then stop and prune the docker container
docker_prune_this 'onlyoffice/documentserver'
# Revoke LE
- SUBDOMAIN=$(input_box "Please enter the subdomain you are using for Onlyoffice Docker, e.g: office.yourdomain.com")
+ while :
+ do
+ SUBDOMAIN=$(input_box "Please enter the subdomain you are using for OnlyOffice, e.g: office.yourdomain.com")
+ if yesno_box_yes "Is this correct? $SUBDOMAIN"
+ then
+ break
+ fi
+ done
if [ -f "$CERTFILES/$SUBDOMAIN/cert.pem" ]
then
yes no | certbot revoke --cert-path "$CERTFILES/$SUBDOMAIN/cert.pem"
@@ -157,9 +164,18 @@ then
fi
fi
-# OnlyOffice URL (onlyoffice.sh)
-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)
+# Ask for the domain for OnlyOffice
+while :
+do
+ # OnlyOffice URL (onlyoffice.sh)
+ 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.")
+ if yesno_box_yes "Is this correct? $SUBDOMAIN"
+ then
+ break
+ fi
+done
+
+# Nextcloud Main Domain
NCDOMAIN=$(occ_command_no_check config:system:get overwrite.cli.url | sed 's|https://||;s|/||')
# shellcheck disable=2034,2059
@@ -318,6 +334,7 @@ then
# Add prune command
add_dockerprune
# Restart Docker
+ print_text_in_color "$ICyan" "Restaring Docker..."
systemctl restart docker.service
docker restart onlyoffice
print_text_in_color "$IGreen" "OnlyOffice Docker is now successfully installed."
diff --git a/apps/onlyoffice_integrated.sh b/apps/onlyoffice_integrated.sh
index f6340cbe..d95f6de2 100644
--- a/apps/onlyoffice_integrated.sh
+++ b/apps/onlyoffice_integrated.sh
@@ -46,7 +46,14 @@ then
occ_command app:remove onlyoffice
fi
# Revoke LE
- SUBDOMAIN=$(input_box "Please enter the subdomain you are using for OnlyOffice, e.g: office.yourdomain.com")
+ while :
+ do
+ SUBDOMAIN=$(input_box "Please enter the subdomain you are using for OnlyOffice, e.g: office.yourdomain.com")
+ if yesno_box_yes "Is this correct? $SUBDOMAIN"
+ then
+ break
+ fi
+ done
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 cae8308b..435e68f2 100644
--- a/apps/previewgenerator.sh
+++ b/apps/previewgenerator.sh
@@ -225,7 +225,7 @@ then
# Pre generate everything
occ_command preview:generate-all
else
- while true
+ while :
do
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}')" ]
diff --git a/apps/smbmount.sh b/apps/smbmount.sh
index 1acaf552..2b0e0682 100644
--- a/apps/smbmount.sh
+++ b/apps/smbmount.sh
@@ -81,7 +81,7 @@ If you really want to mount more, you can simply download the smb-mount script d
fi
# Enter SMB-server and Share-name
-while true
+while :
do
SERVER_SHARE_NAME=$(input_box "Please enter the server and Share-name like this:\n//Server/Share\nor\n//IP-address/Share" "$SUBTITLE")
if ! yesno_box_yes "Is this correct? $SERVER_SHARE_NAME" "$SUBTITLE"
@@ -94,7 +94,7 @@ do
done
# Enter the SMB-user
-while true
+while :
do
SMB_USER=$(input_box "Please enter the username of the SMB-user" "$SUBTITLE")
if ! yesno_box_yes "Is this correct? $SMB_USER" "$SUBTITLE"
@@ -106,7 +106,7 @@ do
done
# Enter the password of the SMB-user
-while true
+while :
do
SMB_PASSWORD=$(input_box "Please enter the password of the SMB-user $SMB_USER." "$SUBTITLE")
if ! yesno_box_yes "Is this correct? $SMB_PASSWORD" "$SUBTITLE"
@@ -371,7 +371,7 @@ case "$choice" in
*"Share"*)
clear
# Enter SMB-server and Share-name
- while true
+ while :
do
SERVER_SHARE_NAME=$(input_box "Please enter the server and Share-name like this:\n//Server/Share\nor\n//IP-address/Share" "$SUBTITLE")
if ! yesno_box_yes "Is this correct? $SERVER_SHARE_NAME" "$SUBTITLE"
@@ -386,7 +386,7 @@ case "$choice" in
*"Username"*)
clear
# Enter the SMB-user
- while true
+ while :
do
SMB_USER=$(input_box "Please enter the username of the SMB-user" "$SUBTITLE")
if ! yesno_box_yes "Is this correct? $SMB_USER" "$SUBTITLE"
@@ -400,7 +400,7 @@ case "$choice" in
*"Password"*)
clear
# Enter the password of the SMB-user
- while true
+ while :
do
SMB_PASSWORD=$(input_box "Please enter the password of the SMB-user $SMB_USER." "$SUBTITLE")
if ! yesno_box_yes "Is this correct? $SMB_PASSWORD" "$SUBTITLE"
@@ -589,7 +589,7 @@ return
}
# Loop main menu until exited
-while true
+while :
do
# Main menu
choice=$(whiptail --title "$TITLE" --menu "This script let you manage SMB-shares to access files from the host-computer or other machines in the local network.\nChoose what you want to do." "$WT_HEIGHT" "$WT_WIDTH" 4 \
diff --git a/apps/talk.sh b/apps/talk.sh
index ef0c4763..dd74cf24 100644
--- a/apps/talk.sh
+++ b/apps/talk.sh
@@ -93,7 +93,7 @@ ${NONO_PORTS[*]}"
if yesno_box_no "Do you want to change port?"
then
- while true
+ while :
do
# Ask for port
TURN_PORT=$(input_box "Please enter the port you will use for Nextcloud Talk")
diff --git a/apps/talk_signaling.sh b/apps/talk_signaling.sh
index 2413c62e..dccc1c78 100644
--- a/apps/talk_signaling.sh
+++ b/apps/talk_signaling.sh
@@ -115,7 +115,7 @@ ${NONO_PORTS[*]}"
if yesno_box_no "Do you want to change port?"
then
- while true
+ while :
do
# Ask for port
TURN_PORT=$(input_box "Please enter the port you will use for Nextcloud Talk")
@@ -221,7 +221,16 @@ then
exit 1
fi
-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.")
+# Ask for the domain for Talk
+while :
+do
+ # Talk Proxy URL
+ 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.")
+ if yesno_box_yes "Is this correct? $SUBDOMAIN"
+ then
+ break
+ fi
+done
# curl the lib another time to get the correct https_conf
# shellcheck source=lib.sh
diff --git a/lets-encrypt/activate-tls.sh b/lets-encrypt/activate-tls.sh
index fad46359..c1dcafa1 100644
--- a/lets-encrypt/activate-tls.sh
+++ b/lets-encrypt/activate-tls.sh
@@ -61,7 +61,7 @@ just type: sudo bash /var/scripts/activate-tls.sh"
exit
fi
-while true
+while :
do
print_text_in_color "$ICyan" "Updating lib.sh..."
# shellcheck disable=2034,2059
diff --git a/network/ddclient-configuration.sh b/network/ddclient-configuration.sh
index 6570a023..08d28af9 100644
--- a/network/ddclient-configuration.sh
+++ b/network/ddclient-configuration.sh
@@ -56,7 +56,7 @@ then
fi
# Enter your Hostname
-while true
+while :
do
HOSTNAME=$(input_box "Please enter the Host that you want to configure DDNS for.\nE.g. 'example.com'")
if ! yesno_box_yes "Is this correct? $HOSTNAME"
@@ -73,7 +73,7 @@ do
done
# Enter your login
-while true
+while :
do
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_yes "Is this correct? $LOGIN"
@@ -90,7 +90,7 @@ do
done
# Enter your password
-while true
+while :
do
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_yes "Is this correct? $PASSWORD"
diff --git a/network/static_ip.sh b/network/static_ip.sh
index f14f3882..fc54ceaf 100644
--- a/network/static_ip.sh
+++ b/network/static_ip.sh
@@ -60,11 +60,11 @@ fi
# Loop until working network settings are validated or the user asks to quit
echo
-while true
+while :
do
# Loop until user is happy with the IP address and subnet
echo
- while true
+ while :
do
# Ask for IP address
LANIP=$(input_box "Please enter the static IP address you want to set, including the subnet.\nExample: 192.168.1.100/24")
@@ -81,7 +81,7 @@ do
# Loop until user is happy with the default gateway
echo
- while true
+ while :
do
# Ask for domain name
GATEWAYIP=$(input_box "Please enter the gateway address you want to set.\nJust hit enter to choose the current gateway.\nYour current gateway is: $GATEWAY")
@@ -122,7 +122,7 @@ $DNS2
then
# Loop until user is happy with the nameserver 1
echo
- while true
+ while :
do
# Ask for nameserver
NSIP1=$(input_box "Please enter the local nameserver address you want to set.\nJust hit enter to choose the current NS1.\nYour current NS1 is: $DNS1")
@@ -146,7 +146,7 @@ $DNS2
# Loop until user is happy with the nameserver 2
echo
- while true
+ while :
do
# Ask for nameserver
NSIP2=$(input_box "Please enter the local nameserver address you want to set. The 3 options are:\n- Hit enter to choose the current NS2.\n- Enter a new IP address for NS2.\n- Enter the text 'none' if you only have one NS.\nYour current NS2 is: $DISPLAY_DNS2")
diff --git a/nextcloud-startup-script.sh b/nextcloud-startup-script.sh
index c65d3085..818e61b7 100644
--- a/nextcloud-startup-script.sh
+++ b/nextcloud-startup-script.sh
@@ -382,7 +382,7 @@ clear
# CLI USER
print_text_in_color "$ICyan" "For better security, change the system user password for [$(getent group sudo | cut -d: -f4 | cut -d, -f1)]"
any_key "Press any key to change password for system user..."
-while true
+while :
do
sudo passwd "$(getent group sudo | cut -d: -f4 | cut -d, -f1)" && break
done
@@ -394,7 +394,7 @@ print_text_in_color "$ICyan" "The current admin user in Nextcloud GUI is [$NCADM
print_text_in_color "$ICyan" "We will now replace this user with your own."
any_key "Press any key to replace the current (local) admin user for Nextcloud..."
# Create new user
-while true
+while :
do
print_text_in_color "$ICyan" "Please enter the username for your new user:"
read -r NEWUSER
diff --git a/static/adduser.sh b/static/adduser.sh
index ccddf8a8..6e7327ab 100644
--- a/static/adduser.sh
+++ b/static/adduser.sh
@@ -31,7 +31,7 @@ The preferred user is 'ncadmin'."
adduser --disabled-password --gecos "" "$NEWUSER"
sudo usermod -aG sudo "$NEWUSER"
usermod -s /bin/bash "$NEWUSER"
- while true
+ while :
do
sudo passwd "$NEWUSER" && break
done
diff --git a/static/cookielifetime.sh b/static/cookielifetime.sh
index b161278b..779ad724 100644
--- a/static/cookielifetime.sh
+++ b/static/cookielifetime.sh
@@ -48,7 +48,7 @@ case "$choice" in
occ_command config:system:set remember_login_cookie_lifetime --value="2419200"
;;
"Custom")
- while true
+ while :
do
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"
diff --git a/static/static_ip.sh b/static/static_ip.sh
index a85b8e34..03b3a3b8 100644
--- a/static/static_ip.sh
+++ b/static/static_ip.sh
@@ -66,11 +66,11 @@ fi
# Loop until working network settings are validated or the user asks to quit
echo
-while true
+while :
do
# Loop until user is happy with the IP address and subnet
echo
- while true
+ while :
do
# Ask for IP address
LANIP=$(input_box "Please enter the static IP address you want to set, including the subnet.\nExample: 192.168.1.100/24")
@@ -87,7 +87,7 @@ do
# Loop until user is happy with the default gateway
echo
- while true
+ while :
do
# Ask for domain name
GATEWAYIP=$(input_box "Please enter the gateway address you want to set.\nJust hit enter to choose the current gateway.\nYour current gateway is: $GATEWAY")
@@ -128,7 +128,7 @@ $DNS2
then
# Loop until user is happy with the nameserver 1
echo
- while true
+ while :
do
# Ask for nameserver
NSIP1=$(input_box "Please enter the local nameserver address you want to set.\nJust hit enter to choose the current NS1.\nYour current NS1 is: $DNS1")
@@ -152,7 +152,7 @@ $DNS2
# Loop until user is happy with the nameserver 2
echo
- while true
+ while :
do
# Ask for nameserver
NSIP2=$(input_box "Please enter the local nameserver address you want to set. The 3 options are:\n- Hit enter to choose the current NS2.\n- Enter a new IP address for NS2.\n- Enter the text 'none' if you only have one NS.\nYour current NS2 is: $DISPLAY_DNS2")