update cdn

This commit is contained in:
Andras Bacsai 2023-06-06 09:22:48 +02:00
parent b46410d705
commit 5f5dde6565
6 changed files with 25 additions and 20 deletions

View File

@ -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

View File

@ -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();

View File

@ -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;

View File

@ -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');
}

View File

@ -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"

View File

@ -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