wip
This commit is contained in:
parent
ec3fe284b6
commit
bba8b25b48
@ -6,6 +6,7 @@
|
|||||||
USERID=
|
USERID=
|
||||||
GROUPID=
|
GROUPID=
|
||||||
PROJECT_PATH_ON_HOST=/Users/your-username-here/code/coollabsio/coolify
|
PROJECT_PATH_ON_HOST=/Users/your-username-here/code/coollabsio/coolify
|
||||||
|
SERVEO_URL=<for receiving webhooks locally https://serveo.net/>
|
||||||
############################################################################################################
|
############################################################################################################
|
||||||
|
|
||||||
APP_NAME=Coolify
|
APP_NAME=Coolify
|
||||||
|
@ -57,6 +57,7 @@ public function instantSave()
|
|||||||
$this->application->settings->is_dual_cert = $this->is_dual_cert;
|
$this->application->settings->is_dual_cert = $this->is_dual_cert;
|
||||||
$this->application->settings->save();
|
$this->application->settings->save();
|
||||||
$this->application->refresh();
|
$this->application->refresh();
|
||||||
|
$this->emit('saved', 'Application settings updated!');
|
||||||
}
|
}
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
|
@ -67,6 +67,7 @@ public function instantSave()
|
|||||||
$this->port = 3000;
|
$this->port = 3000;
|
||||||
$this->publish_directory = null;
|
$this->publish_directory = null;
|
||||||
}
|
}
|
||||||
|
$this->emit('saved', 'Application settings updated!');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function submit()
|
public function submit()
|
||||||
|
@ -33,6 +33,7 @@ public function instantSave()
|
|||||||
$this->settings->is_registration_enabled = $this->is_registration_enabled;
|
$this->settings->is_registration_enabled = $this->is_registration_enabled;
|
||||||
$this->settings->is_https_forced = $this->is_https_forced;
|
$this->settings->is_https_forced = $this->is_https_forced;
|
||||||
$this->settings->save();
|
$this->settings->save();
|
||||||
|
$this->emit('saved', 'Settings updated!');
|
||||||
}
|
}
|
||||||
public function submit()
|
public function submit()
|
||||||
{
|
{
|
||||||
|
@ -44,6 +44,7 @@ public function instantSave()
|
|||||||
try {
|
try {
|
||||||
$this->github_app->is_system_wide = $this->is_system_wide;
|
$this->github_app->is_system_wide = $this->is_system_wide;
|
||||||
$this->github_app->save();
|
$this->github_app->save();
|
||||||
|
$this->emit('saved', 'GitHub settings updated!');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return generalErrorHandlerLivewire($e, $this);
|
return generalErrorHandlerLivewire($e, $this);
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,6 @@ static public function public()
|
|||||||
}
|
}
|
||||||
static public function private()
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
$config = include 'config/coolify.php';
|
$version = include 'config/version.php';
|
||||||
echo $config['version'];
|
echo $version;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'version' => '4.0.0-nightly.2',
|
'dev_webhook' => env('SERVEO_URL'),
|
||||||
];
|
];
|
||||||
|
3
config/version.php
Normal file
3
config/version.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return '4.0.0-nightly.2';
|
@ -2,10 +2,20 @@
|
|||||||
<a target="_blank" href="{{ $gitLocation }}">
|
<a target="_blank" href="{{ $gitLocation }}">
|
||||||
<x-inputs.button>Open on Git ↗️</x-inputs.button>
|
<x-inputs.button>Open on Git ↗️</x-inputs.button>
|
||||||
</a>
|
</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>
|
<x-inputs.button>Configuration</x-inputs.button>
|
||||||
</a>
|
</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>
|
<x-inputs.button>Deployments</x-inputs.button>
|
||||||
</a>
|
</a>
|
||||||
<livewire:project.application.deploy :applicationId="$applicationId" />
|
<livewire:project.application.deploy :applicationId="$applicationId" />
|
||||||
|
@ -79,6 +79,10 @@ function checkHealth() {
|
|||||||
Livewire.on('error', (message) => {
|
Livewire.on('error', (message) => {
|
||||||
console.log(message);
|
console.log(message);
|
||||||
})
|
})
|
||||||
|
Livewire.on('saved', (message) => {
|
||||||
|
if (message) console.log(message);
|
||||||
|
else console.log('saved');
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
@endauth
|
@endauth
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<nav class="flex gap-2 ">
|
<nav class="flex gap-2 ">
|
||||||
<div>v{{ config('coolify.version') }}</div>
|
<div>v{{ config('version') }}</div>
|
||||||
@auth
|
@auth
|
||||||
<a href="/">Home</a>
|
<a href="/">Home</a>
|
||||||
<a href="/command-center">Command Center</a>
|
<a href="/command-center">Command Center</a>
|
||||||
|
@ -44,10 +44,11 @@
|
|||||||
</x-inputs.button>
|
</x-inputs.button>
|
||||||
</form>
|
</form>
|
||||||
<div class="flex flex-col pt-4">
|
<div class="flex flex-col pt-4">
|
||||||
<x-inputs.input instantSave type="checkbox" id="is_static" label="Static website?" />
|
<x-inputs.input noDirty 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 noDirty instantSave type="checkbox" id="is_git_submodules_allowed"
|
||||||
<x-inputs.input instantSave type="checkbox" id="is_git_lfs_allowed" label="Git LFS Allowed?" />
|
label="Git Submodules Allowed?" />
|
||||||
<x-inputs.input instantSave type="checkbox" id="is_debug" label="Debug" />
|
<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_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_dual_cert" label="Dual Certs?" />
|
||||||
<x-inputs.input disabled instantSave type="checkbox" id="is_previews" label="Previews?" />
|
<x-inputs.input disabled instantSave type="checkbox" id="is_previews" label="Previews?" />
|
||||||
|
@ -1,53 +1,58 @@
|
|||||||
<x-layout>
|
<x-layout>
|
||||||
<h1>GitHub App</h1>
|
<h1>GitHub App</h1>
|
||||||
<livewire:source.github.change :github_app="$github_app" />
|
<livewire:source.github.change :github_app="$github_app" />
|
||||||
<form x-data>
|
@if (!$github_app->app_id)
|
||||||
<x-inputs.button x-on:click.prevent="createGithubApp">Create GitHub Application</x-inputs.button>
|
<form x-data>
|
||||||
</form>
|
<x-inputs.button x-on:click.prevent="createGithubApp">Create GitHub Application</x-inputs.button>
|
||||||
<script>
|
</form>
|
||||||
function createGithubApp() {
|
<script>
|
||||||
const {
|
function createGithubApp() {
|
||||||
organization,
|
const {
|
||||||
uuid,
|
organization,
|
||||||
html_url
|
uuid,
|
||||||
} = @json($github_app);
|
html_url
|
||||||
const host = @js($host);
|
} = @json($github_app);
|
||||||
const name = @js($name);
|
let baseUrl = @js($host);
|
||||||
let url = 'settings/apps/new';
|
const name = @js($name);
|
||||||
if (organization) {
|
const isDev = @js(config('app.env')) === 'local';
|
||||||
organization = `'organizations/${organization}/settings/apps/new`;
|
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 = {
|
</script>
|
||||||
name,
|
@endif
|
||||||
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>
|
|
||||||
</x-layout>
|
</x-layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user