From 3b4aa40eb0fed72bb2b8344279326e0beafbc07f Mon Sep 17 00:00:00 2001 From: rosslh Date: Fri, 19 Jun 2026 20:23:30 -0400 Subject: [PATCH] fix(update): use MapleDeploy CDN and registry artifacts --- .env.production | 3 ++- app/Actions/Server/StartSentinel.php | 3 ++- app/Actions/Server/UpdateCoolify.php | 4 +++- bootstrap/helpers/shared.php | 7 ++++--- config/constants.php | 27 ++++++++++++++------------- docker-compose.prod.yml | 4 ++-- docker/production/Dockerfile | 10 ++++++++++ scripts/upgrade.sh | 6 +++--- 8 files changed, 40 insertions(+), 24 deletions(-) diff --git a/.env.production b/.env.production index fe3c8370e..f1d95827f 100644 --- a/.env.production +++ b/.env.production @@ -15,4 +15,5 @@ ROOT_USERNAME= ROOT_USER_EMAIL= ROOT_USER_PASSWORD= -REGISTRY_URL=ghcr.io +REGISTRY_URL=forgejo.mapledeploy.ca +CDN_URL=https://updates.mapledeploy.ca diff --git a/app/Actions/Server/StartSentinel.php b/app/Actions/Server/StartSentinel.php index 289ab9ebe..ad4cb03aa 100644 --- a/app/Actions/Server/StartSentinel.php +++ b/app/Actions/Server/StartSentinel.php @@ -26,7 +26,8 @@ public function handle(Server $server, bool $restart = false, ?string $latestVer $endpoint = data_get($server, 'settings.sentinel_custom_url'); $debug = data_get($server, 'settings.is_sentinel_debug_enabled'); $mountDir = '/data/coolify/sentinel'; - $image = config('constants.coolify.registry_url').'/coollabsio/sentinel:'.$version; + // MapleDeploy branding: Sentinel is not mirrored to our Forgejo registry, so pull from ghcr.io directly (upstream image) + $image = 'ghcr.io/coollabsio/sentinel:'.$version; if (! $endpoint) { throw new \RuntimeException('You should set FQDN in Instance Settings.'); } diff --git a/app/Actions/Server/UpdateCoolify.php b/app/Actions/Server/UpdateCoolify.php index b5ebd92b2..0d5d5ac9d 100644 --- a/app/Actions/Server/UpdateCoolify.php +++ b/app/Actions/Server/UpdateCoolify.php @@ -119,9 +119,11 @@ private function update() $latestHelperImageVersion = getHelperVersion(); $upgradeScriptUrl = config('constants.coolify.upgrade_script_url'); + $registryUrl = config('constants.coolify.registry_url'); + remote_process([ "curl -fsSL {$upgradeScriptUrl} -o /data/coolify/source/upgrade.sh", - "bash /data/coolify/source/upgrade.sh $this->latestVersion $latestHelperImageVersion", + "bash /data/coolify/source/upgrade.sh $this->latestVersion $latestHelperImageVersion $registryUrl", ], $this->server); } } diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index f2b672fef..ccb6a7488 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -426,13 +426,14 @@ function get_route_parameters(): array function get_latest_sentinel_version(): string { + // MapleDeploy branding: our versions.json omits the sentinel key, so fall back to 'latest' (matches upstream's fallback in CheckAndStartSentinelJob) try { $response = Http::get(config('constants.coolify.versions_url')); $versions = $response->json(); - return data_get($versions, 'coolify.sentinel.version'); - } catch (Throwable) { - return '0.0.0'; + return data_get($versions, 'coolify.sentinel.version') ?? 'latest'; + } catch (\Throwable) { + return 'latest'; } } function get_latest_version_of_coolify(): string diff --git a/config/constants.php b/config/constants.php index a01669673..71d29776d 100644 --- a/config/constants.php +++ b/config/constants.php @@ -1,27 +1,28 @@ [ 'version' => '4.1.2', 'helper_version' => '1.0.14', 'realtime_version' => '1.0.16', 'railpack_version' => '0.23.0', 'self_hosted' => env('SELF_HOSTED', true), - 'autoupdate' => env('AUTOUPDATE'), + 'autoupdate' => env('AUTOUPDATE', false), 'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'), - 'registry_url' => env('REGISTRY_URL', 'ghcr.io'), - 'helper_image' => env('HELPER_IMAGE', env('REGISTRY_URL', 'ghcr.io').'/coollabsio/coolify-helper'), - 'realtime_image' => env('REALTIME_IMAGE', env('REGISTRY_URL', 'ghcr.io').'/coollabsio/coolify-realtime'), + 'registry_url' => env('REGISTRY_URL', 'forgejo.mapledeploy.ca'), + 'helper_image' => env('HELPER_IMAGE', 'ghcr.io/coollabsio/coolify-helper'), + 'realtime_image' => env('REALTIME_IMAGE', 'ghcr.io/coollabsio/coolify-realtime'), 'is_windows_docker_desktop' => env('IS_WINDOWS_DOCKER_DESKTOP', false), - 'cdn_url' => env('CDN_URL', 'https://cdn.coollabs.io'), - 'versions_url' => env('VERSIONS_URL', env('CDN_URL', 'https://cdn.coollabs.io').'/coolify/versions.json'), - 'upgrade_script_url' => env('UPGRADE_SCRIPT_URL', env('CDN_URL', 'https://cdn.coollabs.io').'/coolify/upgrade.sh'), - 'releases_url' => env('RELEASES_URL', 'https://raw.githubusercontent.com/coollabsio/coolify-cdn/main/json/releases.json'), + 'cdn_url' => env('CDN_URL', 'https://updates.mapledeploy.ca'), + 'versions_url' => env('VERSIONS_URL', env('CDN_URL', 'https://updates.mapledeploy.ca').'/coolify/versions.json'), + 'upgrade_script_url' => env('UPGRADE_SCRIPT_URL', env('CDN_URL', 'https://updates.mapledeploy.ca').'/coolify/upgrade.sh'), + 'releases_url' => 'https://cdn.coolify.io/releases.json', ], 'urls' => [ - 'docs' => 'https://coolify.io/docs', - 'contact' => 'https://coolify.io/docs/contact', + 'docs' => 'https://mapledeploy.ca/docs', + 'contact' => 'https://mapledeploy.ca/contact', ], 'services' => [ @@ -95,8 +96,9 @@ 'verification_code_expiry_minutes' => 10, ], - 'sentry' => [ - 'sentry_dsn' => env('SENTRY_DSN'), + // MapleDeploy branding: telemetry disabled + 'sentry' => [ // disabled by MapleDeploy + 'sentry_dsn' => null, ], 'sentinel' => [ @@ -117,7 +119,6 @@ ], 'webhooks' => [ - 'feedback_discord_webhook' => env('FEEDBACK_DISCORD_WEBHOOK'), 'dev_webhook' => env('SERVEO_URL'), ], diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 8907a30b9..3536e1390 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,6 +1,6 @@ services: coolify: - image: "${REGISTRY_URL:-ghcr.io}/coollabsio/coolify:${LATEST_IMAGE:-latest}" + image: "${REGISTRY_URL:-forgejo.mapledeploy.ca}/rosslh/coolify:${LATEST_IMAGE:-latest}" volumes: - type: bind source: /data/coolify/source/.env @@ -60,7 +60,7 @@ services: retries: 10 timeout: 2s soketi: - image: '${REGISTRY_URL:-ghcr.io}/coollabsio/coolify-realtime:1.0.16' + image: 'ghcr.io/coollabsio/coolify-realtime:1.0.16' # MapleDeploy branding: pinned to ghcr.io, not mirrored ports: - "${SOKETI_PORT:-6001}:6001" - "6002:6002" diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 0f849785e..5086f619e 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -144,6 +144,16 @@ COPY --chown=www-data:www-data composer.json composer.lock ./ COPY --chown=www-data:www-data app ./app COPY --chown=www-data:www-data bootstrap ./bootstrap COPY --chown=www-data:www-data config ./config + +# MapleDeploy: inject build version into constants.php at build time. +# The version in git stays at the upstream value to avoid rebase conflicts. +# CI passes the timestamped version (e.g. 4.0.0-beta.468.202603140006) as a build arg. +ARG MAPLEDEPLOY_VERSION="" +RUN if [ -n "$MAPLEDEPLOY_VERSION" ]; then \ + sed -i "s/'version' => '[^']*'/'version' => '$MAPLEDEPLOY_VERSION'/" config/constants.php && \ + chown www-data:www-data config/constants.php; \ + fi + COPY --chown=www-data:www-data database ./database COPY --chown=www-data:www-data lang ./lang COPY --chown=www-data:www-data public ./public diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index fb27694b0..c1946b867 100644 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -1,7 +1,7 @@ #!/bin/bash ## Do not modify this file. You will lose the ability to autoupdate! -CDN="https://cdn.coollabs.io/coolify" +CDN="https://updates.mapledeploy.ca/coolify" LATEST_IMAGE=${1:-latest} LATEST_HELPER_VERSION=${2:-latest} REGISTRY_URL=${3:-ghcr.io} @@ -173,7 +173,7 @@ echo "3/6 Pulling Docker images..." echo " This may take a few minutes depending on your connection." # Also pull the helper image (not in compose files but needed for upgrade) -HELPER_IMAGE="${REGISTRY_URL:-ghcr.io}/coollabsio/coolify-helper:${LATEST_HELPER_VERSION}" +HELPER_IMAGE="ghcr.io/coollabsio/coolify-helper:${LATEST_HELPER_VERSION}" echo " - Pulling $HELPER_IMAGE..." log "Pulling image: $HELPER_IMAGE" if docker pull "$HELPER_IMAGE" >>"$LOGFILE" 2>&1; then @@ -265,7 +265,7 @@ nohup bash -c " fi log 'Running docker compose up...' - docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock \${DOCKER_CONFIG_MOUNT} --rm \${REGISTRY_URL:-ghcr.io}/coollabsio/coolify-helper:\${LATEST_HELPER_VERSION} bash -c \"LATEST_IMAGE=\${LATEST_IMAGE} docker compose --env-file /data/coolify/source/.env \${COMPOSE_FILES} up -d --remove-orphans --wait --wait-timeout 60\" >>\"\$LOGFILE\" 2>&1 + docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock \${DOCKER_CONFIG_MOUNT} --rm ghcr.io/coollabsio/coolify-helper:\${LATEST_HELPER_VERSION} bash -c \"LATEST_IMAGE=\${LATEST_IMAGE} docker compose --env-file /data/coolify/source/.env \${COMPOSE_FILES} up -d --remove-orphans --wait --wait-timeout 60\" >>\"\$LOGFILE\" 2>&1 log 'Docker compose up completed' # Final log entry