Merge branch 'main' into develop

pull/26/head
Manuel Aranda Rosales 2025-03-12 09:23:29 +01:00
commit 868a015902
3 changed files with 33 additions and 1 deletions

View File

@ -1,4 +1,8 @@
# Changelog
## [0.9.1] - 2025-03-12
### 🐛 Fixed
- Corrección en la cancelacion de transmisiones p2p.
## [0.9.0] - 2025-03-04
### 🔹 Added
- Nueva funcionalidad para tener notificaciones en tiempo real. Instalación de bundle "Mercure".

View File

@ -39,9 +39,32 @@ services:
- ogcore-network
image: opengnsys/ogcore-php:static
mercure:
image: dunglas/mercure
restart: unless-stopped
container_name: ogcore-mercure
environment:
# Uncomment the following line to disable HTTPS,
SERVER_NAME: ':3000'
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
MERCURE_EXTRA_DIRECTIVES: |
cors_origins *
# Comment the following line to disable the development mode
command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile
ports:
- "3000:3000"
volumes:
- mercure_data:/data
- mercure_config:/config
networks:
- ogcore-network
volumes:
database_data:
ogpublic:
mercure_data:
mercure_config:
networks:

View File

@ -8,6 +8,7 @@ use App\Entity\Image;
use App\Entity\ImageImageRepository;
use App\Entity\Trace;
use App\Model\CommandTypes;
use App\Model\DeployMethodTypes;
use App\Model\TraceStatus;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
@ -52,7 +53,11 @@ class CancelTransmissionAction extends AbstractOgRepositoryController
throw new ValidatorException('Fullsum is required');
}
$content = $this->createRequest('DELETE', 'http://'.$image->getRepository()->getIp().':8006/ogrepository/v1/'.$method.'/images/'.$image->getImageFullsum());
if ($method === DeployMethodTypes::TORRENT) {
$content = $this->createRequest('DELETE', 'http://'.$image->getRepository()->getIp().':8006/ogrepository/v1/p2p');
} else {
$content = $this->createRequest('DELETE', 'http://'.$image->getRepository()->getIp().':8006/ogrepository/v1/'.$method.'/images/'.$image->getImageFullsum());
}
if (isset($content['error']) && $content['code'] === Response::HTTP_INTERNAL_SERVER_ERROR ) {
throw new ValidatorException('Error cancelling transmission');