mirror of
https://github.com/nextcloud/docker.git
synced 2024-11-05 22:04:58 +01:00
Runs update.sh
This commit is contained in:
parent
d3251467e6
commit
040d8687a6
19 changed files with 447 additions and 24 deletions
|
@ -111,6 +111,11 @@ RUN { \
|
||||||
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
||||||
\
|
\
|
||||||
mkdir /var/www/data; \
|
mkdir /var/www/data; \
|
||||||
|
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
|
||||||
|
/docker-entrypoint-hooks.d/post-installation \
|
||||||
|
/docker-entrypoint-hooks.d/pre-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/post-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/before-starting; \
|
||||||
chown -R www-data:root /var/www; \
|
chown -R www-data:root /var/www; \
|
||||||
chmod -R g=u /var/www
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
|
@ -125,7 +130,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 25.0.7
|
ENV NEXTCLOUD_VERSION 25.0.8
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
fetchDeps=" \
|
fetchDeps=" \
|
||||||
|
@ -135,8 +140,8 @@ RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -19,6 +19,39 @@ run_as() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Execute all executable files in a given directory in alphanumeric order
|
||||||
|
run_path() {
|
||||||
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
|
local return_code=0
|
||||||
|
|
||||||
|
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
||||||
|
|
||||||
|
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
|
||||||
|
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
for script_file_path in "${hook_folder_path}/"*.sh; do
|
||||||
|
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
|
||||||
|
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
|
||||||
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
|
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Finished the script: \"${script_file_path}\""
|
||||||
|
done
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# usage: file_env VAR [DEFAULT]
|
# usage: file_env VAR [DEFAULT]
|
||||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||||
|
@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$install" = true ]; then
|
if [ "$install" = true ]; then
|
||||||
|
run_path pre-installation
|
||||||
|
|
||||||
echo "Starting nextcloud installation"
|
echo "Starting nextcloud installation"
|
||||||
max_retries=10
|
max_retries=10
|
||||||
try=0
|
try=0
|
||||||
|
@ -204,12 +239,16 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_path post-installation
|
||||||
else
|
else
|
||||||
echo "Please run the 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_path pre-upgrade
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ upgrade'
|
run_as 'php /var/www/html/occ upgrade'
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||||
|
@ -217,6 +256,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
rm -f /tmp/list_before /tmp/list_after
|
||||||
|
|
||||||
|
run_path post-upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Initializing finished"
|
echo "Initializing finished"
|
||||||
|
@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
||||||
fi
|
fi
|
||||||
) 9> /var/www/html/nextcloud-init-sync.lock
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
|
|
||||||
|
run_path before-starting
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -99,13 +99,18 @@ RUN { \
|
||||||
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
||||||
\
|
\
|
||||||
mkdir /var/www/data; \
|
mkdir /var/www/data; \
|
||||||
|
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
|
||||||
|
/docker-entrypoint-hooks.d/post-installation \
|
||||||
|
/docker-entrypoint-hooks.d/pre-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/post-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/before-starting; \
|
||||||
chown -R www-data:root /var/www; \
|
chown -R www-data:root /var/www; \
|
||||||
chmod -R g=u /var/www
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 25.0.7
|
ENV NEXTCLOUD_VERSION 25.0.8
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apk add --no-cache --virtual .fetch-deps \
|
apk add --no-cache --virtual .fetch-deps \
|
||||||
|
@ -113,8 +118,8 @@ RUN set -ex; \
|
||||||
gnupg \
|
gnupg \
|
||||||
; \
|
; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -19,6 +19,39 @@ run_as() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Execute all executable files in a given directory in alphanumeric order
|
||||||
|
run_path() {
|
||||||
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
|
local return_code=0
|
||||||
|
|
||||||
|
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
||||||
|
|
||||||
|
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
|
||||||
|
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
for script_file_path in "${hook_folder_path}/"*.sh; do
|
||||||
|
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
|
||||||
|
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
|
||||||
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
|
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Finished the script: \"${script_file_path}\""
|
||||||
|
done
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# usage: file_env VAR [DEFAULT]
|
# usage: file_env VAR [DEFAULT]
|
||||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||||
|
@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$install" = true ]; then
|
if [ "$install" = true ]; then
|
||||||
|
run_path pre-installation
|
||||||
|
|
||||||
echo "Starting nextcloud installation"
|
echo "Starting nextcloud installation"
|
||||||
max_retries=10
|
max_retries=10
|
||||||
try=0
|
try=0
|
||||||
|
@ -204,12 +239,16 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_path post-installation
|
||||||
else
|
else
|
||||||
echo "Please run the 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_path pre-upgrade
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ upgrade'
|
run_as 'php /var/www/html/occ upgrade'
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||||
|
@ -217,6 +256,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
rm -f /tmp/list_before /tmp/list_after
|
||||||
|
|
||||||
|
run_path post-upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Initializing finished"
|
echo "Initializing finished"
|
||||||
|
@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
||||||
fi
|
fi
|
||||||
) 9> /var/www/html/nextcloud-init-sync.lock
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
|
|
||||||
|
run_path before-starting
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -111,13 +111,18 @@ RUN { \
|
||||||
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
||||||
\
|
\
|
||||||
mkdir /var/www/data; \
|
mkdir /var/www/data; \
|
||||||
|
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
|
||||||
|
/docker-entrypoint-hooks.d/post-installation \
|
||||||
|
/docker-entrypoint-hooks.d/pre-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/post-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/before-starting; \
|
||||||
chown -R www-data:root /var/www; \
|
chown -R www-data:root /var/www; \
|
||||||
chmod -R g=u /var/www
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 25.0.7
|
ENV NEXTCLOUD_VERSION 25.0.8
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
fetchDeps=" \
|
fetchDeps=" \
|
||||||
|
@ -127,8 +132,8 @@ RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -19,6 +19,39 @@ run_as() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Execute all executable files in a given directory in alphanumeric order
|
||||||
|
run_path() {
|
||||||
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
|
local return_code=0
|
||||||
|
|
||||||
|
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
||||||
|
|
||||||
|
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
|
||||||
|
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
for script_file_path in "${hook_folder_path}/"*.sh; do
|
||||||
|
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
|
||||||
|
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
|
||||||
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
|
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Finished the script: \"${script_file_path}\""
|
||||||
|
done
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# usage: file_env VAR [DEFAULT]
|
# usage: file_env VAR [DEFAULT]
|
||||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||||
|
@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$install" = true ]; then
|
if [ "$install" = true ]; then
|
||||||
|
run_path pre-installation
|
||||||
|
|
||||||
echo "Starting nextcloud installation"
|
echo "Starting nextcloud installation"
|
||||||
max_retries=10
|
max_retries=10
|
||||||
try=0
|
try=0
|
||||||
|
@ -204,12 +239,16 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_path post-installation
|
||||||
else
|
else
|
||||||
echo "Please run the 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_path pre-upgrade
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ upgrade'
|
run_as 'php /var/www/html/occ upgrade'
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||||
|
@ -217,6 +256,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
rm -f /tmp/list_before /tmp/list_after
|
||||||
|
|
||||||
|
run_path post-upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Initializing finished"
|
echo "Initializing finished"
|
||||||
|
@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
||||||
fi
|
fi
|
||||||
) 9> /var/www/html/nextcloud-init-sync.lock
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
|
|
||||||
|
run_path before-starting
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -112,6 +112,11 @@ RUN { \
|
||||||
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
||||||
\
|
\
|
||||||
mkdir /var/www/data; \
|
mkdir /var/www/data; \
|
||||||
|
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
|
||||||
|
/docker-entrypoint-hooks.d/post-installation \
|
||||||
|
/docker-entrypoint-hooks.d/pre-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/post-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/before-starting; \
|
||||||
chown -R www-data:root /var/www; \
|
chown -R www-data:root /var/www; \
|
||||||
chmod -R g=u /var/www
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
|
@ -126,7 +131,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 26.0.2
|
ENV NEXTCLOUD_VERSION 26.0.3
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
fetchDeps=" \
|
fetchDeps=" \
|
||||||
|
@ -136,8 +141,8 @@ RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-26.0.2.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-26.0.3.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-26.0.2.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-26.0.3.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -19,6 +19,39 @@ run_as() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Execute all executable files in a given directory in alphanumeric order
|
||||||
|
run_path() {
|
||||||
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
|
local return_code=0
|
||||||
|
|
||||||
|
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
||||||
|
|
||||||
|
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
|
||||||
|
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
for script_file_path in "${hook_folder_path}/"*.sh; do
|
||||||
|
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
|
||||||
|
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
|
||||||
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
|
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Finished the script: \"${script_file_path}\""
|
||||||
|
done
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# usage: file_env VAR [DEFAULT]
|
# usage: file_env VAR [DEFAULT]
|
||||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||||
|
@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$install" = true ]; then
|
if [ "$install" = true ]; then
|
||||||
|
run_path pre-installation
|
||||||
|
|
||||||
echo "Starting nextcloud installation"
|
echo "Starting nextcloud installation"
|
||||||
max_retries=10
|
max_retries=10
|
||||||
try=0
|
try=0
|
||||||
|
@ -204,12 +239,16 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_path post-installation
|
||||||
else
|
else
|
||||||
echo "Please run the 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_path pre-upgrade
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ upgrade'
|
run_as 'php /var/www/html/occ upgrade'
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||||
|
@ -217,6 +256,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
rm -f /tmp/list_before /tmp/list_after
|
||||||
|
|
||||||
|
run_path post-upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Initializing finished"
|
echo "Initializing finished"
|
||||||
|
@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
||||||
fi
|
fi
|
||||||
) 9> /var/www/html/nextcloud-init-sync.lock
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
|
|
||||||
|
run_path before-starting
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -100,13 +100,18 @@ RUN { \
|
||||||
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
||||||
\
|
\
|
||||||
mkdir /var/www/data; \
|
mkdir /var/www/data; \
|
||||||
|
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
|
||||||
|
/docker-entrypoint-hooks.d/post-installation \
|
||||||
|
/docker-entrypoint-hooks.d/pre-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/post-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/before-starting; \
|
||||||
chown -R www-data:root /var/www; \
|
chown -R www-data:root /var/www; \
|
||||||
chmod -R g=u /var/www
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 26.0.2
|
ENV NEXTCLOUD_VERSION 26.0.3
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apk add --no-cache --virtual .fetch-deps \
|
apk add --no-cache --virtual .fetch-deps \
|
||||||
|
@ -114,8 +119,8 @@ RUN set -ex; \
|
||||||
gnupg \
|
gnupg \
|
||||||
; \
|
; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-26.0.2.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-26.0.3.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-26.0.2.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-26.0.3.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -19,6 +19,39 @@ run_as() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Execute all executable files in a given directory in alphanumeric order
|
||||||
|
run_path() {
|
||||||
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
|
local return_code=0
|
||||||
|
|
||||||
|
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
||||||
|
|
||||||
|
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
|
||||||
|
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
for script_file_path in "${hook_folder_path}/"*.sh; do
|
||||||
|
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
|
||||||
|
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
|
||||||
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
|
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Finished the script: \"${script_file_path}\""
|
||||||
|
done
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# usage: file_env VAR [DEFAULT]
|
# usage: file_env VAR [DEFAULT]
|
||||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||||
|
@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$install" = true ]; then
|
if [ "$install" = true ]; then
|
||||||
|
run_path pre-installation
|
||||||
|
|
||||||
echo "Starting nextcloud installation"
|
echo "Starting nextcloud installation"
|
||||||
max_retries=10
|
max_retries=10
|
||||||
try=0
|
try=0
|
||||||
|
@ -204,12 +239,16 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_path post-installation
|
||||||
else
|
else
|
||||||
echo "Please run the 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_path pre-upgrade
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ upgrade'
|
run_as 'php /var/www/html/occ upgrade'
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||||
|
@ -217,6 +256,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
rm -f /tmp/list_before /tmp/list_after
|
||||||
|
|
||||||
|
run_path post-upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Initializing finished"
|
echo "Initializing finished"
|
||||||
|
@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
||||||
fi
|
fi
|
||||||
) 9> /var/www/html/nextcloud-init-sync.lock
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
|
|
||||||
|
run_path before-starting
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -112,13 +112,18 @@ RUN { \
|
||||||
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
||||||
\
|
\
|
||||||
mkdir /var/www/data; \
|
mkdir /var/www/data; \
|
||||||
|
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
|
||||||
|
/docker-entrypoint-hooks.d/post-installation \
|
||||||
|
/docker-entrypoint-hooks.d/pre-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/post-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/before-starting; \
|
||||||
chown -R www-data:root /var/www; \
|
chown -R www-data:root /var/www; \
|
||||||
chmod -R g=u /var/www
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 26.0.2
|
ENV NEXTCLOUD_VERSION 26.0.3
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
fetchDeps=" \
|
fetchDeps=" \
|
||||||
|
@ -128,8 +133,8 @@ RUN set -ex; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
\
|
\
|
||||||
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-26.0.2.tar.bz2"; \
|
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-26.0.3.tar.bz2"; \
|
||||||
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-26.0.2.tar.bz2.asc"; \
|
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-26.0.3.tar.bz2.asc"; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# gpg key from https://nextcloud.com/nextcloud.asc
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
|
|
@ -19,6 +19,39 @@ run_as() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Execute all executable files in a given directory in alphanumeric order
|
||||||
|
run_path() {
|
||||||
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
|
local return_code=0
|
||||||
|
|
||||||
|
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
||||||
|
|
||||||
|
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
|
||||||
|
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
for script_file_path in "${hook_folder_path}/"*.sh; do
|
||||||
|
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
|
||||||
|
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
|
||||||
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
|
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Finished the script: \"${script_file_path}\""
|
||||||
|
done
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# usage: file_env VAR [DEFAULT]
|
# usage: file_env VAR [DEFAULT]
|
||||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||||
|
@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$install" = true ]; then
|
if [ "$install" = true ]; then
|
||||||
|
run_path pre-installation
|
||||||
|
|
||||||
echo "Starting nextcloud installation"
|
echo "Starting nextcloud installation"
|
||||||
max_retries=10
|
max_retries=10
|
||||||
try=0
|
try=0
|
||||||
|
@ -204,12 +239,16 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_path post-installation
|
||||||
else
|
else
|
||||||
echo "Please run the 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_path pre-upgrade
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ upgrade'
|
run_as 'php /var/www/html/occ upgrade'
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||||
|
@ -217,6 +256,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
rm -f /tmp/list_before /tmp/list_after
|
||||||
|
|
||||||
|
run_path post-upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Initializing finished"
|
echo "Initializing finished"
|
||||||
|
@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
||||||
fi
|
fi
|
||||||
) 9> /var/www/html/nextcloud-init-sync.lock
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
|
|
||||||
|
run_path before-starting
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -112,6 +112,11 @@ RUN { \
|
||||||
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
||||||
\
|
\
|
||||||
mkdir /var/www/data; \
|
mkdir /var/www/data; \
|
||||||
|
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
|
||||||
|
/docker-entrypoint-hooks.d/post-installation \
|
||||||
|
/docker-entrypoint-hooks.d/pre-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/post-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/before-starting; \
|
||||||
chown -R www-data:root /var/www; \
|
chown -R www-data:root /var/www; \
|
||||||
chmod -R g=u /var/www
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,39 @@ run_as() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Execute all executable files in a given directory in alphanumeric order
|
||||||
|
run_path() {
|
||||||
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
|
local return_code=0
|
||||||
|
|
||||||
|
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
||||||
|
|
||||||
|
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
|
||||||
|
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
for script_file_path in "${hook_folder_path}/"*.sh; do
|
||||||
|
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
|
||||||
|
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
|
||||||
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
|
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Finished the script: \"${script_file_path}\""
|
||||||
|
done
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# usage: file_env VAR [DEFAULT]
|
# usage: file_env VAR [DEFAULT]
|
||||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||||
|
@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$install" = true ]; then
|
if [ "$install" = true ]; then
|
||||||
|
run_path pre-installation
|
||||||
|
|
||||||
echo "Starting nextcloud installation"
|
echo "Starting nextcloud installation"
|
||||||
max_retries=10
|
max_retries=10
|
||||||
try=0
|
try=0
|
||||||
|
@ -204,12 +239,16 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_path post-installation
|
||||||
else
|
else
|
||||||
echo "Please run the 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_path pre-upgrade
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ upgrade'
|
run_as 'php /var/www/html/occ upgrade'
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||||
|
@ -217,6 +256,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
rm -f /tmp/list_before /tmp/list_after
|
||||||
|
|
||||||
|
run_path post-upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Initializing finished"
|
echo "Initializing finished"
|
||||||
|
@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
||||||
fi
|
fi
|
||||||
) 9> /var/www/html/nextcloud-init-sync.lock
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
|
|
||||||
|
run_path before-starting
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -100,6 +100,11 @@ RUN { \
|
||||||
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
||||||
\
|
\
|
||||||
mkdir /var/www/data; \
|
mkdir /var/www/data; \
|
||||||
|
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
|
||||||
|
/docker-entrypoint-hooks.d/post-installation \
|
||||||
|
/docker-entrypoint-hooks.d/pre-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/post-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/before-starting; \
|
||||||
chown -R www-data:root /var/www; \
|
chown -R www-data:root /var/www; \
|
||||||
chmod -R g=u /var/www
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,39 @@ run_as() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Execute all executable files in a given directory in alphanumeric order
|
||||||
|
run_path() {
|
||||||
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
|
local return_code=0
|
||||||
|
|
||||||
|
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
||||||
|
|
||||||
|
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
|
||||||
|
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
for script_file_path in "${hook_folder_path}/"*.sh; do
|
||||||
|
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
|
||||||
|
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
|
||||||
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
|
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Finished the script: \"${script_file_path}\""
|
||||||
|
done
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# usage: file_env VAR [DEFAULT]
|
# usage: file_env VAR [DEFAULT]
|
||||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||||
|
@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$install" = true ]; then
|
if [ "$install" = true ]; then
|
||||||
|
run_path pre-installation
|
||||||
|
|
||||||
echo "Starting nextcloud installation"
|
echo "Starting nextcloud installation"
|
||||||
max_retries=10
|
max_retries=10
|
||||||
try=0
|
try=0
|
||||||
|
@ -204,12 +239,16 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_path post-installation
|
||||||
else
|
else
|
||||||
echo "Please run the 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_path pre-upgrade
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ upgrade'
|
run_as 'php /var/www/html/occ upgrade'
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||||
|
@ -217,6 +256,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
rm -f /tmp/list_before /tmp/list_after
|
||||||
|
|
||||||
|
run_path post-upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Initializing finished"
|
echo "Initializing finished"
|
||||||
|
@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
||||||
fi
|
fi
|
||||||
) 9> /var/www/html/nextcloud-init-sync.lock
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
|
|
||||||
|
run_path before-starting
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -112,6 +112,11 @@ RUN { \
|
||||||
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
|
||||||
\
|
\
|
||||||
mkdir /var/www/data; \
|
mkdir /var/www/data; \
|
||||||
|
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
|
||||||
|
/docker-entrypoint-hooks.d/post-installation \
|
||||||
|
/docker-entrypoint-hooks.d/pre-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/post-upgrade \
|
||||||
|
/docker-entrypoint-hooks.d/before-starting; \
|
||||||
chown -R www-data:root /var/www; \
|
chown -R www-data:root /var/www; \
|
||||||
chmod -R g=u /var/www
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,39 @@ run_as() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Execute all executable files in a given directory in alphanumeric order
|
||||||
|
run_path() {
|
||||||
|
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
|
||||||
|
local return_code=0
|
||||||
|
|
||||||
|
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
|
||||||
|
|
||||||
|
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
|
||||||
|
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
for script_file_path in "${hook_folder_path}/"*.sh; do
|
||||||
|
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
|
||||||
|
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
|
||||||
|
|
||||||
|
run_as "${script_file_path}" || return_code="$?"
|
||||||
|
|
||||||
|
if [ "${return_code}" -ne "0" ]; then
|
||||||
|
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Finished the script: \"${script_file_path}\""
|
||||||
|
done
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# usage: file_env VAR [DEFAULT]
|
# usage: file_env VAR [DEFAULT]
|
||||||
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||||
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||||
|
@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$install" = true ]; then
|
if [ "$install" = true ]; then
|
||||||
|
run_path pre-installation
|
||||||
|
|
||||||
echo "Starting nextcloud installation"
|
echo "Starting nextcloud installation"
|
||||||
max_retries=10
|
max_retries=10
|
||||||
try=0
|
try=0
|
||||||
|
@ -204,12 +239,16 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_path post-installation
|
||||||
else
|
else
|
||||||
echo "Please run the 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_path pre-upgrade
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ upgrade'
|
run_as 'php /var/www/html/occ upgrade'
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||||
|
@ -217,6 +256,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
rm -f /tmp/list_before /tmp/list_after
|
||||||
|
|
||||||
|
run_path post-upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Initializing finished"
|
echo "Initializing finished"
|
||||||
|
@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
run_as 'php /var/www/html/occ maintenance:update:htaccess'
|
||||||
fi
|
fi
|
||||||
) 9> /var/www/html/nextcloud-init-sync.lock
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
|
|
||||||
|
run_path before-starting
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
},
|
},
|
||||||
"26": {
|
"26": {
|
||||||
"branch": "26",
|
"branch": "26",
|
||||||
"version": "26.0.2",
|
"version": "26.0.3",
|
||||||
"url": "https://download.nextcloud.com/server/releases/nextcloud-26.0.2.tar.bz2",
|
"url": "https://download.nextcloud.com/server/releases/nextcloud-26.0.3.tar.bz2",
|
||||||
"ascUrl": "https://download.nextcloud.com/server/releases/nextcloud-26.0.2.tar.bz2.asc",
|
"ascUrl": "https://download.nextcloud.com/server/releases/nextcloud-26.0.3.tar.bz2.asc",
|
||||||
"variants": {
|
"variants": {
|
||||||
"apache": {
|
"apache": {
|
||||||
"variant": "apache",
|
"variant": "apache",
|
||||||
|
@ -53,9 +53,9 @@
|
||||||
},
|
},
|
||||||
"25": {
|
"25": {
|
||||||
"branch": "25",
|
"branch": "25",
|
||||||
"version": "25.0.7",
|
"version": "25.0.8",
|
||||||
"url": "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2",
|
"url": "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2",
|
||||||
"ascUrl": "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2.asc",
|
"ascUrl": "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2.asc",
|
||||||
"variants": {
|
"variants": {
|
||||||
"apache": {
|
"apache": {
|
||||||
"variant": "apache",
|
"variant": "apache",
|
||||||
|
|
Loading…
Reference in a new issue