cleanup update.sh

This commit is contained in:
nachoparker 2019-04-05 00:22:25 -06:00
parent 194d11101b
commit c775a46b3f

View File

@ -128,8 +128,6 @@ cp -r ncp-app /var/www/
# docker images only
[[ -f /.docker-image ]] && {
# shouldn't be present in docker
rm -f /usr/local/bin/ncp/SYSTEM/nc-zram.sh /usr/local/etc/ncp-config.d/nc-zram.cfg
:
}
@ -141,63 +139,6 @@ cp -r ncp-app /var/www/
# update to the latest version
is_active_app nc-autoupdate-nc && run_app nc-autoupdate-nc
# configure MariaDB (UTF8 4 byte support)
[[ -f /etc/mysql/mariadb.conf.d/91-ncp.cnf ]] || {
cat > /etc/mysql/mariadb.conf.d/91-ncp.cnf <<EOF
[mysqld]
transaction_isolation = READ-COMMITTED
innodb_large_prefix=true
innodb_file_per_table=1
innodb_file_format=barracuda
[server]
# innodb settings
skip-name-resolve
innodb_buffer_pool_size = 256M
innodb_buffer_pool_instances = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 32M
innodb_max_dirty_pages_pct = 90
innodb_log_file_size = 32M
# disable query cache
query_cache_type = 0
query_cache_size = 0
# other
tmp_table_size= 64M
max_heap_table_size= 64M
EOF
ncc maintenance:mode --on
service mysql restart
ncc maintenance:mode --off
}
# disable .user.ini
PHPVER=7.2
[[ -f /etc/php/${PHPVER}/fpm/conf.d/90-ncp.ini ]] || {
MAXFILESIZE="$(grep upload_max_filesize /var/www/nextcloud/.user.ini | cut -d= -f2)"
MEMORYLIMIT="$(grep memory_limit /var/www/nextcloud/.user.ini | cut -d= -f2)"
cat > /etc/php/${PHPVER}/fpm/conf.d/90-ncp.ini <<EOF
; disable .user.ini files for performance and workaround NC update bugs
user_ini.filename =
; from Nextcloud .user.ini
upload_max_filesize=$MAXFILESIZE
post_max_size=$MAXFILESIZE
memory_limit=$MEMORYLIMIT
mbstring.func_overload=0
always_populate_raw_post_data=-1
default_charset='UTF-8'
output_buffering=0
; slow transfers will be killed after this time
max_execution_time=3600
max_input_time=3600
EOF
bash -c "sleep 3 && service php$PHPVER-fpm restart" &
}
# previews settings
ncc config:app:set previewgenerator squareSizes --value="32"
ncc config:app:set previewgenerator widthSizes --value="128 256 512"