Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
777224709d | ||
| 0a4b0cdc14 | |||
| 3fd745196f | |||
| 8481fe8fef | |||
| 061ab13d2b | |||
|
|
656aaf816f | ||
| 36777e50a8 | |||
| fdd1182caf | |||
| 98237daa56 | |||
|
|
67b722612c | ||
| 4e32fb8222 | |||
| f9555c515c | |||
|
|
6458a1b35c | ||
| de81b55867 | |||
| a3cd1f6b74 |
@@ -26,6 +26,7 @@
|
|||||||
"symfony/http-client": "8.0.*",
|
"symfony/http-client": "8.0.*",
|
||||||
"symfony/mime": "8.0.*",
|
"symfony/mime": "8.0.*",
|
||||||
"symfony/monolog-bundle": "^4.0",
|
"symfony/monolog-bundle": "^4.0",
|
||||||
|
"symfony/process": "8.0.*",
|
||||||
"symfony/property-access": "8.0.*",
|
"symfony/property-access": "8.0.*",
|
||||||
"symfony/property-info": "8.0.*",
|
"symfony/property-info": "8.0.*",
|
||||||
"symfony/rate-limiter": "8.0.*",
|
"symfony/rate-limiter": "8.0.*",
|
||||||
|
|||||||
132
composer.lock
generated
132
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "bfd26e903d79f710cfe95452c05f2a25",
|
"content-hash": "51813b5c3b6dacd3cc99cfe121ab918b",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "api-platform/doctrine-common",
|
"name": "api-platform/doctrine-common",
|
||||||
@@ -6234,6 +6234,71 @@
|
|||||||
],
|
],
|
||||||
"time": "2024-09-09T11:45:10+00:00"
|
"time": "2024-09-09T11:45:10+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/process",
|
||||||
|
"version": "v8.0.8",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/process.git",
|
||||||
|
"reference": "cb8939aff03470d1a9d1d1b66d08c6fa71b3bbdc"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/process/zipball/cb8939aff03470d1a9d1d1b66d08c6fa71b3bbdc",
|
||||||
|
"reference": "cb8939aff03470d1a9d1d1b66d08c6fa71b3bbdc",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=8.4"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\Process\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Executes commands in sub-processes",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/process/tree/v8.0.8"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/nicolas-grekas",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2026-03-30T15:14:47+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/property-access",
|
"name": "symfony/property-access",
|
||||||
"version": "v8.0.8",
|
"version": "v8.0.8",
|
||||||
@@ -11018,71 +11083,6 @@
|
|||||||
],
|
],
|
||||||
"time": "2024-10-20T05:08:20+00:00"
|
"time": "2024-10-20T05:08:20+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "symfony/process",
|
|
||||||
"version": "v8.0.8",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/symfony/process.git",
|
|
||||||
"reference": "cb8939aff03470d1a9d1d1b66d08c6fa71b3bbdc"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/symfony/process/zipball/cb8939aff03470d1a9d1d1b66d08c6fa71b3bbdc",
|
|
||||||
"reference": "cb8939aff03470d1a9d1d1b66d08c6fa71b3bbdc",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=8.4"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Component\\Process\\": ""
|
|
||||||
},
|
|
||||||
"exclude-from-classmap": [
|
|
||||||
"/Tests/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Fabien Potencier",
|
|
||||||
"email": "fabien@symfony.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Symfony Community",
|
|
||||||
"homepage": "https://symfony.com/contributors"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Executes commands in sub-processes",
|
|
||||||
"homepage": "https://symfony.com",
|
|
||||||
"support": {
|
|
||||||
"source": "https://github.com/symfony/process/tree/v8.0.8"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://symfony.com/sponsor",
|
|
||||||
"type": "custom"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/fabpot",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/nicolas-grekas",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2026-03-30T15:14:47+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "theseer/tokenizer",
|
"name": "theseer/tokenizer",
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
parameters:
|
parameters:
|
||||||
app.version: '0.1.15'
|
app.version: '0.1.19'
|
||||||
|
|||||||
@@ -71,10 +71,12 @@ COPY --from=frontend-build /app/frontend/.output/public /var/www/html/frontend/.
|
|||||||
# Symfony needs a .env file to boot (variables are overridden by env_file in docker-compose)
|
# Symfony needs a .env file to boot (variables are overridden by env_file in docker-compose)
|
||||||
RUN echo "APP_ENV=prod" > /var/www/html/.env
|
RUN echo "APP_ENV=prod" > /var/www/html/.env
|
||||||
|
|
||||||
# Permissions
|
# Permissions + directories
|
||||||
RUN mkdir -p /var/www/html/var /var/www/html/var/uploads \
|
RUN mkdir -p /var/www/html/var/log /var/www/html/var/uploads \
|
||||||
/var/www/maintenance/sirh /var/www/maintenance/lesstime /var/www/maintenance/inventory \
|
&& chown -R www-data:www-data /var/www/html/var
|
||||||
&& chown -R www-data:www-data /var/www/html/var /var/www/maintenance
|
|
||||||
|
# Allow www-data to use Docker socket (GID 987 matches host's docker group)
|
||||||
|
RUN groupadd -g 987 dockerhost 2>/dev/null; usermod -aG dockerhost www-data
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: gitea.malio.fr/malio-dev/central:${CENTRAL_IMAGE_TAG:-latest}
|
image: gitea.malio.fr/malio-dev/central:${CENTRAL_IMAGE_TAG:-latest}
|
||||||
container_name: central-app
|
container_name: central-app
|
||||||
env_file: .env
|
env_file: .env
|
||||||
ports:
|
ports:
|
||||||
- "8084:80"
|
- "8084:80"
|
||||||
volumes:
|
group_add:
|
||||||
- ./config/jwt:/var/www/html/config/jwt:ro
|
- "987"
|
||||||
- ./uploads:/var/www/html/var/uploads
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- ./config/jwt:/var/www/html/config/jwt:ro
|
||||||
- /var/www/sirh:/var/www/sirh
|
- ./uploads:/var/www/html/var/uploads
|
||||||
- /var/www/lesstime:/var/www/lesstime
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
- /var/www/inventory:/var/www/inventory
|
- /var/www:/mnt/apps
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ use ApiPlatform\Metadata\Link;
|
|||||||
use ApiPlatform\Metadata\Patch;
|
use ApiPlatform\Metadata\Patch;
|
||||||
use ApiPlatform\Metadata\Post;
|
use ApiPlatform\Metadata\Post;
|
||||||
use App\Repository\EnvironmentRepository;
|
use App\Repository\EnvironmentRepository;
|
||||||
|
use App\State\EnvironmentCreateProcessor;
|
||||||
use App\State\MaintenanceToggleProcessor;
|
use App\State\MaintenanceToggleProcessor;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
@@ -23,7 +24,9 @@ use Symfony\Component\Serializer\Attribute\Groups;
|
|||||||
uriVariables: [
|
uriVariables: [
|
||||||
'slug' => new Link(toProperty: 'application', fromClass: Application::class, identifiers: ['slug']),
|
'slug' => new Link(toProperty: 'application', fromClass: Application::class, identifiers: ['slug']),
|
||||||
],
|
],
|
||||||
|
read: false,
|
||||||
security: "is_granted('ROLE_ADMIN')",
|
security: "is_granted('ROLE_ADMIN')",
|
||||||
|
processor: EnvironmentCreateProcessor::class,
|
||||||
),
|
),
|
||||||
new Patch(
|
new Patch(
|
||||||
security: "is_granted('ROLE_ADMIN')",
|
security: "is_granted('ROLE_ADMIN')",
|
||||||
|
|||||||
44
src/State/EnvironmentCreateProcessor.php
Normal file
44
src/State/EnvironmentCreateProcessor.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\State;
|
||||||
|
|
||||||
|
use ApiPlatform\Metadata\Operation;
|
||||||
|
use ApiPlatform\State\ProcessorInterface;
|
||||||
|
use App\Entity\Environment;
|
||||||
|
use App\Repository\ApplicationRepository;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
|
final readonly class EnvironmentCreateProcessor implements ProcessorInterface
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private ApplicationRepository $applicationRepository,
|
||||||
|
private EntityManagerInterface $entityManager,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Environment $data
|
||||||
|
*/
|
||||||
|
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): Environment
|
||||||
|
{
|
||||||
|
$slug = $uriVariables['slug']
|
||||||
|
?? $context['request']?->attributes->get('slug')
|
||||||
|
?? $context['request']?->attributes->get('_route_params')['slug']
|
||||||
|
?? '';
|
||||||
|
|
||||||
|
$application = $this->applicationRepository->findOneBy(['slug' => $slug]);
|
||||||
|
|
||||||
|
if (null === $application) {
|
||||||
|
throw new NotFoundHttpException(sprintf('Application "%s" not found.', $slug));
|
||||||
|
}
|
||||||
|
|
||||||
|
$data->setApplication($application);
|
||||||
|
|
||||||
|
$this->entityManager->persist($data);
|
||||||
|
$this->entityManager->flush();
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user