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() public function mount()
{ {
if (is_cloud()) {
$this->webhook_endpoint = config('app.url');
} else {
$this->webhook_endpoint = $this->ipv4; $this->webhook_endpoint = $this->ipv4;
$this->parameters = get_route_parameters();
$this->is_system_wide = $this->github_app->is_system_wide; $this->is_system_wide = $this->github_app->is_system_wide;
} }
$this->parameters = get_route_parameters();
}
public function submit() public function submit()
{ {

View File

@ -77,6 +77,7 @@
</div> </div>
<div class="pt-1 pb-2 ">You need to register a GitHub App before using this source.</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"> <div class="pt-2 pb-10">
@if (!is_cloud())
<div class="flex items-end gap-2"> <div class="flex items-end gap-2">
<x-forms.select wire:model='webhook_endpoint' label="Webhook Endpoint" <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."> 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 @endif
</x-forms.select> </x-forms.select>
</div> </div>
@endif
<div class="flex flex-col gap-2 pt-4"> <div class="flex flex-col gap-2 pt-4">
<x-forms.checkbox disabled instantSave id="default_permissions" label="Default Permissions" <x-forms.checkbox disabled instantSave id="default_permissions" label="Default Permissions"
helper="Contents: read<br>Metadata: read<br>Email: read" /> 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 /> <x-forms.input type="number" id="github_app.custom_port" label="Port" required />
@endif @endif
</div> </div>
@if (!is_cloud())
<x-forms.checkbox <x-forms.checkbox
helper="If checked, this GitHub App will be available for everyone in this Coolify instance." helper="If checked, this GitHub App will be available for everyone in this Coolify instance."
label="System Wide?" disabled id="is_system_wide" /> label="System Wide?" disabled id="is_system_wide" />
@endif
<script> <script>
function createGithubApp(webhook_endpoint, preview_deployment_permissions) { function createGithubApp(webhook_endpoint, preview_deployment_permissions) {
const { const {