Skip to content

Commit 12a3aa6

Browse files
authored
Merge pull request coollabsio#3285 from coollabsio/next
Fixing infrastructure files
2 parents 90267a9 + f8d6ce2 commit 12a3aa6

23 files changed

+563
-532
lines changed

.env.development.example

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
1-
APP_NAME=Coolify-localhost
2-
APP_ID=development
1+
# Coolify Configuration
32
APP_ENV=local
3+
APP_NAME="Coolify Development"
4+
APP_ID=development
45
APP_KEY=
5-
APP_DEBUG=true
66
APP_URL=http://localhost
77
APP_PORT=8000
8+
APP_DEBUG=true
89
MUX_ENABLED=false
910

11+
# Enable Laravel Telescope for debugging
12+
TELESCOPE_ENABLED=false
13+
14+
# Selenium Driver URL for Dusk
1015
DUSK_DRIVER_URL=http://selenium:4444
1116

12-
## For Andras only
13-
# To purge cache
17+
# PostgreSQL Database Configuration
18+
DB_DATABASE=coolify
19+
DB_USERNAME=coolify
20+
DB_PASSWORD=password
21+
DB_HOST=host.docker.internal
22+
DB_PORT=5432
23+
24+
#Set custom ray port
25+
RAY_PORT=
26+
27+
# Special Keys for Andras
28+
# For cache purging
1429
BUNNY_API_KEY=
15-
# To upload assets
30+
# For asset uploads
1631
BUNNY_STORAGE_API_KEY=

.env.production

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
# Coolify Configuration
12
APP_ID=
23
APP_NAME=Coolify
34
APP_KEY=
45

6+
# PostgreSQL Database Configuration
7+
DB_USERNAME=coolify
58
DB_PASSWORD=
9+
10+
# Redis Configuration
611
REDIS_PASSWORD=
712

13+
# Pusher Configuration
814
PUSHER_APP_ID=
915
PUSHER_APP_KEY=
1016
PUSHER_APP_SECRET=

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"),

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"guzzlehttp/guzzle": "^7.5.0",
1515
"laravel/fortify": "^v1.16.0",
1616
"laravel/framework": "^v11",
17-
"laravel/horizon": "^5.23.1",
17+
"laravel/horizon": "^5.27.1",
1818
"laravel/prompts": "^0.1.6",
1919
"laravel/sanctum": "^v4.0",
2020
"laravel/socialite": "^v5.14.0",
@@ -95,7 +95,7 @@
9595
"extra": {
9696
"laravel": {
9797
"dont-discover": [
98-
"laravel/telescope"
98+
"laravel/telescope"
9999
]
100100
}
101101
},
@@ -110,4 +110,4 @@
110110
},
111111
"minimum-stability": "stable",
112112
"prefer-stable": true
113-
}
113+
}

0 commit comments

Comments
 (0)