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>2018-10-02 05:14:22 +0300
committernachoparker <nacho@ownyourbits.com>2018-10-02 05:20:03 +0300
commit6aa9dfd21f6362a82037202b11a9edbf7f56a572 (patch)
tree481eb4cafd731e95deefa9ffd505987f234f68d5
parenta74f1d5f1e55f211a6a6dbcb560a17203cf70a3e (diff)
docker: fix upgrade to PHP7.2
-rw-r--r--changelog.md8
-rwxr-xr-xdocker-common/debian-ncp/run-parts.sh2
-rwxr-xr-xdocker-common/nextcloud/020nextcloud27
-rwxr-xr-xupdate.sh21
4 files changed, 34 insertions, 24 deletions
diff --git a/changelog.md b/changelog.md
index df54143a..78ea942e 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,9 +1,11 @@
-[v0.62.0](https://github.com/nextcloud/nextcloudpi/commit/aca5004) (2018-09-23) upgrade to NC14
+[v0.62.1 ](https://github.com/nextcloud/nextcloudpi/commit/4f20b71) (2018-09-30) redis: change eviction policy
-[v0.61.0, php72](https://github.com/nextcloud/nextcloudpi/commit/20c1e8a) (2018-06-21) upgrade to PHP7.2
+[v0.62.0 ](https://github.com/nextcloud/nextcloudpi/commit/4bce1bb) (2018-09-26) upgrade to PHP7.2
-[v0.60.8](https://github.com/nextcloud/nextcloudpi/commit/6152e7e) (2018-09-24) ncp-web: put configuration in a separate file from available languages
+[v0.61.0 ](https://github.com/nextcloud/nextcloudpi/commit/66e4d83) (2018-09-26) upgrade to NC14
+
+[v0.60.8 ](https://github.com/nextcloud/nextcloudpi/commit/6152e7e) (2018-09-24) ncp-web: put configuration in a separate file from available languages
[v0.60.7 ](https://github.com/nextcloud/nextcloudpi/commit/cdbb750) (2018-09-24) docker: disable auto-upgrade until it is adapted to containers
diff --git a/docker-common/debian-ncp/run-parts.sh b/docker-common/debian-ncp/run-parts.sh
index eddb03d0..c2a04b79 100755
--- a/docker-common/debian-ncp/run-parts.sh
+++ b/docker-common/debian-ncp/run-parts.sh
@@ -21,7 +21,7 @@ FILE=/etc/services-available.d/???"$1"
test -f $FILE || {
echo "$1 doesn't exist"
- exit 1
+ exit 0
}
[[ "$2" == "enable" ]] && {
diff --git a/docker-common/nextcloud/020nextcloud b/docker-common/nextcloud/020nextcloud
index 19311f3b..686aaaa2 100755
--- a/docker-common/nextcloud/020nextcloud
+++ b/docker-common/nextcloud/020nextcloud
@@ -20,10 +20,6 @@ set -e
rm /var/www/nextcloud
ln -s /data/app /var/www/nextcloud
-echo "Provisioning"
-DB_PID="$( pidof mysqld )"
-bash /usr/local/bin/ncp-provisioning.sh
-
echo "Starting Redis"
mkdir -p /var/run/redis
chown redis /var/run/redis
@@ -38,18 +34,24 @@ postfix start
# INIT DATABASE AND NEXTCLOUD CONFIG (first run)
test -f /data/app/config/config.php || {
echo "Uninitialized instance, running nc-init..."
-
- # mariaDB is restarted in the backgroud during provisioning
- while kill -0 "$DB_PID" 2>/dev/null; do sleep 0.5; done
- while :; do
- [[ -S /run/mysqld/mysqld.sock ]] && break
- sleep 0.5
- done
source /usr/local/etc/library.sh
activate_script /nc-init.sh
mv /index.php /var/www/nextcloud/ # restore this file after init
}
+# Better do real provisioning at the end, as it can restart PHP asynchronously
+sed -i "s|'password'.*|'password' => 'default',|" /data/app/config/config.php
+sed -i "s|'dbpassword' =>.*|'dbpassword' => 'default',|" /data/app/config/config.php
+DBPASSWD=default
+DBADMIN=ncadmin
+mysql <<EOF
+GRANT USAGE ON *.* TO '$DBADMIN'@'localhost' IDENTIFIED BY '$DBPASSWD';
+DROP USER '$DBADMIN'@'localhost';
+CREATE USER '$DBADMIN'@'localhost' IDENTIFIED BY '$DBPASSWD';
+GRANT ALL PRIVILEGES ON nextcloud.* TO $DBADMIN@localhost;
+EXIT
+EOF
+
# Trusted Domain ( local IP )
IFACE=$( ip r | grep "default via" | awk '{ print $5 }' | head -1 )
IP=$( ip a show dev "$IFACE" | grep global | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 )
@@ -59,6 +61,9 @@ ncc config:system:set trusted_domains 1 --value="$IP"
[[ "$2" != "" ]] && \
ncc config:system:set trusted_domains 6 --value="$2"
+echo "Provisioning"
+bash /usr/local/bin/ncp-provisioning.sh
+
# Display NC logs in the docker logs
tail -f -n0 /data/app/data/nextcloud.log &
diff --git a/update.sh b/update.sh
index 2171baf8..c175a699 100755
--- a/update.sh
+++ b/update.sh
@@ -138,6 +138,8 @@ EOF
/etc/services-available.d/000ncp
rm /data/etc/letsencrypt/live
mv /data/etc/live /data/etc/letsencrypt
+
+ sed -i 's|exit 1|exit 0|' /usr/local/sbin/update-rc.d
}
}
@@ -194,19 +196,21 @@ EOF
ncc maintenance:mode --on
- apt-get update
- $APTINSTALL apt-transport-https
+ [[ -f /usr/bin/raspi-config ]] && {
+ apt-get update
+ $APTINSTALL apt-transport-https
+
+ echo "deb https://deb.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list.d/ncp-buster.list
+ apt-get --allow-unauthenticated update
+ $APTINSTALL --allow-unauthenticated debian-archive-keyring
+ }
- echo "deb https://deb.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list.d/ncp-buster.list
+ echo "deb http://deb.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list.d/ncp-buster.list
cat > /etc/apt/preferences.d/10-ncp-buster <<EOF
Package: *
Pin: release n=stretch
Pin-Priority: 600
EOF
-
- apt-get --allow-unauthenticated update
- $APTINSTALL --allow-unauthenticated debian-archive-keyring
-
apt-get update
apt-get purge -y php7.0-*
@@ -258,7 +262,7 @@ EOF
service mysql start
" &>/dev/null &
- # PHP7.2 end
+ } # PHP7.2 end
# Redis eviction policy
grep -q "^maxmemory-policy allkeys-lru" /etc/redis/redis.conf || {
@@ -277,7 +281,6 @@ EOF
# nc-prettyURL: fix for NC14
URL="$(ncc config:system:get overwrite.cli.url)"
[[ "${URL: -1}" != "/" ]] && ncc config:system:set overwrite.cli.url --value="${URL}/"
- }
} # end - only live updates