Corrected the pull address.

This commit is contained in:
Leonid Nikitin 2024-07-06 22:46:15 +05:00
parent 7501968d04
commit f3b6c8cd49
Signed by: kor-elf
GPG Key ID: 3C0F720C170F6E1D
4 changed files with 11 additions and 3 deletions

View File

@ -38,4 +38,9 @@ public static function shortDigest(string $digest): string
$digest = Str::of($digest)->explode(':', 2)->last(); $digest = Str::of($digest)->explode(':', 2)->last();
return Str::of($digest)->take(12)->toString(); return Str::of($digest)->take(12)->toString();
} }
public static function dockerServiceAddress(): string
{
return Str::of(config('registry.service_http'))->remove(['http://', 'https://'])->toString();
}
} }

View File

@ -5,6 +5,7 @@
use App\Dto\QuerySettingsDto; use App\Dto\QuerySettingsDto;
use App\Dto\Service\Site\AccessTokens\StoreUpdate; use App\Dto\Service\Site\AccessTokens\StoreUpdate;
use App\Enums\AccessTokenPermission; use App\Enums\AccessTokenPermission;
use App\Helpers\Helpers;
use App\Models\User; use App\Models\User;
use App\Repositories\AccessTokenRepository; use App\Repositories\AccessTokenRepository;
use App\ServiceResults\ServiceResultArray; use App\ServiceResults\ServiceResultArray;
@ -39,7 +40,7 @@ public function create(User $user): ServiceResultError | ServiceResultArray
{ {
return $this->result([ return $this->result([
'user' => $user, 'user' => $user,
'serviceAddress' => config('registry.service_http'), 'serviceAddress' => Helpers::dockerServiceAddress(),
'permissions' => AccessTokenPermission::toCollection()->pluck('title', 'value')->toArray(), 'permissions' => AccessTokenPermission::toCollection()->pluck('title', 'value')->toArray(),
]); ]);
} }

View File

@ -5,6 +5,7 @@
use App\Dto\Builder\Repository as RepositoryBuilder; use App\Dto\Builder\Repository as RepositoryBuilder;
use App\Dto\QuerySettingsDto; use App\Dto\QuerySettingsDto;
use App\Dto\Service\Site\Repository\StoreUpdate; use App\Dto\Service\Site\Repository\StoreUpdate;
use App\Helpers\Helpers;
use App\Models\Repository; use App\Models\Repository;
use App\Models\User; use App\Models\User;
use App\Repositories\RepositoryRepository; use App\Repositories\RepositoryRepository;
@ -65,7 +66,7 @@ public function repository(string $username, string $repositoryName, ?User $user
return $this->result([ return $this->result([
'repository' => $repository, 'repository' => $repository,
'pageUser' => $pageUser, 'pageUser' => $pageUser,
'serviceAddress' => config('registry.service_http'), 'serviceAddress' => Helpers::dockerServiceAddress(),
]); ]);
} }

View File

@ -3,6 +3,7 @@
namespace App\Services\Site; namespace App\Services\Site;
use App\Dto\QuerySettingsDto; use App\Dto\QuerySettingsDto;
use App\Helpers\Helpers;
use App\Models\User; use App\Models\User;
use App\Repositories\RepositoryRepository; use App\Repositories\RepositoryRepository;
use App\Repositories\TagRepositoryRepository; use App\Repositories\TagRepositoryRepository;
@ -55,7 +56,7 @@ public function tags(string $username, string $repositoryName, QuerySettingsDto
'tags' => $tags, 'tags' => $tags,
'repository' => $repository, 'repository' => $repository,
'pageUser' => $pageUser, 'pageUser' => $pageUser,
'serviceAddress' => config('registry.service_http'), 'serviceAddress' => Helpers::dockerServiceAddress(),
]); ]);
} }