An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
update a few things
Andras Bacsai2d8f166e4a76
diff --git a/app/Http/Livewire/Subscription/Actions.php b/app/Http/Livewire/Subscription/Actions.phpindex 6c74880b7e..7830a935b9 100644--- a/app/Http/Livewire/Subscription/Actions.php+++ b/app/Http/Livewire/Subscription/Actions.php@@ -17,7 +17,7 @@ class Actions extends Component$response = Http::withHeaders(['Accept' => 'application/vnd.api+json','Content-Type' => 'application/vnd.api+json',- 'Authorization' => 'Bearer ' . config('coolify.lemon_squeezy_api_key'),+ 'Authorization' => 'Bearer ' . config('subscription.lemon_squeezy_api_key'),])->delete('https://api.lemonsqueezy.com/v1/subscriptions/' . $subscription_id);$json = $response->json();if ($response->failed()) {@@ -44,7 +44,7 @@ class Actions extends Component$response = Http::withHeaders(['Accept' => 'application/vnd.api+json','Content-Type' => 'application/vnd.api+json',- 'Authorization' => 'Bearer ' . config('coolify.lemon_squeezy_api_key'),+ 'Authorization' => 'Bearer ' . config('subscription.lemon_squeezy_api_key'),])->patch('https://api.lemonsqueezy.com/v1/subscriptions/' . $subscription_id, ['data' => ['type' => 'subscriptions',diff --git a/app/Models/Server.php b/app/Models/Server.phpindex 8f70ef1f35..764c58246e 100644--- a/app/Models/Server.php+++ b/app/Models/Server.php@@ -16,11 +16,21 @@ class Server extends BaseModelServerSetting::create(['server_id' => $server->id,]);- StandaloneDocker::create([- 'name' => 'coolify',- 'network' => 'coolify',- 'server_id' => $server->id,- ]);+ if ($server->id === 0) {+ StandaloneDocker::create([+ 'id' => 0,+ 'name' => 'coolify',+ 'network' => 'coolify',+ 'server_id' => $server->id,+ ]);+ } else {+ StandaloneDocker::create([+ 'name' => 'coolify',+ 'network' => 'coolify',+ 'server_id' => $server->id,+ ]);+ }+});static::deleting(function ($server) {$server->settings()->delete();diff --git a/app/Models/Subscription.php b/app/Models/Subscription.phpindex 4b78c37a9e..e0a52d5b13 100644--- a/app/Models/Subscription.php+++ b/app/Models/Subscription.php@@ -14,9 +14,9 @@ class Subscription extends Model}public function type(){- $basic = explode(',', config('coolify.lemon_squeezy_basic_plan_ids'));- $pro = explode(',', config('coolify.lemon_squeezy_pro_plan_ids'));- $ultimate = explode(',', config('coolify.lemon_squeezy_ultimate_plan_ids'));+ $basic = explode(',', config('subscription.lemon_squeezy_basic_plan_ids'));+ $pro = explode(',', config('subscription.lemon_squeezy_pro_plan_ids'));+ $ultimate = explode(',', config('subscription.lemon_squeezy_ultimate_plan_ids'));$subscription = $this->lemon_variant_id;if (in_array($subscription, $basic)) {diff --git a/bootstrap/helpers/subscriptions.php b/bootstrap/helpers/subscriptions.phpindex 5cb17d588c..b514fb5afe 100644--- a/bootstrap/helpers/subscriptions.php+++ b/bootstrap/helpers/subscriptions.php@@ -4,7 +4,7 @@ use Illuminate\Support\Carbon;function getSubscriptionLink($type){- $checkout_id = config("coolify.lemon_squeezy_checkout_id_$type");+ $checkout_id = config("subscription.lemon_squeezy_checkout_id_$type");if (!$checkout_id) {return null;}diff --git a/config/coolify.php b/config/coolify.phpindex 0276b9a789..f3485f0da4 100644--- a/config/coolify.php+++ b/config/coolify.php@@ -4,17 +4,6 @@ return ['self_hosted' => env('SELF_HOSTED', true),'waitlist' => env('WAITLIST', false),'license_url' => 'https://license.coolify.io',- 'lemon_squeezy_api_key' => env('LEMON_SQUEEZY_API_KEY', null),- 'lemon_squeezy_webhook_secret' => env('LEMON_SQUEEZY_WEBHOOK_SECRET', null),- 'lemon_squeezy_checkout_id_monthly_basic' => env('LEMON_SQUEEZY_CHECKOUT_ID_MONTHLY_BASIC', null),- 'lemon_squeezy_checkout_id_monthly_pro' => env('LEMON_SQUEEZY_CHECKOUT_ID_MONTHLY_PRO', null),- 'lemon_squeezy_checkout_id_monthly_ultimate' => env('LEMON_SQUEEZY_CHECKOUT_ID_MONTHLY_ULTIMATE', null),- 'lemon_squeezy_checkout_id_yearly_basic' => env('LEMON_SQUEEZY_CHECKOUT_ID_YEARLY_BASIC', null),- 'lemon_squeezy_checkout_id_yearly_pro' => env('LEMON_SQUEEZY_CHECKOUT_ID_YEARLY_PRO', null),- 'lemon_squeezy_checkout_id_yearly_ultimate' => env('LEMON_SQUEEZY_CHECKOUT_ID_YEARLY_ULTIMATE', null),- 'lemon_squeezy_basic_plan_ids' => env('LEMON_SQUEEZY_BASIC_PLAN_IDS', ""),- 'lemon_squeezy_pro_plan_ids' => env('LEMON_SQUEEZY_PRO_PLAN_IDS', ""),- 'lemon_squeezy_ultimate_plan_ids' => env('LEMON_SQUEEZY_ULTIMATE_PLAN_IDS', ""),'mux_enabled' => env('MUX_ENABLED', true),'dev_webhook' => env('SERVEO_URL'),'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'),diff --git a/config/subscription.php b/config/subscription.phpnew file mode 100644index 0000000000..d4e94c7d8e--- /dev/null+++ b/config/subscription.php@@ -0,0 +1,15 @@+<?php++return [+ 'lemon_squeezy_api_key' => env('LEMON_SQUEEZY_API_KEY', null),+ 'lemon_squeezy_webhook_secret' => env('LEMON_SQUEEZY_WEBHOOK_SECRET', null),+ 'lemon_squeezy_checkout_id_monthly_basic' => env('LEMON_SQUEEZY_CHECKOUT_ID_MONTHLY_BASIC', null),+ 'lemon_squeezy_checkout_id_monthly_pro' => env('LEMON_SQUEEZY_CHECKOUT_ID_MONTHLY_PRO', null),+ 'lemon_squeezy_checkout_id_monthly_ultimate' => env('LEMON_SQUEEZY_CHECKOUT_ID_MONTHLY_ULTIMATE', null),+ 'lemon_squeezy_checkout_id_yearly_basic' => env('LEMON_SQUEEZY_CHECKOUT_ID_YEARLY_BASIC', null),+ 'lemon_squeezy_checkout_id_yearly_pro' => env('LEMON_SQUEEZY_CHECKOUT_ID_YEARLY_PRO', null),+ 'lemon_squeezy_checkout_id_yearly_ultimate' => env('LEMON_SQUEEZY_CHECKOUT_ID_YEARLY_ULTIMATE', null),+ 'lemon_squeezy_basic_plan_ids' => env('LEMON_SQUEEZY_BASIC_PLAN_IDS', ""),+ 'lemon_squeezy_pro_plan_ids' => env('LEMON_SQUEEZY_PRO_PLAN_IDS', ""),+ 'lemon_squeezy_ultimate_plan_ids' => env('LEMON_SQUEEZY_ULTIMATE_PLAN_IDS', ""),+];diff --git a/database/seeders/InstanceSettingsSeeder.php b/database/seeders/InstanceSettingsSeeder.phpindex a00d8715c0..1be6462c9c 100644--- a/database/seeders/InstanceSettingsSeeder.php+++ b/database/seeders/InstanceSettingsSeeder.php@@ -16,6 +16,7 @@ class InstanceSettingsSeeder extends SeederInstanceSettings::create(['id' => 0,'is_registration_enabled' => true,+ 'is_resale_license_active' => true,'smtp_enabled' => true,'smtp_host' => 'coolify-mail','smtp_port' => 1025,diff --git a/database/seeders/StandaloneDockerSeeder.php b/database/seeders/StandaloneDockerSeeder.phpindex 9f67de710a..1e9a749dd9 100644--- a/database/seeders/StandaloneDockerSeeder.php+++ b/database/seeders/StandaloneDockerSeeder.php@@ -13,11 +13,11 @@ class StandaloneDockerSeeder extends Seeder*/public function run(): void{- StandaloneDocker::create([- 'id' => 0,- 'name' => 'Standalone Docker 1',- 'network' => 'coolify',- 'server_id' => 0,- ]);+ // StandaloneDocker::create([+ // 'id' => 0,+ // 'name' => 'Standalone Docker 1',+ // 'network' => 'coolify',+ // 'server_id' => 0,+ // ]);}}diff --git a/routes/webhooks.php b/routes/webhooks.phpindex 1e196181bc..8d4917f17c 100644--- a/routes/webhooks.php+++ b/routes/webhooks.php@@ -208,7 +208,7 @@ Route::get('/waitlist/cancel', function () {})->name('webhooks.waitlist.cancel');Route::post('/payments/events', function () {try {- $secret = config('coolify.lemon_squeezy_webhook_secret');+ $secret = config('subscription.lemon_squeezy_webhook_secret');$payload = request()->collect();$hash = hash_hmac('sha256', $payload, $secret);$signature = request()->header('X-Signature');