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.

Merge remote-tracking branch 'origin/next' into feat/api/tag-management

Andras Bacsaiaded45acbef9
diff --cc app/Http/Controllers/Api/ApplicationsController.php
index 0192befd14,ab063ca8d3..e10bc06583
--- a/app/Http/Controllers/Api/ApplicationsController.php
+++ b/app/Http/Controllers/Api/ApplicationsController.php
@@@ -33,18 -33,15 +33,27 @@@ use Symfony\Component\Yaml\Yaml
class ApplicationsController extends Controller
{
+ use Concerns\HandlesTagsApi;
+
+ protected function findTaggableResource(string $uuid, int|string $teamId): mixed
+ {
+ return Application::ownedByCurrentTeamAPI($teamId)->where('uuid', $uuid)->first();
+ }
+
+ protected function tagResourceNotFoundMessage(): string
+ {
+ return 'Application not found.';
+ }
+
+ private function exposeFileStorageContentIfAllowed(LocalFileVolume|LocalPersistentVolume $storage): LocalFileVolume|LocalPersistentVolume
+ {
+ if (request()->attributes->get('can_read_sensitive', false) === true) {
+ $storage->makeVisible(['content']);
+ }
+
+ return $storage;
+ }
+
private function removeSensitiveData($application)
{
$application->makeHidden([
diff --cc app/Http/Controllers/Api/DatabasesController.php
index d3dd779552,d6622f29e6..3cd2f0a73b
--- a/app/Http/Controllers/Api/DatabasesController.php
+++ b/app/Http/Controllers/Api/DatabasesController.php
@@@ -27,19 -28,16 +28,28 @@@ use OpenApi\Attributes as OA
class DatabasesController extends Controller
{
+ use Concerns\HandlesTagsApi;
+
+ protected function findTaggableResource(string $uuid, int|string $teamId): mixed
+ {
+ return queryDatabaseByUuidWithinTeam($uuid, $teamId);
+ }
+
+ protected function tagResourceNotFoundMessage(): string
+ {
+ return 'Database not found.';
+ }
+
- private function removeSensitiveData($database)
+ private function exposeFileStorageContentIfAllowed(LocalFileVolume|LocalPersistentVolume $storage): LocalFileVolume|LocalPersistentVolume
+ {
+ if (request()->attributes->get('can_read_sensitive', false) === true) {
+ $storage->makeVisible(['content']);
+ }
+
+ return $storage;
+ }
+
+ private function removeSensitiveData($database, bool $loadNestedServerSecrets = false)
{
$database->makeHidden([
'id',
diff --cc app/Http/Controllers/Api/ServicesController.php
index 46e93ca1ee,24aca896b5..e32415e79c
--- a/app/Http/Controllers/Api/ServicesController.php
+++ b/app/Http/Controllers/Api/ServicesController.php
@@@ -22,20 -24,21 +24,33 @@@ use Symfony\Component\Yaml\Yaml
class ServicesController extends Controller
{
+ use Concerns\HandlesTagsApi;
+
+ protected function findTaggableResource(string $uuid, int|string $teamId): mixed
+ {
+ return Service::whereRelation('environment.project.team', 'id', $teamId)->whereUuid($uuid)->first();
+ }
+
+ protected function tagResourceNotFoundMessage(): string
+ {
+ return 'Service not found.';
+ }
+
+ private function exposeFileStorageContentIfAllowed(LocalFileVolume|LocalPersistentVolume $storage): LocalFileVolume|LocalPersistentVolume
+ {
+ if (request()->attributes->get('can_read_sensitive', false) === true) {
+ $storage->makeVisible(['content']);
+ }
+
+ return $storage;
+ }
+
private function removeSensitiveData($service)
{
+ if ($service instanceof Collection) {
+ return $service->map(fn (Service $item) => $this->removeSensitiveData($item));
+ }
+
$service->makeHidden([
'id',
'resourceable',