fix: webhook endpoint in cloud and no system wide gh app

This commit is contained in:
Andras Bacsai 2023-08-28 21:03:07 +02:00
parent b4a3236284
commit d28cf0b76d
2 changed files with 27 additions and 19 deletions

View File

@ -37,10 +37,14 @@ class Change extends Component
public function mount()
{
if (is_cloud()) {
$this->webhook_endpoint = config('app.url');
} else {
$this->webhook_endpoint = $this->ipv4;
$this->parameters = get_route_parameters();
$this->is_system_wide = $this->github_app->is_system_wide;
}
$this->parameters = get_route_parameters();
}
public function submit()
{

View File

@ -77,6 +77,7 @@
</div>
<div class="pt-1 pb-2 ">You need to register a GitHub App before using this source.</div>
<div class="pt-2 pb-10">
@if (!is_cloud())
<div class="flex items-end gap-2">
<x-forms.select wire:model='webhook_endpoint' label="Webhook Endpoint"
helper="All Git webhooks will be sent to this endpoint. <br><br>If you would like to use domain instead of IP address, set your Coolify instance's FQDN in the Settings menu.">
@ -91,6 +92,7 @@
@endif
</x-forms.select>
</div>
@endif
<div class="flex flex-col gap-2 pt-4">
<x-forms.checkbox disabled instantSave id="default_permissions" label="Default Permissions"
helper="Contents: read<br>Metadata: read<br>Email: read" />
@ -118,9 +120,11 @@
<x-forms.input type="number" id="github_app.custom_port" label="Port" required />
@endif
</div>
@if (!is_cloud())
<x-forms.checkbox
helper="If checked, this GitHub App will be available for everyone in this Coolify instance."
label="System Wide?" disabled id="is_system_wide" />
@endif
<script>
function createGithubApp(webhook_endpoint, preview_deployment_permissions) {
const {