Commit 44b9f3db authored by w4t's avatar w4t

wtserver 0.30

parent 7939ffdd
......@@ -8,8 +8,8 @@ InstallCloud() {
case $CFG_CLOUDTYPE in
"nextcloud")
INSTALL_DIR=/usr/local/lib/nextcloud
CLOUD_DIR=$INSTALL_DIR/cloud
local INSTALL_DIR=/usr/local/lib/nextcloud
local CLOUD_DIR=$INSTALL_DIR/cloud
InstallNextcloud
;;
"seafile")
......@@ -324,6 +324,112 @@ EOF
;;
esac
# Set PHP FPM values to support large file uploads
# (semicolon is the comment character in this file, hashes produce deprecation warnings)
#sed -i "s/upload_max_filesize =.*/upload_max_filesize = 16G/g" /etc/php/8.2/fpm/php.ini
sed -i "s/upload_max_filesize =.*/upload_max_filesize = 1G/g" /etc/php/8.2/fpm/php.ini
#sed -i "s/post_max_size =.*/post_max_size = 16G/g" /etc/php/8.2/fpm/php.ini
sed -i "s/post_max_size =.*/post_max_size = 1G/g" /etc/php/8.2/fpm/php.ini
sed -i "s/output_buffering =.*/output_buffering = 16384/g" /etc/php/8.2/fpm/php.ini
sed -i "s/memory_limit =.*/memory_limit = 512M/g" /etc/php/8.2/fpm/php.ini
sed -i "s/max_execution_time =.*/max_execution_time = 600/g" /etc/php/8.2/fpm/php.ini
sed -i "s/short_open_tag =.*/short_open_tag = On/g" /etc/php/8.2/fpm/php.ini
#management/editconf.py /etc/php/8.2/fpm/php.ini -c ';' \
# upload_max_filesize=16G \
# post_max_size=16G \
# output_buffering=16384 \
# memory_limit=512M \
# max_execution_time=600 \
# short_open_tag=On
# Set Nextcloud recommended opcache settings
#if grep -q opcache.enable=0 /etc/php/7.3/mods-available/apcu.ini; then
# sed -i "s/;opcache.enable=.*/opcache.enable=1/g" /etc/php/7.3/fpm/php.ini
#fi
sed -i "s/;opcache.enable.*/opcache.enable=1/g" /etc/php/8.2/cli/conf.d/10-opcache.ini
sed -i "s/;opcache.enable_cli.*/opcache.enable_cli=1/g" /etc/php/8.2/cli/conf.d/10-opcache.ini
sed -i "s/;opcache.interned_strings_buffer.*/opcache.interned_strings_buffer=16/g" /etc/php/8.2/cli/conf.d/10-opcache.ini
sed -i "s/max_accelerated_files=.*/max_accelerated_files=10000/g" /etc/php/8.2/cli/conf.d/10-opcache.ini
sed -i "s/opcache.memory_consumption=.*/opcache.memory_consumption=128/g" /etc/php/8.2/cli/conf.d/10-opcache.ini
sed -i "s/;opcache.save_comments=.*/opcache.save_comments=1/g" /etc/php/8.2/cli/conf.d/10-opcache.ini
sed -i "s/opcache.revalidate_freq=.*/opcache.revalidate_freq=1/g" /etc/php/8.2/cli/conf.d/10-opcache.ini
#management/editconf.py /etc/php/8.2/cli/conf.d/10-opcache.ini -c ';' \
# opcache.enable=1 \
# opcache.enable_cli=1 \
# opcache.interned_strings_buffer=16 \
# opcache.max_accelerated_files=10000 \
# opcache.memory_consumption=128 \
# opcache.save_comments=1 \
# opcache.revalidate_freq=1
# Configure the path environment for php-fpm
sed -i '/env\[PATH/s/;//g' /etc/php/8.2/fpm/pool.d/www.conf
# If apc is explicitly disabled we need to enable it
#if grep -q apc.enabled=0 /etc/php/8.2/mods-available/apcu.ini; then
#if grep -q apc.enabled=1 /etc/php/8.2/mods-available/apcu.ini; then
# echo "apc.enabled=1" >> /etc/php/8.2/mods-available/apcu.ini
#fi
# Set up a general cron job for Nextcloud.
# Also add another job for Calendar updates, per advice in the Nextcloud docs
# https://docs.nextcloud.com/server/24/admin_manual/groupware/calendar.html#background-jobs
cat > /etc/cron.d/cron-nextcloud << EOF;
#!/bin/bash
# Wolftronics server setup script
*/5 * * * * root sudo -u www-data php8.2 -f $CLOUD_DIR/cron.php
*/5 * * * * root sudo -u www-data php8.2 -f $CLOUD_DIR/occ dav:send-event-reminders
EOF
chmod +x /etc/cron.d/cron-nextcloud
# 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
hide_output sudo -u www-data php8.2 -f $CLOUD_DIR/occ config:app:set dav sendEventRemindersMode --value occ
# Run the maintenance command
hide_output sudo -u www-data php8.2 $CLOUD_DIR/occ maintenance:repair --include-expensive
# Set the config to read-only
sed -i'' "s/'config_is_read_only'\s*=>\s*false/'config_is_read_only' => true/" "$STORAGE_ROOT/owncloud/config.php"
# Create nextcloud log in /var/log
hide_output install -m 644 conf/rsyslog/20-nextcloud.conf /etc/rsyslog.d/
# There's nothing much of interest that a user could do as an admin for Nextcloud,
# and there's a lot they could mess up, so we don't make any users admins of Nextcloud.
# But if we wanted to, we would do this:
# ```
# for user in $(management/cli.py user admins); do
# sqlite3 $STORAGE_ROOT/owncloud/owncloud.db "INSERT OR IGNORE INTO oc_group_user VALUES ('admin', '$user')"
# done
# ```
# Enable PHP modules and restart PHP.
restart_service php8.2-fpm
#echo -n "Configuring Redis Cache for nextCloud..."
#hide_output add-apt-repository -y ppa:chris-lea/redis-server
#hide_output apt-get update
#apt_get_quiet upgrade
#apt_install redis-server
#systemctl restart apache2
#systemctl restart nginx
#phpenmod redis
#hide_output systemctl start redis-server
#hide_output systemctl enable redis-server
#apt_install php-redis
#cat >> $STORAGE_ROOT/owncloud/config/config.php <<EOF
#'memcache.distributed' => '\OC\Memcache\Redis',
#'memcache.local' => '\OC\Memcache\Redis',
#'memcache.locking' => '\OC\Memcache\Redis',
#'redis' => array(
# 'host' => 'localhost',
# 'port' => 6379,
# ),
#EOF
}
#---------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment