From 8106cb7cfa1d1ef4230a18cb90d398507efcee39 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Fri, 2 Oct 2026 16:01:25 +0200 Subject: [PATCH] chore(nightly): sync nightly install and upgrade scripts with the root scripts Co-Authored-By: Claude Opus 5.5 --- other/nightly/.env.production | 2 -- other/nightly/install.sh | 26 ++++++++++++++++++-------- other/nightly/upgrade.sh | 13 +++++++++++++ 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/other/nightly/.env.production b/other/nightly/.env.production index f872a214f9..c6990a51d4 100644 --- a/other/nightly/.env.production +++ b/other/nightly/.env.production @@ -10,8 +10,6 @@ REDIS_PASSWORD= PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= -PUSHER_BACKEND_PORT=6001 - ROOT_USERNAME= ROOT_USER_EMAIL= ROOT_USER_PASSWORD= diff --git a/other/nightly/install.sh b/other/nightly/install.sh index 513eac1c03..5b5d74f1b1 100755 --- a/other/nightly/install.sh +++ b/other/nightly/install.sh @@ -38,12 +38,12 @@ for COOLIFY_DIRECTORY in /data/coolify /data/coolify/{applications,databases,bac chmod 700 "$COOLIFY_DIRECTORY" fi done -mkdir -p /data/coolify/source /data/coolify/ssh/{keys,mux} +mkdir -p /data/coolify/source /data/coolify/images /data/coolify/ssh/{keys,mux} # Coolify's own directories, used by the coolify container (UID 9999) set_coolify_directory_permissions() { - chown -R 9999:root /data/coolify/{source,ssh} - chmod -R 700 /data/coolify/{source,ssh} + chown -R 9999:root /data/coolify/{source,ssh,images} + chmod -R 700 /data/coolify/{source,ssh,images} } set_coolify_directory_permissions @@ -289,11 +289,21 @@ if [ -n "${DOCKER_ADDRESS_POOL_SIZE+x}" ]; then DOCKER_POOL_SIZE_PROVIDED=true fi +# OpenRC (Alpine) returns from "service docker start" before the daemon accepts connections +wait_for_docker_daemon() { + for _ in $(seq 1 30); do + if docker info >/dev/null 2>&1; then + return 0 + fi + sleep 1 + done + return 1 +} + restart_docker_service() { # Check if systemctl is available if command -v systemctl >/dev/null 2>&1; then - systemctl restart docker - if [ $? -eq 0 ]; then + if systemctl restart docker && wait_for_docker_daemon; then echo " - Docker daemon restarted successfully" else echo " - Failed to restart Docker daemon" @@ -301,8 +311,7 @@ restart_docker_service() { fi # Check if service command is available elif command -v service >/dev/null 2>&1; then - service docker restart - if [ $? -eq 0 ]; then + if service docker restart && wait_for_docker_daemon; then echo " - Docker daemon restarted successfully" else echo " - Failed to restart Docker daemon" @@ -803,7 +812,8 @@ fi # Verify minimum Docker version MIN_DOCKER_VERSION=24 -INSTALLED_DOCKER_VERSION=$(docker version --format '{{.Server.Version}}' 2>/dev/null | cut -d. -f1) +wait_for_docker_daemon || true +INSTALLED_DOCKER_VERSION=$(docker version --format '{{.Server.Version}}' 2>/dev/null | cut -d. -f1 || true) if [ -z "$INSTALLED_DOCKER_VERSION" ]; then warn "Could not determine Docker version. Please ensure Docker $MIN_DOCKER_VERSION+ is installed." elif [ "$INSTALLED_DOCKER_VERSION" -lt "$MIN_DOCKER_VERSION" ]; then diff --git a/other/nightly/upgrade.sh b/other/nightly/upgrade.sh index 42b588fe8d..ce8fdb6589 100644 --- a/other/nightly/upgrade.sh +++ b/other/nightly/upgrade.sh @@ -175,6 +175,19 @@ else log "Network 'coolify' already exists" fi +mkdir -p /data/coolify/images/{avatars,project-icons} +chown -R 9999:root /data/coolify/images +chmod -R 700 /data/coolify/images + +# Fix SSH directory ownership if not owned by container user UID 9999 (fixes #6621) +# Only changes owner — preserves existing group to respect custom setups +SSH_OWNER=$(stat -c '%u' /data/coolify/ssh 2>/dev/null || echo "unknown") +if [ "$SSH_OWNER" != "9999" ]; then + log "Fixing SSH directory ownership (was owned by UID $SSH_OWNER)" + chown -R 9999 /data/coolify/ssh + chmod -R 700 /data/coolify/ssh +fi + # Check if Docker config file exists DOCKER_CONFIG_MOUNT="" if [ -f /root/.docker/config.json ]; then