mirror of
https://github.com/nextcloud/docker.git
synced 2025-03-14 18:35:08 +01:00
Bootstrap config.php
Allow the docker, kubernetes, etc, environment to provide a config.php that sets values prior to setup. Signed-off-by: Jarrod Lowe <github@rrod.net> Bootstrap config.php documentation Signed-off-by: Jarrod Lowe <github@rrod.net> Note when copy happens ... on install only Signed-off-by: Jarrod Lowe <github@rrod.net> Undo whitespace change Update per-version entrypoint files
This commit is contained in:
parent
4cd608a6e0
commit
4f8e8306f8
11 changed files with 42 additions and 0 deletions
|
@ -79,6 +79,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||
echo "New nextcloud instance"
|
||||
|
||||
if [ -n "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE+x}" ] ; then
|
||||
cp "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE}" /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||
# shellcheck disable=SC2016
|
||||
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||
|
|
|
@ -79,6 +79,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||
echo "New nextcloud instance"
|
||||
|
||||
if [ -n "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE+x}" ] ; then
|
||||
cp "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE}" /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||
# shellcheck disable=SC2016
|
||||
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||
|
|
|
@ -79,6 +79,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||
echo "New nextcloud instance"
|
||||
|
||||
if [ -n "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE+x}" ] ; then
|
||||
cp "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE}" /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||
# shellcheck disable=SC2016
|
||||
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||
|
|
|
@ -79,6 +79,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||
echo "New nextcloud instance"
|
||||
|
||||
if [ -n "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE+x}" ] ; then
|
||||
cp "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE}" /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||
# shellcheck disable=SC2016
|
||||
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||
|
|
|
@ -79,6 +79,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||
echo "New nextcloud instance"
|
||||
|
||||
if [ -n "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE+x}" ] ; then
|
||||
cp "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE}" /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||
# shellcheck disable=SC2016
|
||||
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||
|
|
|
@ -79,6 +79,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||
echo "New nextcloud instance"
|
||||
|
||||
if [ -n "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE+x}" ] ; then
|
||||
cp "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE}" /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||
# shellcheck disable=SC2016
|
||||
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||
|
|
|
@ -79,6 +79,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||
echo "New nextcloud instance"
|
||||
|
||||
if [ -n "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE+x}" ] ; then
|
||||
cp "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE}" /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||
# shellcheck disable=SC2016
|
||||
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||
|
|
|
@ -79,6 +79,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||
echo "New nextcloud instance"
|
||||
|
||||
if [ -n "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE+x}" ] ; then
|
||||
cp "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE}" /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||
# shellcheck disable=SC2016
|
||||
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||
|
|
|
@ -79,6 +79,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||
echo "New nextcloud instance"
|
||||
|
||||
if [ -n "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE+x}" ] ; then
|
||||
cp "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE}" /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||
# shellcheck disable=SC2016
|
||||
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||
|
|
|
@ -158,6 +158,8 @@ To use an external SMTP server, you have to provide the connection details. To c
|
|||
|
||||
Check the [Nextcloud documentation](https://docs.nextcloud.com/server/15/admin_manual/configuration_server/email_configuration.html) for other values to configure SMTP.
|
||||
|
||||
To insert custom config for nextcloud, you can insert a seed config.php into the image (for example, you might mount a secret), and set `NEXTCLOUD_CONFIG_BOOTSTRAP_FILE` to the filename of your seed config file. The config file must be valid PHP, in the same format as the normal config.php file. The config file will only be used on new installations - it will not override config on update, or when restarting the container.
|
||||
|
||||
# Running this image with docker-compose
|
||||
The easiest way to get a fully featured and functional setup is using a `docker-compose` file. There are too many different possibilities to setup your system, so here are only some examples of what you have to look for.
|
||||
|
||||
|
|
|
@ -79,6 +79,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||
echo "New nextcloud instance"
|
||||
|
||||
if [ -n "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE+x}" ] ; then
|
||||
cp "${NEXTCLOUD_CONFIG_BOOTSTRAP_FILE}" /var/www/html/config/config.php
|
||||
fi
|
||||
|
||||
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||
# shellcheck disable=SC2016
|
||||
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||
|
|
Loading…
Add table
Reference in a new issue