diff --git a/app/Actions/License/CheckResaleLicense.php b/app/Actions/License/CheckResaleLicense.php index 9aa6e8486..4f08b5d4a 100644 --- a/app/Actions/License/CheckResaleLicense.php +++ b/app/Actions/License/CheckResaleLicense.php @@ -24,12 +24,7 @@ class CheckResaleLicense 'instance_name' => $instance_id, ])->throw()->json(); $product_id = data_get($data, 'meta.product_id'); - - if (isDev()) { - $valid_product_id = 93221; - } else { - $valid_product_id = 93222; - } + $valid_product_id = config('coolify.lemon_squeezy_product_id'); if ($product_id !== $valid_product_id) { throw new \Exception('Invalid product id'); } diff --git a/bootstrap/helpers/subscriptions.php b/bootstrap/helpers/subscriptions.php index 7e291fabc..bf7847cda 100644 --- a/bootstrap/helpers/subscriptions.php +++ b/bootstrap/helpers/subscriptions.php @@ -8,7 +8,8 @@ function getSubscriptionLink() $team_id = auth()->user()->currentTeam()->id ?? null; $email = auth()->user()->email ?? null; $name = auth()->user()->name ?? null; - $url = "https://store.coollabs.io/checkout/buy/d0b28c6a-9b57-40bf-8b84-89fbafde6526?"; + $checkout_id = config('coolify.lemon_squeezy_checkout_id'); + $url = "https://store.coollabs.io/checkout/buy/$checkout_id?"; if ($user_id) { $url .= "&checkout[custom][user_id]={$user_id}"; } diff --git a/config/coolify.php b/config/coolify.php index 08634313d..0a4220887 100644 --- a/config/coolify.php +++ b/config/coolify.php @@ -3,6 +3,8 @@ return [ 'self_hosted' => env('SELF_HOSTED', true), 'lemon_squeezy_webhook_secret' => env('LEMON_SQUEEZY_WEBHOOK_SECRET'), + 'lemon_squeezy_product_id' => env('LEMON_SQUEEZY_PRODUCT_ID'), + 'lemon_squeezy_checkout_id' => env('LEMON_SQUEEZY_CHECKOUT_ID'), 'mux_enabled' => env('MUX_ENABLED', true), 'dev_webhook' => env('SERVEO_URL'), 'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'), diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 8184d35cc..3b2d9b791 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -10,8 +10,6 @@ services: - /data/coolify/ssh:/var/www/html/storage/app/ssh - /data/coolify/deployments:/var/www/html/storage/app/deployments environment: - - SELF_HOSTED - - LEMON_SQUEEZY_WEBHOOK_SECRET - APP_ENV=production - APP_DEBUG - APP_NAME @@ -31,6 +29,10 @@ services: - PHP_PM_START_SERVERS=1 - PHP_PM_MIN_SPARE_SERVERS=1 - PHP_PM_MAX_SPARE_SERVERS=10 + - SELF_HOSTED + - LEMON_SQUEEZY_WEBHOOK_SECRET + - LEMON_SQUEEZY_CHECKOUT_ID + - LEMON_SQUEEZY_PRODUCT_ID ports: - "${APP_PORT:-8000}:80" expose: