update cdn
This commit is contained in:
parent
b46410d705
commit
5f5dde6565
@ -11,7 +11,7 @@ Thinks will be added here incrementally through PR's.
|
|||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -fsSL https://coolify-cdn.b-cdn.net/files/install.sh | bash
|
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
@ -28,9 +28,9 @@ class SyncBunny extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$bunny_cdn = "https://coolify-cdn.b-cdn.net";
|
$bunny_cdn = "https://cdn.coollabs.io";
|
||||||
$bunny_cdn_path = "files";
|
$bunny_cdn_path = "coolify";
|
||||||
$bunny_cdn_storage_name = "coolify-cdn";
|
$bunny_cdn_storage_name = "coolcdn";
|
||||||
|
|
||||||
$parent_dir = realpath(dirname(__FILE__) . '/../../..');
|
$parent_dir = realpath(dirname(__FILE__) . '/../../..');
|
||||||
|
|
||||||
@ -58,9 +58,11 @@ class SyncBunny extends Command
|
|||||||
'AccessKey' => env('BUNNY_API_KEY'),
|
'AccessKey' => env('BUNNY_API_KEY'),
|
||||||
'Accept' => 'application/json',
|
'Accept' => 'application/json',
|
||||||
];
|
];
|
||||||
return PendingRequest::withHeaders($headers)->post('https://api.bunny.net/purge', [
|
ray('Purging: ' . $url);
|
||||||
"urls" => [$url],
|
return PendingRequest::withHeaders($headers)->get('https://api.bunny.net/purge', [
|
||||||
])->throw();
|
"url" => $url,
|
||||||
|
"async" => false
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
Http::pool(fn (Pool $pool) => [
|
Http::pool(fn (Pool $pool) => [
|
||||||
@ -70,15 +72,18 @@ class SyncBunny extends Command
|
|||||||
$pool->storage(file: "$parent_dir/scripts/$upgrade_script")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$upgrade_script"),
|
$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/$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/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";
|
echo "All files uploaded & purged...\n";
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
echo $e->getMessage();
|
echo $e->getMessage();
|
||||||
|
@ -42,7 +42,7 @@ class InstanceAutoUpdateJob implements ShouldQueue, ShouldBeUnique
|
|||||||
} else {
|
} else {
|
||||||
ray('Running update on production server');
|
ray('Running update on production server');
|
||||||
instant_remote_process([
|
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"
|
"bash /data/coolify/source/upgrade.sh $this->latest_version"
|
||||||
], $this->server);
|
], $this->server);
|
||||||
return;
|
return;
|
||||||
|
@ -42,7 +42,7 @@ function get_parameters()
|
|||||||
|
|
||||||
function get_latest_version_of_coolify()
|
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();
|
$versions = $response->json();
|
||||||
return data_get($versions, 'coolify.v4.version');
|
return data_get($versions, 'coolify.v4.version');
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,10 @@
|
|||||||
VERSION="1.0.0"
|
VERSION="1.0.0"
|
||||||
DOCKER_VERSION="23.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_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 '"')
|
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
|
if [ $EUID != 0 ]; then
|
||||||
echo "Please run as root"
|
echo "Please run as root"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
###########
|
###########
|
||||||
|
|
||||||
VERSION="1.0.0"
|
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.yml -o /data/coolify/source/docker-compose.yml
|
||||||
curl -fsSL $CDN/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml
|
curl -fsSL $CDN/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml
|
||||||
|
Loading…
x
Reference in New Issue
Block a user