Skip to content

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.

Merge branch 'next' into feat/scheduled-tasks-cron

Andras Bacsaice0b38035cf9
diff --cc resources/views/livewire/project/service/index.blade.php
index 3462730ec7,15e9b9d210..b16a738b56
--- a/resources/views/livewire/project/service/index.blade.php
+++ b/resources/views/livewire/project/service/index.blade.php
@@@ -1,176 -1,62 +1,82 @@@
- <div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'service-stack' }" x-init="$wire.checkStatus">
+ <div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'general' }">
<livewire:project.service.navbar :service="$service" :parameters="$parameters" :query="$query" />
<div class="flex h-full pt-6">
- <div class="flex flex-col items-start gap-4 min-w-fit">
- <a target="_blank" href="{{ $service->documentation() }}">Documentation <x-external-link /></a>
- <a :class="activeTab === 'service-stack' && 'text-white'"
- @click.prevent="activeTab = 'service-stack';
- window.location.hash = 'service-stack'"
- href="#">Service Stack</a>
- <a :class="activeTab === 'execute-command' && 'text-white'"
- @click.prevent="activeTab = 'execute-command';
- window.location.hash = 'execute-command'"
- href="#">Execute Command</a>
- <a :class="activeTab === 'logs' && 'text-white'"
- @click.prevent="activeTab = 'logs';
- window.location.hash = 'logs'"
- href="#">Logs</a>
+ <div class="flex flex-col gap-4 min-w-fit">
+ <a class="{{ request()->routeIs('project.service.configuration') ? 'text-white' : '' }}"
+ href="{{ route('project.service.configuration', [...$parameters, 'service_name' => null]) }}">
+ <button><- Back</button>
+ </a>
+ <a :class="activeTab === 'general' && 'text-white'"
+ @click.prevent="activeTab = 'general'; window.location.hash = 'general'; if(window.location.search) window.location.search = ''"
+ href="#">General</a>
<a :class="activeTab === 'storages' && 'text-white'"
- @click.prevent="activeTab = 'storages';
- window.location.hash = 'storages'"
- href="#">Storages</a>
- <a :class="activeTab === 'webhooks' && 'text-white'"
- @click.prevent="activeTab = 'webhooks'; window.location.hash = 'webhooks'" href="#">Webhooks
+ @click.prevent="activeTab = 'storages'; window.location.hash = 'storages'; if(window.location.search) window.location.search = ''"
+ href="#">Storages
</a>
+ <a :class="activeTab === 'environment-variables' && 'text-white'"
+ @click.prevent="activeTab = 'environment-variables'; window.location.hash = 'environment-variables'"
+ href="#">Environment
+ Variables</a>
+ <a :class="activeTab === 'scheduled-tasks' && 'text-white'"
+ @click.prevent="activeTab = 'scheduled-tasks'; window.location.hash = 'scheduled-tasks'"
+ href="#">Scheduled Tasks
+ </a>
+ <a :class="activeTab === 'danger' && 'text-white'"
+ @click.prevent="activeTab = 'danger';
+ window.location.hash = 'danger'"
+ href="#">Danger Zone
- </a>
++
+ @if (
+ $serviceDatabase?->databaseType() === 'standalone-mysql' ||
+ $serviceDatabase?->databaseType() === 'standalone-postgresql' ||
+ $serviceDatabase?->databaseType() === 'standalone-mariadb')
+ <a :class="activeTab === 'backups' && 'text-white'"
+ @click.prevent="activeTab = 'backups'; window.location.hash = 'backups'" href="#">Backups</a>
+ @endif
</div>
<div class="w-full pl-8">
- <div x-cloak x-show="activeTab === 'service-stack'">
- <livewire:project.service.stack-form :service="$service" />
- <div class="grid grid-cols-1 gap-2 pt-4 xl:grid-cols-1">
- @foreach ($applications as $application)
- <div @class([
- 'border-l border-dashed border-red-500' => Str::of(
- $application->status)->contains(['exited']),
- 'border-l border-dashed border-success' => Str::of(
- $application->status)->contains(['running']),
- 'border-l border-dashed border-warning' => Str::of(
- $application->status)->contains(['starting']),
- 'flex gap-2 box-without-bg bg-coolgray-100 hover:text-neutral-300 group',
- ])>
- <div class="flex flex-row w-full">
- <div class="flex flex-col flex-1">
- <div class="pb-2">
- @if ($application->human_name)
- {{ Str::headline($application->human_name) }}
- @else
- {{ Str::headline($application->name) }}
- @endif
- <span class="text-xs">({{ $application->image }})</span>
- </div>
- @if ($application->configuration_required)
- <span class="text-xs text-error">(configuration required)</span>
- @endif
- @if ($application->description)
- <span class="text-xs">{{ Str::limit($application->description, 60) }}</span>
- @endif
- @if ($application->fqdn)
- <span class="text-xs">{{ Str::limit($application->fqdn, 60) }}</span>
- @endif
- <div class="text-xs">{{ $application->status }}</div>
- </div>
- <div class="flex items-center px-4">
- <a
- class="flex flex-col flex-1 group-hover:text-white hover:no-underline"
- href="{{ route('project.service.show', [...$parameters, 'service_name' => $application->name]) }}">
- <svg xmlns="http://www.w3.org/2000/svg" class="icon hover:text-warning"
- viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
- stroke-linecap="round" stroke-linejoin="round">
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path
- d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z" />
- <path d="M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" />
- </svg>
- </a>
- </div>
- </div>
- </div>
- @endforeach
- @foreach ($databases as $database)
- <div @class([
- 'border-l border-dashed border-red-500' => Str::of(
- $database->status)->contains(['exited']),
- 'border-l border-dashed border-success' => Str::of(
- $database->status)->contains(['running']),
- 'border-l border-dashed border-warning' => Str::of(
- $database->status)->contains(['restarting']),
- 'flex gap-2 box-without-bg bg-coolgray-100 hover:text-neutral-300 group',
- ])>
-
-
- <div class="flex flex-row w-full">
- <div class="flex flex-col flex-1">
- <div class="pb-2">
- @if ($database->human_name)
- {{ Str::headline($database->human_name) }}
- @else
- {{ Str::headline($database->name) }}
- @endif
- <span class="text-xs">({{ $database->image }})</span>
- </div>
- @if ($database->configuration_required)
- <span class="text-xs text-error">(configuration required)</span>
- @endif
- @if ($database->description)
- <span class="text-xs">{{ Str::limit($database->description, 60) }}</span>
- @endif
- <div class="text-xs">{{ $database->status }}</div>
- </div>
- <div class="flex items-center px-4">
- <a
- class="flex flex-col flex-1 group-hover:text-white hover:no-underline"
- href="{{ route('project.service.show', [...$parameters, 'service_name' => $database->name]) }}">
- <svg xmlns="http://www.w3.org/2000/svg" class="icon hover:text-warning"
- viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
- stroke-linecap="round" stroke-linejoin="round">
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path
- d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z" />
- <path d="M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" />
- </svg>
- </a>
- </div>
- </div>
- </div>
- @endforeach
+ @isset($serviceApplication)
+ <div x-cloak x-show="activeTab === 'general'" class="h-full">
+ <livewire:project.service.application :application="$serviceApplication" />
</div>
- </div>
- <div x-cloak x-show="activeTab === 'storages'">
- <div class="flex items-center gap-2">
- <h2>Storages</h2>
+ <div x-cloak x-show="activeTab === 'storages'">
+ <div class="flex items-center gap-2">
+ <h2>Storages</h2>
+ </div>
+ <div class="pb-4">Persistent storage to preserve data between deployments.</div>
+ <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
+ <livewire:project.service.storage wire:key="application-{{ $serviceApplication->id }}"
+ :resource="$serviceApplication" />
</div>
- <div class="pb-4">Persistent storage to preserve data between deployments.</div>
- <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
- @foreach ($applications as $application)
- <livewire:project.service.storage wire:key="application-{{ $application->id }}"
- :resource="$application" />
- @endforeach
- @foreach ($databases as $database)
- <livewire:project.service.storage wire:key="database-{{ $database->id }}" :resource="$database" />
- @endforeach
- </div>
- <div x-cloak x-show="activeTab === 'webhooks'">
- <livewire:project.shared.webhooks :resource="$service" />
- </div>
- <div x-cloak x-show="activeTab === 'logs'">
- <livewire:project.shared.logs :resource="$service" />
- </div>
- <div x-cloak x-show="activeTab === 'execute-command'">
- <livewire:project.shared.execute-container-command :resource="$service" />
- </div>
- <div x-cloak x-show="activeTab === 'environment-variables'">
- <div x-cloak x-show="activeTab === 'environment-variables'">
- <livewire:project.shared.environment-variable.all :resource="$service" />
+ @endisset
+ @isset($serviceDatabase)
+ <div x-cloak x-show="activeTab === 'general'" class="h-full">
+ <livewire:project.service.database :database="$serviceDatabase" />
+ </div>
+ <div x-cloak x-show="activeTab === 'storages'">
+ <div class="flex items-center gap-2">
+ <h2>Storages</h2>
+ </div>
+ <div class="pb-4">Persistent storage to preserve data between deployments.</div>
+ <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
+ <livewire:project.service.storage wire:key="application-{{ $serviceDatabase->id }}" :resource="$serviceDatabase" />
+ </div>
+ <div x-cloak x-show="activeTab === 'backups'">
+ <div class="flex gap-2 ">
+ <h2 class="pb-4">Scheduled Backups</h2>
+ <x-forms.button onclick="createScheduledBackup.showModal()">+ Add</x-forms.button>
+ </div>
+ <livewire:project.database.create-scheduled-backup :database="$serviceDatabase" :s3s="$s3s" />
+ <livewire:project.database.scheduled-backups :database="$serviceDatabase" />
</div>
+ </div>
+ <div x-cloak x-show="activeTab === 'scheduled-tasks'">
+ <livewire:project.shared.scheduled-task.all :resource="$service" />
+ </div>
+ <div x-cloak x-show="activeTab === 'danger'">
+ <livewire:project.shared.danger :resource="$service" />
+ </div>
+ @endisset
</div>
</div>
</div>
diff --cc routes/web.php
index 1ee3fa4a6f,b25ee38194..8735cf8725
--- a/routes/web.php
+++ b/routes/web.php
@@@ -16,10 -50,14 +50,15 @@@ use App\Livewire\Project\Service\Index
use App\Livewire\Project\EnvironmentEdit;
use App\Livewire\Project\Shared\ExecuteContainerCommand;
use App\Livewire\Project\Shared\Logs;
+use App\Livewire\Project\Shared\ScheduledTask\Show as ScheduledTaskShow;
+
use App\Livewire\Security\ApiTokens;
- use App\Livewire\Server\All;
- use App\Livewire\Server\Create;
+ use App\Livewire\Security\PrivateKey\Create as SecurityPrivateKeyCreate;
+ use App\Livewire\Security\PrivateKey\Show as SecurityPrivateKeyShow;
+
+ use App\Livewire\Server\Index as ServerIndex;
+ use App\Livewire\Server\Create as ServerCreate;
+ use App\Livewire\Server\Show as ServerShow;
use App\Livewire\Server\Destination\Show as DestinationShow;
use App\Livewire\Server\LogDrains;
use App\Livewire\Server\PrivateKey\Show as PrivateKeyShow;
@@@ -108,81 -91,81 +92,83 @@@ Route::prefix('magic')->middleware(['au
});
Route::middleware(['auth', 'verified'])->group(function () {
- Route::get('/projects', [ProjectController::class, 'all'])->name('projects');
- Route::get('/project/{project_uuid}', [ProjectController::class, 'show'])->name('project.show');
- Route::get('/project/{project_uuid}/edit', [ProjectController::class, 'edit'])->name('project.edit');
- Route::get('/project/{project_uuid}/{environment_name}/clone', CloneProject::class)->name('project.clone');
-
- Route::get('/project/{project_uuid}/{environment_name}/new', [ProjectController::class, 'new'])->name('project.resources.new');
- Route::get('/project/{project_uuid}/{environment_name}', [ProjectController::class, 'resources'])->name('project.resources');
- Route::get('/project/{project_uuid}/{environment_name}/edit', EnvironmentEdit::class)->name('project.environment.edit');
-
- // Applications
- Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}', ApplicationConfiguration::class)->name('project.application.configuration');
+ Route::middleware(['throttle:force-password-reset'])->group(function () {
+ Route::get('/force-password-reset', ForcePasswordReset::class)->name('auth.force-password-reset');
+ });
- Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}/deployment', [ApplicationController::class, 'deployments'])->name('project.application.deployments');
- Route::get(
- '/project/{project_uuid}/{environment_name}/application/{application_uuid}/deployment/{deployment_uuid}',
- [ApplicationController::class, 'deployment']
- )->name('project.application.deployment');
+ Route::get('/', Dashboard::class)->name('dashboard');
+ Route::get('/boarding', BoardingIndex::class)->name('boarding');
- Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}/logs', Logs::class)->name('project.application.logs');
- Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}/command', ExecuteContainerCommand::class)->name('project.application.command');
- Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}/tasks/{task_uuid}', ScheduledTaskShow::class)->name('project.application.scheduled-tasks');
+ Route::get('/subscription', SubscriptionIndex::class)->name('subscription.index');
+ Route::get('/settings', SettingsIndex::class)->name('settings.index');
+ Route::get('/settings/license', SettingsLicense::class)->name('settings.license');
- // Databases
- Route::get('/project/{project_uuid}/{environment_name}/database/{database_uuid}', [DatabaseController::class, 'configuration'])->name('project.database.configuration');
- Route::get('/project/{project_uuid}/{environment_name}/database/{database_uuid}/backups', [DatabaseController::class, 'backups'])->name('project.database.backups.all');
- Route::get('/project/{project_uuid}/{environment_name}/database/{database_uuid}/backups/{backup_uuid}', [DatabaseController::class, 'executions'])->name('project.database.backups.executions');
- Route::get('/project/{project_uuid}/{environment_name}/database/{database_uuid}/logs', Logs::class)->name('project.database.logs');
- Route::get('/project/{project_uuid}/{environment_name}/database/{database_uuid}/command', ExecuteContainerCommand::class)->name('project.database.command');
+ Route::get('/profile', ProfileIndex::class)->name('profile');
+ Route::prefix('team')->group(function () {
+ Route::get('/', TeamIndex::class)->name('team.index');
+ Route::get('/new', TeamCreate::class)->name('team.create');
+ Route::get('/members', TeamMemberIndex::class)->name('team.member.index');
+ Route::get('/notifications', TeamNotificationIndex::class)->name('team.notification.index');
+ Route::get('/storages', TeamStorageIndex::class)->name('team.storage.index');
+ Route::get('/storages/new', TeamStorageCreate::class)->name('team.storage.create');
+ Route::get('/storages/{storage_uuid}', TeamStorageShow::class)->name('team.storage.show');
+ });
- // Services
- Route::get('/project/{project_uuid}/{environment_name}/service/{service_uuid}', ServiceIndex::class)->name('project.service.configuration');
- Route::get('/project/{project_uuid}/{environment_name}/service/{service_uuid}/{service_name}', ServiceShow::class)->name('project.service.show');
- Route::get('/project/{project_uuid}/{environment_name}/service/{service_uuid}/command', ExecuteContainerCommand::class)->name('project.service.command');
- Route::get('/project/{project_uuid}/{environment_name}/service/{service_uuid}/tasks/{task_uuid}', ScheduledTaskShow::class)->name('project.service.scheduled-tasks');
+ Route::get('/command-center', CommandCenterIndex::class)->name('command-center');
- });
+ Route::prefix('invitations')->group(function () {
+ Route::get('/{uuid}', [Controller::class, 'accept_invitation'])->name('team.invitation.accept');
+ Route::get('/{uuid}/revoke', [Controller::class, 'revoke_invitation'])->name('team.invitation.revoke');
+ });
- Route::middleware(['auth'])->group(function () {
- Route::get('/servers', All::class)->name('server.all');
- Route::get('/server/new', Create::class)->name('server.create');
- Route::get('/server/{server_uuid}', Show::class)->name('server.show');
- Route::get('/server/{server_uuid}/proxy', ProxyShow::class)->name('server.proxy');
- Route::get('/server/{server_uuid}/proxy/logs', ProxyLogs::class)->name('server.proxy.logs');
- Route::get('/server/{server_uuid}/private-key', PrivateKeyShow::class)->name('server.private-key');
- Route::get('/server/{server_uuid}/destinations', DestinationShow::class)->name('server.destinations');
- Route::get('/server/{server_uuid}/log-drains', LogDrains::class)->name('server.log-drains');
- });
+ Route::get('/projects', ProjectIndex::class)->name('project.index');
+ Route::prefix('project/{project_uuid}')->group(function () {
+ Route::get('/', ProjectShow::class)->name('project.show');
+ Route::get('/edit', ProjectEdit::class)->name('project.edit');
+ });
+ Route::prefix('project/{project_uuid}/{environment_name}')->group(function () {
+ Route::get('/', ResourceIndex::class)->name('project.resource.index');
+ Route::get('/clone', ProjectCloneMe::class)->name('project.clone-me');
+ Route::get('/new', ResourceCreate::class)->name('project.resource.create');
+ Route::get('/edit', EnvironmentEdit::class)->name('project.environment.edit');
+ });
+ Route::prefix('project/{project_uuid}/{environment_name}/application/{application_uuid}')->group(function () {
+ Route::get('/', ApplicationConfiguration::class)->name('project.application.configuration');
+ Route::get('/deployment', DeploymentIndex::class)->name('project.application.deployment.index');
+ Route::get('/deployment/{deployment_uuid}', DeploymentShow::class)->name('project.application.deployment.show');
+ Route::get('/logs', Logs::class)->name('project.application.logs');
+ Route::get('/command', ExecuteContainerCommand::class)->name('project.application.command');
++ Route::get('/tasks/{task_uuid}', ScheduledTaskShow::class)->name('project.application.scheduled-tasks');
+ });
+ Route::prefix('project/{project_uuid}/{environment_name}/database/{database_uuid}')->group(function () {
+ Route::get('/', DatabaseConfiguration::class)->name('project.database.configuration');
+ Route::get('/logs', Logs::class)->name('project.database.logs');
+ Route::get('/command', ExecuteContainerCommand::class)->name('project.database.command');
+ Route::get('/backups', DatabaseBackupIndex::class)->name('project.database.backup.index');
+ Route::get('/backups/{backup_uuid}', DatabaseBackupExecution::class)->name('project.database.backup.execution');
+ });
+ Route::prefix('project/{project_uuid}/{environment_name}/service/{service_uuid}')->group(function () {
+ Route::get('/', ServiceConfiguration::class)->name('project.service.configuration');
+ Route::get('/{service_name}', ServiceIndex::class)->name('project.service.index');
+ Route::get('/command', ExecuteContainerCommand::class)->name('project.service.command');
++ Route::get('/tasks/{task_uuid}', ScheduledTaskShow::class)->name('project.service.scheduled-tasks');
+ });
+ Route::get('/servers', ServerIndex::class)->name('server.index');
+ Route::get('/server/new', ServerCreate::class)->name('server.create');
- Route::middleware(['auth', 'verified'])->group(function () {
- Route::get('/', Dashboard::class)->name('dashboard');
- Route::get('/boarding', BoardingIndex::class)->name('boarding');
- Route::middleware(['throttle:force-password-reset'])->group(function () {
- Route::get('/force-password-reset', [Controller::class, 'force_passoword_reset'])->name('auth.force-password-reset');
+ Route::prefix('server/{server_uuid}')->group(function () {
+ Route::get('/', ServerShow::class)->name('server.show');
+ Route::get('/proxy', ProxyShow::class)->name('server.proxy');
+ Route::get('/proxy/logs', ProxyLogs::class)->name('server.proxy.logs');
+ Route::get('/private-key', PrivateKeyShow::class)->name('server.private-key');
+ Route::get('/destinations', DestinationShow::class)->name('server.destinations');
+ Route::get('/log-drains', LogDrains::class)->name('server.log-drains');
});
- Route::get('/subscription', SubscriptionShow::class)->name('subscription.index');
- Route::get('/settings', [Controller::class, 'settings'])->name('settings.configuration');
- Route::get('/settings/license', [Controller::class, 'license'])->name('settings.license');
- Route::get('/profile', fn () => view('profile', ['request' => request()]))->name('profile');
- Route::get('/team', [Controller::class, 'team'])->name('team.index');
- Route::get('/team/new', fn () => view('team.create'))->name('team.create');
- Route::get('/team/notifications', fn () => view('team.notifications'))->name('team.notifications');
- Route::get('/team/storages', [Controller::class, 'storages'])->name('team.storages.all');
- Route::get('/team/storages/new', fn () => view('team.storages.create'))->name('team.storages.new');
- Route::get('/team/storages/{storage_uuid}', [Controller::class, 'storages_show'])->name('team.storages.show');
- Route::get('/team/members', [Controller::class, 'members'])->name('team.members');
- Route::get('/command-center', fn () => view('command-center', ['servers' => Server::isReachable()->get()]))->name('command-center');
- Route::get('/invitations/{uuid}', [Controller::class, 'acceptInvitation'])->name('team.invitation.accept');
- Route::get('/invitations/{uuid}/revoke', [Controller::class, 'revokeInvitation'])->name('team.invitation.revoke');
- });
- Route::middleware(['auth'])->group(function () {
- Route::get('/security', fn () => view('security.index'))->name('security.index');
+ // Route::get('/security', fn () => view('security.index'))->name('security.index');
Route::get('/security/private-key', fn () => view('security.private-key.index', [
'privateKeys' => PrivateKey::ownedByCurrentTeam(['name', 'uuid', 'is_git_related'])->get()
]))->name('security.private-key.index');