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

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2017-11-06 21:55:44 +0300
committernachoparker <nacho@ownyourbits.com>2017-11-09 19:04:31 +0300
commit7e2abc9133f9f6f22b7db15e9b47e9ec75da9865 (patch)
treefc3a49c0ab0401781f607399525d58e9234d20f1
parent9fbdb3e357814f9f8398d229c4ed834f233bf023 (diff)
added redisv0.33.0
-rw-r--r--changelog.md8
-rw-r--r--etc/nextcloudpi-config.d/nc-init.sh15
-rw-r--r--etc/nextcloudpi-config.d/nc-nextcloud.sh17
-rw-r--r--lamp.sh13
-rwxr-xr-xupdate.sh50
5 files changed, 83 insertions, 20 deletions
diff --git a/changelog.md b/changelog.md
index eb3b3ab7..43c72ae9 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,7 +1,11 @@
-[v0.32.7](https://github.com/nextcloud/nextcloudpi/commit/ae1c47a) (2017-11-09) nc-notify-updates: fixes
+[v0.34.0](https://github.com/nextcloud/nextcloudpi/commit/d2f8ce2) (2017-11-06) added redis
-[v0.32.6](https://github.com/nextcloud/nextcloudpi/commit/455cb73) (2017-11-08) noip: manage many interfaces and fix return value
+[v0.33.0](https://github.com/nextcloud/nextcloudpi/commit/c3b35e1) (2017-11-07) added NCP custom theme with new logo
+
+[v0.32.7 ](https://github.com/nextcloud/nextcloudpi/commit/555d86b) (2017-11-09) nc-notify-updates: fixes
+
+[v0.32.6 ](https://github.com/nextcloud/nextcloudpi/commit/455cb73) (2017-11-08) noip: manage many interfaces and fix return value
[v0.32.5 ](https://github.com/nextcloud/nextcloudpi/commit/3147047) (2017-11-08) update: wait running apt processes
diff --git a/etc/nextcloudpi-config.d/nc-init.sh b/etc/nextcloudpi-config.d/nc-init.sh
index 6fab5e5f..0f416941 100644
--- a/etc/nextcloudpi-config.d/nc-init.sh
+++ b/etc/nextcloudpi-config.d/nc-init.sh
@@ -67,8 +67,19 @@ EOF
# cron jobs
sudo -u www-data php occ background:cron
- # ACPu cache
- sed -i '$i\ \ '\''memcache.local'\'' => '\''\\\\OC\\\\Memcache\\\\APCu'\'',' /var/www/nextcloud/config/config.php
+ # redis cache
+ sed -i '$d' config/config.php
+ cat >> config/config.php <<'EOF'
+ 'memcache.local' => '\OC\Memcache\Redis',
+ 'memcache.locking' => '\OC\Memcache\Redis',
+ 'redis' =>
+ array (
+ 'host' => '/var/run/redis/redis.sock',
+ 'port' => 0,
+ 'timeout' => 0.0,
+ ),
+);
+EOF
# 4 Byte UTF8 support
sudo -u www-data php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
diff --git a/etc/nextcloudpi-config.d/nc-nextcloud.sh b/etc/nextcloudpi-config.d/nc-nextcloud.sh
index bff9152b..37cf7919 100644
--- a/etc/nextcloudpi-config.d/nc-nextcloud.sh
+++ b/etc/nextcloudpi-config.d/nc-nextcloud.sh
@@ -19,6 +19,7 @@ MAXFILESIZE_=2G
MEMORYLIMIT_=768M
MAXTRANSFERTIME_=3600
DBADMIN=ncadmin
+REDIS_MEM=3gb
DESCRIPTION="Install any NextCloud version"
APTINSTALL="apt-get install -y --no-install-recommends"
@@ -42,11 +43,25 @@ install()
apt-get update
$APTINSTALL -o "Dpkg::Options::=--force-confold" php-smbclient
$APTINSTALL postfix lbzip2 iputils-ping
+
+ # REDIS
+ $APTINSTALL redis-server php7.0-redis
+
+ local REDIS_CONF=/etc/redis/redis.conf
+ sed -i "s|# unixsocket.*|unixsocket /var/run/redis/redis.sock|" $REDIS_CONF
+ sed -i "s|# unixsocketperm.*|unixsocketperm 777|" $REDIS_CONF
+ sed -i "s|port.*|port 0|" $REDIS_CONF
+ echo "maxmemory ${REDIS_MEM}" >> $REDIS_CONF
+ echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
+
+ sudo usermod -a -G redis www-data
+
+ systemctl enable redis-server
}
configure()
{
- ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; return 1; }
+ ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; return 1; }
## RE-CREATE DATABASE TABLE
echo "Starting mariaDB"
diff --git a/lamp.sh b/lamp.sh
index 73079c7f..e78c9562 100644
--- a/lamp.sh
+++ b/lamp.sh
@@ -32,7 +32,7 @@ install()
$APTINSTALL apt-utils
$APTINSTALL cron
$APTINSTALL apache2
- $APTINSTALL php7.0 php7.0-curl php7.0-gd php7.0-fpm php7.0-cli php7.0-opcache php7.0-mbstring php7.0-xml php7.0-zip php7.0-APC php7.0-fileinfo php7.0-mcrypt
+ $APTINSTALL php7.0 php7.0-curl php7.0-gd php7.0-fpm php7.0-cli php7.0-opcache php7.0-mbstring php7.0-xml php7.0-zip php7.0-fileinfo php7.0-mcrypt
mkdir -p /run/php
# Randomize mariaDB password
@@ -74,17 +74,6 @@ EOF
# CONFIGURE PHP7
##########################################
- cat > /etc/php/7.0/mods-available/apcu.ini <<EOF
-extension=apcu.so
-apc.enable_cli=0
-apc.shm_size=256M
-apc.ttl=7200
-apc.gc_ttl=3600
-apc.entries_hint=4096
-apc.slam_defense=1
-apc.serializer=igbinary
-EOF
-
cat > /etc/php/7.0/mods-available/opcache.ini <<EOF
zend_extension=opcache.so
opcache.enable=1
diff --git a/update.sh b/update.sh
index 03ad5a7e..1688a081 100755
--- a/update.sh
+++ b/update.sh
@@ -230,10 +230,54 @@ EOF
grep -q TimeOut /etc/apache2/sites-enabled/ncp.conf || \
sed -i '/SSLCertificateKeyFile/aTimeOut 172800' /etc/apache2/sites-enabled/ncp.conf
-# relocate noip2 config
-mkdir -p /usr/local/etc/noip2
+ # relocate noip2 config
+ mkdir -p /usr/local/etc/noip2
- # fix unattended
+ # redis
+ grep -q APCu /var/www/nextcloud/config/config.php && {
+ echo "installing redis..."
+ apt-get update
+ apt-get install -y --no-install-recommends redis-server php7.0-redis
+
+ sed -i '/memcache/d' /var/www/nextcloud/config/config.php
+ sed -i '$d' /var/www/nextcloud/config/config.php
+
+ cat >> /var/www/nextcloud/config/config.php <<'EOF'
+ 'memcache.local' => '\OC\Memcache\Redis',
+ 'memcache.locking' => '\OC\Memcache\Redis',
+ 'redis' =>
+ array (
+ 'host' => '/var/run/redis/redis.sock',
+ 'port' => 0,
+ 'timeout' => 0.0,
+ ),
+);
+EOF
+
+ REDIS_CONF=/etc/redis/redis.conf
+ REDIS_MEM=3gb
+ sed -i "s|# unixsocket.*|unixsocket /var/run/redis/redis.sock|" $REDIS_CONF
+ sed -i "s|# unixsocketperm.*|unixsocketperm 777|" $REDIS_CONF
+ sed -i "s|port.*|port 0|" $REDIS_CONF
+ echo "maxmemory ${REDIS_MEM}" >> $REDIS_CONF
+ echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
+
+ sudo usermod -a -G redis www-data
+
+ systemctl restart redis-server
+ systemctl enable redis-server
+
+ # need to restart php
+ bash -c " sleep 3
+ systemctl stop php7.0-fpm
+ systemctl stop mysqld
+ sleep 0.5
+ systemctl start php7.0-fpm
+ systemctl start mysqld
+ " &>/dev/null &
+ }
+
+# fix unattended
NUSER=$( grep USER_ /usr/local/etc/nextcloudpi-config.d/nc-notify-updates.sh | head -1 | cut -f2 -d= )
cat > /usr/local/bin/ncp-notify-unattended-upgrade <<EOF
#!/bin/bash