Skip to content

Commit

Permalink
fixin and trixin
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
  • Loading branch information
enoch85 committed Apr 11, 2024
1 parent 0ce37fa commit 4601e1f
Show file tree
Hide file tree
Showing 29 changed files with 71 additions and 71 deletions.
4 changes: 2 additions & 2 deletions addons/deSEC/desec.sh
Expand Up @@ -140,9 +140,9 @@ then
# Add DNS renewals with the deSEC hoock script
print_text_in_color "$ICyan" "Preparing for DNS-renewals..."
mkdir -p "$SCRIPTS"/deSEC
curl_to_dir "https://raw.githubusercontent.com/nextcloud/vm/master/addons/deSEC" "hook.sh" "$SCRIPTS"/deSEC
curl_to_dir "https://raw.githubusercontent.com/nextcloud/vm/24.04-LTS/addons/deSEC" "hook.sh" "$SCRIPTS"/deSEC
chmod +x "$SCRIPTS"/deSEC/hook.sh
curl_to_dir "https://raw.githubusercontent.com/nextcloud/vm/master/addons/deSEC" ".dedynauth" "$SCRIPTS"/deSEC
curl_to_dir "https://raw.githubusercontent.com/nextcloud/vm/24.04-LTS/addons/deSEC" ".dedynauth" "$SCRIPTS"/deSEC
check_command sed -i "s|DEDYN_TOKEN=.*|DEDYN_TOKEN=$DEDYNAUTHTOKEN|g" "$SCRIPTS"/deSEC/.dedynauth
check_command sed -i "s|DEDYN_NAME=.*|DEDYN_NAME=$DEDYNDOMAIN|g" "$SCRIPTS"/deSEC/.dedynauth
msg_box "DNS updates for deSEC are now set. This means you don't have to open any ports (80|443) for the renewal process since deSEC TLS renewals will be run with a built in hook. \
Expand Down
4 changes: 2 additions & 2 deletions addons/redis-server-ubuntu.sh
Expand Up @@ -16,9 +16,9 @@ debug_mode
root_check

# Check Ubuntu version
if ! version 18.04 "$DISTRO" 22.04.10
if ! version 18.04 "$DISTRO" 24.04.10
then
msg_box "Your current Ubuntu version is $DISTRO but must be between 18.04 - 22.04.10 to run this script."
msg_box "Your current Ubuntu version is $DISTRO but must be between 18.04 - 24.04.10 to run this script."
msg_box "Please contact us to get support for upgrading your server:
https://www.hanssonit.se/#contact
https://shop.hanssonit.se/"
Expand Down
4 changes: 2 additions & 2 deletions apps/adminer.sh
Expand Up @@ -56,8 +56,8 @@ curl_to_dir "http://www.adminer.org" "latest.php" "$ADMINERDIR"
curl_to_dir "https://raw.githubusercontent.com/Niyko/Hydra-Dark-Theme-for-Adminer/master" "adminer.css" "$ADMINERDIR"
ln -s "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php

# Only add TLS 1.3 on Ubuntu later than 20.04
if version 20.04 "$DISTRO" 22.04.10
# Only add TLS 1.3 on Ubuntu later than 22.04
if version 22.04 "$DISTRO" 24.04.10
then
TLS13="+TLSv1.3"
fi
Expand Down
8 changes: 4 additions & 4 deletions apps/collabora_docker.sh
Expand Up @@ -6,7 +6,7 @@ true
SCRIPT_NAME="Collabora (Docker)"
SCRIPT_EXPLAINER="This script will install the Collabora Office Server bundled with Docker"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/24.04-LTS/lib.sh)
# To work with https://github.com/nextcloud/richdocuments/pull/2235

# Check for errors + debug code and abort if something isn't right
Expand Down Expand Up @@ -57,7 +57,7 @@ NCDOMAIN=$(nextcloud_occ_no_check config:system:get overwrite.cli.url | sed 's|h

# Curl the library another time to get the correct https_conf
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
source /var/scripts/fetch_lib.sh || source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/24.04-LTS/lib.sh)

# Get all needed variables from the library
nc_update
Expand Down Expand Up @@ -135,8 +135,8 @@ a2enmod proxy_http
a2enmod ssl
a2enmod headers

# Only add TLS 1.3 on Ubuntu later than 20.04
if version 20.04 "$DISTRO" 22.04.10
# Only add TLS 1.3 on Ubuntu later than 22.04
if version 22.04 "$DISTRO" 24.04.10
then
TLS13="+TLSv1.3"
fi
Expand Down
4 changes: 2 additions & 2 deletions apps/onlyoffice_docker.sh
Expand Up @@ -152,8 +152,8 @@ a2enmod proxy_http
a2enmod ssl
a2enmod headers

# Only add TLS 1.3 on Ubuntu later than 20.04
if version 20.04 "$DISTRO" 22.04.10
# Only add TLS 1.3 on Ubuntu later than 22.04
if version 22.04 "$DISTRO" 24.04.10
then
TLS13="+TLSv1.3"
fi
Expand Down
2 changes: 1 addition & 1 deletion apps/opensearch_certs.sh
Expand Up @@ -40,6 +40,6 @@ mv client.pem \
root-ca-key.pem -t tls_store

# openssl 3.0 workaround
if [ "$(lsb_release -sr)" = "20.04" ]; then
if [ "$(lsb_release -sr)" = "22.04" ]; then
mv root-ca.srl tls_store
fi
4 changes: 2 additions & 2 deletions apps/pico_cms.sh
Expand Up @@ -214,8 +214,8 @@ a2enmod proxy_http
a2enmod ssl
a2enmod headers

# Only add TLS 1.3 on Ubuntu later than 20.04
if version 20.04 "$DISTRO" 22.04.10
# Only add TLS 1.3 on Ubuntu later than 22.04
if version 22.04 "$DISTRO" 24.04.10
then
TLS13="+TLSv1.3"
fi
Expand Down
2 changes: 1 addition & 1 deletion apps/recognize.sh
Expand Up @@ -58,7 +58,7 @@ then
4. Install
We will run the uninstaller for you now, then exit."
wget https://raw.githubusercontent.com/nextcloud/vm/master/old/face-recognition.sh && bash face-recognition.sh && rm -f face-recognition.sh
wget https://raw.githubusercontent.com/nextcloud/vm/24.04-LTS/old/face-recognition.sh && bash face-recognition.sh && rm -f face-recognition.sh
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion apps/smbmount.sh
Expand Up @@ -77,7 +77,7 @@ then
msg_box "All $MAX_COUNT slots are occupied. No mounting slots available. Please delete one of the SMB-mounts.
If you really want to mount more, you can simply download the smb-mount script \
directly and edit the variable 'MAX_COUNT' to a higher value than $MAX_COUNT by running:
'curl -sLO https://raw.githubusercontent.com/nextcloud/vm/master/apps/smbmount.sh' # Download the script
'curl -sLO https://raw.githubusercontent.com/nextcloud/vm/24.04-LTS/apps/smbmount.sh' # Download the script
'nano smbmount.sh' # Edit MAX_COUNT=$MAX_COUNT to your likings and save the file
'sudo bash smbmount.sh' # Execute the script." "$SUBTITLE"
return
Expand Down
10 changes: 5 additions & 5 deletions apps/talk.sh
Expand Up @@ -88,10 +88,10 @@ else
removal_popup "$SCRIPT_NAME"
fi

# Must be 22.04
if ! version 20.04 "$DISTRO" 22.04.10
# Must be 24.04
if ! version 22.04 "$DISTRO" 24.04.10
then
msg_box "Your current Ubuntu version is $DISTRO but must be between 20.04 - 22.04.10 to install Talk"
msg_box "Your current Ubuntu version is $DISTRO but must be between 22.04 - 24.04.10 to install Talk"
msg_box "Please contact us to get support for upgrading your server:
https://www.hanssonit.se/#contact
https://shop.hanssonit.se/"
Expand Down Expand Up @@ -398,8 +398,8 @@ mkdir -p /var/www/html/error
echo "Hi there! :) If you see this page, the Apache2 proxy for $SCRIPT_NAME is up and running." > /var/www/html/error/404_proxy.html
chown -R www-data:www-data /var/www/html/error

# Only add TLS 1.3 on Ubuntu later than 20.04
if version 20.04 "$DISTRO" 22.04.10
# Only add TLS 1.3 on Ubuntu later than 22.04
if version 22.04 "$DISTRO" 24.04.10
then
TLS13="+TLSv1.3"
fi
Expand Down
4 changes: 2 additions & 2 deletions apps/tmbitwarden.sh
Expand Up @@ -240,8 +240,8 @@ a2enmod ssl
a2enmod headers
a2enmod remoteip

# Only add TLS 1.3 on Ubuntu later than 20.04
if version 20.04 "$DISTRO" 22.04.10
# Only add TLS 1.3 on Ubuntu later than 22.04
if version 22.04 "$DISTRO" 24.04.10
then
TLS13="+TLSv1.3"
fi
Expand Down
4 changes: 2 additions & 2 deletions apps/vaultwarden.sh
Expand Up @@ -122,8 +122,8 @@ a2enmod ssl
a2enmod headers
a2enmod remoteip

# Only add TLS 1.3 on Ubuntu later than 20.04
if version 20.04 "$DISTRO" 22.04.10
# Only add TLS 1.3 on Ubuntu later than 22.04
if version 22.04 "$DISTRO" 24.04.10
then
TLS13="+TLSv1.3"
fi
Expand Down
6 changes: 3 additions & 3 deletions disk/change-to-zfs-mount-generator.sh
Expand Up @@ -3,9 +3,9 @@
# T&M Hansson IT AB © - 2024, https://www.hanssonit.se/

# https://wiki.archlinux.org/index.php/ZFS#Using_zfs-mount-generator
# Tested on Ubuntu 20.04
# Tested on Ubuntu 22.04

# This script came to life when we were having issues with importing the ZFS pool (ncdata) on Ubuntu 20.04.
# This script came to life when we were having issues with importing the ZFS pool (ncdata) on Ubuntu 22.04.
# After some forum reading and some digging on Github, this is the result.
# The intention here is to make the import process more robust, and less prune to fail
# Essentially, changing from 'zfs-mount.service' to 'zfs-mount-generator' which by many has been working better.
Expand All @@ -18,7 +18,7 @@ source /var/scripts/fetch_lib.sh
# Check if root
root_check

# Needs to be Ubuntu 20.04 and Multiverse
# Needs to be Ubuntu 22.04 and Multiverse
check_distro_version
check_multiverse

Expand Down
2 changes: 1 addition & 1 deletion disk/format-chosen.sh
Expand Up @@ -10,7 +10,7 @@ source /var/scripts/fetch_lib.sh
# Check if root
root_check

# Needs to be Ubuntu 20.04 and Multiverse
# Needs to be Ubuntu 22.04 and Multiverse
check_distro_version
check_multiverse

Expand Down
2 changes: 1 addition & 1 deletion disk/format-sdb.sh
Expand Up @@ -10,7 +10,7 @@ source /var/scripts/fetch_lib.sh
# Check if root
root_check

# Needs to be Ubuntu 20.04 and Multiverse
# Needs to be Ubuntu 22.04 and Multiverse
check_distro_version
check_multiverse

Expand Down
6 changes: 3 additions & 3 deletions lets-encrypt/activate-tls.sh
Expand Up @@ -115,15 +115,15 @@ fi
# To get the correct version for the Apache conf file
check_php

# Only add TLS 1.3 on Ubuntu later than 20.04
if version 20.04 "$DISTRO" 22.04.10
# Only add TLS 1.3 on Ubuntu later than 22.04
if version 22.04 "$DISTRO" 24.04.10
then
TLS13="+TLSv1.3"
fi

# Fix zero file sizes
# See https://github.com/nextcloud/server/issues/3056
if version 22.04 "$DISTRO" 26.04.10
if version 24.04 "$DISTRO" 26.04.10
then
SETENVPROXY="SetEnv proxy-sendcl 1"
fi
Expand Down
18 changes: 9 additions & 9 deletions lib.sh
Expand Up @@ -708,10 +708,10 @@ version(){

[[ $2 != "$h" && $2 != "$t" ]]
}
if ! version 20.04 "$DISTRO" 24.04.10
if ! version 22.04 "$DISTRO" 24.04.10
then
print_text_in_color "$IRed" "Your current Ubuntu version is $DISTRO but must be between \
20.04 - 24.04.10 to run this script."
22.04 - 24.04.10 to run this script."
print_text_in_color "$ICyan" "Please contact us for support upgrading your server:"
print_text_in_color "$ICyan" "https://www.hanssonit.se/#contact"
print_text_in_color "$ICyan" "https://shop.hanssonit.se/"
Expand Down Expand Up @@ -1067,7 +1067,7 @@ remove_from_trusted_domains() {
}

check_distro_version() {
# Subṕport Ubuntu 22.0.4 jammy, and Ubuntu 20.04 focal.
# Subṕport Ubuntu 22.0.4 jammy, and Ubuntu 22.04 focal.

# Check Ubuntu version
if [ "${CODENAME}" == "jammy" ] || [ "${CODENAME}" == "focal" ]
Expand All @@ -1093,8 +1093,8 @@ You can find the download link here: https://www.ubuntu.com/download/server"
exit 1
fi

if ! version 20.04 "$DISTRO" 24.04.10; then
msg_box "Your current Ubuntu version is $DISTRO but must be between 20.04 - 24.04.10 to run this script."
if ! version 22.04 "$DISTRO" 24.04.10; then
msg_box "Your current Ubuntu version is $DISTRO but must be between 22.04 - 24.04.10 to run this script."
msg_box "Please contact us to get support for upgrading your server:
https://www.hanssonit.se/#contact
https://shop.hanssonit.se/product/upgrade-ubuntu-os-between-major-versions/"
Expand Down Expand Up @@ -1253,7 +1253,7 @@ version(){

[[ $2 != "$h" && $2 != "$t" ]]
}
if version 20.04 "$DISTRO" 24.04.10
if version 22.04 "$DISTRO" 24.04.10
then
print_text_in_color "$ICyan" "Testing if network is OK..."
if site_200 github.com
Expand All @@ -1278,7 +1278,7 @@ then
fi
fi
else
msg_box "Your current Ubuntu version is $DISTRO but must be between 20.04 - 24.04.10 to run this script."
msg_box "Your current Ubuntu version is $DISTRO but must be between 22.04 - 24.04.10 to run this script."
msg_box "Please contact us to get support for upgrading your server:
https://www.hanssonit.se/#contact
https://shop.hanssonit.se/"
Expand Down Expand Up @@ -1769,7 +1769,7 @@ then
CONTAINER="$(docker container ls -a | grep "$1" | awk '{print $1}' | tail -1)"
if [ -z "$CONTAINER" ]
then
# Special solution if the container name is scrambled, then search for the actual name instead
# Special solution if the container name is scrambled, then search for the actual name instead
CONTAINER="$(docker container ls -a | grep "$2" | awk '{print $1}' | tail -1)"
fi
docker stop "$CONTAINER"
Expand Down Expand Up @@ -2167,7 +2167,7 @@ add_trusted_key_and_repo() {
curl -sL "$2"/"$1" | tee -a /etc/apt/keyrings/"$1"
echo "deb [signed-by=/etc/apt/keyrings/$1] $3 $4" > "/etc/apt/sources.list.d/$5"
apt-get update -q4 & spinner_loading
elif version 20.04 "$DISTRO" 20.04.10
elif version 22.04 "$DISTRO" 22.04.10
then
# Legacy way with apt-key
print_text_in_color "$ICyan" "Adding trusted key with apt-key..."
Expand Down
2 changes: 1 addition & 1 deletion network/trusted.sh
Expand Up @@ -2,7 +2,7 @@
true
SCRIPT_NAME="Set trusted domain"
# shellcheck source=lib.sh
source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/24.04-LTS/lib.sh)

# Removed in NC 26.0.0.

Expand Down
14 changes: 7 additions & 7 deletions nextcloud_install_production.sh
Expand Up @@ -41,7 +41,7 @@ SCRIPT_NAME="Nextcloud Install Script"
SCRIPT_EXPLAINER="This script is installing all requirements that are needed for Nextcloud to run.
It's the first of two parts that are necessary to finish your customized Nextcloud installation."
# shellcheck source=lib.sh
source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/24.04-LTS/lib.sh)

# Check for errors + debug code and abort if something isn't right
# 1 = ON
Expand Down Expand Up @@ -211,7 +211,6 @@ stop_if_installed php7.3-fpm
stop_if_installed php8.0-fpm
stop_if_installed php8.1-fpm
stop_if_installed php8.2-fpm
stop_if_installed php8.3-fpm
stop_if_installed mysql-common
stop_if_installed mariadb-server

Expand Down Expand Up @@ -799,7 +798,7 @@ then
SetEnv HOME $NCPATH
SetEnv HTTP_HOME $NCPATH
# Disable HTTP TRACE method.
TraceEnable off
# Disable HTTP TRACK method.
Expand Down Expand Up @@ -886,7 +885,7 @@ then
SetEnv HOME $NCPATH
SetEnv HTTP_HOME $NCPATH
# Disable HTTP TRACE method.
TraceEnable off
# Disable HTTP TRACK method.
Expand All @@ -898,8 +897,9 @@ then
<IfModule mod_reqtimeout.c>
RequestReadTimeout body=0
</IfModule>
# Avoid zero byte files (only works in Ubuntu 22.04 -->>)
# Avoid zero byte files (only works in Ubuntu 24.04 -->>)
# See https://github.com/nextcloud/server/issues/3056
SETENVPROXY="SetEnv proxy-sendcl 1"
### LOCATION OF CERT FILES ###
Expand Down Expand Up @@ -1045,7 +1045,7 @@ then
then
# Upgrade Realtek drivers
print_text_in_color "$ICyan" "Upgrading Realtek firmware..."
curl_to_dir https://raw.githubusercontent.com/nextcloud/vm/master/network/asusnuc pn51.sh "$SCRIPTS"
curl_to_dir https://raw.githubusercontent.com/nextcloud/vm/24.04-LTS/network/asusnuc pn51.sh "$SCRIPTS"
bash "$SCRIPTS"/pn51.sh
fi
fi
Expand Down
12 changes: 6 additions & 6 deletions nextcloud_update.sh
Expand Up @@ -11,7 +11,7 @@
true
SCRIPT_NAME="Nextcloud Update Script"
# shellcheck source=lib.sh
source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
source <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/24.04-LTS/lib.sh)

# Get all needed variables from the library
ncdb
Expand All @@ -32,8 +32,8 @@ root_check
is_process_running apt
is_process_running dpkg

# Automatically restart services (Ubuntu 22.04)
if ! version 16.04.10 "$DISTRO" 20.04.10
# Automatically restart services (Ubuntu 24.04)
if ! version 16.04.10 "$DISTRO" 22.04.10
then
if [ ! -f /etc/needrestart/needrestart.conf ]
then
Expand Down Expand Up @@ -364,11 +364,11 @@ fi
# Fix Realtek on PN51
if asuspn51
then
if ! version 22.04 "$DISTRO" 22.04.10
if ! version 24.04 "$DISTRO" 24.04.10
then
# Upgrade Realtek drivers
print_text_in_color "$ICyan" "Upgrading Realtek firmware..."
curl_to_dir https://raw.githubusercontent.com/nextcloud/vm/master/network/asusnuc pn51.sh "$SCRIPTS"
curl_to_dir https://raw.githubusercontent.com/nextcloud/vm/24.04-LTS/network/asusnuc pn51.sh "$SCRIPTS"
bash "$SCRIPTS"/pn51.sh
fi
fi
Expand Down Expand Up @@ -419,7 +419,7 @@ then
rm -f /tmp/channel.xml
fi

# Update Redis PHP extension (18.04 --> 20.04 since 16.04 already is deprecated in the top of this script)
# Update Redis PHP extension (18.04 --> 22.04 since 16.04 already is deprecated in the top of this script)
print_text_in_color "$ICyan" "Trying to upgrade the Redis PECL extension..."

# Check current PHP version
Expand Down

0 comments on commit 4601e1f

Please sign in to comment.