[service] fixed appwrite too many redirects error

Without this fix users have to manually uncheck strip prefix option for appwrite, appwrite-console, and appwrite-realtime services for the service to work
This commit is contained in:
ShadowArcanist 2025-11-27 06:27:09 +01:00
parent e5c7459284
commit 6254cdfd5a

View file

@ -102,13 +102,25 @@ public function mount()
} }
}); });
} }
$service->parse(isNew: true); $service->parse(isNew: true);
return redirect()->route('project.service.configuration', [ // For Appwrite services, disable strip prefix for services that handle domain requests
'service_uuid' => $service->uuid, if ($oneClickServiceName === 'appwrite') {
'environment_uuid' => $environment->uuid, $servicesToDisableStripPrefix = ['appwrite', 'appwrite-console', 'appwrite-realtime'];
'project_uuid' => $project->uuid, foreach ($servicesToDisableStripPrefix as $serviceName) {
]); $appService = $service->applications()->whereName($serviceName)->first();
if ($appService) {
$appService->is_stripprefix_enabled = false;
$appService->save();
}
}
}
return redirect()->route('project.service.configuration', [
'service_uuid' => $service->uuid,
'environment_uuid' => $environment->uuid,
'project_uuid' => $project->uuid,
]);
} }
} }
$this->type = $type->value(); $this->type = $type->value();