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 Bacsaibba8b25b489c
diff --git a/.env.development.example b/.env.development.example
index d37a25ea24..a2345b11a5 100644
--- a/.env.development.example
+++ b/.env.development.example
@@ -6,6 +6,7 @@
USERID=
GROUPID=
PROJECT_PATH_ON_HOST=/Users/your-username-here/code/coollabsio/coolify
+SERVEO_URL=<for receiving webhooks locally https://serveo.net/>
############################################################################################################
APP_NAME=Coolify
diff --git a/app/Http/Livewire/Project/Application/General.php b/app/Http/Livewire/Project/Application/General.php
index 9b40b4be3a..a0236e3bcd 100644
--- a/app/Http/Livewire/Project/Application/General.php
+++ b/app/Http/Livewire/Project/Application/General.php
@@ -57,6 +57,7 @@ class General extends Component
$this->application->settings->is_dual_cert = $this->is_dual_cert;
$this->application->settings->save();
$this->application->refresh();
+ $this->emit('saved', 'Application settings updated!');
}
public function mount()
{
diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.php
index 6e2c1804d8..22a0bca964 100644
--- a/app/Http/Livewire/Project/New/PublicGitRepository.php
+++ b/app/Http/Livewire/Project/New/PublicGitRepository.php
@@ -67,6 +67,7 @@ class PublicGitRepository extends Component
$this->port = 3000;
$this->publish_directory = null;
}
+ $this->emit('saved', 'Application settings updated!');
}
public function submit()
diff --git a/app/Http/Livewire/Settings/Form.php b/app/Http/Livewire/Settings/Form.php
index ec0b54d734..0c4dcf5a8a 100644
--- a/app/Http/Livewire/Settings/Form.php
+++ b/app/Http/Livewire/Settings/Form.php
@@ -33,6 +33,7 @@ class Form extends Component
$this->settings->is_registration_enabled = $this->is_registration_enabled;
$this->settings->is_https_forced = $this->is_https_forced;
$this->settings->save();
+ $this->emit('saved', 'Settings updated!');
}
public function submit()
{
diff --git a/app/Http/Livewire/Source/Github/Change.php b/app/Http/Livewire/Source/Github/Change.php
index 53d5f374ca..430ea99992 100644
--- a/app/Http/Livewire/Source/Github/Change.php
+++ b/app/Http/Livewire/Source/Github/Change.php
@@ -44,6 +44,7 @@ class Change extends Component
try {
$this->github_app->is_system_wide = $this->is_system_wide;
$this->github_app->save();
+ $this->emit('saved', 'GitHub settings updated!');
} catch (\Exception $e) {
return generalErrorHandlerLivewire($e, $this);
}
diff --git a/app/Models/GithubApp.php b/app/Models/GithubApp.php
index e8f25a96a1..918beb53d4 100644
--- a/app/Models/GithubApp.php
+++ b/app/Models/GithubApp.php
@@ -22,6 +22,6 @@ class GithubApp extends BaseModel
}
static public function private()
{
- return GithubApp::where('team_id', session('currentTeam')->id)->where('is_public', false)->whereNotNull('app_id')->whereNotNull('installation_id')->get();
+ return GithubApp::where('team_id', session('currentTeam')->id)->where('is_public', false)->get();
}
}
diff --git a/bootstrap/getVersion.php b/bootstrap/getVersion.php
index 2a36543155..2653f65750 100644
--- a/bootstrap/getVersion.php
+++ b/bootstrap/getVersion.php
@@ -1,3 +1,3 @@
<?php
-$config = include 'config/coolify.php';
-echo $config['version'];
+$version = include 'config/version.php';
+echo $version;
diff --git a/config/coolify.php b/config/coolify.php
index 5438c7dab2..aef26cdb34 100644
--- a/config/coolify.php
+++ b/config/coolify.php
@@ -1,5 +1,5 @@
<?php
return [
- 'version' => '4.0.0-nightly.2',
+ 'dev_webhook' => env('SERVEO_URL'),
];
diff --git a/config/version.php b/config/version.php
new file mode 100644
index 0000000000..d5300c6eaf
--- /dev/null
+++ b/config/version.php
@@ -0,0 +1,3 @@
+<?php
+
+return '4.0.0-nightly.2';
diff --git a/resources/views/components/applications/navbar.blade.php b/resources/views/components/applications/navbar.blade.php
index 2e97cbba79..266d8380a5 100644
--- a/resources/views/components/applications/navbar.blade.php
+++ b/resources/views/components/applications/navbar.blade.php
@@ -2,10 +2,20 @@
<a target="_blank" href="{{ $gitLocation }}">
<x-inputs.button>Open on Git ↗️</x-inputs.button>
</a>
- <a href="{{ route('project.application.configuration', Route::current()->parameters()) }}">
+ <a
+ href="{{ route('project.application.configuration', [
+ 'project_uuid' => Route::current()->parameters()['project_uuid'],
+ 'application_uuid' => Route::current()->parameters()['application_uuid'],
+ 'environment_name' => Route::current()->parameters()['environment_name'],
+ ]) }}">
<x-inputs.button>Configuration</x-inputs.button>
</a>
- <a href="{{ route('project.application.deployments', Route::current()->parameters()) }}">
+ <a
+ href="{{ route('project.application.deployments', [
+ 'project_uuid' => Route::current()->parameters()['project_uuid'],
+ 'application_uuid' => Route::current()->parameters()['application_uuid'],
+ 'environment_name' => Route::current()->parameters()['environment_name'],
+ ]) }}">
<x-inputs.button>Deployments</x-inputs.button>
</a>
<livewire:project.application.deploy :applicationId="$applicationId" />
diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php
index cd9f8b5323..05a45f111a 100644
--- a/resources/views/components/layout.blade.php
+++ b/resources/views/components/layout.blade.php
@@ -79,6 +79,10 @@
Livewire.on('error', (message) => {
console.log(message);
})
+ Livewire.on('saved', (message) => {
+ if (message) console.log(message);
+ else console.log('saved');
+ })
</script>
@endauth
diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php
index 7b6f916832..bacc0b37e0 100644
--- a/resources/views/components/navbar.blade.php
+++ b/resources/views/components/navbar.blade.php
@@ -1,5 +1,5 @@
<nav class="flex gap-2 ">
- <div>v{{ config('coolify.version') }}</div>
+ <div>v{{ config('version') }}</div>
@auth
<a href="/">Home</a>
<a href="/command-center">Command Center</a>
diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php
index 6ed6b53439..9f2d549a39 100644
--- a/resources/views/livewire/project/application/general.blade.php
+++ b/resources/views/livewire/project/application/general.blade.php
@@ -44,10 +44,11 @@
</x-inputs.button>
</form>
<div class="flex flex-col pt-4">
- <x-inputs.input instantSave type="checkbox" id="is_static" label="Static website?" />
- <x-inputs.input instantSave type="checkbox" id="is_git_submodules_allowed" label="Git Submodules Allowed?" />
- <x-inputs.input instantSave type="checkbox" id="is_git_lfs_allowed" label="Git LFS Allowed?" />
- <x-inputs.input instantSave type="checkbox" id="is_debug" label="Debug" />
+ <x-inputs.input noDirty instantSave type="checkbox" id="is_static" label="Static website?" />
+ <x-inputs.input noDirty instantSave type="checkbox" id="is_git_submodules_allowed"
+ label="Git Submodules Allowed?" />
+ <x-inputs.input noDirty instantSave type="checkbox" id="is_git_lfs_allowed" label="Git LFS Allowed?" />
+ <x-inputs.input noDirty instantSave type="checkbox" id="is_debug" label="Debug" />
<x-inputs.input disabled instantSave type="checkbox" id="is_auto_deploy" label="Auto Deploy?" />
<x-inputs.input disabled instantSave type="checkbox" id="is_dual_cert" label="Dual Certs?" />
<x-inputs.input disabled instantSave type="checkbox" id="is_previews" label="Previews?" />
diff --git a/resources/views/source/github/show.blade.php b/resources/views/source/github/show.blade.php
index 7c6e8d992f..fecc66deb5 100644
--- a/resources/views/source/github/show.blade.php
+++ b/resources/views/source/github/show.blade.php
@@ -1,53 +1,58 @@
<x-layout>
<h1>GitHub App</h1>
<livewire:source.github.change :github_app="$github_app" />
- <form x-data>
- <x-inputs.button x-on:click.prevent="createGithubApp">Create GitHub Application</x-inputs.button>
- </form>
- <script>
- function createGithubApp() {
- const {
- organization,
- uuid,
- html_url
- } = @json($github_app);
- const host = @js($host);
- const name = @js($name);
- let url = 'settings/apps/new';
- if (organization) {
- organization = `'organizations/${organization}/settings/apps/new`;
+ @if (!$github_app->app_id)
+ <form x-data>
+ <x-inputs.button x-on:click.prevent="createGithubApp">Create GitHub Application</x-inputs.button>
+ </form>
+ <script>
+ function createGithubApp() {
+ const {
+ organization,
+ uuid,
+ html_url
+ } = @json($github_app);
+ let baseUrl = @js($host);
+ const name = @js($name);
+ const isDev = @js(config('app.env')) === 'local';
+ const devWebhook = @js(config('coolify.dev_webhook'));
+ if (isDev && devWebhook) {
+ baseUrl = devWebhook;
+ }
+ const webhookBaseUrl = `${baseUrl}/webhooks`;
+ const path = organization ? `organizations/${organization}/settings/apps/new` : 'settings/apps/new';
+ const data = {
+ name,
+ url: baseUrl,
+ hook_attributes: {
+ url: `${webhookBaseUrl}/github/events`
+ },
+ redirect_url: `${webhookBaseUrl}/github`,
+ callback_urls: [`${baseUrl}/login/github/app`],
+ public: false,
+ request_oauth_on_install: false,
+ setup_url: `${webhookBaseUrl}/github/install?source=${uuid}`,
+ setup_on_update: true,
+ default_permissions: {
+ contents: 'read',
+ metadata: 'read',
+ pull_requests: 'read',
+ emails: 'read'
+ },
+ default_events: ['pull_request', 'push']
+ };
+ const form = document.createElement('form');
+ form.setAttribute('method', 'post');
+ form.setAttribute('action', `${html_url}/${path}?state=${uuid}`);
+ const input = document.createElement('input');
+ input.setAttribute('id', 'manifest');
+ input.setAttribute('name', 'manifest');
+ input.setAttribute('type', 'hidden');
+ input.setAttribute('value', JSON.stringify(data));
+ form.appendChild(input);
+ document.getElementsByTagName('body')[0].appendChild(form);
+ form.submit();
}
- const data = {
- name,
- url: host,
- hook_attributes: {
- url: `${host}/webhooks/github/events`
- },
- redirect_url: `${host}/webhooks/github`,
- callback_urls: [`${host}/login/github/app`],
- public: false,
- request_oauth_on_install: false,
- setup_url: `${host}/webhooks/github/install?source=${uuid}`,
- setup_on_update: true,
- default_permissions: {
- contents: 'read',
- metadata: 'read',
- pull_requests: 'read',
- emails: 'read'
- },
- default_events: ['pull_request', 'push']
- };
- const form = document.createElement('form');
- form.setAttribute('method', 'post');
- form.setAttribute('action', `${html_url}/${url}?state=${uuid}`);
- const input = document.createElement('input');
- input.setAttribute('id', 'manifest');
- input.setAttribute('name', 'manifest');
- input.setAttribute('type', 'hidden');
- input.setAttribute('value', data);
- form.appendChild(input);
- document.getElementsByTagName('body')[0].appendChild(form);
- form.submit();
- }
- </script>
+ </script>
+ @endif
</x-layout>