0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2024-11-18 02:56:42 +01:00

Runs update.sh

This commit is contained in:
GitHub Workflow 2022-04-26 05:42:34 +00:00
parent b842cb3bb5
commit a497f03af8
19 changed files with 631 additions and 493 deletions

View file

@ -122,7 +122,7 @@ RUN a2enmod headers rewrite remoteip ;\
} > /etc/apache2/conf-available/remoteip.conf;\ } > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip a2enconf remoteip
ENV NEXTCLOUD_VERSION 22.2.6 ENV NEXTCLOUD_VERSION 22.2.7
RUN set -ex; \ RUN set -ex; \
fetchDeps=" \ fetchDeps=" \

View file

@ -101,6 +101,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
else else
rsync_options="-rlD" rsync_options="-rlD"
fi fi
# If another process is syncing the html folder, wait for
# it to be done, then escape initalization
lock=/var/www/html/nextcloud-init-sync.lock
count=0
if [ -f "$lock" ]; then
until [ ! -f "$lock" ]
do
count=$((count+1))
wait=$((count*10))
echo "Another process is initializing Nextcloud. Waiting $wait seconds..."
sleep $wait
done
echo "The other process is done, assuming complete initialization"
else
# Prevent multiple images syncing simultaneously
touch $lock
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
for dir in config data custom_apps themes; do for dir in config data custom_apps themes; do
@ -109,9 +127,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
done done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
echo "Initializing finished"
#install # Install
if [ "$installed_version" = "0.0.0.0" ]; then if [ "$installed_version" = "0.0.0.0" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
@ -152,21 +169,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
if [ "$install" = true ]; then if [ "$install" = true ]; then
echo "starting nextcloud installation" echo "Starting nextcloud installation"
max_retries=10 max_retries=10
try=0 try=0
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
do do
echo "retrying install..." echo "Retrying install..."
try=$((try+1)) try=$((try+1))
sleep 10s sleep 10s
done done
if [ "$try" -gt "$max_retries" ]; then if [ "$try" -gt "$max_retries" ]; then
echo "installing of nextcloud failed!" echo "Installing of nextcloud failed!"
exit 1 exit 1
fi fi
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
echo "setting trusted domains…" echo "Setting trusted domains…"
NC_TRUSTED_DOMAIN_IDX=1 NC_TRUSTED_DOMAIN_IDX=1
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
@ -175,10 +192,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
done done
fi fi
else else
echo "running web-based installer on first connect!" echo "Please run the web-based installer on first connect!"
fi fi
fi fi
#upgrade # Upgrade
else else
run_as 'php /var/www/html/occ upgrade' run_as 'php /var/www/html/occ upgrade'
@ -188,6 +205,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rm -f /tmp/list_before /tmp/list_after rm -f /tmp/list_before /tmp/list_after
fi fi
# Initialization done, reset lock
rm $lock
echo "Initializing finished"
fi
fi fi
fi fi

View file

@ -3,3 +3,4 @@
/custom_apps/ /custom_apps/
/themes/ /themes/
/version.php /version.php
/nextcloud-init-sync.lock

View file

@ -102,7 +102,7 @@ RUN { \
VOLUME /var/www/html VOLUME /var/www/html
ENV NEXTCLOUD_VERSION 22.2.6 ENV NEXTCLOUD_VERSION 22.2.7
RUN set -ex; \ RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \ apk add --no-cache --virtual .fetch-deps \

View file

@ -101,6 +101,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
else else
rsync_options="-rlD" rsync_options="-rlD"
fi fi
# If another process is syncing the html folder, wait for
# it to be done, then escape initalization
lock=/var/www/html/nextcloud-init-sync.lock
count=0
if [ -f "$lock" ]; then
until [ ! -f "$lock" ]
do
count=$((count+1))
wait=$((count*10))
echo "Another process is initializing Nextcloud. Waiting $wait seconds..."
sleep $wait
done
echo "The other process is done, assuming complete initialization"
else
# Prevent multiple images syncing simultaneously
touch $lock
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
for dir in config data custom_apps themes; do for dir in config data custom_apps themes; do
@ -109,9 +127,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
done done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
echo "Initializing finished"
#install # Install
if [ "$installed_version" = "0.0.0.0" ]; then if [ "$installed_version" = "0.0.0.0" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
@ -152,21 +169,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
if [ "$install" = true ]; then if [ "$install" = true ]; then
echo "starting nextcloud installation" echo "Starting nextcloud installation"
max_retries=10 max_retries=10
try=0 try=0
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
do do
echo "retrying install..." echo "Retrying install..."
try=$((try+1)) try=$((try+1))
sleep 10s sleep 10s
done done
if [ "$try" -gt "$max_retries" ]; then if [ "$try" -gt "$max_retries" ]; then
echo "installing of nextcloud failed!" echo "Installing of nextcloud failed!"
exit 1 exit 1
fi fi
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
echo "setting trusted domains…" echo "Setting trusted domains…"
NC_TRUSTED_DOMAIN_IDX=1 NC_TRUSTED_DOMAIN_IDX=1
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
@ -175,10 +192,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
done done
fi fi
else else
echo "running web-based installer on first connect!" echo "Please run the web-based installer on first connect!"
fi fi
fi fi
#upgrade # Upgrade
else else
run_as 'php /var/www/html/occ upgrade' run_as 'php /var/www/html/occ upgrade'
@ -188,6 +205,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rm -f /tmp/list_before /tmp/list_after rm -f /tmp/list_before /tmp/list_after
fi fi
# Initialization done, reset lock
rm $lock
echo "Initializing finished"
fi
fi fi
fi fi

View file

@ -3,3 +3,4 @@
/custom_apps/ /custom_apps/
/themes/ /themes/
/version.php /version.php
/nextcloud-init-sync.lock

View file

@ -114,7 +114,7 @@ RUN { \
VOLUME /var/www/html VOLUME /var/www/html
ENV NEXTCLOUD_VERSION 22.2.6 ENV NEXTCLOUD_VERSION 22.2.7
RUN set -ex; \ RUN set -ex; \
fetchDeps=" \ fetchDeps=" \

View file

@ -101,6 +101,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
else else
rsync_options="-rlD" rsync_options="-rlD"
fi fi
# If another process is syncing the html folder, wait for
# it to be done, then escape initalization
lock=/var/www/html/nextcloud-init-sync.lock
count=0
if [ -f "$lock" ]; then
until [ ! -f "$lock" ]
do
count=$((count+1))
wait=$((count*10))
echo "Another process is initializing Nextcloud. Waiting $wait seconds..."
sleep $wait
done
echo "The other process is done, assuming complete initialization"
else
# Prevent multiple images syncing simultaneously
touch $lock
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
for dir in config data custom_apps themes; do for dir in config data custom_apps themes; do
@ -109,9 +127,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
done done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
echo "Initializing finished"
#install # Install
if [ "$installed_version" = "0.0.0.0" ]; then if [ "$installed_version" = "0.0.0.0" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
@ -152,21 +169,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
if [ "$install" = true ]; then if [ "$install" = true ]; then
echo "starting nextcloud installation" echo "Starting nextcloud installation"
max_retries=10 max_retries=10
try=0 try=0
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
do do
echo "retrying install..." echo "Retrying install..."
try=$((try+1)) try=$((try+1))
sleep 10s sleep 10s
done done
if [ "$try" -gt "$max_retries" ]; then if [ "$try" -gt "$max_retries" ]; then
echo "installing of nextcloud failed!" echo "Installing of nextcloud failed!"
exit 1 exit 1
fi fi
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
echo "setting trusted domains…" echo "Setting trusted domains…"
NC_TRUSTED_DOMAIN_IDX=1 NC_TRUSTED_DOMAIN_IDX=1
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
@ -175,10 +192,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
done done
fi fi
else else
echo "running web-based installer on first connect!" echo "Please run the web-based installer on first connect!"
fi fi
fi fi
#upgrade # Upgrade
else else
run_as 'php /var/www/html/occ upgrade' run_as 'php /var/www/html/occ upgrade'
@ -188,6 +205,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rm -f /tmp/list_before /tmp/list_after rm -f /tmp/list_before /tmp/list_after
fi fi
# Initialization done, reset lock
rm $lock
echo "Initializing finished"
fi
fi fi
fi fi

View file

@ -3,3 +3,4 @@
/custom_apps/ /custom_apps/
/themes/ /themes/
/version.php /version.php
/nextcloud-init-sync.lock

View file

@ -122,7 +122,7 @@ RUN a2enmod headers rewrite remoteip ;\
} > /etc/apache2/conf-available/remoteip.conf;\ } > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip a2enconf remoteip
ENV NEXTCLOUD_VERSION 23.0.3 ENV NEXTCLOUD_VERSION 23.0.4
RUN set -ex; \ RUN set -ex; \
fetchDeps=" \ fetchDeps=" \

View file

@ -101,6 +101,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
else else
rsync_options="-rlD" rsync_options="-rlD"
fi fi
# If another process is syncing the html folder, wait for
# it to be done, then escape initalization
lock=/var/www/html/nextcloud-init-sync.lock
count=0
if [ -f "$lock" ]; then
until [ ! -f "$lock" ]
do
count=$((count+1))
wait=$((count*10))
echo "Another process is initializing Nextcloud. Waiting $wait seconds..."
sleep $wait
done
echo "The other process is done, assuming complete initialization"
else
# Prevent multiple images syncing simultaneously
touch $lock
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
for dir in config data custom_apps themes; do for dir in config data custom_apps themes; do
@ -109,9 +127,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
done done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
echo "Initializing finished"
#install # Install
if [ "$installed_version" = "0.0.0.0" ]; then if [ "$installed_version" = "0.0.0.0" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
@ -152,21 +169,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
if [ "$install" = true ]; then if [ "$install" = true ]; then
echo "starting nextcloud installation" echo "Starting nextcloud installation"
max_retries=10 max_retries=10
try=0 try=0
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
do do
echo "retrying install..." echo "Retrying install..."
try=$((try+1)) try=$((try+1))
sleep 10s sleep 10s
done done
if [ "$try" -gt "$max_retries" ]; then if [ "$try" -gt "$max_retries" ]; then
echo "installing of nextcloud failed!" echo "Installing of nextcloud failed!"
exit 1 exit 1
fi fi
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
echo "setting trusted domains…" echo "Setting trusted domains…"
NC_TRUSTED_DOMAIN_IDX=1 NC_TRUSTED_DOMAIN_IDX=1
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
@ -175,10 +192,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
done done
fi fi
else else
echo "running web-based installer on first connect!" echo "Please run the web-based installer on first connect!"
fi fi
fi fi
#upgrade # Upgrade
else else
run_as 'php /var/www/html/occ upgrade' run_as 'php /var/www/html/occ upgrade'
@ -188,6 +205,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rm -f /tmp/list_before /tmp/list_after rm -f /tmp/list_before /tmp/list_after
fi fi
# Initialization done, reset lock
rm $lock
echo "Initializing finished"
fi
fi fi
fi fi

View file

@ -3,3 +3,4 @@
/custom_apps/ /custom_apps/
/themes/ /themes/
/version.php /version.php
/nextcloud-init-sync.lock

View file

@ -102,7 +102,7 @@ RUN { \
VOLUME /var/www/html VOLUME /var/www/html
ENV NEXTCLOUD_VERSION 23.0.3 ENV NEXTCLOUD_VERSION 23.0.4
RUN set -ex; \ RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \ apk add --no-cache --virtual .fetch-deps \

View file

@ -101,6 +101,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
else else
rsync_options="-rlD" rsync_options="-rlD"
fi fi
# If another process is syncing the html folder, wait for
# it to be done, then escape initalization
lock=/var/www/html/nextcloud-init-sync.lock
count=0
if [ -f "$lock" ]; then
until [ ! -f "$lock" ]
do
count=$((count+1))
wait=$((count*10))
echo "Another process is initializing Nextcloud. Waiting $wait seconds..."
sleep $wait
done
echo "The other process is done, assuming complete initialization"
else
# Prevent multiple images syncing simultaneously
touch $lock
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
for dir in config data custom_apps themes; do for dir in config data custom_apps themes; do
@ -109,9 +127,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
done done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
echo "Initializing finished"
#install # Install
if [ "$installed_version" = "0.0.0.0" ]; then if [ "$installed_version" = "0.0.0.0" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
@ -152,21 +169,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
if [ "$install" = true ]; then if [ "$install" = true ]; then
echo "starting nextcloud installation" echo "Starting nextcloud installation"
max_retries=10 max_retries=10
try=0 try=0
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
do do
echo "retrying install..." echo "Retrying install..."
try=$((try+1)) try=$((try+1))
sleep 10s sleep 10s
done done
if [ "$try" -gt "$max_retries" ]; then if [ "$try" -gt "$max_retries" ]; then
echo "installing of nextcloud failed!" echo "Installing of nextcloud failed!"
exit 1 exit 1
fi fi
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
echo "setting trusted domains…" echo "Setting trusted domains…"
NC_TRUSTED_DOMAIN_IDX=1 NC_TRUSTED_DOMAIN_IDX=1
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
@ -175,10 +192,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
done done
fi fi
else else
echo "running web-based installer on first connect!" echo "Please run the web-based installer on first connect!"
fi fi
fi fi
#upgrade # Upgrade
else else
run_as 'php /var/www/html/occ upgrade' run_as 'php /var/www/html/occ upgrade'
@ -188,6 +205,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rm -f /tmp/list_before /tmp/list_after rm -f /tmp/list_before /tmp/list_after
fi fi
# Initialization done, reset lock
rm $lock
echo "Initializing finished"
fi
fi fi
fi fi

View file

@ -3,3 +3,4 @@
/custom_apps/ /custom_apps/
/themes/ /themes/
/version.php /version.php
/nextcloud-init-sync.lock

View file

@ -114,7 +114,7 @@ RUN { \
VOLUME /var/www/html VOLUME /var/www/html
ENV NEXTCLOUD_VERSION 23.0.3 ENV NEXTCLOUD_VERSION 23.0.4
RUN set -ex; \ RUN set -ex; \
fetchDeps=" \ fetchDeps=" \

View file

@ -101,6 +101,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
else else
rsync_options="-rlD" rsync_options="-rlD"
fi fi
# If another process is syncing the html folder, wait for
# it to be done, then escape initalization
lock=/var/www/html/nextcloud-init-sync.lock
count=0
if [ -f "$lock" ]; then
until [ ! -f "$lock" ]
do
count=$((count+1))
wait=$((count*10))
echo "Another process is initializing Nextcloud. Waiting $wait seconds..."
sleep $wait
done
echo "The other process is done, assuming complete initialization"
else
# Prevent multiple images syncing simultaneously
touch $lock
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
for dir in config data custom_apps themes; do for dir in config data custom_apps themes; do
@ -109,9 +127,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
done done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
echo "Initializing finished"
#install # Install
if [ "$installed_version" = "0.0.0.0" ]; then if [ "$installed_version" = "0.0.0.0" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
@ -152,21 +169,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
if [ "$install" = true ]; then if [ "$install" = true ]; then
echo "starting nextcloud installation" echo "Starting nextcloud installation"
max_retries=10 max_retries=10
try=0 try=0
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ] until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
do do
echo "retrying install..." echo "Retrying install..."
try=$((try+1)) try=$((try+1))
sleep 10s sleep 10s
done done
if [ "$try" -gt "$max_retries" ]; then if [ "$try" -gt "$max_retries" ]; then
echo "installing of nextcloud failed!" echo "Installing of nextcloud failed!"
exit 1 exit 1
fi fi
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
echo "setting trusted domains…" echo "Setting trusted domains…"
NC_TRUSTED_DOMAIN_IDX=1 NC_TRUSTED_DOMAIN_IDX=1
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
@ -175,10 +192,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
done done
fi fi
else else
echo "running web-based installer on first connect!" echo "Please run the web-based installer on first connect!"
fi fi
fi fi
#upgrade # Upgrade
else else
run_as 'php /var/www/html/occ upgrade' run_as 'php /var/www/html/occ upgrade'
@ -188,6 +205,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rm -f /tmp/list_before /tmp/list_after rm -f /tmp/list_before /tmp/list_after
fi fi
# Initialization done, reset lock
rm $lock
echo "Initializing finished"
fi
fi fi
fi fi

View file

@ -3,3 +3,4 @@
/custom_apps/ /custom_apps/
/themes/ /themes/
/version.php /version.php
/nextcloud-init-sync.lock

View file

@ -1 +1 @@
23.0.3 23.0.4