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
updates
Andras Bacsai448182497f26
diff --git a/app/Http/Livewire/PrivateKey/Change.php b/app/Http/Livewire/PrivateKey/Change.phpindex 568ed74869..cbddfddf61 100644--- a/app/Http/Livewire/PrivateKey/Change.php+++ b/app/Http/Livewire/PrivateKey/Change.php@@ -12,7 +12,8 @@ class Change extends Componentprotected $rules = ['private_key.name' => 'required|string','private_key.description' => 'nullable|string',- 'private_key.private_key' => 'required|string'+ 'private_key.private_key' => 'required|string',+ 'private_key.is_git_related' => 'nullable|boolean'];protected $validationAttributes = ['private_key.name' => 'name',diff --git a/app/Http/Livewire/Settings/Email.php b/app/Http/Livewire/Settings/Email.phpindex 6569f5c715..fa03bb8473 100644--- a/app/Http/Livewire/Settings/Email.php+++ b/app/Http/Livewire/Settings/Email.php@@ -46,6 +46,7 @@ class Email extends Componentpublic function test_email(){Notification::send($this->settings, new TestEmail);+ $this->emit('success', 'Test email sent.');}public function submit(){diff --git a/app/Models/PrivateKey.php b/app/Models/PrivateKey.phpindex 337e1555a4..7c242dbb6b 100644--- a/app/Models/PrivateKey.php+++ b/app/Models/PrivateKey.php@@ -9,6 +9,7 @@ class PrivateKey extends BaseModel'name','description','private_key',+ 'is_git_related','team_id',];static public function ownedByCurrentTeam(array $select = ['*'])diff --git a/database/migrations/2023_06_19_084152_add_git_related_private_key.php b/database/migrations/2023_06_19_084152_add_git_related_private_key.phpnew file mode 100644index 0000000000..c24b903c30--- /dev/null+++ b/database/migrations/2023_06_19_084152_add_git_related_private_key.php@@ -0,0 +1,28 @@+<?php++use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;+use Illuminate\Support\Facades\Schema;++return new class extends Migration+{+ /**+ * Run the migrations.+ */+ public function up(): void+ {+ Schema::table('private_keys', function (Blueprint $table) {+ $table->boolean('is_git_related')->default(false);+ });+ }++ /**+ * Reverse the migrations.+ */+ public function down(): void+ {+ Schema::table('private_keys', function (Blueprint $table) {+ $table->dropColumn('is_git_related');+ });+ }+};diff --git a/database/seeders/PrivateKeySeeder.php b/database/seeders/PrivateKeySeeder.phpindex 25561053dd..9078d1bc72 100644--- a/database/seeders/PrivateKeySeeder.php+++ b/database/seeders/PrivateKeySeeder.php@@ -60,7 +60,8 @@ KDOflMRFj39/bOLmv9Wmct+3ArKiLtftlqkmAJTF+w7fJCiqH0s31A+OChi9PMcyoV2PBC0CgYAXOm08kFOQA+bPBdLAte8Ga89frh6asH/Z8ucfsz9/zMMG/hhq5nF37TItY9Pblc2Fp805J13G96zWLX4YGyLwXXkYs+Ae7QoqjonTw7/mUDARY1Zxs9m/a1C8EDKapCw5hAhizEFOUQKOygL8Ipn+tmEUkORYdZ8Q8cWFCv9nIw==------END RSA PRIVATE KEY-----"+-----END RSA PRIVATE KEY-----",+ "is_git_related" => true]);PrivateKey::create(["team_id" => $team_1->id,diff --git a/resources/css/app.css b/resources/css/app.cssindex cff52e3ee4..4ca15b761c 100644--- a/resources/css/app.css+++ b/resources/css/app.css@@ -15,13 +15,13 @@ body {@apply pl-24 pr-10 mx-auto max-w-screen-xl pt-4;}input {- @apply input input-sm h-7 outline-none placeholder:text-neutral-700 text-white rounded bg-coolgray-200 w-full read-only:bg-coolgray-200/50 read-only:text-opacity-25 disabled:border-none;+ @apply input input-sm h-7 outline-none placeholder:text-neutral-700 text-white rounded bg-coolgray-200 w-full read-only:bg-coolgray-200/50 read-only:text-opacity-25;}-input && :not(input[type="checkbox"]) {- @apply border-none;+:not(input[type="checkbox"]) {+ @apply border-none disabled:border-none;}input[type="checkbox"] {- @apply toggle toggle-warning toggle-xs rounded;+ @apply toggle toggle-warning toggle-xs rounded disabled:toggle-warning;}textarea {diff --git a/resources/views/components/forms/checkbox.blade.php b/resources/views/components/forms/checkbox.blade.phpindex 15bc107246..b734736d7d 100644--- a/resources/views/components/forms/checkbox.blade.php+++ b/resources/views/components/forms/checkbox.blade.php@@ -8,7 +8,7 @@'noDirty' => $attributes->has('noDirty'),'disabled' => null,])-<div {{ $attributes->merge(['class' => 'flex cursor-pointer w-96 label']) }}>+<div {{ $attributes->merge(['class' => 'flex cursor-pointer label']) }}><div class="flex gap-1 label-text">@if ($label){{ $label }}diff --git a/resources/views/livewire/private-key/change.blade.php b/resources/views/livewire/private-key/change.blade.phpindex fabb1f4dbc..c24bf59302 100644--- a/resources/views/livewire/private-key/change.blade.php+++ b/resources/views/livewire/private-key/change.blade.php@@ -11,7 +11,7 @@Delete</x-forms.button></div>- <div class="pb-8 ">Private Key used for SSH connection</div>+ <div class="pb-8">Private Key used for SSH connection</div><x-forms.input id="private_key.name" label="Name" required /><x-forms.input id="private_key.description" label="Description" /><div>@@ -26,6 +26,11 @@Hide</div></div>+ @if ($private_key->is_git_related)+ <div class="w-48">+ <x-forms.checkbox id="private_key.is_git_related" disabled label="Is used by a Git App?" />+ </div>+ @endif<div x-cloak x-show="!showPrivateKey"><x-forms.input cannotPeakPassword type="password" rows="10" id="private_key.private_key" requireddisabled />@@ -34,6 +39,5 @@<x-forms.textarea rows="10" id="private_key.private_key" required /></div></div>-</form></div>diff --git a/routes/web.php b/routes/web.phpindex 80d0804244..ee65262741 100644--- a/routes/web.php+++ b/routes/web.php@@ -98,11 +98,11 @@ Route::middleware(['auth'])->group(function () {Route::middleware(['auth'])->group(function () {Route::get('/private-keys', fn () => view('private-key.all', [- 'privateKeys' => PrivateKey::ownedByCurrentTeam(['name', 'uuid'])->get()+ 'privateKeys' => PrivateKey::ownedByCurrentTeam(['name', 'uuid', 'is_git_related'])->where('is_git_related', false)->get()]))->name('private-key.all');Route::get('/private-key/new', fn () => view('private-key.new'))->name('private-key.new');Route::get('/private-key/{private_key_uuid}', fn () => view('private-key.show', [- 'private_key' => PrivateKey::ownedByCurrentTeam(['name', 'description', 'private_key'])->whereUuid(request()->private_key_uuid)->firstOrFail()+ 'private_key' => PrivateKey::ownedByCurrentTeam(['name', 'description', 'private_key', 'is_git_related'])->whereUuid(request()->private_key_uuid)->firstOrFail()]))->name('private-key.show');});diff --git a/routes/webhooks.php b/routes/webhooks.phpindex 62bcc758b7..bf2217b110 100644--- a/routes/webhooks.php+++ b/routes/webhooks.php@@ -27,7 +27,8 @@ Route::get('/source/github/redirect', function () {$private_key = PrivateKey::create(['name' => $slug,'private_key' => $private_key,- 'team_id' => $github_app->team_id+ 'team_id' => $github_app->team_id,+ 'is_git_related' => true,]);$github_app->name = $slug;$github_app->app_id = $id;diff --git a/scripts/run b/scripts/runindex 546580828f..01c643e383 100755--- a/scripts/run+++ b/scripts/run@@ -44,8 +44,12 @@ function db:reset {bash vendor/bin/spin exec -u webuser coolify php artisan migrate:fresh --seed}-function mfs {- db:reset+function db {+ bash vendor/bin/spin exec -u webuser coolify php artisan db+}++function db:migrate {+ bash vendor/bin/spin exec -u webuser coolify php artisan migrate}function db:reset-prod {@@ -53,6 +57,10 @@ function db:reset-prod {php artisan migrate:fresh --force --seed --seeder=ProductionSeeder}+function mfs {+ db:reset+}+function coolify {bash vendor/bin/spin exec -u webuser coolify bash}@@ -76,9 +84,6 @@ function tinker {bash vendor/bin/spin exec -u webuser coolify php artisan tinker}-function db {- bash vendor/bin/spin exec -u webuser coolify php artisan db-}function build:builder {act -W .github/workflows/coolify-builder.yml --secret-file .env.secrets