diff --git a/CHANGELOG.md b/CHANGELOG.md index 39571c2..39d73b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,13 @@ # Changelog + +## [1.4.2] - 2026-04-13 +### Fixed +- Añadido fichero de migración con el cambio en la base de datos para añadir la fecha de despliegue de una partición. + +## [1.4.1] - 2026-04-08 +### Added +- En el comando RestaurarImagen se añade el parámetros "update-cache" o "deploy" para realizar el despliegue completo o sólo la actualización de la cache + ## [1.4.0] - 2026-04-08 ### Added - Entidad Partition: Añadido el campo deployDate expuesto mediante el DTO para registrar la fecha exacta de despliegue de imagen. diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index b6cfd9e..5bc08c3 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -5,6 +5,13 @@ framework: annotations: false http_method_override: false handle_all_throwables: true + trusted_proxies: '127.0.0.1' + trusted_headers: + - x-forwarded-for + - x-forwarded-host + - x-forwarded-proto + - x-forwarded-port + - x-forwarded-prefix # Enables session support. Note that the session will ONLY be started if you read or write from it. # Remove or comment this section to explicitly disable session support. diff --git a/migrations/Version20260413114545.php b/migrations/Version20260413114545.php new file mode 100644 index 0000000..53b03c2 --- /dev/null +++ b/migrations/Version20260413114545.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE `partition` ADD deploy_date DATETIME DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE `partition` DROP deploy_date'); + } +} diff --git a/src/Controller/OgAgent/DeployImageAction.php b/src/Controller/OgAgent/DeployImageAction.php index 5d12823..9677a38 100644 --- a/src/Controller/OgAgent/DeployImageAction.php +++ b/src/Controller/OgAgent/DeployImageAction.php @@ -61,6 +61,8 @@ class DeployImageAction extends AbstractOgAgentController $repository = $imageImageRepository->getRepository(); + $nfn = ($input->deployMode === 'update-cache') ? 'ActualizarCache' : 'RestaurarImagen'; + $data = [ 'dsk' => (string) $input->diskNumber, 'par' => (string) $input->partitionNumber, @@ -68,7 +70,7 @@ class DeployImageAction extends AbstractOgAgentController 'idi' => $image->getUuid(), 'nci' => $imageImageRepository->getName(), 'ipr' => $repository->getIp(), - 'nfn' => 'RestaurarImagen', + 'nfn' => $nfn, 'ptc' => $ptcValue, 'ids' => '0' ]; diff --git a/src/Dto/Input/DeployImageInput.php b/src/Dto/Input/DeployImageInput.php index e76d77e..59762fd 100644 --- a/src/Dto/Input/DeployImageInput.php +++ b/src/Dto/Input/DeployImageInput.php @@ -74,4 +74,8 @@ class DeployImageInput #[Groups(['image-image-repository:write'])] #[ApiProperty(description: 'Whether to queue the deployment', example: false)] public bool $queue = false; + + #[Groups(['image-image-repository:write'])] + #[ApiProperty(description: 'Deploy mode: full deploy or cache-only update', example: 'deploy')] + public ?string $deployMode = 'deploy'; // 'deploy' | 'update-cache' }