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.

wip

Andras Bacsai2e8b1134b943
diff --git a/app/Http/Livewire/Application/General.php b/app/Http/Livewire/Application/General.php
index 41d4cbb624..10a550feb0 100644
--- a/app/Http/Livewire/Application/General.php
+++ b/app/Http/Livewire/Application/General.php
@@ -17,6 +17,16 @@ class General extends Component
public string|null $git_commit_sha;
public string $build_pack;
+ public bool $is_git_submodules_allowed;
+ public bool $is_git_lfs_allowed;
+ public bool $is_debug;
+ public bool $is_previews;
+ public bool $is_bot;
+ public bool $is_custom_ssl;
+ public bool $is_http2;
+ public bool $is_auto_deploy;
+ public bool $is_dual_cert;
+
protected $rules = [
'application.name' => 'required|min:6',
'application.fqdn' => 'nullable',
@@ -26,17 +36,37 @@ class General extends Component
'application.build_pack' => 'required',
'application.base_directory' => 'required',
'application.publish_directory' => 'nullable',
- 'application.environment.name' => 'required',
- 'application.destination.network' => 'required',
];
-
+ public function instantSave()
+ {
+ // @TODO: find another way
+ $this->application->settings->is_git_submodules_allowed = $this->is_git_submodules_allowed;
+ $this->application->settings->is_git_lfs_allowed = $this->is_git_lfs_allowed;
+ $this->application->settings->is_debug = $this->is_debug;
+ $this->application->settings->is_previews = $this->is_previews;
+ $this->application->settings->is_bot = $this->is_bot;
+ $this->application->settings->is_custom_ssl = $this->is_custom_ssl;
+ $this->application->settings->is_http2 = $this->is_http2;
+ $this->application->settings->is_auto_deploy = $this->is_auto_deploy;
+ $this->application->settings->is_dual_cert = $this->is_dual_cert;
+ $this->application->settings->save();
+ }
public function mount()
{
- $this->application = Application::find($this->applicationId)->with('destination')->first();
+ $this->application = Application::find($this->applicationId)->with('destination', 'settings')->first();
+ $this->is_git_submodules_allowed = $this->application->settings->is_git_submodules_allowed;
+ $this->is_git_lfs_allowed = $this->application->settings->is_git_lfs_allowed;
+ $this->is_debug = $this->application->settings->is_debug;
+ $this->is_previews = $this->application->settings->is_previews;
+ $this->is_bot = $this->application->settings->is_bot;
+ $this->is_custom_ssl = $this->application->settings->is_custom_ssl;
+ $this->is_http2 = $this->application->settings->is_http2;
+ $this->is_auto_deploy = $this->application->settings->is_auto_deploy;
+ $this->is_dual_cert = $this->application->settings->is_dual_cert;
+
}
public function submit()
{
- $this->validate();
$this->application->save();
}
}
diff --git a/app/Http/Livewire/Application/Secrets.php b/app/Http/Livewire/Application/Secrets.php
index c94e0e4a4c..d23fd8386a 100644
--- a/app/Http/Livewire/Application/Secrets.php
+++ b/app/Http/Livewire/Application/Secrets.php
@@ -6,8 +6,5 @@ use Livewire\Component;
class Secrets extends Component
{
- public function render()
- {
- return view('livewire.application.secrets');
- }
+ public array $secrets = [];
}
diff --git a/app/Http/Livewire/Application/Storages.php b/app/Http/Livewire/Application/Storages.php
new file mode 100644
index 0000000000..340c897ada
--- /dev/null
+++ b/app/Http/Livewire/Application/Storages.php
@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Http\Livewire\Application;
+
+use Illuminate\Database\Eloquent\Collection;
+use Livewire\Component;
+
+class Storages extends Component
+{
+ public Collection $storages;
+}
diff --git a/app/Models/ApplicationSetting.php b/app/Models/ApplicationSetting.php
index 9acad2ae9b..a664f8d3c3 100644
--- a/app/Models/ApplicationSetting.php
+++ b/app/Models/ApplicationSetting.php
@@ -6,6 +6,10 @@ use Illuminate\Database\Eloquent\Model;
class ApplicationSetting extends Model
{
+ protected $fillable = [
+ 'is_git_submodules_allowed',
+ 'is_git_lfs_allowed',
+ ];
public function application()
{
return $this->belongsTo(Application::class);
diff --git a/app/Models/GithubApp.php b/app/Models/GithubApp.php
index fd7dd07754..5e16fa5744 100644
--- a/app/Models/GithubApp.php
+++ b/app/Models/GithubApp.php
@@ -4,6 +4,9 @@ namespace App\Models;
class GithubApp extends BaseModel
{
+ protected $casts = [
+ 'is_public' => 'boolean',
+ ];
public function applications()
{
return $this->morphMany(Application::class, 'source');
diff --git a/app/View/Components/Input.php b/app/View/Components/Input.php
index 16897aef1a..07879b157b 100644
--- a/app/View/Components/Input.php
+++ b/app/View/Components/Input.php
@@ -16,6 +16,8 @@ class Input extends Component
public bool $required = false,
public bool $readonly = false,
public string|null $label = null,
+ public string|null $type = 'text',
+ public bool $instantSave = false,
) {
//
}
diff --git a/resources/views/components/applications/layout.blade.php b/resources/views/components/applications/layout.blade.php
index abc1bbd99d..24de20df5a 100644
--- a/resources/views/components/applications/layout.blade.php
+++ b/resources/views/components/applications/layout.blade.php
@@ -2,6 +2,6 @@
<h1>{{ $title ?? 'NOT SET' }}</h1>
<x-applications.navbar :applicationId="$applicationId" />
<div>
- {{ $slot }}
+ {{ $slot }}
</div>
</x-layout>
diff --git a/resources/views/components/input.blade.php b/resources/views/components/input.blade.php
index 5abd7953d1..4d6140a89f 100644
--- a/resources/views/components/input.blade.php
+++ b/resources/views/components/input.blade.php
@@ -1,16 +1,33 @@
-<label for={{ $name }}>
- @if ($label)
- {{ $label }}
- @else
- {{ $name }}
- @endif
- @if ($required)
- *
- @endif
-</label>
-<input id={{ $name }} wire:model.defer={{ $name }} type="text" name={{ $name }}
- @if ($required) required @endif
- @if ($readonly) readOnly=true disabled=true @endif />
+@if ($type === 'checkbox')
+ <label for={{ $name }}>
+ @if ($label)
+ {{ $label }}
+ @else
+ {{ $name }}
+ @endif
+ @if ($required)
+ *
+ @endif
+ <input type="checkbox" id={{ $name }}
+ @if ($instantSave) wire:click='instantSave' wire:model.defer={{ $name }} @else wire:model.defer={{ $name }} @endif
+ name={{ $name }}>
+ </label>
+@else
+ <label for={{ $name }}>
+ @if ($label)
+ {{ $label }}
+ @else
+ {{ $name }}
+ @endif
+ @if ($required)
+ *
+ @endif
+ </label>
+ <input type="text" id={{ $name }} wire:model.defer={{ $name }} name={{ $name }}
+ @if ($required) required @endif
+ @if ($readonly) readOnly=true disabled=true @endif />
+@endif
+
@error($name)
<span class="text-red-500">{{ $message }}</span>
@enderror
diff --git a/resources/views/livewire/application/destination.blade.php b/resources/views/livewire/application/destination.blade.php
index 6f48b8eecc..a141c6c4bd 100644
--- a/resources/views/livewire/application/destination.blade.php
+++ b/resources/views/livewire/application/destination.blade.php
@@ -1,3 +1,5 @@
<div>
- <p>{{$destination->name}}</p>
+ <p>IP: {{ $destination->server->ip }}</p>
+ <p>Description: {{ $destination->server->description }}</p>
+ <p>Docker Network: {{ $destination->network }}</p>
</div>
diff --git a/resources/views/livewire/application/general.blade.php b/resources/views/livewire/application/general.blade.php
index 573a5ee4b6..fae4d09f70 100644
--- a/resources/views/livewire/application/general.blade.php
+++ b/resources/views/livewire/application/general.blade.php
@@ -15,12 +15,24 @@
<div class="flex-col flex w-96">
<x-input name="application.base_directory" label="Base Directory" />
<x-input name="application.publish_directory" label="Publish Directory" />
- <x-input name="application.destination.network" readonly label="Destination Network" />
</div>
</div>
+
+
<button class="flex mx-auto mt-4" type="submit">
Submit
</button>
</form>
+ <div class="flex flex-col pt-4 w-52 text-right">
+ <x-input instantSave type="checkbox" name="is_auto_deploy" label="Auto Deploy?" />
+ <x-input instantSave type="checkbox" name="is_dual_cert" label="Dual Certs?" />
+ <x-input instantSave type="checkbox" name="is_previews" label="Previews?" />
+ <x-input instantSave type="checkbox" name="is_bot" label="Is Bot?" />
+ <x-input instantSave type="checkbox" name="is_custom_ssl" label="Is Custom SSL?" />
+ <x-input instantSave type="checkbox" name="is_http2" label="Is Http2?" />
+ <x-input instantSave type="checkbox" name="is_git_submodules_allowed" label="Git Submodules Allowed?" />
+ <x-input instantSave type="checkbox" name="is_git_lfs_allowed" label="Git LFS Allowed?" />
+ <x-input instantSave type="checkbox" name="is_debug" label="Debug" />
+ </div>
</div>
diff --git a/resources/views/livewire/application/secrets.blade.php b/resources/views/livewire/application/secrets.blade.php
index fd5ed6b9b4..88d549b1d5 100644
--- a/resources/views/livewire/application/secrets.blade.php
+++ b/resources/views/livewire/application/secrets.blade.php
@@ -1,3 +1,7 @@
<div>
- {{-- Nothing in the world is as soft and yielding as water. --}}
+ @forelse ($secrets as $secret)
+ {{ dump($secret) }}
+ @empty
+ <p>There are no secrets for this application.</p>
+ @endforelse
</div>
diff --git a/resources/views/livewire/application/source.blade.php b/resources/views/livewire/application/source.blade.php
index 5af721496a..45329f7690 100644
--- a/resources/views/livewire/application/source.blade.php
+++ b/resources/views/livewire/application/source.blade.php
@@ -1,5 +1,6 @@
<div>
- <p>{{ $application->source->name }}</p>
+ <p>Source Name: {{ data_get($application,'source.name') }}</p>
+ <p>Is Public Source: {{ data_get($application,'source.is_public') }}</p>
<div class="flex-col flex w-96">
<x-input name="application.git_repository" label="Git Repository" readonly />
<x-input name="application.git_branch" label="Git Branch" readonly />
diff --git a/resources/views/livewire/application/storages.blade.php b/resources/views/livewire/application/storages.blade.php
new file mode 100644
index 0000000000..0f7a5bc9c7
--- /dev/null
+++ b/resources/views/livewire/application/storages.blade.php
@@ -0,0 +1,10 @@
+<div>
+ @forelse ($storages as $storage)
+ <p>Name:{{ data_get($storage, 'name') }}</p>
+ <p>MountPath:{{ data_get($storage, 'mount_path') }}</p>
+ <p>HostPath:{{ data_get($storage, 'host_path') }}</p>
+ <p>ContainerId:{{ data_get($storage, 'container_id') }}</p>
+ @empty
+ <p>No storage found.</p>
+ @endforelse
+</div>
diff --git a/resources/views/project/applications/configuration.blade.php b/resources/views/project/applications/configuration.blade.php
index 72c04977a8..a62504bc49 100644
--- a/resources/views/project/applications/configuration.blade.php
+++ b/resources/views/project/applications/configuration.blade.php
@@ -6,18 +6,23 @@
<button @click.prevent="tab = 'source'; window.location.hash = 'source'" href="#">Source</button>
<button @click.prevent="tab = 'destination'; window.location.hash = 'destination'" href="#">Destination
</button>
+ <button @click.prevent="tab = 'storages'; window.location.hash = 'storages'" href="#">Storage
+ </button>
</div>
<div x-cloak x-show="tab === 'general'">
<livewire:application.general :applicationId="$application->id" />
</div>
<div x-cloak x-show="tab === 'secrets'">
- <livewire:application.secrets :secrets="$application->id" />
+ <livewire:application.secrets />
</div>
<div x-cloak x-show="tab === 'source'">
<livewire:application.source :applicationId="$application->id" />
</div>
<div x-cloak x-show="tab === 'destination'">
- <livewire:application.destination :destination="$application->destination->server" />
+ <livewire:application.destination :destination="$application->destination" />
+ </div>
+ <div x-cloak x-show="tab === 'storages'">
+ <livewire:application.storages :storages="$application->persistentStorages" />
</div>
</div>
</x-applications.layout>