Skip to content

Commit c6df243

Browse files
committed
chore: Update Coolify version to 4.0.0-beta.324 and fix file paths in upgrade script
1 parent 59c95c4 commit c6df243

File tree

12 files changed

+68
-82
lines changed

12 files changed

+68
-82
lines changed

app/Console/Commands/SyncBunny.php

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SyncBunny extends Command
1616
*
1717
* @var string
1818
*/
19-
protected $signature = 'sync:bunny {--templates} {--release}';
19+
protected $signature = 'sync:bunny {--templates} {--release} {--nightly}';
2020

2121
/**
2222
* The console command description.
@@ -33,6 +33,7 @@ public function handle()
3333
$that = $this;
3434
$only_template = $this->option('templates');
3535
$only_version = $this->option('release');
36+
$nightly = $this->option('nightly');
3637
$bunny_cdn = 'https://cdn.coollabs.io';
3738
$bunny_cdn_path = 'coolify';
3839
$bunny_cdn_storage_name = 'coolcdn';
@@ -45,9 +46,15 @@ public function handle()
4546
$upgrade_script = 'upgrade.sh';
4647
$production_env = '.env.production';
4748
$service_template = 'service-templates.json';
48-
4949
$versions = 'versions.json';
5050

51+
$compose_file_location = "$parent_dir/$compose_file";
52+
$compose_file_prod_location = "$parent_dir/$compose_file_prod";
53+
$install_script_location = "$parent_dir/scripts/install.sh";
54+
$upgrade_script_location = "$parent_dir/scripts/upgrade.sh";
55+
$production_env_location = "$parent_dir/.env.production";
56+
$versions_location = "$parent_dir/$versions";
57+
5158
PendingRequest::macro('storage', function ($fileName) use ($that) {
5259
$headers = [
5360
'AccessKey' => env('BUNNY_STORAGE_API_KEY'),
@@ -73,8 +80,26 @@ public function handle()
7380
]);
7481
});
7582
try {
83+
if ($nightly) {
84+
$bunny_cdn_path = 'coolify-nightly';
85+
86+
$compose_file_location = "$parent_dir/other/nightly/$compose_file";
87+
$compose_file_prod_location = "$parent_dir/other/nightly/$compose_file_prod";
88+
$production_env_location = "$parent_dir/other/nightly/$production_env";
89+
$upgrade_script_location = "$parent_dir/other/nightly/$upgrade_script";
90+
$install_script_location = "$parent_dir/other/nightly/$install_script";
91+
$versions_location = "$parent_dir/other/nightly/$versions";
92+
}
7693
if (! $only_template && ! $only_version) {
77-
$this->info('About to sync files (docker-compose.prod.yaml, upgrade.sh, install.sh, etc) to BunnyCDN.');
94+
if ($nightly) {
95+
$this->info('About to sync files NIGHTLY (docker-compose.prod.yaml, upgrade.sh, install.sh, etc) to BunnyCDN.');
96+
} else {
97+
$this->info('About to sync files PRODUCTION (docker-compose.yml, docker-compose.prod.yml, upgrade.sh, install.sh, etc) to BunnyCDN.');
98+
}
99+
$confirmed = confirm('Are you sure you want to sync?');
100+
if (! $confirmed) {
101+
return;
102+
}
78103
}
79104
if ($only_template) {
80105
$this->info('About to sync service-templates.json to BunnyCDN.');
@@ -90,8 +115,12 @@ public function handle()
90115

91116
return;
92117
} elseif ($only_version) {
93-
$this->info('About to sync versions.json to BunnyCDN.');
94-
$file = file_get_contents("$parent_dir/$versions");
118+
if ($nightly) {
119+
$this->info('About to sync NIGHLTY versions.json to BunnyCDN.');
120+
} else {
121+
$this->info('About to sync PRODUCTION versions.json to BunnyCDN.');
122+
}
123+
$file = file_get_contents($versions_location);
95124
$json = json_decode($file, true);
96125
$actual_version = data_get($json, 'coolify.v4.version');
97126

@@ -100,7 +129,7 @@ public function handle()
100129
return;
101130
}
102131
Http::pool(fn (Pool $pool) => [
103-
$pool->storage(fileName: "$parent_dir/$versions")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$versions"),
132+
$pool->storage(fileName: $versions_location)->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$versions"),
104133
$pool->purge("$bunny_cdn/$bunny_cdn_path/$versions"),
105134
]);
106135
$this->info('versions.json uploaded & purged...');
@@ -109,11 +138,11 @@ public function handle()
109138
}
110139

111140
Http::pool(fn (Pool $pool) => [
112-
$pool->storage(fileName: "$parent_dir/$compose_file")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$compose_file"),
113-
$pool->storage(fileName: "$parent_dir/$compose_file_prod")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$compose_file_prod"),
114-
$pool->storage(fileName: "$parent_dir/$production_env")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$production_env"),
115-
$pool->storage(fileName: "$parent_dir/scripts/$upgrade_script")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$upgrade_script"),
116-
$pool->storage(fileName: "$parent_dir/scripts/$install_script")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$install_script"),
141+
$pool->storage(fileName: "$compose_file_location")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$compose_file"),
142+
$pool->storage(fileName: "$compose_file_prod_location")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$compose_file_prod"),
143+
$pool->storage(fileName: "$production_env_location")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$production_env"),
144+
$pool->storage(fileName: "$upgrade_script_location")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$upgrade_script"),
145+
$pool->storage(fileName: "$install_script_location")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$install_script"),
117146
]);
118147
Http::pool(fn (Pool $pool) => [
119148
$pool->purge("$bunny_cdn/$bunny_cdn_path/$compose_file"),

config/database.php

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,6 @@
3535

3636
'connections' => [
3737

38-
'sqlite' => [
39-
'driver' => 'sqlite',
40-
'url' => env('DATABASE_URL'),
41-
'database' => env('DB_DATABASE', database_path('database.sqlite')),
42-
'prefix' => '',
43-
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
44-
],
45-
46-
'mysql' => [
47-
'driver' => 'mysql',
48-
'url' => env('DATABASE_URL'),
49-
'host' => env('DB_HOST', '127.0.0.1'),
50-
'port' => env('DB_PORT', '3306'),
51-
'database' => env('DB_DATABASE', 'forge'),
52-
'username' => env('DB_USERNAME', 'forge'),
53-
'password' => env('DB_PASSWORD', ''),
54-
'unix_socket' => env('DB_SOCKET', ''),
55-
'charset' => 'utf8mb4',
56-
'collation' => 'utf8mb4_unicode_ci',
57-
'prefix' => '',
58-
'prefix_indexes' => true,
59-
'strict' => true,
60-
'engine' => null,
61-
'options' => extension_loaded('pdo_mysql') ? array_filter([
62-
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
63-
]) : [],
64-
],
65-
6638
'pgsql' => [
6739
'driver' => 'pgsql',
6840
'url' => env('DATABASE_URL'),
@@ -77,22 +49,6 @@
7749
'search_path' => 'public',
7850
'sslmode' => 'prefer',
7951
],
80-
81-
'sqlsrv' => [
82-
'driver' => 'sqlsrv',
83-
'url' => env('DATABASE_URL'),
84-
'host' => env('DB_HOST', 'localhost'),
85-
'port' => env('DB_PORT', '1433'),
86-
'database' => env('DB_DATABASE', 'forge'),
87-
'username' => env('DB_USERNAME', 'forge'),
88-
'password' => env('DB_PASSWORD', ''),
89-
'charset' => 'utf8',
90-
'prefix' => '',
91-
'prefix_indexes' => true,
92-
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
93-
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
94-
],
95-
9652
],
9753

9854
/*

other/newcompose/.env.production renamed to other/nightly/.env.production

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Coolify Configuration
22
APP_ID=
3+
APP_NAME=Coolify
34
APP_KEY=
45

56
# PostgreSQL Database Configuration
6-
DB_DATABASE=coolify
7-
DB_USERNAME=
7+
DB_USERNAME=coolify
88
DB_PASSWORD=
99

1010
# Redis Configuration

other/newcompose/docker-compose.prod.yml renamed to other/nightly/docker-compose.prod.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
- /data/coolify/webhooks-during-maintenance:/var/www/html/storage/app/webhooks-during-maintenance
1515
environment:
1616
- APP_ENV=production
17-
- APP_NAME=Coolify
17+
- APP_NAME
1818
- APP_ID
1919
- APP_KEY
2020
- APP_URL
@@ -93,13 +93,7 @@ services:
9393
POSTGRES_PASSWORD: "${DB_PASSWORD}"
9494
POSTGRES_DB: "${DB_DATABASE:-coolify}"
9595
healthcheck:
96-
test:
97-
[
98-
"CMD-SHELL",
99-
"pg_isready -U ${DB_USERNAME}",
100-
"-d",
101-
"${DB_DATABASE:-coolify}"
102-
]
96+
test: [ "CMD-SHELL", "pg_isready -U ${DB_USERNAME}", "-d", "${DB_DATABASE:-coolify}" ]
10397
interval: 5s
10498
retries: 10
10599
timeout: 2s
@@ -132,3 +126,7 @@ volumes:
132126
name: coolify-db
133127
coolify-redis:
134128
name: coolify-redis
129+
130+
networks:
131+
coolify:
132+
external: true

other/newcompose/install.sh renamed to other/nightly/install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -o pipefail # Cause a pipeline to return the status of the last command that
99
VERSION="1.3.4"
1010
DOCKER_VERSION="26.0"
1111

12-
CDN="https://cdn.coollabs.io/coolify"
12+
CDN="https://cdn.coollabs.io/coolify-nightly"
1313
OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')
1414
ENV_FILE="/data/coolify/source/.env"
1515

@@ -70,7 +70,7 @@ fi
7070
echo -e "-------------"
7171
echo -e "Welcome to Coolify v4 beta installer!"
7272
echo -e "This script will install everything for you."
73-
echo -e "(Source code: https://github.com/coollabsio/coolify/blob/main/scripts/install.sh )\n"
73+
echo -e "Source code: https://github.com/coollabsio/coolify/blob/main/scripts/install.sh\n"
7474
echo -e "-------------"
7575

7676
echo "OS: $OS_TYPE $OS_VERSION"
@@ -296,7 +296,8 @@ if [ ! -f $ENV_FILE ]; then
296296
sed -i "s|^APP_KEY=.*|APP_KEY=base64:$(openssl rand -base64 32)|" "$ENV_FILE"
297297

298298
# Generate a secure Postgres DB username and password
299-
sed -i "s|^DB_USERNAME=.*|DB_USERNAME=$(openssl rand -hex 16)|" "$ENV_FILE"
299+
# Causes issues: database "random-user" does not exist
300+
# sed -i "s|^DB_USERNAME=.*|DB_USERNAME=$(openssl rand -hex 16)|" "$ENV_FILE"
300301
sed -i "s|^DB_PASSWORD=.*|DB_PASSWORD=$(openssl rand -base64 32)|" "$ENV_FILE"
301302

302303
# Generate a secure Redis password

other/newcompose/upgrade.sh renamed to other/nightly/upgrade.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## Do not modify this file. You will lose the ability to autoupdate!
33

44
VERSION="1.0.6"
5-
CDN="https://cdn.coollabs.io/coolify"
5+
CDN="https://cdn.coollabs.io/coolify-nightly"
66

77
curl -fsSL $CDN/docker-compose.yml -o /data/coolify/source/docker-compose.yml
88
curl -fsSL $CDN/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml
@@ -26,7 +26,7 @@ fi
2626

2727
# Make sure coolify network exists
2828
# It is created when starting Coolify with docker compose
29-
# docker network create --attachable coolify 2>/dev/null
29+
docker network create --attachable coolify 2>/dev/null
3030
# docker network create --attachable --driver=overlay coolify-overlay 2>/dev/null
3131

3232
if [ -f /data/coolify/source/docker-compose.custom.yml ]; then

other/nightly/versions.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"coolify": {
3+
"v4": {
4+
"version": "4.0.0-beta.324"
5+
},
6+
"nightly": {
7+
"version": "4.0.0-beta.324"
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)