Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions rootfs/etc/cont-init.d/03-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ if [ ! -f /data/config/config.php ]; then
# https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/automatic_configuration.html
touch /tmp/first-install
echo "Creating automatic configuration..."
if [ -z "$NEXTCLOUD_ADMIN_USER" ]; then
cat > /var/www/config/autoconfig.php <<EOL
<?php
\$AUTOCONFIG = array(
'directory' => '/data/data',
'dbtype' => '${DB_TYPE}',
'dbname' => '${DB_NAME}',
'dbuser' => '${DB_USER}',
'dbpass' => '${DB_PASSWORD}',
'dbhost' => '${DB_HOST}',
'dbtableprefix' => '',
);
EOL
else
cat > /var/www/config/autoconfig.php <<EOL
<?php
\$AUTOCONFIG = array(
Expand All @@ -124,8 +138,11 @@ if [ ! -f /data/config/config.php ]; then
'dbpass' => '${DB_PASSWORD}',
'dbhost' => '${DB_HOST}',
'dbtableprefix' => '',
'adminlogin' => '${NEXTCLOUD_ADMIN_USER}',
'adminpass' => '${NEXTCLOUD_ADMIN_PASSWORD}',
);
EOL
fi
runas_user cat > /data/config/config.php <<EOL
<?php
\$CONFIG = array(
Expand Down