Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions .docker/bin/test-e2e
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ elif [ -n "$1" ] && [ -d "volumes/nextcloud/$1" ]; then
APP_PATH="volumes/nextcloud/$1"
shift
elif [ -n "$APP_PATH" ]; then
APP_PATH="$APP_PATH"
:
elif [ -f "package.json" ] && [ -f "appinfo/info.xml" ]; then
# We're inside an app directory
APP_PATH="."
Expand Down Expand Up @@ -49,7 +49,6 @@ else
fi
fi

CONTAINER="nextcloud-playwright"
WORKSPACE="/var/www/html/$RELATIVE_PATH"

GREEN='\033[0;32m'
Expand Down
2 changes: 1 addition & 1 deletion .docker/bin/test-e2e-headed
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ elif [ -n "$1" ] && [ -d "volumes/nextcloud/$1" ]; then
APP_PATH="volumes/nextcloud/$1"
shift
elif [ -n "$APP_PATH" ]; then
APP_PATH="$APP_PATH"
:
elif [ -f "package.json" ] && [ -f "appinfo/info.xml" ]; then
APP_PATH="."
else
Expand Down
2 changes: 1 addition & 1 deletion .docker/bin/test-e2e-report
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ elif [ -n "$1" ] && [ -d "volumes/nextcloud/$1" ]; then
APP_PATH="volumes/nextcloud/$1"
shift
elif [ -n "$APP_PATH" ]; then
APP_PATH="$APP_PATH"
:
elif [ -f "package.json" ] && [ -f "appinfo/info.xml" ]; then
# We're inside an app directory
APP_PATH="."
Expand Down
2 changes: 1 addition & 1 deletion .docker/bin/test-e2e-ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ elif [ -n "$1" ] && [ -d "volumes/nextcloud/$1" ]; then
APP_PATH="volumes/nextcloud/$1"
shift
elif [ -n "$APP_PATH" ]; then
APP_PATH="$APP_PATH"
:
elif [ -f "package.json" ] && [ -f "appinfo/info.xml" ]; then
APP_PATH="."
else
Expand Down
2 changes: 1 addition & 1 deletion .docker/bin/trust-local-cert
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eu

ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)
ROOT_DIR=$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd)
cd "$ROOT_DIR"

container_id=$(docker compose ps -q nginx)
Expand Down
23 changes: 23 additions & 0 deletions .docker/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,34 @@ mkdir -p apps-extra
# Wait for database
php /var/www/scripts/wait-for-db.php

install_cmd_status=0

# Set configurations, if needed
if [[ ! -f "config/config.php" && ${AUTOINSTALL} -eq 1 ]]; then
echo "⌛️ Starting installation ..."
chown -R www-data:www-data .
if [[ ${DB_HOST} == 'mysql' ]]; then
occ maintenance:install --verbose --database="${DB_HOST}" --database-name="${MYSQL_DATABASE}" --database-host="${DB_HOST}" --database-port= --database-user="${MYSQL_USER}" --database-pass="${MYSQL_PASSWORD}" --admin-user="${NEXTCLOUD_ADMIN_USER}" --admin-pass="${NEXTCLOUD_ADMIN_PASSWORD}" --admin-email="${NEXTCLOUD_ADMIN_EMAIL}"
install_cmd_status=$?
elif [[ "${DB_HOST}" == 'pgsql' ]]; then
occ maintenance:install --verbose --database="${DB_HOST}" --database-name="${POSTGRES_DB}" --database-host="${DB_HOST}" --database-port= --database-user="${POSTGRES_USER}" --database-pass="${POSTGRES_PASSWORD}" --admin-user="${NEXTCLOUD_ADMIN_USER}" --admin-pass="${NEXTCLOUD_ADMIN_PASSWORD}" --admin-email="${NEXTCLOUD_ADMIN_EMAIL}"
install_cmd_status=$?
else
occ maintenance:install --verbose --admin-user="${NEXTCLOUD_ADMIN_USER}" --admin-pass="${NEXTCLOUD_ADMIN_PASSWORD}" --admin-email="${NEXTCLOUD_ADMIN_EMAIL}"
install_cmd_status=$?
fi

if [[ ${install_cmd_status} -ne 0 ]]; then
db_reset_hint="volumes/nextcloud/config and volumes/nextcloud/data"
if [[ ${DB_HOST} == 'mysql' ]]; then
db_reset_hint="volumes/mysql/data, ${db_reset_hint}"
elif [[ ${DB_HOST} == 'pgsql' ]]; then
db_reset_hint="volumes/postgres/data, ${db_reset_hint}"
fi

echo "❌ Installation failed. Check the logs above for the exact reason."
echo " If this is a local reset issue, remove: ${db_reset_hint}"
exit ${install_cmd_status}
fi

echo "🔧 Making initial config ..."
Expand Down Expand Up @@ -111,6 +129,11 @@ EOF
echo "🥳 Setup completed !!!"
fi

if ! occ status | grep -q 'installed: true'; then
echo "❌ Nextcloud is not installed. Skipping startup tasks and stopping container."
exit 1
fi

# Run cron
echo "📅 Running cron for the first time ..."
exec busybox crond -f -l 0 -L /dev/stdout > /dev/null 2>&1 &
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main

concurrency:
group: push-to-registry-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main

concurrency:
group: push-to-registry-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Reset entire setup?

- Go down the containers
- Remove the folder volumes
- Remove persisted volumes (`volumes/mysql/data`, `volumes/nextcloud/config` and `volumes/nextcloud/data`) or remove the entire `volumes` folder
- Go up the containers

This will delete the database and Nextcloud volumes. Before do a backup of all that you don't want to lost, by example `volumes/nextcloud/config/config.php`
Expand Down
Loading