Merge branch 'next' into rename-github-app

This commit is contained in:
🏔️ Peak
2024-12-03 15:35:23 +01:00
committed by GitHub
14 changed files with 30 additions and 35 deletions

View File

@@ -24,7 +24,7 @@ class StartClickhouse
$this->configuration_dir = database_configuration_dir().'/'.$container_name; $this->configuration_dir = database_configuration_dir().'/'.$container_name;
$this->commands = [ $this->commands = [
"echo 'Starting {$database->name}.'", "echo 'Starting database.'",
"mkdir -p $this->configuration_dir", "mkdir -p $this->configuration_dir",
]; ];

View File

@@ -26,7 +26,7 @@ class StartDragonfly
$this->configuration_dir = database_configuration_dir().'/'.$container_name; $this->configuration_dir = database_configuration_dir().'/'.$container_name;
$this->commands = [ $this->commands = [
"echo 'Starting {$database->name}.'", "echo 'Starting database.'",
"mkdir -p $this->configuration_dir", "mkdir -p $this->configuration_dir",
]; ];

View File

@@ -27,7 +27,7 @@ class StartKeydb
$this->configuration_dir = database_configuration_dir().'/'.$container_name; $this->configuration_dir = database_configuration_dir().'/'.$container_name;
$this->commands = [ $this->commands = [
"echo 'Starting {$database->name}.'", "echo 'Starting database.'",
"mkdir -p $this->configuration_dir", "mkdir -p $this->configuration_dir",
]; ];

View File

@@ -24,7 +24,7 @@ class StartMariadb
$this->configuration_dir = database_configuration_dir().'/'.$container_name; $this->configuration_dir = database_configuration_dir().'/'.$container_name;
$this->commands = [ $this->commands = [
"echo 'Starting {$database->name}.'", "echo 'Starting database.'",
"mkdir -p $this->configuration_dir", "mkdir -p $this->configuration_dir",
]; ];

View File

@@ -30,7 +30,7 @@ class StartMongodb
} }
$this->commands = [ $this->commands = [
"echo 'Starting {$database->name}.'", "echo 'Starting database.'",
"mkdir -p $this->configuration_dir", "mkdir -p $this->configuration_dir",
]; ];

View File

@@ -24,7 +24,7 @@ class StartMysql
$this->configuration_dir = database_configuration_dir().'/'.$container_name; $this->configuration_dir = database_configuration_dir().'/'.$container_name;
$this->commands = [ $this->commands = [
"echo 'Starting {$database->name}.'", "echo 'Starting database.'",
"mkdir -p $this->configuration_dir", "mkdir -p $this->configuration_dir",
]; ];

View File

@@ -25,7 +25,7 @@ class StartPostgresql
$this->configuration_dir = database_configuration_dir().'/'.$container_name; $this->configuration_dir = database_configuration_dir().'/'.$container_name;
$this->commands = [ $this->commands = [
"echo 'Starting {$database->name}.'", "echo 'Starting database.'",
"mkdir -p $this->configuration_dir", "mkdir -p $this->configuration_dir",
"mkdir -p $this->configuration_dir/docker-entrypoint-initdb.d/", "mkdir -p $this->configuration_dir/docker-entrypoint-initdb.d/",
]; ];

View File

@@ -25,7 +25,7 @@ class StartRedis
$this->configuration_dir = database_configuration_dir().'/'.$container_name; $this->configuration_dir = database_configuration_dir().'/'.$container_name;
$this->commands = [ $this->commands = [
"echo 'Starting {$database->name}.'", "echo 'Starting database.'",
"mkdir -p $this->configuration_dir", "mkdir -p $this->configuration_dir",
]; ];

View File

@@ -36,7 +36,7 @@ class CloudCleanupSubscriptions extends Command
} }
// If the team has no subscription id and the invoice is paid, we need to reset the invoice paid status // If the team has no subscription id and the invoice is paid, we need to reset the invoice paid status
if (! (data_get($team, 'subscription.stripe_subscription_id'))) { if (! (data_get($team, 'subscription.stripe_subscription_id'))) {
$this->info("Resetting invoice paid status for team {$team->id} {$team->name}"); $this->info("Resetting invoice paid status for team {$team->id}");
$team->subscription->update([ $team->subscription->update([
'stripe_invoice_paid' => false, 'stripe_invoice_paid' => false,
@@ -61,9 +61,9 @@ class CloudCleanupSubscriptions extends Command
$this->info('Subscription id: '.data_get($team, 'subscription.stripe_subscription_id')); $this->info('Subscription id: '.data_get($team, 'subscription.stripe_subscription_id'));
$confirm = $this->confirm('Do you want to cancel the subscription?', true); $confirm = $this->confirm('Do you want to cancel the subscription?', true);
if (! $confirm) { if (! $confirm) {
$this->info("Skipping team {$team->id} {$team->name}"); $this->info("Skipping team {$team->id}");
} else { } else {
$this->info("Cancelling subscription for team {$team->id} {$team->name}"); $this->info("Cancelling subscription for team {$team->id}");
$team->subscription->update([ $team->subscription->update([
'stripe_invoice_paid' => false, 'stripe_invoice_paid' => false,
'stripe_trial_already_ended' => false, 'stripe_trial_already_ended' => false,

View File

@@ -16,24 +16,26 @@ class Configuration extends Component
public function mount() public function mount()
{ {
$this->application = Application::query() $project = currentTeam()
->whereHas('environment.project', function ($query) { ->projects()
$query->where('team_id', currentTeam()->id) ->select('id', 'uuid', 'team_id')
->where('uuid', request()->route('project_uuid')); ->where('uuid', request()->route('project_uuid'))
}) ->firstOrFail();
->whereHas('environment', function ($query) { $environment = $project->environments()
$query->where('name', request()->route('environment_name')); ->select('id', 'name', 'project_id')
}) ->where('name', request()->route('environment_name'))
->firstOrFail();
$application = $environment->applications()
->with(['destination'])
->where('uuid', request()->route('application_uuid')) ->where('uuid', request()->route('application_uuid'))
->with(['destination' => function ($query) {
$query->select('id', 'server_id');
}])
->firstOrFail(); ->firstOrFail();
if ($this->application->destination && $this->application->destination->server_id) { $this->application = $application;
if ($application->destination && $application->destination->server) {
$mainServer = $application->destination->server;
$this->servers = Server::ownedByCurrentTeam() $this->servers = Server::ownedByCurrentTeam()
->select('id', 'name') ->select('id', 'name')
->where('id', '!=', $this->application->destination->server_id) ->where('id', '!=', $mainServer->id)
->get(); ->get();
} else { } else {
$this->servers = collect(); $this->servers = collect();

View File

@@ -127,13 +127,6 @@ class Team extends Model implements SendsDiscord, SendsEmail
]; ];
} }
public function name(): Attribute
{
return new Attribute(
get: fn () => sanitize_string($this->getRawOriginal('name')),
);
}
public function getRecepients($notification) public function getRecepients($notification)
{ {
$recipients = data_get($notification, 'emails', null); $recipients = data_get($notification, 'emails', null);

View File

@@ -2,7 +2,7 @@
return [ return [
'coolify' => [ 'coolify' => [
'version' => '4.0.0-beta.374', 'version' => '4.0.0-beta.375',
'self_hosted' => env('SELF_HOSTED', true), 'self_hosted' => env('SELF_HOSTED', true),
'autoupdate' => env('AUTOUPDATE'), 'autoupdate' => env('AUTOUPDATE'),
'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'), 'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'),

View File

@@ -1,6 +1,6 @@
<x-forms.select wire:model.live="selectedTeamId" label="Current Team"> <x-forms.select wire:model.live="selectedTeamId" label="Current Team">
<option value="default" disabled selected>Switch team</option> <option value="default" disabled selected>Switch team</option>
@foreach (auth()->user()->teams as $team) @foreach (auth()->user()->teams as $team)
<option value="{{ $team->id }}">{{ $team->name }}</option> <option value="{{ $team->id }}">{{ $team->name }}</option>
@endforeach @endforeach
</x-forms.select> </x-forms.select>

View File

@@ -1,10 +1,10 @@
{ {
"coolify": { "coolify": {
"v4": { "v4": {
"version": "4.0.0-beta.374" "version": "4.0.0-beta.375"
}, },
"nightly": { "nightly": {
"version": "4.0.0-beta.375" "version": "4.0.0-beta.376"
}, },
"helper": { "helper": {
"version": "1.0.4" "version": "1.0.4"