mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-06-30 22:40:55 +00:00
Fixed more SC2086.
This commit is contained in:
parent
4175448b36
commit
fe953c050e
@ -63,10 +63,10 @@ if [ ! -d "$HOME/mailinabox" ]; then
|
|||||||
SOURCE=https://github.com/mail-in-a-box/mailinabox
|
SOURCE=https://github.com/mail-in-a-box/mailinabox
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo Downloading Mail-in-a-Box $TAG. . .
|
echo "Downloading Mail-in-a-Box $TAG. . ."
|
||||||
git clone \
|
git clone \
|
||||||
-b $TAG --depth 1 \
|
-b "$TAG" --depth 1 \
|
||||||
$SOURCE \
|
"$SOURCE" \
|
||||||
"$HOME/mailinabox" \
|
"$HOME/mailinabox" \
|
||||||
< /dev/null 2> /dev/null
|
< /dev/null 2> /dev/null
|
||||||
|
|
||||||
@ -78,9 +78,9 @@ cd "$HOME/mailinabox" || exit
|
|||||||
|
|
||||||
# Update it.
|
# Update it.
|
||||||
if [ "$TAG" != $(git describe --always) ]; then
|
if [ "$TAG" != $(git describe --always) ]; then
|
||||||
echo Updating Mail-in-a-Box to $TAG . . .
|
echo "Updating Mail-in-a-Box to $TAG . . ."
|
||||||
git fetch --depth 1 --force --prune origin tag $TAG
|
git fetch --depth 1 --force --prune origin tag "$TAG"
|
||||||
if ! git checkout -q $TAG; then
|
if ! git checkout -q "$TAG"; then
|
||||||
echo "Update failed. Did you modify something in $(pwd)?"
|
echo "Update failed. Did you modify something in $(pwd)?"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -47,7 +47,7 @@ if [ -z "$(management/cli.py user)" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the user's mail account. This will ask for a password if none was given above.
|
# Create the user's mail account. This will ask for a password if none was given above.
|
||||||
management/cli.py user add "$EMAIL_ADDR" ${EMAIL_PW:-}
|
management/cli.py user add "$EMAIL_ADDR" "${EMAIL_PW:-}"
|
||||||
|
|
||||||
# Make it an admin.
|
# Make it an admin.
|
||||||
hide_output management/cli.py user make-admin "$EMAIL_ADDR"
|
hide_output management/cli.py user make-admin "$EMAIL_ADDR"
|
||||||
|
@ -62,9 +62,9 @@ function get_default_hostname {
|
|||||||
# Guess the machine's hostname. It should be a fully qualified
|
# Guess the machine's hostname. It should be a fully qualified
|
||||||
# domain name suitable for DNS. None of these calls may provide
|
# domain name suitable for DNS. None of these calls may provide
|
||||||
# the right value, but it's the best guess we can make.
|
# the right value, but it's the best guess we can make.
|
||||||
set -- $(hostname --fqdn 2>/dev/null ||
|
set -- "$(hostname --fqdn 2>/dev/null ||
|
||||||
hostname --all-fqdns 2>/dev/null ||
|
hostname --all-fqdns 2>/dev/null ||
|
||||||
hostname 2>/dev/null)
|
hostname 2>/dev/null)"
|
||||||
printf '%s\n' "$1" # return this value
|
printf '%s\n' "$1" # return this value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ done
|
|||||||
mkdir -p /var/lib/munin-node/plugin-state/
|
mkdir -p /var/lib/munin-node/plugin-state/
|
||||||
|
|
||||||
# Create a systemd service for munin.
|
# Create a systemd service for munin.
|
||||||
ln -sf $(pwd)/management/munin_start.sh /usr/local/lib/mailinabox/munin_start.sh
|
ln -sf "$(pwd)/management/munin_start.sh" /usr/local/lib/mailinabox/munin_start.sh
|
||||||
chmod 0744 /usr/local/lib/mailinabox/munin_start.sh
|
chmod 0744 /usr/local/lib/mailinabox/munin_start.sh
|
||||||
cp --remove-destination conf/munin.service /lib/systemd/system/munin.service # target was previously a symlink so remove first
|
cp --remove-destination conf/munin.service /lib/systemd/system/munin.service # target was previously a symlink so remove first
|
||||||
hide_output systemctl link -f /lib/systemd/system/munin.service
|
hide_output systemctl link -f /lib/systemd/system/munin.service
|
||||||
|
@ -48,13 +48,13 @@ user_external_hash=a494073dcdecbbbc79a9c77f72524ac9994d2eec
|
|||||||
|
|
||||||
apt-get purge -qq -y owncloud* # we used to use the package manager
|
apt-get purge -qq -y owncloud* # we used to use the package manager
|
||||||
|
|
||||||
apt_install curl php${PHP_VER} php${PHP_VER}-fpm \
|
apt_install curl php"${PHP_VER}" php"${PHP_VER}"-fpm \
|
||||||
php${PHP_VER}-cli php${PHP_VER}-sqlite3 php${PHP_VER}-gd php${PHP_VER}-imap php${PHP_VER}-curl \
|
php"${PHP_VER}"-cli php"${PHP_VER}"-sqlite3 php"${PHP_VER}"-gd php"${PHP_VER}"-imap php"${PHP_VER}"-curl \
|
||||||
php${PHP_VER}-dev php${PHP_VER}-gd php${PHP_VER}-xml php${PHP_VER}-mbstring php${PHP_VER}-zip php${PHP_VER}-apcu \
|
php"${PHP_VER}"-dev php"${PHP_VER}"-gd php"${PHP_VER}"-xml php"${PHP_VER}"-mbstring php"${PHP_VER}"-zip php"${PHP_VER}"-apcu \
|
||||||
php${PHP_VER}-intl php${PHP_VER}-imagick php${PHP_VER}-gmp php${PHP_VER}-bcmath
|
php"${PHP_VER}"-intl php"${PHP_VER}"-imagick php"${PHP_VER}"-gmp php"${PHP_VER}"-bcmath
|
||||||
|
|
||||||
# Enable APC before Nextcloud tools are run.
|
# Enable APC before Nextcloud tools are run.
|
||||||
tools/editconf.py /etc/php/$PHP_VER/mods-available/apcu.ini -c ';' \
|
tools/editconf.py /etc/php/"$PHP_VER"/mods-available/apcu.ini -c ';' \
|
||||||
apc.enabled=1 \
|
apc.enabled=1 \
|
||||||
apc.enable_cli=1
|
apc.enable_cli=1
|
||||||
|
|
||||||
@ -121,21 +121,21 @@ InstallNextcloud() {
|
|||||||
if [ -e "$STORAGE_ROOT/owncloud/owncloud.db" ]; then
|
if [ -e "$STORAGE_ROOT/owncloud/owncloud.db" ]; then
|
||||||
# ownCloud 8.1.1 broke upgrades. It may fail on the first attempt, but
|
# ownCloud 8.1.1 broke upgrades. It may fail on the first attempt, but
|
||||||
# that can be OK.
|
# that can be OK.
|
||||||
sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ upgrade
|
sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/occ upgrade
|
||||||
if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then
|
if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then
|
||||||
echo "Trying ownCloud upgrade again to work around ownCloud upgrade bug..."
|
echo "Trying ownCloud upgrade again to work around ownCloud upgrade bug..."
|
||||||
sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ upgrade
|
sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/occ upgrade
|
||||||
if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then exit 1; fi
|
if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then exit 1; fi
|
||||||
sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ maintenance:mode --off
|
sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/occ maintenance:mode --off
|
||||||
echo "...which seemed to work."
|
echo "...which seemed to work."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add missing indices. NextCloud didn't include this in the normal upgrade because it might take some time.
|
# Add missing indices. NextCloud didn't include this in the normal upgrade because it might take some time.
|
||||||
sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ db:add-missing-indices
|
sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/occ db:add-missing-indices
|
||||||
sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ db:add-missing-primary-keys
|
sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/occ db:add-missing-primary-keys
|
||||||
|
|
||||||
# Run conversion to BigInt identifiers, this process may take some time on large tables.
|
# Run conversion to BigInt identifiers, this process may take some time on large tables.
|
||||||
sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ db:convert-filecache-bigint --no-interaction
|
sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/occ db:convert-filecache-bigint --no-interaction
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ InstallNextcloud() {
|
|||||||
|
|
||||||
# If config.php exists, get version number, otherwise CURRENT_NEXTCLOUD_VER is empty.
|
# If config.php exists, get version number, otherwise CURRENT_NEXTCLOUD_VER is empty.
|
||||||
if [ -f "$STORAGE_ROOT/owncloud/config.php" ]; then
|
if [ -f "$STORAGE_ROOT/owncloud/config.php" ]; then
|
||||||
CURRENT_NEXTCLOUD_VER=$(php$PHP_VER -r "include(\"$STORAGE_ROOT/owncloud/config.php\"); echo(\$CONFIG['version']);")
|
CURRENT_NEXTCLOUD_VER=$(php"$PHP_VER" -r "include(\"$STORAGE_ROOT/owncloud/config.php\"); echo(\$CONFIG['version']);")
|
||||||
else
|
else
|
||||||
CURRENT_NEXTCLOUD_VER=""
|
CURRENT_NEXTCLOUD_VER=""
|
||||||
fi
|
fi
|
||||||
@ -157,7 +157,7 @@ fi
|
|||||||
if [ ! -d /usr/local/lib/owncloud/ ] || [[ ! ${CURRENT_NEXTCLOUD_VER} =~ ^$nextcloud_ver ]]; then
|
if [ ! -d /usr/local/lib/owncloud/ ] || [[ ! ${CURRENT_NEXTCLOUD_VER} =~ ^$nextcloud_ver ]]; then
|
||||||
|
|
||||||
# Stop php-fpm if running. If they are not running (which happens on a previously failed install), dont bail.
|
# Stop php-fpm if running. If they are not running (which happens on a previously failed install), dont bail.
|
||||||
service php$PHP_VER-fpm stop &> /dev/null || /bin/true
|
service php"$PHP_VER"-fpm stop &> /dev/null || /bin/true
|
||||||
|
|
||||||
# Backup the existing ownCloud/Nextcloud.
|
# Backup the existing ownCloud/Nextcloud.
|
||||||
# Create a backup directory to store the current installation and database to
|
# Create a backup directory to store the current installation and database to
|
||||||
@ -284,7 +284,7 @@ EOF
|
|||||||
# Execute Nextcloud's setup step, which creates the Nextcloud sqlite database.
|
# Execute Nextcloud's setup step, which creates the Nextcloud sqlite database.
|
||||||
# It also wipes it if it exists. And it updates config.php with database
|
# It also wipes it if it exists. And it updates config.php with database
|
||||||
# settings and deletes the autoconfig.php file.
|
# settings and deletes the autoconfig.php file.
|
||||||
(cd /usr/local/lib/owncloud; sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/index.php;)
|
(cd /usr/local/lib/owncloud; sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/index.php;)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update config.php.
|
# Update config.php.
|
||||||
@ -300,7 +300,7 @@ fi
|
|||||||
# Use PHP to read the settings file, modify it, and write out the new settings array.
|
# Use PHP to read the settings file, modify it, and write out the new settings array.
|
||||||
TIMEZONE=$(cat /etc/timezone)
|
TIMEZONE=$(cat /etc/timezone)
|
||||||
CONFIG_TEMP=$(/bin/mktemp)
|
CONFIG_TEMP=$(/bin/mktemp)
|
||||||
php$PHP_VER <<EOF > "$CONFIG_TEMP" && mv "$CONFIG_TEMP" "$STORAGE_ROOT/owncloud/config.php";
|
php"$PHP_VER" <<EOF > "$CONFIG_TEMP" && mv "$CONFIG_TEMP" "$STORAGE_ROOT/owncloud/config.php";
|
||||||
<?php
|
<?php
|
||||||
include("$STORAGE_ROOT/owncloud/config.php");
|
include("$STORAGE_ROOT/owncloud/config.php");
|
||||||
|
|
||||||
@ -337,25 +337,25 @@ chown www-data:www-data "$STORAGE_ROOT/owncloud/config.php"
|
|||||||
# The firstrunwizard gave Josh all sorts of problems, so disabling that.
|
# The firstrunwizard gave Josh all sorts of problems, so disabling that.
|
||||||
# user_external is what allows Nextcloud to use IMAP for login. The contacts
|
# user_external is what allows Nextcloud to use IMAP for login. The contacts
|
||||||
# and calendar apps are the extensions we really care about here.
|
# and calendar apps are the extensions we really care about here.
|
||||||
hide_output sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/console.php app:disable firstrunwizard
|
hide_output sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/console.php app:disable firstrunwizard
|
||||||
hide_output sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/console.php app:enable user_external
|
hide_output sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/console.php app:enable user_external
|
||||||
hide_output sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/console.php app:enable contacts
|
hide_output sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/console.php app:enable contacts
|
||||||
hide_output sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/console.php app:enable calendar
|
hide_output sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/console.php app:enable calendar
|
||||||
|
|
||||||
# When upgrading, run the upgrade script again now that apps are enabled. It seems like
|
# When upgrading, run the upgrade script again now that apps are enabled. It seems like
|
||||||
# the first upgrade at the top won't work because apps may be disabled during upgrade?
|
# the first upgrade at the top won't work because apps may be disabled during upgrade?
|
||||||
# Check for success (0=ok, 3=no upgrade needed).
|
# Check for success (0=ok, 3=no upgrade needed).
|
||||||
sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ upgrade
|
sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/occ upgrade
|
||||||
if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then exit 1; fi
|
if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then exit 1; fi
|
||||||
|
|
||||||
# Disable default apps that we don't support
|
# Disable default apps that we don't support
|
||||||
sudo -u www-data \
|
sudo -u www-data \
|
||||||
php$PHP_VER /usr/local/lib/owncloud/occ app:disable photos dashboard activity \
|
php"$PHP_VER" /usr/local/lib/owncloud/occ app:disable photos dashboard activity \
|
||||||
| (grep -v "No such app enabled" || /bin/true)
|
| (grep -v "No such app enabled" || /bin/true)
|
||||||
|
|
||||||
# Set PHP FPM values to support large file uploads
|
# Set PHP FPM values to support large file uploads
|
||||||
# (semicolon is the comment character in this file, hashes produce deprecation warnings)
|
# (semicolon is the comment character in this file, hashes produce deprecation warnings)
|
||||||
tools/editconf.py /etc/php/$PHP_VER/fpm/php.ini -c ';' \
|
tools/editconf.py /etc/php/"$PHP_VER"/fpm/php.ini -c ';' \
|
||||||
upload_max_filesize=16G \
|
upload_max_filesize=16G \
|
||||||
post_max_size=16G \
|
post_max_size=16G \
|
||||||
output_buffering=16384 \
|
output_buffering=16384 \
|
||||||
@ -364,7 +364,7 @@ tools/editconf.py /etc/php/$PHP_VER/fpm/php.ini -c ';' \
|
|||||||
short_open_tag=On
|
short_open_tag=On
|
||||||
|
|
||||||
# Set Nextcloud recommended opcache settings
|
# Set Nextcloud recommended opcache settings
|
||||||
tools/editconf.py /etc/php/$PHP_VER/cli/conf.d/10-opcache.ini -c ';' \
|
tools/editconf.py /etc/php/"$PHP_VER"/cli/conf.d/10-opcache.ini -c ';' \
|
||||||
opcache.enable=1 \
|
opcache.enable=1 \
|
||||||
opcache.enable_cli=1 \
|
opcache.enable_cli=1 \
|
||||||
opcache.interned_strings_buffer=8 \
|
opcache.interned_strings_buffer=8 \
|
||||||
@ -393,7 +393,7 @@ chmod +x /etc/cron.d/mailinabox-nextcloud
|
|||||||
|
|
||||||
# We also need to change the sending mode from background-job to occ.
|
# We also need to change the sending mode from background-job to occ.
|
||||||
# Or else the reminders will just be sent as soon as possible when the background jobs run.
|
# Or else the reminders will just be sent as soon as possible when the background jobs run.
|
||||||
hide_output sudo -u www-data php$PHP_VER -f /usr/local/lib/owncloud/occ config:app:set dav sendEventRemindersMode --value occ
|
hide_output sudo -u www-data php"$PHP_VER" -f /usr/local/lib/owncloud/occ config:app:set dav sendEventRemindersMode --value occ
|
||||||
|
|
||||||
# Now set the config to read-only.
|
# Now set the config to read-only.
|
||||||
# Do this only at the very bottom when no further occ commands are needed.
|
# Do this only at the very bottom when no further occ commands are needed.
|
||||||
@ -422,4 +422,4 @@ EOF
|
|||||||
# ```
|
# ```
|
||||||
|
|
||||||
# Enable PHP modules and restart PHP.
|
# Enable PHP modules and restart PHP.
|
||||||
restart_service php$PHP_VER-fpm
|
restart_service php"$PHP_VER"-fpm
|
||||||
|
@ -207,6 +207,6 @@ if [ "$PRIVATE_IPV6" != "$PUBLIC_IPV6" ]; then
|
|||||||
echo "Private IPv6 Address: $PRIVATE_IPV6"
|
echo "Private IPv6 Address: $PRIVATE_IPV6"
|
||||||
fi
|
fi
|
||||||
if [ -f /usr/bin/git ] && [ -d .git ]; then
|
if [ -f /usr/bin/git ] && [ -d .git ]; then
|
||||||
echo "Mail-in-a-Box Version: " $(git describe --always)
|
echo "Mail-in-a-Box Version: $(git describe --always)"
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
18
setup/web.sh
18
setup/web.sh
@ -19,7 +19,7 @@ fi
|
|||||||
|
|
||||||
echo "Installing Nginx (web server)..."
|
echo "Installing Nginx (web server)..."
|
||||||
|
|
||||||
apt_install nginx php${PHP_VER}-cli php${PHP_VER}-fpm idn2
|
apt_install nginx php"${PHP_VER}"-cli php"${PHP_VER}"-fpm idn2
|
||||||
|
|
||||||
rm -f /etc/nginx/sites-enabled/default
|
rm -f /etc/nginx/sites-enabled/default
|
||||||
|
|
||||||
@ -46,15 +46,15 @@ tools/editconf.py /etc/nginx/nginx.conf -s \
|
|||||||
ssl_protocols="TLSv1.2 TLSv1.3;"
|
ssl_protocols="TLSv1.2 TLSv1.3;"
|
||||||
|
|
||||||
# Tell PHP not to expose its version number in the X-Powered-By header.
|
# Tell PHP not to expose its version number in the X-Powered-By header.
|
||||||
tools/editconf.py /etc/php/$PHP_VER/fpm/php.ini -c ';' \
|
tools/editconf.py /etc/php/"$PHP_VER"/fpm/php.ini -c ';' \
|
||||||
expose_php=Off
|
expose_php=Off
|
||||||
|
|
||||||
# Set PHPs default charset to UTF-8, since we use it. See #367.
|
# Set PHPs default charset to UTF-8, since we use it. See #367.
|
||||||
tools/editconf.py /etc/php/$PHP_VER/fpm/php.ini -c ';' \
|
tools/editconf.py /etc/php/"$PHP_VER"/fpm/php.ini -c ';' \
|
||||||
default_charset="UTF-8"
|
default_charset="UTF-8"
|
||||||
|
|
||||||
# Configure the path environment for php-fpm
|
# Configure the path environment for php-fpm
|
||||||
tools/editconf.py /etc/php/$PHP_VER/fpm/pool.d/www.conf -c ';' \
|
tools/editconf.py /etc/php/"$PHP_VER"/fpm/pool.d/www.conf -c ';' \
|
||||||
env[PATH]=/usr/local/bin:/usr/bin:/bin \
|
env[PATH]=/usr/local/bin:/usr/bin:/bin \
|
||||||
|
|
||||||
# Configure php-fpm based on the amount of memory the machine has
|
# Configure php-fpm based on the amount of memory the machine has
|
||||||
@ -64,7 +64,7 @@ tools/editconf.py /etc/php/$PHP_VER/fpm/pool.d/www.conf -c ';' \
|
|||||||
TOTAL_PHYSICAL_MEM=$(head -n 1 /proc/meminfo | awk '{print $2}' || /bin/true)
|
TOTAL_PHYSICAL_MEM=$(head -n 1 /proc/meminfo | awk '{print $2}' || /bin/true)
|
||||||
if [ "$TOTAL_PHYSICAL_MEM" -lt 1000000 ]
|
if [ "$TOTAL_PHYSICAL_MEM" -lt 1000000 ]
|
||||||
then
|
then
|
||||||
tools/editconf.py /etc/php/$PHP_VER/fpm/pool.d/www.conf -c ';' \
|
tools/editconf.py /etc/php/"$PHP_VER"/fpm/pool.d/www.conf -c ';' \
|
||||||
pm=ondemand \
|
pm=ondemand \
|
||||||
pm.max_children=8 \
|
pm.max_children=8 \
|
||||||
pm.start_servers=2 \
|
pm.start_servers=2 \
|
||||||
@ -72,7 +72,7 @@ then
|
|||||||
pm.max_spare_servers=3
|
pm.max_spare_servers=3
|
||||||
elif [ "$TOTAL_PHYSICAL_MEM" -lt 2000000 ]
|
elif [ "$TOTAL_PHYSICAL_MEM" -lt 2000000 ]
|
||||||
then
|
then
|
||||||
tools/editconf.py /etc/php/$PHP_VER/fpm/pool.d/www.conf -c ';' \
|
tools/editconf.py /etc/php/"$PHP_VER"/fpm/pool.d/www.conf -c ';' \
|
||||||
pm=ondemand \
|
pm=ondemand \
|
||||||
pm.max_children=16 \
|
pm.max_children=16 \
|
||||||
pm.start_servers=4 \
|
pm.start_servers=4 \
|
||||||
@ -80,14 +80,14 @@ then
|
|||||||
pm.max_spare_servers=6
|
pm.max_spare_servers=6
|
||||||
elif [ "$TOTAL_PHYSICAL_MEM" -lt 3000000 ]
|
elif [ "$TOTAL_PHYSICAL_MEM" -lt 3000000 ]
|
||||||
then
|
then
|
||||||
tools/editconf.py /etc/php/$PHP_VER/fpm/pool.d/www.conf -c ';' \
|
tools/editconf.py /etc/php/"$PHP_VER"/fpm/pool.d/www.conf -c ';' \
|
||||||
pm=dynamic \
|
pm=dynamic \
|
||||||
pm.max_children=60 \
|
pm.max_children=60 \
|
||||||
pm.start_servers=6 \
|
pm.start_servers=6 \
|
||||||
pm.min_spare_servers=3 \
|
pm.min_spare_servers=3 \
|
||||||
pm.max_spare_servers=9
|
pm.max_spare_servers=9
|
||||||
else
|
else
|
||||||
tools/editconf.py /etc/php/$PHP_VER/fpm/pool.d/www.conf -c ';' \
|
tools/editconf.py /etc/php/"$PHP_VER"/fpm/pool.d/www.conf -c ';' \
|
||||||
pm=dynamic \
|
pm=dynamic \
|
||||||
pm.max_children=120 \
|
pm.max_children=120 \
|
||||||
pm.start_servers=12 \
|
pm.start_servers=12 \
|
||||||
@ -147,7 +147,7 @@ chown -R "$STORAGE_USER" "$STORAGE_ROOT/www"
|
|||||||
|
|
||||||
# Start services.
|
# Start services.
|
||||||
restart_service nginx
|
restart_service nginx
|
||||||
restart_service php$PHP_VER-fpm
|
restart_service php"$PHP_VER"-fpm
|
||||||
|
|
||||||
# Open ports.
|
# Open ports.
|
||||||
ufw_allow http
|
ufw_allow http
|
||||||
|
@ -22,8 +22,8 @@ source /etc/mailinabox.conf # load global vars
|
|||||||
echo "Installing Roundcube (webmail)..."
|
echo "Installing Roundcube (webmail)..."
|
||||||
apt_install \
|
apt_install \
|
||||||
dbconfig-common \
|
dbconfig-common \
|
||||||
php${PHP_VER}-cli php${PHP_VER}-sqlite3 php${PHP_VER}-intl php${PHP_VER}-common php${PHP_VER}-curl php${PHP_VER}-imap \
|
php"${PHP_VER}"-cli php"${PHP_VER}"-sqlite3 php"${PHP_VER}"-intl php"${PHP_VER}"-common php"${PHP_VER}"-curl php"${PHP_VER}"-imap \
|
||||||
php${PHP_VER}-gd php${PHP_VER}-pspell php${PHP_VER}-mbstring libjs-jquery libjs-jquery-mousewheel libmagic1 \
|
php"${PHP_VER}"-gd php"${PHP_VER}"-pspell php"${PHP_VER}"-mbstring libjs-jquery libjs-jquery-mousewheel libmagic1 \
|
||||||
sqlite3
|
sqlite3
|
||||||
|
|
||||||
# Install Roundcube from source if it is not already present or if it is out of date.
|
# Install Roundcube from source if it is not already present or if it is out of date.
|
||||||
@ -205,7 +205,7 @@ chown -f -R root:www-data ${RCM_PLUGIN_DIR}/carddav
|
|||||||
chmod -R 774 ${RCM_PLUGIN_DIR}/carddav
|
chmod -R 774 ${RCM_PLUGIN_DIR}/carddav
|
||||||
|
|
||||||
# Run Roundcube database migration script (database is created if it does not exist)
|
# Run Roundcube database migration script (database is created if it does not exist)
|
||||||
php$PHP_VER ${RCM_DIR}/bin/updatedb.sh --dir ${RCM_DIR}/SQL --package roundcube
|
php"$PHP_VER" ${RCM_DIR}/bin/updatedb.sh --dir ${RCM_DIR}/SQL --package roundcube
|
||||||
chown www-data:www-data "$STORAGE_ROOT/mail/roundcube/roundcube.sqlite"
|
chown www-data:www-data "$STORAGE_ROOT/mail/roundcube/roundcube.sqlite"
|
||||||
chmod 664 "$STORAGE_ROOT/mail/roundcube/roundcube.sqlite"
|
chmod 664 "$STORAGE_ROOT/mail/roundcube/roundcube.sqlite"
|
||||||
|
|
||||||
@ -220,5 +220,5 @@ sed -i.miabold 's/^[^#]\+.\+PRAGMA journal_mode = WAL.\+$/#&/' \
|
|||||||
sqlite3 "$STORAGE_ROOT/mail/roundcube/roundcube.sqlite" 'PRAGMA journal_mode=WAL;'
|
sqlite3 "$STORAGE_ROOT/mail/roundcube/roundcube.sqlite" 'PRAGMA journal_mode=WAL;'
|
||||||
|
|
||||||
# Enable PHP modules.
|
# Enable PHP modules.
|
||||||
phpenmod -v $PHP_VER imap
|
phpenmod -v "$PHP_VER" imap
|
||||||
restart_service php$PHP_VER-fpm
|
restart_service php"$PHP_VER"-fpm
|
||||||
|
@ -17,9 +17,9 @@ source /etc/mailinabox.conf # load global vars
|
|||||||
|
|
||||||
echo "Installing Z-Push (Exchange/ActiveSync server)..."
|
echo "Installing Z-Push (Exchange/ActiveSync server)..."
|
||||||
apt_install \
|
apt_install \
|
||||||
php${PHP_VER}-soap php${PHP_VER}-imap libawl-php php$PHP_VER-xml
|
php"${PHP_VER}"-soap php"${PHP_VER}"-imap libawl-php php"$PHP_VER"-xml
|
||||||
|
|
||||||
phpenmod -v $PHP_VER imap
|
phpenmod -v "$PHP_VER" imap
|
||||||
|
|
||||||
# Copy Z-Push into place.
|
# Copy Z-Push into place.
|
||||||
VERSION=2.7.1
|
VERSION=2.7.1
|
||||||
@ -44,10 +44,10 @@ if [ $needs_update == 1 ]; then
|
|||||||
# Create admin and top scripts with PHP_VER
|
# Create admin and top scripts with PHP_VER
|
||||||
rm -f /usr/sbin/z-push-{admin,top}
|
rm -f /usr/sbin/z-push-{admin,top}
|
||||||
echo '#!/bin/bash' > /usr/sbin/z-push-admin
|
echo '#!/bin/bash' > /usr/sbin/z-push-admin
|
||||||
echo php$PHP_VER /usr/local/lib/z-push/z-push-admin.php '"$@"' >> /usr/sbin/z-push-admin
|
echo php"$PHP_VER" /usr/local/lib/z-push/z-push-admin.php '"$@"' >> /usr/sbin/z-push-admin
|
||||||
chmod 755 /usr/sbin/z-push-admin
|
chmod 755 /usr/sbin/z-push-admin
|
||||||
echo '#!/bin/bash' > /usr/sbin/z-push-top
|
echo '#!/bin/bash' > /usr/sbin/z-push-top
|
||||||
echo php$PHP_VER /usr/local/lib/z-push/z-push-top.php '"$@"' >> /usr/sbin/z-push-top
|
echo php"$PHP_VER" /usr/local/lib/z-push/z-push-top.php '"$@"' >> /usr/sbin/z-push-top
|
||||||
chmod 755 /usr/sbin/z-push-top
|
chmod 755 /usr/sbin/z-push-top
|
||||||
|
|
||||||
echo $VERSION > /usr/local/lib/z-push/version
|
echo $VERSION > /usr/local/lib/z-push/version
|
||||||
@ -108,8 +108,8 @@ EOF
|
|||||||
|
|
||||||
# Restart service.
|
# Restart service.
|
||||||
|
|
||||||
restart_service php$PHP_VER-fpm
|
restart_service php"$PHP_VER"-fpm
|
||||||
|
|
||||||
# Fix states after upgrade
|
# Fix states after upgrade
|
||||||
|
|
||||||
hide_output php$PHP_VER /usr/local/lib/z-push/z-push-admin.php -a fixstates
|
hide_output php"$PHP_VER" /usr/local/lib/z-push/z-push-admin.php -a fixstates
|
||||||
|
@ -3,4 +3,4 @@ POSTDATA=dummy
|
|||||||
if [ "$1" == "--force" ]; then
|
if [ "$1" == "--force" ]; then
|
||||||
POSTDATA=force=1
|
POSTDATA=force=1
|
||||||
fi
|
fi
|
||||||
curl -s -d $POSTDATA --user $(</var/lib/mailinabox/api.key): http://127.0.0.1:10222/dns/update
|
curl -s -d $POSTDATA --user "$(</var/lib/mailinabox/api.key):" http://127.0.0.1:10222/dns/update
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
curl -s -d POSTDATA --user $(</var/lib/mailinabox/api.key): http://127.0.0.1:10222/web/update
|
curl -s -d POSTDATA --user "$(</var/lib/mailinabox/api.key):" http://127.0.0.1:10222/web/update
|
||||||
|
Loading…
Reference in New Issue
Block a user