diff --git a/README.md b/README.md index 35efc8c78..29e0b6798 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ # v4 # Installation ```bash -curl -fsSL https://coolify-cdn.b-cdn.net/files/install.sh | bash +curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash ``` ## Support diff --git a/app/Console/Commands/SyncBunny.php b/app/Console/Commands/SyncBunny.php index 88062fb6b..48e903a1a 100644 --- a/app/Console/Commands/SyncBunny.php +++ b/app/Console/Commands/SyncBunny.php @@ -28,9 +28,9 @@ class SyncBunny extends Command */ public function handle() { - $bunny_cdn = "https://coolify-cdn.b-cdn.net"; - $bunny_cdn_path = "files"; - $bunny_cdn_storage_name = "coolify-cdn"; + $bunny_cdn = "https://cdn.coollabs.io"; + $bunny_cdn_path = "coolify"; + $bunny_cdn_storage_name = "coolcdn"; $parent_dir = realpath(dirname(__FILE__) . '/../../..'); @@ -58,9 +58,11 @@ public function handle() 'AccessKey' => env('BUNNY_API_KEY'), 'Accept' => 'application/json', ]; - return PendingRequest::withHeaders($headers)->post('https://api.bunny.net/purge', [ - "urls" => [$url], - ])->throw(); + ray('Purging: ' . $url); + return PendingRequest::withHeaders($headers)->get('https://api.bunny.net/purge', [ + "url" => $url, + "async" => false + ]); }); try { Http::pool(fn (Pool $pool) => [ @@ -70,15 +72,18 @@ public function handle() $pool->storage(file: "$parent_dir/scripts/$upgrade_script")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$upgrade_script"), $pool->storage(file: "$parent_dir/scripts/$install_script")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$install_script"), $pool->storage(file: "$parent_dir/scripts/$docker_install_script")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$docker_install_script"), - $pool->storage(file: "$parent_dir/$versions")->put("/$bunny_cdn_storage_name/$versions"), + $pool->storage(file: "$parent_dir/$versions")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$versions"), + ]); + ray("{$bunny_cdn}/{$bunny_cdn_path}"); + Http::pool(fn (Pool $pool) => [ + $pool->purge("$bunny_cdn/$bunny_cdn_path/$compose_file"), + $pool->purge("$bunny_cdn/$bunny_cdn_path/$compose_file_prod"), + $pool->purge("$bunny_cdn/$bunny_cdn_path/$production_env"), + $pool->purge("$bunny_cdn/$bunny_cdn_path/$upgrade_script"), + $pool->purge("$bunny_cdn/$bunny_cdn_path/$install_script"), + $pool->purge("$bunny_cdn/$bunny_cdn_path/$docker_install_script"), + $pool->purge("$bunny_cdn/$versions"), ]); - Http::withHeaders([ - 'AccessKey' => env('BUNNY_API_KEY'), - 'Accept' => 'application/json', - ])->get('https://api.bunny.net/purge', [ - "url" => "$bunny_cdn/$bunny_cdn_path/*", - "async" => false - ])->throw(); echo "All files uploaded & purged...\n"; } catch (\Exception $e) { echo $e->getMessage(); diff --git a/app/Jobs/InstanceAutoUpdateJob.php b/app/Jobs/InstanceAutoUpdateJob.php index 4a34f457b..de32e5a16 100644 --- a/app/Jobs/InstanceAutoUpdateJob.php +++ b/app/Jobs/InstanceAutoUpdateJob.php @@ -42,7 +42,7 @@ private function update() } else { ray('Running update on production server'); instant_remote_process([ - "curl -fsSL https://coolify-cdn.b-cdn.net/files/upgrade.sh -o /data/coolify/source/upgrade.sh", + "curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh -o /data/coolify/source/upgrade.sh", "bash /data/coolify/source/upgrade.sh $this->latest_version" ], $this->server); return; diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index d3f017aa6..89725d0bc 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -42,7 +42,7 @@ function get_parameters() function get_latest_version_of_coolify() { - $response = Http::get('https://coolify-cdn.b-cdn.net/versions.json'); + $response = Http::get('https://cdn.coollabs.io/coolify/versions.json'); $versions = $response->json(); return data_get($versions, 'coolify.v4.version'); } diff --git a/scripts/install.sh b/scripts/install.sh index 3f225195f..89660917c 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -8,10 +8,10 @@ VERSION="1.0.0" DOCKER_VERSION="23.0" -CDN="https://coolify-cdn.b-cdn.net/files" +CDN="https://cdn.coollabs.io/coolify" OS_TYPE=$(cat /etc/os-release | grep -w "ID" | cut -d "=" -f 2 | tr -d '"') OS_VERSION=$(cat /etc/os-release | grep -w "VERSION_ID" | cut -d "=" -f 2 | tr -d '"') -LATEST_VERSION=$(curl --silent https://coolify-cdn.b-cdn.net/versions.json | grep -i version | sed -n '2p' | xargs | awk '{print $2}' | tr -d ',') +LATEST_VERSION=$(curl --silent $CDN/versions.json | grep -i version | sed -n '2p' | xargs | awk '{print $2}' | tr -d ',') if [ $EUID != 0 ]; then echo "Please run as root" diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index bc4de3b57..21456b260 100644 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -6,7 +6,7 @@ ########### VERSION="1.0.0" -CDN="https://coolify-cdn.b-cdn.net/files" +CDN="https://cdn.coollabs.io/coolify" curl -fsSL $CDN/docker-compose.yml -o /data/coolify/source/docker-compose.yml curl -fsSL $CDN/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml