Compare commits

..

10 Commits

Author SHA1 Message Date
Nicolas Arenas cdc24f0c33 Fix typo in pipeline
testing/ogcore-api/pipeline/head This commit looks good Details
ogcore-debian-package/pipeline/head There was a failure building this commit Details
2025-03-13 18:51:33 +01:00
Nicolas Arenas 74456f85a1 add Jenkinsfile to build package in Jenkins
ogcore-debian-package/pipeline/head There was a failure building this commit Details
testing/ogcore-api/pipeline/head There was a failure building this commit Details
2025-03-13 18:49:13 +01:00
Manuel Aranda Rosales 33b8cba802 Fixed test. Removed Mercure from test env 2025-03-13 17:33:34 +01:00
Manuel Aranda Rosales c3ee618c6e Fixed test. Removed Mercure from test env 2025-03-13 17:33:34 +01:00
Nicolas Arenas 145e50a453 Update changelog for 0.9.2 release 2025-03-13 17:33:34 +01:00
Manuel Aranda Rosales 02646f0c4b Updated changelog 2025-03-13 17:33:34 +01:00
Nicolas Arenas 852d3ccd14 Add mercure service to docker-compose for deploy 2025-03-13 17:33:34 +01:00
Manuel Aranda Rosales 24352cc2c8 Updated and fixed cancel P2p transmission 2025-03-13 17:33:34 +01:00
Nicolas Arenas 9713c83f57 remove old DEBIAN directory
testing/ogcore-api/pipeline/head There was a failure building this commit Details
2025-03-10 15:19:04 +01:00
Nicolas Arenas f778c337fb Added debian packaging
testing/ogcore-api/pipeline/head There was a failure building this commit Details
testing/ogcore-api/pipeline/pr-main This commit looks good Details
2025-03-10 15:16:24 +01:00
499 changed files with 2915 additions and 28996 deletions

View File

@ -20,7 +20,7 @@ JWT_PASSPHRASE=8b9154df37ffa91ef9186ce095324e39e50ff3b023bb1ed34383abd019ba4515
###< lexik/jwt-authentication-bundle ###
###> symfony/mercure-bundle ###
MERCURE_URL=https://localhost:3000/.well-known/mercure
MERCURE_PUBLIC_URL=https://localhost:3000/.well-known/mercure
MERCURE_URL=http://localhost:3000/.well-known/mercure
MERCURE_PUBLIC_URL=http://localhost:3000/.well-known/mercure
MERCURE_JWT_SECRET="!ChangeThisMercureHubJWTSecretKey!"
###< symfony/mercure-bundle ###

6
.gitignore vendored
View File

@ -7,7 +7,6 @@
/public/bundles/
/var/
/vendor/
api/public/bundles/
###< symfony/framework-bundle ###
#phpstorm
@ -32,10 +31,5 @@ debian/ogcore
debian/*.substvars
debian/*.log
debian/.debhelper/
debian/files
### Certificates
certs/
.venv/
.vscode/

View File

@ -1,697 +1,15 @@
# Changelog
## [1.15.2] - 2026-10-26
### Fixed
- **Cancelación Robusta de Trazas (`KillJobService`, `CancelMultipleTracesAction`)**:
- Al cancelar una traza en progreso (`IN_PROGRESS`), la petición HTTP al endpoint del agente (`/opengnsys/KillJob`) se ejecuta de forma segura capturando cualquier excepción (código HTTP 404 por trabajo inexistente o ya finalizado, error de conexión por cliente reiniciando o apagado, etc.).
- La traza se cancela siempre localmente a nivel de base de datos (`CANCELLED`), registrando la fecha de finalización (`finished_at`) y publicando el cambio reactivo a través de Mercure, evitando errores Hydra 400 y bloqueos en la interfaz cuando el agente no responde.
## [1.15.1] - 2026-10-26
### Fixed
- **Asignación de Cliente en Creación de Imagen (`CreateImageAction`)**:
- Corregida la creación de nuevas trazas para que utilicen el cliente actual que ejecuta la orden (`$client`) en lugar del cliente original asociado a la entidad imagen (`$image->getClient()`), evitando la asignación errónea de trazas al crear nuevas versiones de imágenes desde puestos diferentes.
## [1.15.0] - 2026-10-23
### Added
- **Activación y Desactivación de Plugins (`PluginController`)**:
- Incorporado parámetro `?all=true` en `GET /plugins` para permitir listar todos los plugins instalados (tanto activos como inactivos) desde la consola de administración.
- Nuevo endpoint `POST|PATCH /plugins/{name}/toggle` para activar o desactivar plugins de manera dinámica y desacoplada, persistiendo el estado en `og_plugins.enabled`.
## [1.14.2] - 2026-10-22
### Fixed
- **Consistencia de Estado en Trazas de Script (`RunScriptAction`, `CancelMultipleTracesAction`)**:
- `RunScriptAction`: Al actualizar trazas existentes desde la cola pendientes (`updateExistingTrace`), se unifica el estado a `IN_PROGRESS` (en lugar de `SENT`), alineándolo con la ejecución directa y con el estándar de scripts del sistema.
- `CancelMultipleTracesAction`: Revertida la cancelación de trazas en `SENT`, manteniendo la regla estricta que solo permite cancelar trazas en estado `pending` o `in-progress`.
## [1.14.1] - 2026-10-22
### Fixed
- **Resolución y Cancelación de Tareas en Estado Enviado (`StatusController`, `CancelMultipleTracesAction`)**:
- `CancelMultipleTracesAction`: Permite cancelar de forma explícita trazas que se encuentran en estado `sent` (`SENT`), eliminando el bloqueo que impedía cancelar tareas en vuelo o pendientes de respuesta.
- `StatusController`: En el webhook de reinicio y apagado (`REBOOT` / `POWEROFF`), se resuelven automáticamente a éxito tanto las trazas en progreso (`IN_PROGRESS`) como las enviadas (`SENT`), asegurando que los scripts que provocan el reinicio del equipo (como los scripts de congelación/descongelación) cierren su ciclo de ejecución correctamente.
## [1.14.0] - 2026-10-22
### Added
- **Soporte de Sistema Operativo Destino en Cola de Tareas (`target_os` en `PendingTraceExecutionService`, `ExecutePendingTracesCommand`, `RunScriptAction`)**:
- Incorporada la capacidad de asociar restricciones de sistema operativo (`target_os`, ej: `windows`, `linux`, `og-live`) a las trazas encoladas (`PENDING`).
- `PendingTraceExecutionService::executeNextTraceForClient` comprueba ahora si el estado del cliente (`ClientStatus`) coincide con el sistema operativo requerido por la tarea. Si un equipo arranca en un entorno incompatible (como `ogLive` vía PXE cuando la tarea requiere `windows`), la traza no se dispara indebidamente en bash y se mantiene en espera (`PENDING`) hasta que el cliente reporte su inicio en el sistema operativo correspondiente.
- Actualizado `ExecutePendingTracesCommand` para posponer tareas pendientes cuyos requisitos de SO no se cumplan.
- Actualizado `CommandExecuteInput` y `RunScriptAction` para aceptar `targetOs`, encolando la orden si el cliente está offline o si está encendido en un SO distinto al destino solicitado.
## [1.13.0] - 2026-10-22
### Added
- **Infraestructura Modular de Plugins (`Plugin`, `PluginRepository`, `PluginController`, `og_plugins`)**:
- Incorporada la arquitectura base y endpoints agnósticos (`/api/plugins`, `/api/plugins/{name}`, `/api/plugins/{name}/config`) para soportar extensiones y plugins desacoplados (como el próximo plugin de congelación de puestos `ogfreeze`).
- La nueva tabla `og_plugins` almacena de forma dinámica comandos inyectables en la consola de comandos, esquemas de configuración JSON autogenerados y parámetros persistentes de cada plugin.
- Comportamiento 100% neutro e idéntico a 1.12.0 si la tabla de plugins se encuentra vacía.
- Creada migración de base de datos (`Version20261022100000`).
## [1.12.0] - 2026-10-20
### Added
- **Cola y Despacho Asíncrono de Comandos (`AbstractOgAgentController`, `RunScriptAction`, `RebootAction`, `PowerOffAction`, `PartitionAssistantAction`, `RefreshAction`, `DeployImageAction`)**:
- Implementada detección temprana de clientes offline (`isClientOffline`): cuando un equipo está apagado o no disponible, sus acciones o scripts se encolan directamente en estado `PENDING` en la base de datos sin realizar peticiones de red bloqueantes, eliminando los cuelgues del servidor por timeouts prolongados al enviar comandos masivos en aulas.
- Implementado envío HTTP asíncrono y en paralelo (`sendAsyncRequest` / Guzzle Promises) para clientes encendidos en todas las acciones principales de ogAgent, optimizando la concurrencia y reduciendo drásticamente el tiempo de respuesta de la API.
## [1.11.3] - 2026-10-14
### Fixed
- **Menú del navegador (`MenuBrowserController`)**: Corregido un error crítico ("Call to a member function getPublicUrl() on null") al cargar el menú en clientes que no tienen asignado un menú explícito o cuando el cliente no está registrado. Se ha implementado un mecanismo de resolución en cascada que busca primero en la jerarquía de Unidades Organizativas (de hijo a ancestros), luego en el menú por defecto del sistema (`isDefault: true`), y como último recurso en cualquier menú disponible, persistiendo automáticamente la asignación en la base de datos para evitar futuros bloqueos. Además, se añade verificación de existencia de la plantilla Twig con fallback a `browser/main.html.twig`.
## [1.11.2] - 2026-10-06
### Fixed
- **API Platform (Client)**: Corregido un error ("The input data is misformatted") al mover clientes a otras unidades organizativas o aulas desde la interfaz. El endpoint de la API (`/clients/change-organizational-unit`) estaba utilizando incorrectamente la restricción de validación `GreaterThan(1)` sobre la lista de equipos en lugar de `Count(min: 1)`, lo que provocaba un fallo interno en el serializador de Symfony. Ahora se pueden mover equipos correctamente, incluso de uno en uno.
## [1.11.1] - 2026-10-02
### Fixed
- **RemotePC Calendars**: Rediseñada por completo la lógica de evaluación en `RemoteCalendar::isAvailable()`. Se ha solucionado un error grave donde las reglas de calendario (especialmente las negativas) se ignoraban de forma silente al depender del orden y salir prematuramente del bucle con valores positivos. Ahora, las reglas negativas bloquean inmediatamente la disponibilidad, y las positivas exigen cumplimiento estricto, respetando casos de calendarios con solo reglas negativas.
## [1.11.0] - 2026-10-02
### Added
- **RemotePC**: Añadida la propiedad `remotePcRebootOnUnreserve` a la entidad `OrganizationalUnit` para permitir configurar si un equipo remoto debe ser reiniciado en lugar de apagado cuando UDS libera su reserva.
## [1.10.0] - 2026-09-23
### Added
- **Cola de Tareas Reactiva**: Refactorizado el sistema de colas (`ExecutePendingTracesCommand` y `StatusController`) para extraer la lógica a un nuevo servicio (`PendingTraceExecutionService`). Ahora el servidor procesa y asigna las siguientes tareas inmediatamente (push-model) al recibir las confirmaciones webhooks de finalización, eliminando la latencia de 1 minuto que imponía el crontab.
## [1.9.7] - 2026-09-18
### Fixed
- **Subida de Assets (`AssetManagerController`)**: Solucionado el error silencioso (código HTTP 500) y la creación de carpetas vacías al subir archivos ZIP que superaban el límite global de `upload_max_filesize` configurado en PHP. Se ha añadido validación nativa que devuelve un mensaje claro de error en la interfaz. También se ha incluido verificación y control de excepciones al extraer con `ZipArchive`.
- **Previsualización de Menús (`MenuBrowserController`)**: Corregido el problema de los iconos rotos (errores 404) al previsualizar menús HTML en la interfaz. El servidor ahora emplea el `baseUrl` exacto enviado por el cliente para reescribir de manera explícita (mediante expresiones regulares) todas las rutas relativas o absolutas de los `assets`, superando así las limitaciones de resolución de rutas en entornos de proxy inverso (Nginx) y descartando el uso inestable de etiquetas `<base>`.
## [1.9.6] - 2026-09-10
### Fixed
- **OgBoot (`DeleteAction`)**: Solucionado error 404 al borrar plantillas PXE durante una modificación de MAC. El código ahora convierte la MAC a minúsculas para coincidir con el sistema de archivos Linux de ogBoot. Además, ahora extrae el `BootServer` específico del cliente para dirigir la petición de borrado al servidor correcto, y maneja de forma estricta los errores 404 como "borrados exitosos" sin abortar la transacción de la base de datos de ogcore.
## [1.9.5] - 2026-09-03
### Fixed
- **Webhook (`StatusController`)**: Añadido mecanismo de protección para ignorar latidos (heartbeats) si el cliente está en los estados de transición `INITIALIZING` o `TURNING_OFF`. Esto evita el conocido error donde un latido residual marcaba permanentemente al cliente como `BUSY` (Rojo) en el momento del apagado o reinicio.
- **Trazas (`CreateService`)**: Corregido el cierre de trazas para que rellene automáticamente la "Hora de fin" (`finishedAt`) al procesar tareas inmediatas que entran con estado `SUCCESS` o `FAILED`.
## [1.9.4] - 2026-07-31
### Added
- Inventario Hardware: Añadida captura y persistencia del tipo de disco (`diskType` en la entidad `Partition`) y de la velocidad de red (`netSpeed` en la entidad `Client`). Estos campos ahora se exponen a través de la API REST para su visualización en el frontend.
## [1.9.3] - 2026-07-31
### Fixed
- Actualización de imagen (`CreateImageAction`): Resuelto error 500 (`Call to a member function getRepository() on null`) al actualizar una imagen existente desde un cliente distinto al que se usó para crearla originalmente. Ahora se utiliza correctamente el cliente enviado en el payload para determinar el repositorio de destino.
## [1.9.2] - 2026-07-23
### Added
- Mercure (`TraceStatusProgressNotifier`): Publish `output` and `finishedAt` fields in Mercure traces event for real-time log updates without page reload.
### Fixed
- Filtro de imágenes (`ImageSearchRepositoryFilter`): Corregida la propiedad `repositories` a `imageImageRepositories` en el `QueryBuilder` de Doctrine para evitar un error 500 al filtrar imágenes por repositorio.
- Menú del navegador (`main.html.twig`): Modificada la acción por defecto para el arranque de sistemas operativos. Se ha cambiado de `command+output:` a `command:` para evitar que se abra la ventana emergente de salida de comandos, ofreciendo una experiencia de arranque más limpia.
- Webhook (`StatusController` y `RunScriptAction`): Solucionado el problema de condición de carrera que creaba trazas duplicadas al ejecutar scripts. Ahora se establece el estado a `IN_PROGRESS` de forma síncrona en `RunScriptAction` al enviar el script a clientes Windows/Linux, prescindiendo del problemático webhook asíncrono `START_SCRIPT`.
- OgBoot (`PostAction`): El enrutador y la máscara de red ahora se extraen prioritariamente de las propiedades de la Subred (Subnet) asociada al cliente, antes de consultar la configuración de red de la Unidad Organizativa, o usar los valores por defecto (vacío y `255.255.255.0`).
- Repositorios Git (`DeleteAction` y `DeleteRepositoryInput`): Corregido el mapeo del payload de Angular aplicando el grupo de serialización correcto (`repository:write`), permitiendo recibir el nombre del repositorio a borrar. Además, se ha blindado el control de errores para capturar e informar correctamente de cualquier código de error (como 404) devuelto por `ogrepository`.
## [1.9.1] - 2026-07-17
### Added
- Webhook (`StatusController`): Procesa la configuración de discos, particiones y caché en la respuesta del payload de la tarea `EjecutarScript`, guardándola automáticamente en base de datos.
- Perfil de usuario: Añadido campo de preferencia de idioma (`language`).
- Unidades organizativas: Ordenar hijos alfabéticamente por nombre.
### Fixed
- Base de datos (`Trace`): Ampliado el tipo de columna de `output` de string a TEXT para evitar errores HTTP 500 al recibir y almacenar salidas de comandos muy largas de los agentes de sistema operativos (OGAgent).
- Tareas programadas (`Schedule`): Corregido bug en ejecución inmediata de comandos (Execute task right now).
- Despliegue de imágenes: Eliminada restricción que impedía el despliegue en clientes con distintos tamaños de partición.
- Perfiles de software: Corregido bug en la creación del perfil de software y actualizada entidad de imagen asociada.
- Perfiles de hardware: Ajustes en los settings de red y propagación de perfiles.
- Scripts: Aumentado el tamaño del campo de texto en base de datos para almacenar scripts más largos.
- Roles: Actualización menor de permisos.
## [1.9.0] - 2026-06-16
### Added
- Sistema de permisos por rol para los cuatro perfiles de usuario:
`ROLE_SUPER_ADMIN`, `ROLE_ORGANIZATIONAL_UNIT_ADMIN`,
`ROLE_ORGANIZATIONAL_UNIT_OPERATOR` y `ROLE_ORGANIZATIONAL_UNIT_MINIMAL`.
Solo super-admin y administrador de aulas pueden crear clientes y unidades
organizativas. La escritura en infraestructura (DHCP, Boot servers,
repositorios, comandos, subredes) queda restringida a super-admin.
- El administrador de aulas solo puede borrar las unidades organizativas que
él mismo creó (verificado via campo `createdBy` de Gedmo Blameable).
- Suite de tests funcionales (`PermissionsTest`) con 25 casos que cubren la
matriz completa de permisos por rol.
- ogLive (`ROLE_OGCLIENT_API`) puede consultar clientes por GET para obtener
su configuración al arrancar.
### Fixed
- Los clientes sin plantilla de arranque (`PxeTemplate`) asignada ahora pueden
borrarse correctamente. Antes el processor intentaba eliminar el fichero PXE
en ogBoot aunque nunca se hubiera creado, provocando un error 404 que abortaba
el borrado.
- Borrado en cascada de `HardwareProfile` al eliminar un cliente: los perfiles
de hardware asociados quedaban como registros huérfanos. Corregido con
`cascade: remove` y migración `Version20260615092704`.
- Las reglas `access_control` del firewall de Symfony usaban el prefijo `/api/`
que nginx elimina antes de reenviar las peticiones a ogcore. Corregido a las
rutas reales (`/clients`, `/organizational-units`).
- La operación DELETE de unidades organizativas devolvía 404 a todos los usuarios
al tener configurado un provider personalizado que no implementaba el caso
`Delete`. Corregido usando el proveedor Doctrine por defecto.
- `DeleteAction` de ficheros PXE usaba la variable `$content` (no definida) en
lugar de `$response` para comprobar errores de ogBoot.
- Normalización de timezone a UTC en los campos `executionTime`, `executionDate`,
`lastExecution` y `nextExecution` de los DTOs de `CommandTask` y
`CommandTaskSchedule`.
### Improved
- Timeout de 5 segundos en el sondeo del estado de cada equipo al consultar un
aula completa, evitando bloqueos cuando algún cliente no responde.
## [1.8.3] - 2026-05-22
### Improved
- Modificada accion WolAction, calcula la ip de broadcast para el comando wakeonlan, para ello, detecta la mascara de red usando la subred configurada en el dhcp, si no se usa ogdhcp, busca la máscara de red en la configuración de la OU, en caso de tampoco encontrala, usa la ip de broadcast por defecto del comando wakeonlan
## [1.8.2] - 2026-05-18
### Improved
- Modificada accion RemoveCacheImage para montar la cache y luego eliminar la imagen deseada
## [1.8.1] - 2026-05-18
### Fixed
- Corregido fallo setRemotePc en la entidad Imagen al sincronizar un repositorio
## [1.8.0] - 2026-05-18
### Added
- Infraestructura journal-pull: servicio plantilla `journal-pull@.service` para
extraer journals de componentes por IP vía `systemd-journal-gatewayd`, con
filtros para ogcore, ogdhcp, ogboot, ogrepo, kea, tftpd-hpa y samba
- `JournalPullService` y `JournalPullSubscriber`: habilitación y deshabilitación
automática de `journal-pull@<IP>` al registrar o eliminar un BootServer,
DhcpServer o ImageRepository desde el GUI; protección contra borrado de IP
compartida entre varios componentes en la misma máquina
- `DiskLogsAction`: soporte de múltiples `SYSLOG_IDENTIFIER` separados por coma
o en array, salida estructurada en JSON y lectura desde fichero de journal
remoto (`/var/log/journal/remote/<IP>.journal`) cuando se indica el parámetro host
- La retención de los journals remotos se delega en `systemd-journald` de cada
componente (configurado por oginstaller: 500MB máx, 10 días); los ficheros
pulled en ogcore quedan acotados sin necesidad de logrotate local
### Fixed
- `journal-pull@.service`: `Restart=always` para reconectar tras salida limpia
(sin entradas); `ExecStartPre` elimina el fichero solo si está vacío para
evitar cursor inválido tras fallos previos; `--split-mode=none` requerido
para escritura a fichero único por IP
- `JournalPullSubscriber`: al cambiar la IP de un servidor se verifica que
ninguna otra entidad usa la IP anterior antes de eliminarla del fichero de
configuración
- postinst: añadido `--no-interaction` al comando de generación de claves JWT
para evitar bloqueo en instalación desatendida
- postinst: permisos `775` en `api/var/` para evitar errores de caché de Doctrine
- postinst: permisos de acceso al journal para el usuario `opengnsys`
(`systemd-journal` y `systemd-journal-remote`)
- postinst (upgrade): añadidos symlinks faltantes en actualizaciones —
`mercure.conf` en nginx, unidades `journal-pull@`, `journal-pull-sync`;
`chmod +x` en `journal-pull-sync.sh`; propietario y permisos de
`journal-pull-sources.conf`; cambiado `ln -s` por `ln -sf` en las
unidades journal-pull para evitar fallo cuando el fichero existe como
fichero regular en lugar de symlink
- `systemd-journal-remote` y `logrotate` añadidos como dependencias del paquete
## [1.7.12] - 2026-05-14
### Fixed
- Corregida migracion de perfiles hardware y software, los tipos de software y hardware no se guardaban en base de datos antes de tener que ser usados por los perfiles.
## [1.7.11] - 2026-05-14
### Fixed
- Corregido error "Call to undefined method App\Entity\Image::setRemotePc()" al importar una imagen desde un repositorio. La propiedad `remotePc` fue eliminada de la entidad `Image` en la versión 1.7.0 pero la llamada a `setRemotePc()` no fue eliminada del controlador `ImportAction`.
## [1.7.10] - 2026-05-13
### Improved
- Modificado setClientBootMode para crear una traza en caso de ejecución en modo temporal, el id de dicha traza se le pasa al comando opengnsys:pxe:sync para que pueda sincronizar el fichero PXE del cliente y finalizar la traza indicando si se ha realizado correctamente o no
- Modificado comando opengnsys:pxe:sync para que pueda ser llamado desde la api con un trace id y se pueda hacer un seguimiento del mismo, con lo que se ha tenido que añadir el servicio de trazas.
## [1.7.9] - 2026-05-12
### Added
- Añadida nueva ruta para cambiar la plantilla de un cliente /clients/set-boot-mode, recibe el nombre de la plantilla, el modo 0=temporal, 1=permanente y puede enviarse mac, ip o nombre del cliente o nombre del aula.
### Fixed
- Modificado script de importación de base de datos OG 1.1 para añadir las tablas grupos y gruposordenadores como obligatorias junto con centros y aulas.
## [1.7.8] - 2026-05-11
### Fixed
- En la importación de clientes, se inicializan con estado "off"
## [1.7.7] - 2026-05-08
### Added
- Mejorado comando ImportLegacy y creada ruta api para invocarlo desde la consola web, controla errores e informa de cambios a través de mercure
## [1.7.6] - 2026-05-08
### Added
- Añadido comando ImportLegacy para importar una base de datos de OG 1.1 a OG 3.0, hace llamadas al resto de comandos Migrate ya creados. Acepta un fichero dump.sql o los parametros de conexión a la base de datos OG 1.1
## [1.7.5] - 2026-05-06
### Fixed
- Corregida la ejecución de tareas programadas y la gestión de zona horaria UTC
- Corregido el scope de OU en tareas programadas
- Corregido error tipográfico en logs de disco
## [1.7.4] - 2026-05-05
### Added
- Nuevo endpoint para consultar logs de disco
### Fixed
- Eliminado el estado 'disconnected' del endpoint de estado de equipos
## [1.7.3] - 2026-05-05
### Fixed
- Modificada funcion para borrar imagen de cache, no se hace usando la partición que contenga un deploy de imagen, se borra el fichero real de la cache
## [1.7.2] - 2026-05-04
### Fixed
- Corregida llamada a instalar/desinstalar oglives en servidores ogboot
## [1.7.1] - 2026-05-04
### Fixed
- Corregido bug en la propagación de parametros de las OU, se propagaban parametros de hijos a padres.
- Corregido también bug en la propagación de la interfaz de red a los clientes de una OU
## [1.7.0] - 2026-04-28
### Added
- Añadido endpoint para consultar y mostrar versiones de los distintos paquetes de Opengnsys
- Sondeo del estado de las aulas
- Nuevo campo size y datasize en Imagenes del repositorio
- Nueva funcionalidad mejorada para la propagacion entre propiedades heredables entre aulas y pcs.
### Improved
- Se ha recuperado y adaptado funcionalidad de remotePc
### Fixed
- Se han corregido varios bugs relacionados con la cola de acciones. Algunos casos de uso que hacia que no saltaran los triggers.
- Se han corregido y eliminado algunas restricciones y relaciones erraticas entre modelos de bbdd.
---
## [1.6.1] - 2026-04-24
### Added
- Añadida propiedad Resolución de los menús a una Unidad Organizativa para poder propagarla a los equipos de dicha OU.
## [1.6.0] - 2026-04-21
### Added
- Creada nueva estructura jerárquica para administrar varios OgBoot servers, las clases PxeTemplate y OgLive ahora tiene una clase padre BootServer, de manera que tenemos una relación 1-N entre BootServer y dichas clases (un Boot Server puede tener varias Plantillas PXE y varios OgLives)
## [1.5.0] - 2026-04-16
### Added
- Creada nueva estructura jerárquica para administrar varios DHCPs, la clase Subnet ahora tiene una clase padre DhcpServer, de manera que tenemos una relación 1-N entre DhcpServer y Subnet (un servidor Dhcp puede tener varias Subnets)
## [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.
- CreatePartitionService: Inclusión de lógica idempotente que asocia la imagen y extrae su fecha real directamente del fichero /.ogimage enviado por el cliente en el parámetro img=.
### Fixed
- Limpieza explícita del deployDate (null) en caso de que el inventario no informe de fecha o haya alteraciones en el payload para evitar desincronizaciones de trazas de la imagen subyacente.
## [1.3.0] - 2026-03-31
### Added
- Añadida acción Refresh para actualizar el estado de un cliente o clientes. Se actualiza su configuración de discos y se recarga el ogBrowser por si hubiese cambio del menu.
## [1.2.11] - 2026-03-25
### Added
Modificada columna cacheContent de una partición para que sea de tipo TEXT y contener la lista de ficheros que tiene la cache. Se envía desde el ogagent al obtener la configuración mediante el campo [cac]
## [1.2.10] - 2026-03-25
### Added
Modificado StatusController para que al recibir un webhook de Poweroff o reboot actualice el estado de las trazas en progreso y las ponga como finalizadas.
## [1.2.9] - 2026-03-25
### Added
- Nuevo webhook `START_SCRIPT` en StatusController que permite crear automáticamente una entidad Trace y poner el equipo local en estado `BUSY` cuando un cliente inicia sus propios scripts de forma autónoma (ej: menús locales de ogLive).
### Fixed
- Se ha corregido un bug en RunScriptAction que provocaba que al enviar la orden de ejecutar un script desde la web de administración, la interfaz no cambiara visualmente el estado del cliente a ocupado (rojo), unificando así el comportamiento con el resto de comandos (como crear o restaurar imagen).
### Improved
- En StatusController ahora se restablece automáticamente el estado del cliente a `OG_LIVE` cuando se recibe el webhook de finalización `RESPUESTA_EjecutarScript`, reflejando visualmente que el equipo ha terminado de trabajar.
## [1.2.8] - 2026-03-20
### Added
- Modificado MenuBrowserController para permitir la edición de las plantillas de menú en "raw", permitiendo modificar el código twig en lugar del html ya compilado por twig, de esta forma podemos editar el fichero twig y aplicar cambios para ver el resultado antes de guardar la plantilla.
## [1.2.7] - 2026-03-17
### Fixed
- Se ha corregido la lectura de la variable `OGCLIENT_API_KEY` desde `env.json` para inyectarla correctamente en la plantilla PXE generada por `ogBoot`.
## [1.2.6] - 2026-03-17
### Added
- Se ha añadido AssetsManagerController para la gestion de assets.
## [1.2.5] - 2026-03-16
### Fixed
- Se ha modificado el fichero security.yml para que el acceso a la api lo tenga el ROLE_USER en lugar de IS_AUTHENTICATED_FULLY, ya que de lo contrario cualquier cliente con rol ROLE_OGCLIENT_API podia acceder a la api, de esta forma se asegura que solo los usuarios con rol ROLE_USER puedan acceder a la api y el cliente solo pueda acceder a la ruta commands.
## [1.2.4] - 2026-03-16
### Added
- Se ha implementado un nuevo [ApiKeyAuthenticator] para dotar de acceso seguro al endpoint `/commands` mediante la cabecera `X-API-KEY`.
- Incorporación de la variable global de entorno `OGCLIENT_API_KEY` en env.json para gestionar el token de acceso de clientes desde la interfaz gráfica.
### Changed
- Se ha modificado el controlador PostAction de `PxeBootFile` para inyectar y propagar la clave `ogclient_api_key` al payload que se envía a `ogBoot` durante la creación del arranque.
## [1.2.3] - 2026-03-11
### Added
- Se ha añadido una nueva funcionalidad en el DTO `MenuInput` (campo `menuHtmlContent`) para recibir la plantilla HTML íntegra del menú codificada en Base64.
### Improved
- Se ha refactorizado y asegurado la lógica de creación de menús dentro de `MenuProcessor`, para decodificar estrictamente el payload en Base64 y sobreescribir físicamente la plantilla `.twig` descartando la plantilla por defecto.
## [1.2.2] - 2026-02-27
### Improved
- Nuevo menú por defecto en el cliente, organizando la información por discos
---
## [1.2.1] - 2025-10-22
### Fixed
- Se ha corregido un error en el commando que se encarga de ejecutar tareas pendientes.
---
## [1.2.0] - 2025-10-21
### Added
- Nueva funcionalidad para poder eliminar equipos a la vez. Nuevo endpoint desde "Client".
### Improved
- Nuevo campo "mac" en el ogbrowser
# Fixed
- Se ha añadido el campo "DNS" a la hora de modificar una subred.
---
## [1.1.0] - 2025-10-16
### Added
- Se ha añadido un nuevo campo en el cliente, para guardar la resolucion del menu browser.
- Se ha añadido un validador en el asistente "deploy", el cual comprueba que el tamaño de la partition destino de todos los clientes sea igual.
### Fixed
- Se ha corregido un bug a la hora de mover clientes cuando el aula destino no tiene plantilla PXE asignada.
---
## [1.0.0] - 2025-10-09
### Added
- Se ha añadido nuevo readme
---
## [0.26.0] - 2025-10-09
### Added
- Se han añadido nueva documentacion en swagger para facilitar la integracion de ogCore
- Se ha añadido y completado el README y la documentacion funcional
---
## [0.25.1] - 2025-10-01
### Fixed
- Se han corregido varios errores con respecto a las tareas programadas.
---
## [0.25.0] - 2025-09-23
### Added
- Se ha añadido logica para obtener el inventario hardware de un cliente para poder almanecarlo en base de datos.
---
## [0.24.4] - 2025-09-21
### Fixed
- Se ha arreglado un error en el servicio de clonado de imagen cuando los equipos no estan conectados.
---
## [0.24.3] - 2025-09-16
### Fixed
- Se ha corregido un error a la hora de borrar un repositorio el cual tuviera imagenes.
---
## [0.24.2] - 2025-09-10
### Improved
- Se han realizado mejoras varias sobre la funcionalidad de tareas programadas.
---
## [0.24.1] - 2025-09-09
### Fixed
- Se ha corregido un error en la funcionalidad de Tareas programadas
---
## [0.24.0] - 2025-09-09
### Added
- Se ha añadido la funcionalidad/servicio para poder eliminar un repositorio GIT
---
## [0.23.0] - 2025-09-08
### Added
- Se ha añadido la funcionalidad/servicio para poder realizar backups a repositorios GIT
---
## [0.22.4] - 2025-09-05
### Fixed
- Se ha corregido un typo en los ficheros de la carpeta "State/Processor"
---
## [0.22.3] - 2025-09-04
### Fixed
- Se han corregido bugs en el deploy, relacionado con las tareas programadas.
### Improved
- Se han cambiado los parametros de las funciones ogGit.
---
## [0.22.2] - 2025-09-03
### Fixed
- Se ha corregido un error con el particionador, en las tareas programadas.
---
## [0.22.1] - 2025-09-03
### Fixed
- Se ha corregido un typo.
### Improved
- Se ha añadido nueva configuracion a Jenkinsfile para la ejecucion de los test automaticos.
---
## [0.22.0] - 2025-09-03
### Added
- Se han mejorado el control de errores respecto a ogRepository
- Se ha añadido una validacion para impedir el deploy de imagenes que no esten en "success".
---
## [0.21.0] - 2025-08-28
### Added
- Se ha incluido una integracion con el agente, para generar los scripts que se llaman al particionar. Nuevo servicio.
---
## [0.20.0] - 2025-08-25
### Added
- Se ha incorporado un servicio para marcar las trazas como completadas.
- Se ha añadido una nueva logica que recoge los "409" del ogAgent para indicar que el cliente esta ocupado.
### Improved
- Se han añadido nuevas funciones para la gestion de colas/tareas programadas.
- Nueva restriccion a la hora de crear repositorios. Ahora hay una unicidad en el nombre y en la IP.
### Fixed
- Se ha corregido un bug en ogRepository que hacia crear instancias en base de datos cuando no deberia.
---
## [0.19.0] - 2025-08-06
### Added
- Se ha añadido un nuevo estado "enviado" para cuando se ejecuten acciones a equipos en estado Windows o Linux
---
## [0.18.1] - 2025-08-06
### Improved
- Se ha añadido el filtro "jobId" a la entidad Trace.
---
## [0.18.0] -2025-08-06
### Added
- Se ha añadido una inetragracin con el agente, que hace que podamos comprobar el tamaño de las particiones, y si son correctas.
### Improved
- Se ha actualizado la funcionalidad para actualizar imagenes de ogGIt
- Se ha mejorado y actualizado la funcionalidad de creacion de tareas, actualizando el script que se ejecuta cada minuto.
- Se ha eliminado el ".py" del menu browser.
- Mejora en el formato de las fechas (datetime) en la ejecucion de algunos scripts.
---
## [0.17.2] - 2025-08-04
### Improved
- Se ha cambiado la respuesta de algunos endpoints que llaman al ogAgent. Ahora devuelve el job_id asociado a la traza.
---
## [0.17.1] - 2025-07-29
### Fixed
- Se ha corregido un bug que aparecia al borrar un cliente. Este error hacia que se borrara el cliente de la base de datos, pero no del DHCP ( en caso de que perteneciera a uno) y el fichero de arranque.
---
## [0.17.0] - 2025-07-20
### Added
- Se ha añadido la funcionalidad para modificar imagenes de ogGit.
---
## [0.16.0] - 2025-06-27
### Added
- Se ha cambiado el html del menu para ser compatible con HTML5.
---
## [0.15.0] - 2025-06-26
### Added
- Se ha añadido la integracion con ogGit para la gestion de imagenes.
- Se ha añadido la primera parte del sistema de cola de acciones.
- Integracion con el endpoint del agente KillJob
- Posibilidad de poder vaciar la cola de acciones.
### Fixed
- Se ha corregido un bug que hacia que al mover clientes entre aulas, diera error en caso de que el cliente no tuviera PXE asignado.
---
## [0.14.2] - 2025-06-09
### Improved
- Cambio en el template base del menu. Ahora apunta a los script de python de manera correcta.
---
## [0.14.1] - 2025-06-09
### Fixed
- Se han corregido los mensajes de error que se envian cuando las APIs de los modulos no estan disponibles.
- Se ha corregido un bug en la herencia de datos entre aulas y grupos, que hacia que no se almacenaran los datos de manera correcta.
---
## [0.14.0] - 2025-06-02
### Added
- Se ha añadido la funcionalidad de mover equipos entre aulas y grupos.
- Se ha añadido la funcionalidad para eliminar imagen cache.
- Se ha añadido la funcionalidad para iniciar sesion.
### Improved
- Se ha cambiado la restriccion que comprobaba los puertos de MULTICAST.
- Se ha modificado el tiempo en el script, que se encarga de comprobar el estado de los equipos. Ahora es de 1 min en lugar de 3.
### Fixed
- Se ha corregido un bug que hacia que al modificar un cliente o eliminarlo, no se actualizaba su estado en la subred.
- Se ha corregido un bug que hacia que al modificar un cliente, no se actualizara su fichero de arranque.
---
## [0.13.1] - 2025-05-23
### Fixed
- Variable de entorno "SSl_ENABLED" desactivada por defecto.
---
## [0.13.0] - 2025-05-20
### Added
- Se ha creado la base para la comunicacion TLS con el agente.
### Improved
- Refactorizacion de la API para la gestion de llamadas al agente
### Fixed
- Se ha corregido un bug que hacia que no se eliminara la imagen al particionar.
---
## [0.12.1] - 2025-05-14
### Improved
- Se ha eliminado la restriccion en el formulario de crear/editar repositorio, que hacia que la comprobara el formato de IP. Ahora tambien puede ser DNS.
- Mejora en el script de ejecutar tareas.
- Ahora al editar la mac de un cliente, se borra el fichero de arranque antiguo.
- Se ha añadido una restriccion en plantillas para que tan solo haya 1 por defecto
---
## [0.12.0] - 2025-05-13
### Added
- Se ha añadido nueva API para poder gestionar las tareas y acciones programadas.
- Se ha añadido un nuevo campo en plantillas (defecto) el cual nos permite tener una plantilla por defecto en caso de que se elimine una.
- Se ha comenzado la integracion con ogGit.
### Improved
- Mejorado el comportamiento de la API al crear una imagen. Ahora se guardan datos del pc de origen.
### Fixed
- Se ha corregido el bug en la creacion de clientes masivos donde no se le asignaba la plantilla PXE.
- Se ha corregido un bug en el DTO de clientes, que hacia que PHP diera un timeout por bucle infinito.
---
## [0.11.2] - 2025-04-23
### Fixed
- Se ha cambiado la forma en guardar la fecha al recibir "ping" de los clientes.
---
## [0.11.1] - 2025-04-16
### Fixed
- Se ha corregido un error al crear imagen versionada. Si la particion de origen era diferente, no dejaba crear.
- Error en la transmision de imagenes. No se actualizaba con la imagen versionada, si no con la canonica.
---
## [0.11.0] - 2025-04-11
### Added
- Se ha añadido funcionalidad para renombrar imagenes en ogRepository. Nuevo sistema de versionado.
- Se ha añadido la integracion con el ogAgent para poder ejecutar scripts.
- Se ha añadido el poder añadir descripcion a una imagen.
- Se han añadido 2 nuevos campos en la gestion de los repositorios: usuario y puerto ssh.
- Se ha añadido funcionalidad para poder gestionar el estado de un equipo de manera automatica. En caso de no haber conexion con el cliente, la web sera notificada en un tiempo maximo de 5 min.
### Improved
- Se han modificado los logs para que puedan "salir" por syslog ademas de por fichero.
### Fixed
- Se ha corregido el bug que hacia que cuando habia demasiados clientes, no se mostraran en pantalla debido a un error de memoria.
---
## [0.10.1] - 2025-03-25
### Improved
- Se ha modificado el script de creación de usuarios, añadiendole la opcion del tipo de visionalizacion por defecto de la vista "grupos".
## [0.10.0] - 2025-03-25
### Added
- Nuevo endpoint ogRepository. Convertir imagen en imagen virtual.
- Nuevo endpoint ogRepository. Importar imágenes externas al sistema.
- Nuevo método para desplegar imagenes sin cache.
---
## [0.9.5] - 2025-03-19
### Added
- Jenkinsfile updated to publish in repo
---
## [0.9.4] - 2025-03-17
### Fixed
- Mercure service behind nginx server for containers, expose port in docker compose for nginx
---
## [0.9.3] - 2025-03-17
### Fixed
- Mercure service behind nginx server for containers
---
## [0.9.2] - 2025-03-12
### Fixed
- Added mercure service in docker compose file for deployments.
---
## [0.9.1] - 2025-03-12
### Fixed
### 🐛 Fixed
- Corrección en la cancelacion de transmisiones p2p.
---
## [0.9.0] - 2025-03-04
### Added
### 🔹 Added
- Nueva funcionalidad para tener notificaciones en tiempo real. Instalación de bundle "Mercure".
- Creacion de EventListener en Symfony, para publicar mensajes en Mercure, cuando se realicen cambios en la base de datos ( cambio de estado en lo equipos, y trazas).
- Nuevo endpoint "backup image". Integracion con ogRepository.
@ -701,24 +19,24 @@ Modificado StatusController para que al recibir un webhook de Poweroff o reboot
- Nueva funcionalidad para cancelar despliegues de imagenes.
- Añadido nuevo campo "cancelado" en trazas.
### Changed
### ⚡ Changed
- Cambios en logs. Cambios en salida (stderror -> file.log)
- Modulo DHCP. Añadir equipos, ahora se gestiona con una unica llamada a la API.
- Acciones masivas en equipos. Se ha cambiado la respuesta para que no fallen las peticiones si uno o mas equipos no da respuesta.
---
## [0.8.1] - 2025-02-25
### Fixed
### 🐛 Fixed
- Corrección de bug en el deploy de imágenes
---
## [0.8.0] - 2025-01-10
### Added
### 🔹 Added
- Nuevos campos en "aulas" para la jerarquia en clientes.
- Nueva funcionalidad "imagen global". Integracion con ogRepository.
### Changed
### ⚡ Changed
- Limpieza en campos "name" y "date" de ogLive. Es necesario parsear el campo "filename" para facilitar el uso al usuario en la web.
### 🐛 Fixed
- Corrección de bug que impedia borrar un cliente si tenia una traza enlazada.
@ -726,7 +44,7 @@ Modificado StatusController para que al recibir un webhook de Poweroff o reboot
## [0.7.3] - 2025-01-03
### Added
### 🔹 Added
- Adaptados cambios en los endpoints para multiseleccion de clientes.
- Se agregó la funcionalidad de importar/exportar. Integración con ogRepository.
- Se agregó la funcionalidad de borrar imágenes. Integración con ogRepository.
@ -741,5 +59,4 @@ Modificado StatusController para que al recibir un webhook de Poweroff o reboot
- **Added**: Secciones con nuevas características.
- **Fixed**: Corrección de errores y bugs.
- **Changed**: Modificaciones o mejoras en funcionalidades existentes.
- **Improved**: Mejoras en funcionalidades existentes.
- **Removed**: Funcionalidades o dependencias eliminadas.

View File

@ -1,153 +1,28 @@
@Library('jenkins-shared-library') _
pipeline {
agent {
label 'jenkins-slave'
}
environment {
DEBIAN_FRONTEND = 'noninteractive'
DEFAULT_DEV_NAME = 'Opengnsys Team'
DEFAULT_DEV_EMAIL = 'opengnsys@qindel.com'
}
options {
skipDefaultCheckout()
}
parameters {
string(name: 'DEV_NAME', defaultValue: '', description: 'Nombre del desarrollador')
string(name: 'DEV_EMAIL', defaultValue: '', description: 'Email del desarrollador')
BUILD_DIR = "${WORKSPACE}/source"
}
stages {
stage('Prepare Workspace') {
steps {
script {
env.BUILD_DIR = "${WORKSPACE}/ogcore"
sh "mkdir -p ${env.BUILD_DIR}"
}
}
}
stage('Checkout') {
steps {
dir("${env.BUILD_DIR}") {
checkout scm
}
}
}
stage('Generate Changelog') {
when {
expression {
return env.TAG_NAME != null
}
}
steps {
script {
def devName = params.DEV_NAME ? params.DEV_NAME : env.DEFAULT_DEV_NAME
def devEmail = params.DEV_EMAIL ? params.DEV_EMAIL : env.DEFAULT_DEV_EMAIL
generateDebianChangelog(env.BUILD_DIR, devName, devEmail)
sh "mkdir -p ${BUILD_DIR}" // Creamos el directorio
dir("${BUILD_DIR}") {
checkout scm // Hacemos el checkout en el subdirectorio
}
}
}
}
stage('Generate Changelog (Nightly)'){
when {
branch 'main'
}
steps {
script {
def devName = params.DEV_NAME ? params.DEV_NAME : env.DEFAULT_DEV_NAME
def devEmail = params.DEV_EMAIL ? params.DEV_EMAIL : env.DEFAULT_DEV_EMAIL
generateDebianChangelog(env.BUILD_DIR, devName, devEmail,"nightly")
}
}
}
stage('Generate Changelog (Devel)') {
when {
branch 'devel'
}
steps {
script {
def devName = params.DEV_NAME ? params.DEV_NAME : env.DEFAULT_DEV_NAME
def devEmail = params.DEV_EMAIL ? params.DEV_EMAIL : env.DEFAULT_DEV_EMAIL
generateDebianChangelog(env.BUILD_DIR, devName, devEmail, "devel")
}
}
}
stage('Build') {
steps {
script {
construirPaquete(env.BUILD_DIR, "../artifacts", "172.17.8.68", "/var/tmp/opengnsys/debian-repo/ogcore")
dir ("${BUILD_DIR}") {
sh 'dpkg-buildpackage -us -uc'
}
}
}
stage ('Publish to Debian Repository') {
when {
expression {
return env.TAG_NAME != null
}
}
agent { label 'debian-repo' }
steps {
script {
// Construir el patrón de versión esperado en el nombre del paquete
def versionPattern = "${env.TAG_NAME}-${env.BUILD_NUMBER}"
publicarEnAptly('/var/tmp/opengnsys/debian-repo/ogcore', 'opengnsys-devel', versionPattern)
}
}
}
stage ('Publish to Debian Repository (Nightly)') {
when {
branch 'main'
}
agent { label 'debian-repo' }
steps {
script {
// Construir el patrón de versión esperado en el nombre del paquete
def versionPattern = "-${env.BUILD_NUMBER}~nightly"
publicarEnAptly('/var/tmp/opengnsys/debian-repo/ogcore', 'nightly', versionPattern)
}
}
}
stage ('Publish to Debian Repository (Devel)') {
when {
branch 'devel'
}
agent { label 'debian-repo' }
steps {
script {
def versionPattern = "-${env.BUILD_NUMBER}~devel"
publicarEnAptly('/var/tmp/opengnsys/debian-repo/ogcore', 'devel', versionPattern)
}
}
}
}
post {
success {
script {
// Solo lanzar cuando el build sea exitoso y en la rama main
if (env.BRANCH_NAME == 'main') {
build job: 'Aptly publish nightly repository',
wait: false,
parameters: [
string(name: 'TRIGGERED_BY', value: "${env.JOB_NAME}-${env.BUILD_NUMBER}")
]
}
if (env.BRANCH_NAME == 'devel') {
build job: 'Aptly publish develop repository',
wait: false,
parameters: [
string(name: 'TRIGGERED_BY', value: "${env.JOB_NAME}-${env.BUILD_NUMBER}")
]
}
}
}
always {
notifyBuildStatus('opengnsys@qindel.com')
}
}
}

2548
README.md

File diff suppressed because it is too large Load Diff

View File

@ -54,8 +54,7 @@
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/",
"Functional\\": "tests/Functional/"
"App\\Tests\\": "tests/"
}
},
"replace": {

View File

@ -1,94 +0,0 @@
resources:
App\Entity\BootServer:
processor: App\State\Processor\BootServerProcessor
input: App\Dto\Input\BootServerInput
output: App\Dto\Output\BootServerOutput
normalizationContext:
groups: ['default', 'boot-server:read']
denormalizationContext:
groups: ['boot-server:write']
operations:
ApiPlatform\Metadata\GetCollection:
provider: App\State\Provider\BootServerProvider
ApiPlatform\Metadata\Get:
provider: App\State\Provider\BootServerProvider
ApiPlatform\Metadata\Put:
security: 'is_granted("ROLE_SUPER_ADMIN")'
provider: App\State\Provider\BootServerProvider
ApiPlatform\Metadata\Patch:
security: 'is_granted("ROLE_SUPER_ADMIN")'
provider: App\State\Provider\BootServerProvider
ApiPlatform\Metadata\Post:
security: 'is_granted("ROLE_SUPER_ADMIN")'
ApiPlatform\Metadata\Delete:
security: 'is_granted("ROLE_SUPER_ADMIN")'
oglives_sync:
shortName: BootServer
class: ApiPlatform\Metadata\Post
method: POST
input: false
security: 'is_granted("ROLE_SUPER_ADMIN")'
uriTemplate: /boot-servers/{uuid}/oglives/sync
controller: App\Controller\OgBoot\OgLive\SyncAction
pxe_templates_sync:
shortName: BootServer
class: ApiPlatform\Metadata\Post
method: POST
input: false
security: 'is_granted("ROLE_SUPER_ADMIN")'
uriTemplate: /boot-servers/{uuid}/pxe-templates/sync
controller: App\Controller\OgBoot\PxeTemplate\SyncAction
get_collection_oglives:
shortName: BootServer
description: Get collection of OgLives from external boot server
class: ApiPlatform\Metadata\Get
method: GET
input: false
uriTemplate: /boot-servers/{uuid}/oglives/get-collection
controller: App\Controller\OgBoot\OgLive\GetCollectionAction
get_isos:
shortName: BootServer
description: Get Isos of OgLive from external boot server
class: ApiPlatform\Metadata\Get
method: GET
input: false
uriTemplate: /boot-servers/{uuid}/oglives/get-isos
controller: App\Controller\OgBoot\OgLive\GetIsosAction
get_default_oglive:
shortName: BootServer
description: Get default OgLive attached to BootServer
class: ApiPlatform\Metadata\Get
method: GET
input: false
uriTemplate: /boot-servers/{uuid}/oglives/get-default
controller: App\Controller\OgBoot\OgLive\GetDefaultAction
get_collection_templates:
shortName: BootServer
description: Get collection of PxeTemplate from external boot server
class: ApiPlatform\Metadata\Get
method: GET
input: false
uriTemplate: /boot-servers/{uuid}/pxe-templates/get-collection
controller: App\Controller\OgBoot\PxeTemplate\GetCollectionAction
boot_server_status:
shortName: BootServer
description: Get status of OgBoot server
class: ApiPlatform\Metadata\Get
method: GET
input: false
uriTemplate: /boot-servers/server/{uuid}/status
controller: App\Controller\OgBoot\StatusAction
properties:
App\Entity\BootServer:
id:
identifier: false
uuid:
identifier: true

View File

@ -24,27 +24,18 @@ resources:
provider: App\State\Provider\ClientProvider
validationContext:
groups: [ 'client:patch' ]
ApiPlatform\Metadata\Post:
security: 'is_granted("ROLE_SUPER_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_OPERATOR")'
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Delete: ~
delete_multiple_clients:
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\DeleteMultipleClientsInput
output: false
uriTemplate: /clients/delete-multiple
controller: App\Controller\DeleteMultipleClientsAction
change_organizational_units:
provider: App\State\Provider\ClientProvider
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\ChangeOrganizationalUnitInput
uriTemplate: /clients/change-organizational-unit
uriTemplate: /clients/change-organizational-units
controller: App\Controller\ChangeOrganizationalUnitAction
client_agent_status:
agent_status:
class: ApiPlatform\Metadata\Post
method: POST
input: false
@ -59,34 +50,6 @@ resources:
uriTemplate: /clients/server/{uuid}/get-pxe
controller: App\Controller\OgBoot\PxeBootFile\GetAction
boot_client:
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\BootClientsInput
uriTemplate: /clients/server/boot-client
controller: App\Controller\OgAgent\LoginAction
remove_cache_image:
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\RemoveCacheImageInput
uriTemplate: /clients/server/remove-cache-image
controller: App\Controller\OgAgent\RemoveCacheImageAction
hardware_inventory:
class: ApiPlatform\Metadata\Post
method: POST
input: false
uriTemplate: /clients/server/{uuid}/hardware-inventory
controller: App\Controller\OgAgent\HardwareInventoryAction
software_inventory:
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\SoftwareInventoryPartitionInput
uriTemplate: /clients/server/{uuid}/software-inventory
controller: App\Controller\OgAgent\SoftwareInventoryAction
reboot_client:
class: ApiPlatform\Metadata\Post
method: POST
@ -101,42 +64,6 @@ resources:
uriTemplate: /clients/server/power-off
controller: App\Controller\OgAgent\PowerOffAction
refresh_client:
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\MultipleClientsInput
uriTemplate: /clients/server/refresh
controller: App\Controller\OgAgent\RefreshAction
check_partition_sizes:
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\CheckPartitionSizesInput
uriTemplate: /clients/{uuid}/check-partition-sizes
controller: App\Controller\OgAgent\CheckPartitionSizesAction
get_partition_script_data:
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\GetPartitionScriptDataInput
uriTemplate: /clients/{uuid}/get-partition-script-data
controller: App\Controller\OgAgent\GetPartitionScriptDataAction
delete_client_lease:
class: ApiPlatform\Metadata\Delete
method: DELETE
input: false
uriTemplate: /clients/{uuid}/delete-lease
controller: App\Controller\OgDhcp\Client\DeleteClientLeaseAction
get_disk_logs:
class: ApiPlatform\Metadata\Get
method: GET
input: false
output: false
uriTemplate: /clients/{uuid}/disk-logs
controller: App\Controller\OgAgent\GetDiskLogsAction
properties:
App\Entity\Client:

View File

@ -7,8 +7,6 @@ resources:
groups: ['default', 'command:read']
denormalizationContext:
groups: ['command:write']
order:
id: 'DESC'
operations:
ApiPlatform\Metadata\GetCollection:
provider: App\State\Provider\CommandProvider
@ -20,22 +18,19 @@ resources:
ApiPlatform\Metadata\Get:
provider: App\State\Provider\CommandProvider
ApiPlatform\Metadata\Put:
security: 'is_granted("ROLE_SUPER_ADMIN")'
provider: App\State\Provider\CommandProvider
ApiPlatform\Metadata\Patch:
security: 'is_granted("ROLE_SUPER_ADMIN")'
provider: App\State\Provider\CommandProvider
ApiPlatform\Metadata\Post:
security: 'is_granted("ROLE_SUPER_ADMIN")'
ApiPlatform\Metadata\Delete:
security: 'is_granted("ROLE_SUPER_ADMIN")'
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Delete: ~
command_execute:
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\CommandExecuteInput
uriTemplate: /commands/run-script
controller: App\Controller\OgAgent\RunScriptAction
uriTemplate: /commands/{uuid}/execute
controller: App\Controller\CommandExecuteAction
properties:
App\Entity\Command:
id:

View File

@ -24,13 +24,6 @@ resources:
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Delete: ~
command_task_execute:
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\CommandTaskExecuteInput
uriTemplate: /command-tasks/{uuid}/execute
controller: App\Controller\CommandTaskExecuteAction
properties:
App\Entity\CommandTask:
id:

View File

@ -1,32 +0,0 @@
resources:
App\Entity\CommandTaskSchedule:
processor: App\State\Processor\CommandTaskScheduleProcessor
input: App\Dto\Input\CommandTaskScheduleInput
output: App\Dto\Output\CommandTaskScheduleOutput
normalizationContext:
groups: ['default', 'command-task-schedule:read']
denormalizationContext:
groups: ['command-task-schedule:write']
operations:
ApiPlatform\Metadata\GetCollection:
provider: App\State\Provider\CommandTaskScheduleProvider
filters:
- 'api_platform.filter.command_task_schedule.order'
- 'api_platform.filter.command_task_schedule.search'
- 'api_platform.filter.command_task_schedule.boolean'
ApiPlatform\Metadata\Get:
provider: App\State\Provider\CommandTaskScheduleProvider
ApiPlatform\Metadata\Put:
provider: App\State\Provider\CommandTaskScheduleProvider
ApiPlatform\Metadata\Patch:
provider: App\State\Provider\CommandTaskScheduleProvider
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Delete: ~
properties:
App\Entity\CommandTaskSchedule:
id:
identifier: false
uuid:
identifier: true

View File

@ -1,35 +0,0 @@
resources:
App\Entity\CommandTaskScript:
processor: App\State\Processor\CommandTaskScriptProcessor
input: App\Dto\Input\CommandTaskScriptInput
output: App\Dto\Output\CommandTaskScriptOutput
normalizationContext:
groups: ['default', 'command-task-script:read']
denormalizationContext:
groups: ['command-task-script:write']
operations:
ApiPlatform\Metadata\GetCollection:
provider: App\State\Provider\CommandTaskScriptProvider
filters:
- 'api_platform.filter.command_task_script.order'
- 'api_platform.filter.command_task_script.search'
- 'api_platform.filter.command_task_script.boolean'
ApiPlatform\Metadata\Get:
provider: App\State\Provider\CommandTaskScriptProvider
ApiPlatform\Metadata\Put:
provider: App\State\Provider\CommandTaskScriptProvider
ApiPlatform\Metadata\Patch:
provider: App\State\Provider\CommandTaskScriptProvider
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Delete: ~
order:
executionOrder: ASC
properties:
App\Entity\CommandTaskScript:
id:
identifier: false
uuid:
identifier: true

View File

@ -1,61 +0,0 @@
resources:
App\Entity\DhcpServer:
processor: App\State\Processor\DhcpServerProcessor
input: App\Dto\Input\DhcpServerInput
output: App\Dto\Output\DhcpServerOutput
normalizationContext:
groups: ['default', 'dhcp-server:read']
denormalizationContext:
groups: ['dhcp-server:write']
operations:
ApiPlatform\Metadata\GetCollection:
provider: App\State\Provider\DhcpServerProvider
ApiPlatform\Metadata\Get:
provider: App\State\Provider\DhcpServerProvider
ApiPlatform\Metadata\Put:
security: 'is_granted("ROLE_SUPER_ADMIN")'
provider: App\State\Provider\DhcpServerProvider
ApiPlatform\Metadata\Patch:
security: 'is_granted("ROLE_SUPER_ADMIN")'
provider: App\State\Provider\DhcpServerProvider
ApiPlatform\Metadata\Post:
security: 'is_granted("ROLE_SUPER_ADMIN")'
ApiPlatform\Metadata\Delete:
security: 'is_granted("ROLE_SUPER_ADMIN")'
subnet_sync:
shortName: DhcpServer
class: ApiPlatform\Metadata\Post
method: POST
input: false
security: 'is_granted("ROLE_SUPER_ADMIN")'
uriTemplate: /dhcp-servers/{uuid}/sync
controller: App\Controller\OgDhcp\Subnet\SyncAction
get_collection_subnets:
shortName: DhcpServer
description: Get collection of Subnets from external dhcp server
class: ApiPlatform\Metadata\Post
method: POST
input: false
uriTemplate: /dhcp-servers/{uuid}/get-collection
controller: App\Controller\OgDhcp\Subnet\GetCollectionAction
dhcp_server_status:
shortName: DhcpServer
description: Get status of OgDhcp
class: ApiPlatform\Metadata\Get
method: GET
input: false
uriTemplate: /dhcp-servers/server/{uuid}/status
controller: App\Controller\OgDhcp\StatusAction
properties:
App\Entity\DhcpServer:
id:
identifier: false
uuid:
identifier: true

View File

@ -1,128 +0,0 @@
resources:
App\Entity\GitRepository:
processor: App\State\Processor\GitRepositoryProcessor
input: App\Dto\Input\GitRepositoryInput
output: App\Dto\Output\GitRepositoryOutput
normalizationContext:
groups: ['default', 'git-repository:read']
denormalizationContext:
groups: ['git-repository:write']
operations:
ApiPlatform\Metadata\GetCollection:
provider: App\State\Provider\GitRepositoryProvider
filters:
- 'api_platform.filter.git_repository.order'
- 'api_platform.filter.git_repository.search'
openapiContext:
summary: 'Obtener lista de repositorios Git'
description: 'Obtiene todos los repositorios Git de un servidor específico'
parameters:
- name: 'repository'
in: 'query'
required: true
schema:
type: 'integer'
description: 'ID del ImageRepository que contiene los repositorios'
- name: 'page'
in: 'query'
schema:
type: 'integer'
default: 1
description: 'Número de página'
- name: 'limit'
in: 'query'
schema:
type: 'integer'
default: 10
description: 'Elementos por página'
ApiPlatform\Metadata\Get:
provider: App\State\Provider\GitRepositoryProvider
openapiContext:
summary: 'Obtener un repositorio Git específico'
description: 'Obtiene un repositorio Git específico por su nombre'
parameters:
- name: 'repository'
in: 'query'
required: true
schema:
type: 'integer'
description: 'ID del ImageRepository'
ApiPlatform\Metadata\Put:
provider: App\State\Provider\GitRepositoryProvider
openapiContext:
summary: 'Actualizar un repositorio Git'
description: 'Actualiza un repositorio Git existente en el servidor externo'
parameters:
- name: 'repository'
in: 'query'
required: true
schema:
type: 'integer'
description: 'ID del ImageRepository'
ApiPlatform\Metadata\Patch:
provider: App\State\Provider\GitRepositoryProvider
openapiContext:
summary: 'Actualizar parcialmente un repositorio Git'
description: 'Actualiza parcialmente un repositorio Git existente'
parameters:
- name: 'repository'
in: 'query'
required: true
schema:
type: 'integer'
description: 'ID del ImageRepository'
ApiPlatform\Metadata\Post:
openapiContext:
summary: 'Crear un nuevo repositorio Git'
description: 'Crea un nuevo repositorio Git en el servidor externo. El ID del ImageRepository debe incluirse en el body del request.'
ApiPlatform\Metadata\Delete:
openapiContext:
summary: 'Eliminar un repositorio Git'
description: 'Elimina un repositorio Git del servidor externo'
parameters:
- name: 'repository'
in: 'query'
required: true
schema:
type: 'integer'
description: 'ID del ImageRepository'
git_deploy_image:
shortName: Deploy Git Image
description: Deploy Git image
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\DeployGitImageInput
uriTemplate: /git-repositories/deploy-image
controller: App\Controller\DeployGitImageAction
git_update_image:
shortName: Update Git Image
description: Update Git image
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\UpdateGitImageInput
uriTemplate: /git-repositories/update-image
controller: App\Controller\UpdateGitImageAction
get_git_data:
shortName: Get Git Data
description: Get Git data
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\GetGitDataInput
uriTemplate: /git-repositories/get-git-data
controller: App\Controller\OgAgent\GetGitDataAction
properties:
App\Entity\GitRepository:
id:
identifier: false
name:
identifier: true

View File

@ -56,22 +56,6 @@ resources:
uriTemplate: /image-image-repositories/{uuid}/backup-image
controller: App\Controller\OgRepository\Image\BackupImageAction
convert_image_to_virtual_image_ogrepository:
shortName: OgRepository Server
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\ConvertImageToVirtualInput
uriTemplate: /image-image-repositories/{uuid}/convert-image-to-virtual
controller: App\Controller\OgRepository\Image\ConvertImageToVirtualAction
rename_image_ogrepository:
shortName: OgRepository Server
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\RenameImageInput
uriTemplate: /image-image-repositories/{uuid}/rename-image
controller: App\Controller\OgRepository\Image\RenameAction
trash_delete_image_ogrepository:
shortName: OgRepository Server
description: Delete Image in OgRepository
@ -104,7 +88,7 @@ resources:
description: Export Image in OgRepository
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\TransferGlobalImageInput
input: App\Dto\Input\ExportImportImageRepositoryInput
uriTemplate: /image-image-repositories/{uuid}/transfer-image
controller: App\Controller\OgRepository\Image\TransferAction
@ -117,15 +101,6 @@ resources:
uriTemplate: /image-image-repositories/server/{uuid}/status
controller: App\Controller\OgRepository\Image\GetStatusAction
transfer_global_image_repository:
shortName: OgRepository Server
description: Transfer Global Image in OgRepository
class: ApiPlatform\Metadata\Post
method: POST
input: false
uriTemplate: /image-image-repositories/server/{uuid}/transfer-global
controller: App\Controller\OgRepository\Image\TransferGlobalAction
properties:
App\Entity\ImageImageRepository:
id:

View File

@ -18,15 +18,11 @@ resources:
ApiPlatform\Metadata\Get:
provider: App\State\Provider\ImageRepositoryProvider
ApiPlatform\Metadata\Put:
security: 'is_granted("ROLE_SUPER_ADMIN")'
provider: App\State\Provider\ImageRepositoryProvider
ApiPlatform\Metadata\Patch:
security: 'is_granted("ROLE_SUPER_ADMIN")'
provider: App\State\Provider\ImageRepositoryProvider
ApiPlatform\Metadata\Post:
security: 'is_granted("ROLE_SUPER_ADMIN")'
ApiPlatform\Metadata\Delete:
security: 'is_granted("ROLE_SUPER_ADMIN")'
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Delete: ~
image_ogrepository_sync:
shortName: OgRepository Server
@ -34,7 +30,7 @@ resources:
method: POST
input: false
uriTemplate: /image-repositories/server/{uuid}/sync
controller: App\Controller\OgRepository\Image\SyncAction
controller: App\Controller\OgRepository\SyncAction
wol_client:
class: ApiPlatform\Metadata\Post
@ -50,7 +46,7 @@ resources:
method: POST
input: false
uriTemplate: /image-repositories/server/{uuid}/get-collection
controller: App\Controller\OgRepository\Image\GetCollectionAction
controller: App\Controller\OgRepository\GetCollectionAction
images_ogrepository_status:
shortName: OgRepository Server
@ -61,86 +57,14 @@ resources:
uriTemplate: /image-repositories/server/{uuid}/status
controller: App\Controller\OgRepository\StatusAction
import_image_ogrepository:
export_image_ogrepository:
shortName: OgRepository Server
description: Export Image in OgRepository
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\ImportImageRepositoryInput
uriTemplate: /image-repositories/{uuid}/import-image
controller: App\Controller\OgRepository\Image\ImportAction
convert_image_ogrepository:
shortName: OgRepository Server
description: Convert Image in OgRepository
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\ConvertImageRepositoryInput
uriTemplate: /image-repositories/{uuid}/convert-image
controller: App\Controller\OgRepository\Image\ConvertAction
get_collection_images_oggit:
shortName: OgRepository Server
description: Get collection of image in OgRepository
class: ApiPlatform\Metadata\Get
method: GET
input: false
uriTemplate: /image-repositories/server/git/{uuid}/get-collection
controller: App\Controller\OgRepository\Git\GetCollectionAction
git_repository_commits:
shortName: OgRepository Server
description: Get commits from a specific branch of a Git repository
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\GetCommitsInput
uriTemplate: /image-repositories/server/git/{uuid}/commits
controller: App\Controller\OgRepository\Git\GetCommitsAction
git_repository_branches:
shortName: OgRepository Server
description: Get branches from a Git repository
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\GetBranchesInput
uriTemplate: /image-repositories/server/git/{uuid}/branches
controller: App\Controller\OgRepository\Git\GetBranchesAction
git_repository_create_tag:
shortName: OgRepository Server
description: Create a tag in a Git repository
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\CreateTagInput
uriTemplate: /image-repositories/server/git/{uuid}/create-tag
controller: App\Controller\OgRepository\Git\CreateTagAction
git_repository_create_branch:
shortName: OgRepository Server
description: Create a branch in a Git repository
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\CreateBranchInput
uriTemplate: /image-repositories/server/git/{uuid}/create-branch
controller: App\Controller\OgRepository\Git\CreateBranchAction
git_repository_create_backup:
shortName: OgRepository Server
description: Create a backup in a Git repository
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\CreateBackupInput
uriTemplate: /image-repositories/server/git/{uuid}/create-backup
controller: App\Controller\OgRepository\Git\CreateBackupAction
git_repository_delete:
shortName: OgRepository Server
description: Delete a repository in a Git repository
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\DeleteRepositoryInput
uriTemplate: /image-repositories/server/git/{uuid}/delete
controller: App\Controller\OgRepository\Git\DeleteAction
input: App\Dto\Input\ExportImportImageRepositoryInput
uriTemplate: /image-repositories/{uuid}/export-image
controller: App\Controller\OgRepository\Image\ExportAction
properties:
App\Entity\ImageRepository:

View File

@ -24,6 +24,22 @@ resources:
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Delete: ~
oglives_sync:
class: ApiPlatform\Metadata\Post
method: POST
input: false
uriTemplate: /og-lives/sync
controller: App\Controller\OgBoot\OgLive\SyncAction
get_collection_oglives:
shortName: OgLive Server
description: Get collection of OgLive
class: ApiPlatform\Metadata\GetCollection
method: GET
input: false
uriTemplate: /og-lives/server/get-collection
controller: App\Controller\OgBoot\OgLive\GetCollectionAction
get_oglive:
shortName: OgLive Server
description: Get OgLive
@ -33,6 +49,24 @@ resources:
uriTemplate: /og-lives/server/{uuid}/get
controller: App\Controller\OgBoot\OgLive\GetAction
get_isos:
shortName: OgLive Server
description: Get Isos of OgLive
class: ApiPlatform\Metadata\GetCollection
method: GET
input: false
uriTemplate: /og-lives/server/get-isos
controller: App\Controller\OgBoot\OgLive\GetIsosAction
get_default:
shortName: OgLive Server
description: Get default OgLive
class: ApiPlatform\Metadata\GetCollection
method: GET
input: false
uriTemplate: /og-lives/server/get-default
controller: App\Controller\OgBoot\OgLive\GetDefaultAction
set_default:
shortName: OgLive Server
description: Set default OgLive

View File

@ -1,6 +1,5 @@
resources:
App\Entity\OrganizationalUnit:
order: { name: 'ASC' }
processor: App\State\Processor\OrganizationalUnitProcessor
output: App\Dto\Output\OrganizationalUnitOutput
input: App\Dto\Input\OrganizationalUnitInput
@ -26,31 +25,14 @@ resources:
provider: App\State\Provider\OrganizationalUnitProvider
validationContext:
groups: ['organizational-unit:patch' ]
ApiPlatform\Metadata\Post:
security: 'is_granted("ROLE_SUPER_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_ADMIN") or is_granted("ROLE_ORGANIZATIONAL_UNIT_OPERATOR")'
ApiPlatform\Metadata\Delete:
security: 'is_granted("ROLE_SUPER_ADMIN") or (is_granted("ROLE_ORGANIZATIONAL_UNIT_ADMIN") and object.getCreatedBy() == user.getUserIdentifier())'
securityMessage: 'You can only delete organizational units you created.'
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Delete: ~
change_parent:
class: ApiPlatform\Metadata\Post
method: POST
input: false
uriTemplate: /organizational-units/{uuid}/change-parent
controller: App\Controller\OrganizationalUnitChangeParentAction
propagate_network_settings:
class: ApiPlatform\Metadata\Post
method: POST
input: false
uriTemplate: /organizational-units/{uuid}/propagate-network-settings
controller: App\Controller\PropagateNetworkSettingsAction
agent_status:
class: ApiPlatform\Metadata\Post
method: POST
input: false
output: false
uriTemplate: /organizational-units/{uuid}/agent/status
controller: App\Controller\OgAgent\OrganizationalUnitStatusAction
properties:
App\Entity\OrganizationalUnit:

View File

@ -4,7 +4,6 @@ resources:
input: App\Dto\Input\PartitionPostInput
output: App\Dto\Output\PartitionOutput
order:
diskNumber: 'ASC'
partitionNumber: 'ASC'
normalizationContext:
groups: ['default', 'partition:read']

View File

@ -24,6 +24,22 @@ resources:
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Delete: ~
pxe_template_sync:
class: ApiPlatform\Metadata\Post
method: POST
input: false
uriTemplate: /pxe-templates/sync
controller: App\Controller\OgBoot\PxeTemplate\SyncAction
get_collection_templates:
shortName: PxeTemplate Server
description: Get collection of PxeTemplate
class: ApiPlatform\Metadata\GetCollection
method: GET
input: false
uriTemplate: /pxe-templates/server/get-collection
controller: App\Controller\OgBoot\PxeTemplate\GetCollectionAction
get_template:
shortName: PxeTemplate Server
description: Get PxeTemplate

View File

@ -13,7 +13,6 @@ resources:
filters:
- 'api_platform.filter.software.order'
- 'api_platform.filter.software.search'
- 'software.software_profile_filter'
ApiPlatform\Metadata\Get:
provider: App\State\Provider\SoftwareProvider

View File

@ -17,16 +17,27 @@ resources:
ApiPlatform\Metadata\Get:
provider: App\State\Provider\SubnetProvider
ApiPlatform\Metadata\Put:
security: 'is_granted("ROLE_SUPER_ADMIN")'
provider: App\State\Provider\SubnetProvider
ApiPlatform\Metadata\Patch:
security: 'is_granted("ROLE_SUPER_ADMIN")'
provider: App\State\Provider\SubnetProvider
ApiPlatform\Metadata\Post:
security: 'is_granted("ROLE_SUPER_ADMIN")'
ApiPlatform\Metadata\Delete:
security: 'is_granted("ROLE_SUPER_ADMIN")'
ApiPlatform\Metadata\Post: ~
ApiPlatform\Metadata\Delete: ~
subnet_sync:
class: ApiPlatform\Metadata\Post
method: POST
input: false
uriTemplate: /subnets/sync
controller: App\Controller\OgDhcp\Subnet\SyncAction
get_collection_subnets:
shortName: Subnet Server
description: Get collection of Subnet
class: ApiPlatform\Metadata\GetCollection
method: GET
input: false
uriTemplate: /og-dhcp/server/get-collection
controller: App\Controller\OgDhcp\Subnet\GetCollectionAction
get_subnet:
shortName: Subnet Server
@ -43,7 +54,6 @@ resources:
class: ApiPlatform\Metadata\Post
method: POST
input: false
security: 'is_granted("ROLE_SUPER_ADMIN")'
uriTemplate: /og-dhcp/server/{uuid}/post
controller: App\Controller\OgDhcp\Subnet\PostAction
@ -53,7 +63,6 @@ resources:
class: ApiPlatform\Metadata\Put
method: PUT
input: false
security: 'is_granted("ROLE_SUPER_ADMIN")'
uriTemplate: /og-dhcp/server/{uuid}/put
controller: App\Controller\OgDhcp\Subnet\PutAction
@ -63,7 +72,6 @@ resources:
class: ApiPlatform\Metadata\Delete
method: DELETE
input: false
security: 'is_granted("ROLE_SUPER_ADMIN")'
uriTemplate: /og-dhcp/server/{uuid}/delete
controller: App\Controller\OgDhcp\Subnet\DeleteAction
@ -73,7 +81,6 @@ resources:
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\SubnetAddHostInput
security: 'is_granted("ROLE_SUPER_ADMIN")'
uriTemplate: /og-dhcp/server/{uuid}/post-host
controller: App\Controller\OgDhcp\Subnet\PostHostAction
@ -92,7 +99,6 @@ resources:
class: ApiPlatform\Metadata\Put
method: PUT
input: false
security: 'is_granted("ROLE_SUPER_ADMIN")'
uriTemplate: /og-dhcp/server/{uuid}/put-host
controller: App\Controller\OgDhcp\Subnet\PutHostAction
@ -103,31 +109,9 @@ resources:
method: DELETE
input: false
read: false
security: 'is_granted("ROLE_SUPER_ADMIN")'
uriTemplate: /og-dhcp/server/{uuid}/delete-host/{clientUuid}
controller: App\Controller\OgDhcp\Subnet\DeleteHostAction
delete_subnet_leases:
shortName: Subnet Server Leases
description: Delete all leases of a Subnet
class: ApiPlatform\Metadata\Delete
method: DELETE
input: false
security: 'is_granted("ROLE_SUPER_ADMIN")'
uriTemplate: /og-dhcp/server/{uuid}/delete-leases
controller: App\Controller\OgDhcp\Subnet\DeleteSubnetLeasesAction
delete_client_lease:
shortName: Subnet Server Leases
description: Delete lease of a specific client
class: ApiPlatform\Metadata\Delete
method: DELETE
input: false
read: false
security: 'is_granted("ROLE_SUPER_ADMIN")'
uriTemplate: /og-dhcp/server/{uuid}/delete-lease/{clientUuid}
controller: App\Controller\OgDhcp\Subnet\DeleteClientLeaseAction
properties:
App\Entity\Subnet:

View File

@ -9,8 +9,6 @@ resources:
filters:
- 'api_platform.filter.trace.order'
- 'api_platform.filter.trace.search'
- 'api_platform.filter.trace.date'
ApiPlatform\Metadata\Get:
provider: App\State\Provider\TraceProvider
@ -23,35 +21,8 @@ resources:
uriTemplate: /traces/server/{uuid}/cancel
controller: App\Controller\OgRepository\Image\CancelTransmissionAction
cancel_multiple_traces:
shortName: Trace Server
description: Cancel Multiple Traces in OgRepository
controller: App\Controller\CancelMultipleTracesAction
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\CancelMultipleTracesInput
uriTemplate: /traces/cancel-multiple
kill_job:
shortName: Kill Job
description: Kill Job in OgAgent
controller: App\Controller\OgAgent\KillJobAction
class: ApiPlatform\Metadata\Post
method: POST
input: App\Dto\Input\KillJobInput
uriTemplate: /traces/{uuid}/kill-job
mark_traces_as_success:
shortName: Mark Trace as Success
description: Mark a single trace as successfully completed
controller: App\Controller\MarkTracesAsSuccessAction
class: ApiPlatform\Metadata\Post
method: POST
input: false
uriTemplate: /traces/{uuid}/mark-as-success
order:
id: DESC
createdAt: DESC
properties:
App\Entity\Trace:

View File

@ -1,7 +1,7 @@
api_platform:
title: 'OgCore Api'
description: 'Api Documentation for OgCore'
version: 1.0.0
version: 0.5.0
path_segment_name_generator: api_platform.path_segment_name_generator.dash
defaults:
pagination_client_items_per_page: true

View File

@ -5,13 +5,6 @@ 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.
@ -19,7 +12,6 @@ framework:
handler_id: null
cookie_secure: auto
cookie_samesite: lax
storage_factory_id: session.storage.factory.native
#esi: true
#fragments: true

View File

@ -10,17 +10,11 @@ when@dev:
level: info
path: "%kernel.logs_dir%/%kernel.environment%.log"
formatter: App\Formatter\CustomLineFormatter
channels: ["!event", "!deprecation"]
channels: ["!event"]
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console", "!deprecation"]
syslog:
type: syslog
ident: "ogcore"
level: info
formatter: App\Formatter\CustomLineFormatter
channels: ["!event", "!deprecation"]
channels: ["!event", "!doctrine", "!console"]
when@test:
monolog:
@ -43,11 +37,14 @@ when@prod:
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: error
formatter: App\Formatter\CustomLineFormatter
channels: ["!event", "!deprecation"]
syslog:
type: syslog
ident: "ogcore"
level: info
formatter: App\Formatter\CustomLineFormatter
channels: ["!event", "!deprecation"]
channels: ["!event"]
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]
deprecation:
type: stream
channels: [deprecation]
path: "%kernel.logs_dir%/%kernel.environment%.log"
formatter: monolog.formatter.json

View File

@ -22,8 +22,6 @@ security:
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
jwt: ~
custom_authenticators:
- App\Security\ApiKeyAuthenticator
refresh_jwt:
check_path: refresh_token
@ -31,20 +29,13 @@ security:
- { path: ^/$, roles: PUBLIC_ACCESS } # Allows accessing the Swagger UI
- { path: ^/docs, roles: PUBLIC_ACCESS } # Allows accessing the Swagger UI docs
- { path: ^/auth/login, roles: PUBLIC_ACCESS }
- { path: ^/commands, roles: [ROLE_OGCLIENT_API, ROLE_USER] }
- { path: ^/opengnsys/rest, roles: PUBLIC_ACCESS }
- { path: ^/og-repository/webhook, roles: PUBLIC_ACCESS }
- { path: ^/og-lives/install/webhook, roles: PUBLIC_ACCESS }
- { path: ^/auth/refresh, roles: PUBLIC_ACCESS }
- { path: ^/validate, roles: PUBLIC_ACCESS }
- { path: ^/menu-browser, roles: PUBLIC_ACCESS }
- { path: ^/menu/, roles: PUBLIC_ACCESS }
# Creación de clientes y OUs: super-admin, ou-admin y ou-operator
- { path: ^/clients$, methods: [POST], roles: [ROLE_SUPER_ADMIN, ROLE_ORGANIZATIONAL_UNIT_ADMIN, ROLE_ORGANIZATIONAL_UNIT_OPERATOR] }
- { path: ^/organizational-units$, methods: [POST], roles: [ROLE_SUPER_ADMIN, ROLE_ORGANIZATIONAL_UNIT_ADMIN, ROLE_ORGANIZATIONAL_UNIT_OPERATOR] }
# ogLive puede consultar clientes por IP con su API key
- { path: ^/clients, methods: [GET], roles: [ROLE_OGCLIENT_API, ROLE_USER] }
- { path: ^/, roles: ROLE_USER }
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }
when@test:
security:

View File

@ -14,4 +14,4 @@ when@test:
intercept_redirects: false
framework:
profiler: { collect: false }
profiler: { collect: false }

View File

@ -137,12 +137,6 @@ services:
bind:
$collectionProvider: '@api_platform.doctrine.orm.state.collection_provider'
$itemProvider: '@api_platform.doctrine.orm.state.item_provider'
App\State\Provider\DhcpServerProvider:
bind:
$collectionProvider: '@api_platform.doctrine.orm.state.collection_provider'
$itemProvider: '@api_platform.doctrine.orm.state.item_provider'
App\State\Provider\TraceProvider:
bind:
$collectionProvider: '@api_platform.doctrine.orm.state.collection_provider'
@ -162,18 +156,3 @@ services:
bind:
$collectionProvider: '@api_platform.doctrine.orm.state.collection_provider'
$itemProvider: '@api_platform.doctrine.orm.state.item_provider'
App\State\Provider\CommandTaskScheduleProvider:
bind:
$collectionProvider: '@api_platform.doctrine.orm.state.collection_provider'
$itemProvider: '@api_platform.doctrine.orm.state.item_provider'
App\State\Provider\CommandTaskScriptProvider:
bind:
$collectionProvider: '@api_platform.doctrine.orm.state.collection_provider'
$itemProvider: '@api_platform.doctrine.orm.state.item_provider'
App\State\Provider\BootServerProvider:
bind:
$collectionProvider: '@api_platform.doctrine.orm.state.collection_provider'
$itemProvider: '@api_platform.doctrine.orm.state.item_provider'

View File

@ -20,7 +20,7 @@ services:
api_platform.filter.client.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'uuid': exact, 'name': 'partial', 'serialNumber': 'exact', 'template.id': 'exact', status: 'exact', organizationalUnit.id: 'exact', mac: 'exact', ip: 'exact', subnet.id: 'exact', 'notes': 'partial' } ]
arguments: [ { 'id': 'exact', 'uuid': exact, 'name': 'partial', 'serialNumber': 'exact', 'template.id': 'exact', status: 'exact', organizationalUnit.id: 'exact', mac: 'exact', ip: 'exact', subnet.id: 'exact' } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.client.exist:
@ -41,52 +41,6 @@ services:
tags: [ 'api_platform.filter' ]
api_platform.filter.command.boolean:
parent: 'api_platform.doctrine.orm.boolean_filter'
arguments: [ { 'enabled': ~, 'readOnly': ~ } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.command_task.order:
parent: 'api_platform.doctrine.orm.order_filter'
arguments:
$properties: { 'id': ~, 'name': ~ }
$orderParameterName: 'order'
tags: [ 'api_platform.filter' ]
api_platform.filter.command_task.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'name': 'partial' } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.command_task_schedule.order:
parent: 'api_platform.doctrine.orm.order_filter'
arguments:
$properties: { 'id': ~, 'name': ~ }
$orderParameterName: 'order'
tags: [ 'api_platform.filter' ]
api_platform.filter.command_task_schedule.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'name': 'partial', 'commandTask.id': 'exact' } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.command_task_schedule.boolean:
parent: 'api_platform.doctrine.orm.boolean_filter'
arguments: [ { 'enabled': ~} ]
tags: [ 'api_platform.filter' ]
api_platform.filter.command_task_script.order:
parent: 'api_platform.doctrine.orm.order_filter'
arguments:
$properties: { 'id': ~, 'name': ~ }
$orderParameterName: 'order'
tags: [ 'api_platform.filter' ]
api_platform.filter.command_task_script.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'name': 'partial', 'commandTask.id': 'exact' } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.command_task_script.boolean:
parent: 'api_platform.doctrine.orm.boolean_filter'
arguments: [ { 'enabled': ~ } ]
tags: [ 'api_platform.filter' ]
@ -107,7 +61,7 @@ services:
api_platform.filter.image.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'name': 'partial', 'repository.id': 'exact', status: 'exact', type: 'exact' } ]
arguments: [ { 'id': 'exact', 'name': 'partial', 'repository.id': 'exact', status: 'exact'} ]
tags: [ 'api_platform.filter' ]
api_platform.filter.image.boolean:
@ -119,10 +73,6 @@ services:
parent: 'App\Filter\ImageSearchRepositoryFilter'
tags: [ 'api_platform.filter' ]
software.software_profile_filter:
parent: 'App\Filter\SoftwareProfileSearchSoftwareFilter'
tags: [ 'api_platform.filter' ]
api_platform.filter.og_live.order:
parent: 'api_platform.doctrine.orm.order_filter'
arguments:
@ -132,7 +82,7 @@ services:
api_platform.filter.og_live.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'name': 'partial', 'status': 'exact', 'bootServer.uuid': 'exact' } ]
arguments: [ { 'id': 'exact', 'name': 'partial', } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.og_live.boolean:
@ -142,7 +92,7 @@ services:
api_platform.filter.hardware.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'name': 'partial', 'clients.id': 'exact' } ]
arguments: [ { 'id': 'exact', 'name': 'partial' } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.menu.order:
@ -212,12 +162,12 @@ services:
api_platform.filter.pxe_template.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'name': 'partial', 'bootServer.uuid': 'exact' } ]
arguments: [ { 'id': 'exact', 'name': 'partial', } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.pxe_template.boolean:
parent: 'api_platform.doctrine.orm.boolean_filter'
arguments: [ { 'synchronized': ~, 'isDefault': ~ } ]
arguments: [ { 'synchronized': ~ } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.remote_calendar.order:
@ -281,7 +231,7 @@ services:
api_platform.filter.software_profile.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'description': 'partial'} ]
arguments: [ { 'id': 'exact', 'description': 'partial' } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.subnet.order:
@ -293,12 +243,12 @@ services:
api_platform.filter.subnet.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'name': 'partial', ip: 'exact', nextServer: 'exact', netmask: 'exact', bootFileName: 'partial', 'dhcpServer.uuid': 'exact'} ]
arguments: [ { 'id': 'exact', 'name': 'partial', ip: 'exact', nextServer: 'exact', netmask: 'exact', bootFileName: 'partial'} ]
tags: [ 'api_platform.filter' ]
api_platform.filter.trace.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'command': 'exact', 'client.id': 'exact', 'status': 'exact', 'jobId': 'exact' } ]
arguments: [ { 'id': 'exact', 'command.id': 'exact', 'client.id': 'exact', status: 'exact' } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.trace.order:
@ -308,11 +258,6 @@ services:
$orderParameterName: 'order'
tags: [ 'api_platform.filter' ]
api_platform.filter.trace.date:
parent: 'api_platform.doctrine.orm.date_filter'
arguments: [ { 'executedAt': ~, 'createdAt': ~ } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.user.order:
parent: 'api_platform.doctrine.orm.order_filter'
arguments:
@ -347,28 +292,4 @@ services:
arguments: [ { 'enabled': ~ } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.git_repository.order:
parent: 'api_platform.doctrine.orm.order_filter'
arguments:
$properties: { 'id': ~, 'name': ~ }
$orderParameterName: 'order'
tags: [ 'api_platform.filter' ]
api_platform.filter.git_repository.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'name': 'partial', 'description': 'partial' } ]
tags: [ 'api_platform.filter' ]
api_platform.filter.git_image_repository.order:
parent: 'api_platform.doctrine.orm.order_filter'
arguments:
$properties: { 'id': ~, 'name': ~, 'status': ~, 'tag': ~, 'branch': ~ }
$orderParameterName: 'order'
tags: [ 'api_platform.filter' ]
api_platform.filter.git_image_repository.search:
parent: 'api_platform.doctrine.orm.search_filter'
arguments: [ { 'id': 'exact', 'name': 'partial', 'status': 'exact', 'tag': 'partial', 'branch': 'partial', 'image.id': 'exact', 'repository.id': 'exact', 'gitRepository.id': 'exact' } ]
tags: [ 'api_platform.filter' ]

63
debian/changelog vendored
View File

@ -1,53 +1,14 @@
ogcore (0.9.2-1) unstable; urgency=medium
ogcore (1.0.5+develop20250310-1) unstable; urgency=medium
* Added mercure service in docker compose file for deployments.
-- Manuel Aranda <maranda@qindel.com> Wed, 12 Mar 2025 14:00:00 +0200
ogcore (0.9.1-1) unstable; urgency=medium
* Corrección en la cancelación de transmisiones p2p.
-- Manuel Aranda <maranda@qindel.com> Wed, 12 Mar 2025 13:00:00 +0200
ogcore (0.9.0-1) unstable; urgency=medium
* Nueva funcionalidad para tener notificaciones en tiempo real. Instalación de bundle "Mercure".
* Creación de EventListener en Symfony, para publicar mensajes en Mercure cuando se realicen cambios en la base de datos.
* Nuevo endpoint "backup image". Integración con ogRepository.
* Nuevo campo en "usuarios" para escoger la visualización por defecto de la vista "grupos".
* Nuevo campo "dns" en "subredes" para gestionar los servidores DNS.
* Integración de endpoint ogRepository para verificar la integridad de una imagen.
* Nueva funcionalidad para cancelar despliegues de imágenes.
* Añadido nuevo campo "cancelado" en trazas.
* Cambios en logs: salida redirigida de stderr a file.log.
* Modificación en módulo DHCP: gestión de equipos con una única llamada a la API.
* Cambios en las respuestas de acciones masivas en equipos para evitar fallos en peticiones parciales.
-- Manuel Aranda <maranda@qindel.com> Tue, 04 Mar 2025 15:00:00 +0200
ogcore (0.8.1-1) unstable; urgency=medium
* Corrección de bug en el deploy de imágenes.
-- Manuel Aranda <maranda@qindel.com> Tue, 25 Feb 2025 10:00:00 +0200
ogcore (0.8.0-1) unstable; urgency=medium
* Nuevos campos en "aulas" para la jerarquía en clientes.
* Nueva funcionalidad "imagen global". Integración con ogRepository.
* Limpieza en campos "name" y "date" de ogLive. Ahora se parsea el campo "filename" para mejorar la experiencia del usuario.
* Corrección de bug que impedía borrar un cliente si tenía una traza enlazada.
-- Manuel Aranda <maranda@qindel.com> Fri, 10 Jan 2025 12:00:00 +0200
ogcore (0.7.3-1) unstable; urgency=medium
* Adaptados cambios en los endpoints para multiselección de clientes.
* Se agregó la funcionalidad de importar/exportar. Integración con ogRepository.
* Se agregó la funcionalidad de borrar imágenes. Integración con ogRepository.
* Se agregó el modo "TORRENT" y "UDPCAST" en el despliegue de imágenes.
* Refactorización del webhook de ogRepository.
-- Manuel Aranda <maranda@qindel.com> Fri, 03 Jan 2025 11:00:00 +0200
* Modified changelog
* Some improvements. Fixed multi select actions
* refs #1644. Cancel deployImage action
* Updated test phunit.xml
* Updated test
* Merge branch 'main' into develop
* Fixed phpxml
* Fixed phpxml
* Changed test
* Changed repoClient funcionality. New filters added
-- Tu Nombre <tuemail@example.com> Mon, 10 Mar 2025 10:59:14 +0000

6
debian/control vendored
View File

@ -2,7 +2,7 @@ Source: ogcore
Section: web
Priority: optional
Maintainer: Nicolas Arenas <nicolas.arenas@qindel.com>
Build-Depends: debhelper (>= 12), composer, php-cli, php-mysql, php-fpm, libzip-dev, zip, unzip
Build-Depends: debhelper (>= 12), composer, php-cli, php-mysql, nginx, php-fpm, libzip-dev, zip, unzip
Standards-Version: 4.5.0
Package: ogcore
@ -10,7 +10,7 @@ Architecture: all
Depends: ${misc:Depends}, mariadb-server, systemd, nginx, libzip-dev, zip, unzip,
php8.3-opcache, php8.3-bcmath, php8.3-cli, php8.3-curl, php8.3-fpm,
php8.3-gd, php8.3-ldap, php8.3-mbstring, php8.3-mysql, php8.3-common,
php8.3-xml, php8.3-zip, mercure, systemd-journal-remote, logrotate
php8.3-xml, php8.3-zip, mercure
Description: OpenGnsys Core
OgCore package is responsible about management of Opengnsys platform
This is a longer description of the ogcore package.
OpenGnsys Core is a platform for system management.

134
debian/ogcore.postinst vendored
View File

@ -4,35 +4,10 @@ set -e
set -x
. /usr/share/debconf/confmodule
restore_config_if_modified() {
local new="$1"
local backup="$1.bak"
if [ -f "$backup" ]; then
if ! cmp -s "$new" "$backup"; then
echo ">>> Archivo modificado por el usuario detectado en $new"
echo " - Guardando archivo nuevo como ${new}.new"
mv -f "$new" "${new}.new"
echo " - Restaurando archivo anterior desde backup"
mv -f "$backup" "$new"
else
echo ">>> El archivo $new no ha cambiado desde la última versión, eliminando backup"
rm -f "$backup"
fi
fi
}
USER="opengnsys"
# Detectar si es una instalación nueva o una actualización
if [ "$1" = "configure" ] && [ -z "$2" ]; then
# Detectar IP de la interfaz de red asociad a la ruta por defecto.
IP=$(ip -4 route get 8.8.8.8 | grep -oP '(?<=src )[\d.]+')
echo ">>> Instalación nueva detectada."
# Solicitar credenciales solo en instalación nueva
@ -50,11 +25,10 @@ if [ "$1" = "configure" ] && [ -z "$2" ]; then
# Configuración inicial
echo ">>> Configurando base de datos y permisos"
mariadb -e "ALTER USER 'root'@'localhost' IDENTIFIED VIA unix_socket OR mysql_native_password USING PASSWORD('root');"
mariadb -e "GRANT ALL ON *.* to 'root'@'localhost' IDENTIFIED BY 'root' WITH GRANT OPTION;"
echo ">>> Creando par de claves para JWT"
php bin/console lexik:jwt:generate-keypair --overwrite --no-interaction
php bin/console lexik:jwt:generate-keypair --overwrite
echo ">>> Creando base de datos"
php bin/console doctrine:database:create --if-not-exists
@ -66,70 +40,42 @@ if [ "$1" = "configure" ] && [ -z "$2" ]; then
php bin/console app:load-default-commands
php bin/console opengnsys:load-default-menu
echo ">>> Configurando usuario de base de datos para Grafana"
cp -a /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/mariadb.conf.d/50-server.cnf.bak
sed -i 's/^bind-address\s*=.*/bind-address = 0.0.0.0/' /etc/mysql/mariadb.conf.d/50-server.cnf
mariadb -e "
CREATE USER IF NOT EXISTS 'grafana'@'%' IDENTIFIED BY 'grafana';
GRANT SELECT ON ogcore.* TO 'grafana'@'%';
FLUSH PRIVILEGES;"
echo ">>> Configurando servidor web y servicios"
ln -s /opt/opengnsys/ogcore/etc/nginx/sites-available/ogcore.conf /etc/nginx/sites-enabled/ogcore.conf
ln -s /opt/opengnsys/ogcore/etc/nginx/sites-available/mercure.conf /etc/nginx/sites-enabled/mercure.conf
ln -s /opt/opengnsys/ogcore/etc/php/8.3/fpm/pool.d/ogcore-fpm.conf /etc/php/8.3/fpm/pool.d/ogcore-fpm.conf
ln -s /opt/opengnsys/ogcore/etc/systemd/system/og-mercure.service /etc/systemd/system/og-mercure.service
ln -s /opt/opengnsys/ogcore/etc/systemd/system/journal-pull@.service /etc/systemd/system/journal-pull@.service
ln -s /opt/opengnsys/ogcore/etc/systemd/system/journal-pull-sync.path /etc/systemd/system/journal-pull-sync.path
ln -s /opt/opengnsys/ogcore/etc/systemd/system/journal-pull-sync.service /etc/systemd/system/journal-pull-sync.service
ln -s /opt/opengnsys/ogcore/etc/logrotate.d/ogclients /etc/logrotate.d/ogclients
chown root:root /opt/opengnsys/ogcore/etc/logrotate.d/ogclients
echo ">>> Configurando journal-pull"
touch /opt/opengnsys/ogcore/etc/journal-pull-sources.conf
chmod +x /opt/opengnsys/ogcore/etc/bin/journal-pull-sync.sh
mkdir -p /var/log/journal/remote
chown systemd-journal-remote:systemd-journal-remote /var/log/journal/remote
echo ">>> Configurando permisos de archivos"
chown opengnsys:www-data /opt/opengnsys/
chown -R opengnsys:www-data /opt/opengnsys/ogcore
chmod -R 775 /opt/opengnsys/ogcore/api/var/
chown www-data:www-data /opt/opengnsys/ogcore/etc/journal-pull-sources.conf
chmod 664 /opt/opengnsys/ogcore/etc/journal-pull-sources.conf
usermod -aG systemd-journal opengnsys
usermod -aG systemd-journal-remote opengnsys
systemctl daemon-reload
systemctl enable og-mercure
systemctl enable --now journal-pull-sync.path
systemctl restart mariadb.service
systemctl restart og-mercure
systemctl restart nginx
systemctl restart php8.3-fpm
#Obteniendo bearer token
BEARER=$(curl -sk -X 'POST' 'https://localhost:8443/auth/login' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{ "username": "ogadmin", "password": "12345678" }' | jq -r .token)
# Creando nuevo repo
curl -skL -X POST 'https://localhost:8443/image-repositories' \
-H "Authorization: Bearer $BEARER" \
-H 'Content-Type: application/json' \
-d "{ \"name\": \"Repository 1\", \"ip\": \"$IP\", \"comments\": \"Repositorio creado automaticamente por oginstaller\" }"
# Solo gestionar credenciales en instalación nueva
if [ "$ADMIN_USER" == "ogadmin" ]; then
echo ">>> Cambiando contraseña de ogadmin"¡
BEARER=$(curl -sk -X 'POST' 'https://localhost:8443/auth/login' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{ "username": "ogadmin", "password": "12345678" }' | jq -r .token)
echo ">>> Cambiando contraseña de ogadmin"
OGADMIN_UUID=$(curl -skL "https://localhost:8443/users/?username=ogadmin" \
-H 'accept: application/json' \
-H "Authorization: Bearer $BEARER" | jq -r '.[0].uuid')
curl -skL -X PUT "https://localhost:8443/users/$OGADMIN_UUID/reset-password" \
-H 'accept: application/ld+json' \
-H 'Content-Type: application/ld+json' \
-H "Authorization: Bearer $BEARER" \
-d "{ \"currentPassword\": \"12345678\", \"newPassword\": \"$ADMIN_PASS\", \"repeatNewPassword\": \"$ADMIN_PASS\" }"
echo ">>> Contraseña de ogadmin cambiada."
else
echo ">>> Creando nuevo usuario administrador: $ADMIN_USER"
curl -skL --location 'https://localhost:8443/users' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $BEARER" \
@ -137,66 +83,30 @@ if [ "$1" = "configure" ] && [ -z "$2" ]; then
echo ">>> Usuario administrador $ADMIN_USER creado."
fi
# Install crontab
echo ">>> Configurando cron para comprobar disponibilidad de clientes"
cp /opt/opengnsys/ogcore/etc/cron.d/opengnsys-check-clients /etc/cron.d/opengnsys-check-clients
chmod 644 /etc/cron.d/opengnsys-check-clients
chown root:root /etc/cron.d/opengnsys-check-clients
elif [ "$1" = "configure" ] && [ -n "$2" ]; then
echo ">>> Actualización detectada desde la versión $2"
# Restaurar archivos de configuración si han sido modificados
restore_config_if_modified "/opt/opengnsys/ogcore/etc/nginx/sites-available/ogcore.conf"
restore_config_if_modified "/opt/opengnsys/ogcore/etc/nginx/sites-available/mercure.conf"
restore_config_if_modified "/opt/opengnsys/ogcore/etc/php/8.3/fpm/pool.d/ogcore-fpm.conf"
restore_config_if_modified "/opt/opengnsys/ogcore/etc/systemd/system/og-mercure.service"
restore_config_if_modified "/opt/opengnsys/ogcore/api/env.json"
cd /opt/opengnsys/ogcore/api
echo ">>> Aplicando migraciones de base de datos"
php bin/console doctrine:migrations:migrate --no-interaction
php bin/console cache:clear
echo ">>> Configurando servidor web y servicios"
[ ! -L /etc/nginx/sites-enabled/ogcore.conf ] && ln -s /opt/opengnsys/ogcore/etc/nginx/sites-available/ogcore.conf /etc/nginx/sites-enabled/ogcore.conf
[ ! -L /etc/nginx/sites-enabled/mercure.conf ] && ln -s /opt/opengnsys/ogcore/etc/nginx/sites-available/mercure.conf /etc/nginx/sites-enabled/mercure.conf
[ ! -L /etc/php/8.3/fpm/pool.d/ogcore-fpm.conf ] && ln -s /opt/opengnsys/ogcore/etc/php/8.3/fpm/pool.d/ogcore-fpm.conf /etc/php/8.3/fpm/pool.d/ogcore-fpm.conf
[ ! -L /etc/systemd/system/og-mercure.service ] && ln -s /opt/opengnsys/ogcore/etc/systemd/system/og-mercure.service /etc/systemd/system/og-mercure.service
ln -sf /opt/opengnsys/ogcore/etc/systemd/system/journal-pull@.service /etc/systemd/system/journal-pull@.service
ln -sf /opt/opengnsys/ogcore/etc/systemd/system/journal-pull-sync.path /etc/systemd/system/journal-pull-sync.path
ln -sf /opt/opengnsys/ogcore/etc/systemd/system/journal-pull-sync.service /etc/systemd/system/journal-pull-sync.service
ln -sf /opt/opengnsys/ogcore/etc/logrotate.d/ogclients /etc/logrotate.d/ogclients
chown root:root /opt/opengnsys/ogcore/etc/logrotate.d/ogclients
chmod +x /opt/opengnsys/ogcore/etc/bin/journal-pull-sync.sh
if [ ! -f /opt/opengnsys/ogcore/etc/journal-pull-sources.conf ]; then
touch /opt/opengnsys/ogcore/etc/journal-pull-sources.conf
chown www-data:www-data /opt/opengnsys/ogcore/etc/journal-pull-sources.conf
chmod 664 /opt/opengnsys/ogcore/etc/journal-pull-sources.conf
fi
[ ! -d /var/log/journal/remote ] && mkdir -p /var/log/journal/remote && chown systemd-journal-remote:systemd-journal-remote /var/log/journal/remote
ln -s /opt/opengnsys/ogcore/etc/nginx/sites-available/ogcore.conf /etc/nginx/sites-enabled/ogcore.conf
ln -s /opt/opengnsys/ogcore/etc/php/8.3/fpm/pool.d/ogcore-fpm.conf /etc/php/8.3/fpm/pool.d/ogcore-fpm.conf
ln -s /opt/opengnsys/ogcore/etc/systemd/system/og-mercure.service /etc/systemd/system/og-mercure.service
echo ">>> Configurando permisos de archivos"
chown opengnsys:www-data /opt/opengnsys/
chown -R opengnsys:www-data /opt/opengnsys/ogcore
if [ ! -f /etc/cron.d/opengnsys-check-clients ]; then
echo ">>> Configurando cron para comprobar disponibilidad de clientes"
cp /opt/opengnsys/ogcore/etc/cron.d/opengnsys-check-clients /etc/cron.d/opengnsys-check-clients
chmod 644 /etc/cron.d/opengnsys-check-clients
chown root:root /etc/cron.d/opengnsys-check-clients
else
echo ">>> El archivo de cron ya existe, no se realizan cambios se ajustan permisos"
chmod 644 /etc/cron.d/opengnsys-check-clients
chown root:root /etc/cron.d/opengnsys-check-clients
fi
systemctl enable og-mercure
systemctl enable --now journal-pull-sync.path 2>/dev/null || true
usermod -aG systemd-journal opengnsys 2>/dev/null || true
usermod -aG systemd-journal-remote opengnsys 2>/dev/null || true
chmod -R 775 /opt/opengnsys/ogcore/api/var/ 2>/dev/null || true
systemctl daemon-reload
systemctl enable og-mercure
systemctl restart og-mercure
systemctl restart php8.3-fpm
systemctl restart nginx
fi
systemctl restart php8.3-fpm
fi
# Recargar systemd y reiniciar servicios en ambos casos
exit 0

29
debian/ogcore.preinst vendored
View File

@ -2,19 +2,6 @@
set -e
backup_file_if_exists() {
local original="$1"
local backup="$1.bak"
if [ -e "$original" ]; then
echo " - Guardando backup de $original en $backup"
cp -a "$original" "$backup"
fi
}
CONFIG_FILE="/opt/opengnsys/ogcore/api/env.json"
BACKUP_FILE="/opt/opengnsys/ogcore/api/env.json.bak"
# Asegurarse de que el usuario exista
USER="opengnsys"
HOME_DIR="/opt/opengnsys"
@ -25,18 +12,4 @@ else
useradd -m -d "$HOME_DIR" -s /bin/bash "$USER"
fi
CONFIG_FILE="/opt/opengnsys/ogcore/api/env.json"
BACKUP_FILE="/opt/opengnsys/ogcore/api/env.json.bak"
# Solo hacemos backup si el archivo existe y es una actualización (posición 1 = upgrade)
if [ "$1" = "upgrade" ]; then
echo ">>> Backup de archivos de configuración reales en /opt/opengnsys"
backup_file_if_exists "/opt/opengnsys/ogcore/etc/nginx/sites-available/ogcore.conf"
backup_file_if_exists "/opt/opengnsys/ogcore/etc/nginx/sites-available/mercure.conf"
backup_file_if_exists "/opt/opengnsys/ogcore/etc/php/8.3/fpm/pool.d/ogcore-fpm.conf"
backup_file_if_exists "/opt/opengnsys/ogcore/etc/systemd/system/og-mercure.service"
backup_file_if_exists "/opt/opengnsys/ogcore/api/env.json"
fi
exit 0
exit 0

4
debian/rules vendored
View File

@ -8,5 +8,5 @@ override_dh_auto_build:
export COMPOSER_ALLOW_SUPERUSER=1
export APP_ENV=prod
dh_auto_build
COMPOSER_ALLOW_SUPERUSER=1 APP_ENV=prod composer install --no-dev --no-interaction --no-progress --optimize-autoloader
COMPOSER_ALLOW_SUPERUSER=1 APP_ENV=prod composer dump-env prod
composer dump-env prod
composer install --no-dev --no-interaction --no-progress --optimize-autoloader

View File

@ -20,7 +20,6 @@ services:
ports:
- 8080:80
- 8443:443
- 3000:3000
volumes:
- ogpublic:/var/www/html/public:cached
networks:
@ -53,8 +52,8 @@ services:
cors_origins *
# Comment the following line to disable the development mode
command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile
# ports:
# - "3000:3000"
ports:
- "3000:3000"
volumes:
- mercure_data:/data
- mercure_config:/config

View File

@ -26,8 +26,7 @@ services:
- 8443:443 # Añadir el puerto 443
volumes:
- ./public:/var/www/html/public:cached
- ./docker/certs:/etc/nginx/certs
- ./certs:/opt/opengnsys/ogcore/etc/certificates
- ./docker/certs:/etc/nginx/certs # Montar certificados en Nginx
networks:
- ogcore-network
@ -38,7 +37,6 @@ services:
dockerfile: ./docker/Dockerfile-php
volumes:
- ./:/var/www/html
- ./certs:/opt/opengnsys/ogcore/etc/certificates
depends_on:
- database
networks:

View File

@ -12,11 +12,20 @@ server {
root /var/www/html/public;
index index.html index.php;
#ssl_certificate /opt/opengnsys/ogcore/etc/certificates/ogcore.crt;
#ssl_certificate_key /opt/opengnsys/ogcore/etc/certificates/ogcore.key;
ssl_certificate /etc/nginx/certs/ogcore.uds-test.net.crt.pem;
ssl_certificate_key /etc/nginx/certs/ogcore.uds-test.net.key.pem;
location /.well-known/mercure {
proxy_pass https://mercure:3000/.well-known/mercure;
proxy_read_timeout 24h;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /opengnsys/rest/ous// {
rewrite ^/opengnsys/rest/ous//([0-9]+)/images /opengnsys/rest/ous/$1/images;
rewrite ^/opengnsys/rest/ous//([0-9]+)/labs /opengnsys/rest/ous/$1/labs;
@ -44,31 +53,4 @@ server {
error_log /var/log/nginx/error.log debug;
access_log /var/log/nginx/access.log;
#ssl_client_certificate /opt/opengnsys/ogcore/etc/certificates/ca.crt;
#ssl_verify_client on;
}
server {
listen 3000 ssl http2;
listen [::]:3000 ssl http2;
ssl_certificate /etc/nginx/certs/ogcore.uds-test.net.crt.pem;
ssl_certificate_key /etc/nginx/certs/ogcore.uds-test.net.key.pem;
location / {
proxy_pass http://ogcore-mercure:3000/;
proxy_read_timeout 24h;
proxy_http_version 1.1;
proxy_set_header Connection "";
# Enable fast reply in SSE
proxy_buffering off;
## Be sure to set USE_FORWARDED_HEADERS=1 to allow the hub to use those headers ##
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

View File

@ -1,305 +0,0 @@
# Integración RemotePC: UDS ↔ ogcore — Flujo y bugs corregidos
## Flujo de reserva de host
### Visión general
UDS actúa como broker de escritorios remotos. Cuando un usuario solicita una sesión, UDS llama a ogcore para reservar una máquina física, arrancarla en el SO correcto y notificar el login/logout.
### Endpoints implicados
| Método | Ruta | Descripción |
|--------|------|-------------|
| `POST` | `/opengnsys/rest/ous/{ouid}/images/{imageId}/reserve` | Reserva un cliente disponible |
| `POST` | `/opengnsys/rest/ous/{ouid}/labs/{labId}/clients/{clientId}/events` | Registra URLs de callback login/logout |
| `POST` | `/opengnsys/rest/ous/{ouid}/labs/{labId}/clients/{clientId}/session` | Define el tiempo máximo de sesión |
| `DELETE` | `/opengnsys/rest/ous/{ouid}/labs/{labId}/clients/{clientId}/unreserve` | Libera la reserva y apaga el cliente |
---
### Flujo detallado: `POST /reserve`
```
UDS → POST /reserve {labid, maxtime}
```
**1. Selección del cliente** (`ClientRepository::findBestAvailableClientForImage`)
La query busca el primer cliente que cumpla todos estos criterios:
- Pertenece a una OU bajo el path del centro (`ouid`)
- El laboratorio tiene `remotePc = true`
- Tiene una partición con la imagen solicitada donde `iir.remotePc = true`
- No está en mantenimiento
- No tiene reserva activa (`reservedUntil IS NULL` o ya expiró)
- Si se pasó `labId`, filtra además por laboratorio
- Ordena por `reservedUntil ASC` (prioriza el liberado hace más tiempo)
- Si no hay cliente disponible → HTTP 404
**2. Búsqueda de la partición**
Se itera sobre las particiones del cliente para encontrar la que contiene la imagen solicitada.
**3. Arranque del cliente** (`startClient`) — máximo 2s por llamada HTTP
Hay tres ramas según el estado actual del cliente:
| Estado del cliente | Acción |
|--------------------|--------|
| `OG_LIVE` | Envía `IniciarSesion` directamente al agente (`https://{ip}:8000/opengnsys/IniciarSesion`) con disco y partición. Si falla, crea traza LOGIN pendiente. |
| `OFF` / `TURNING_OFF` / `DISCONNECTED` / `null` | Envía Wake-on-LAN al ogrepository (`http://{repo}:8006/ogrepository/v1/wol`). Crea traza LOGIN pendiente para cuando arranque en OGLive. |
| Cualquier otro (Windows, Linux…) | Envía `Reiniciar` al agente (`https://{ip}:8000/opengnsys/Reiniciar`). Crea traza LOGIN pendiente. |
**4. Registro de la reserva**
- Se crea la entidad `RemotePC` si no existe
- Se fija `reservedUntil = ahora + maxTime horas`
- Se limpian `urlLogin` y `urlLogout`
- Se persiste en BD
**5. Respuesta a UDS**
```json
{ "id": 3, "name": "PC-01", "ip": "172.16.53.196", "mac": "00:1B:...", "lab": {"id": 2}, "ou": {"id": 1} }
```
---
### Flujo posterior al reserve
```
UDS → POST /events { urlLogin, urlLogout }
ogcore guarda las URLs de callback en RemotePC
Máquina arranca en OGLive
ogagent OGLive → POST /ogAdmClient/InclusionCliente
ogcore: status = OG_LIVE
Command processor (cron cada minuto)
Encuentra traza LOGIN PENDING
Cliente en OG_LIVE → llama LoginAction → envía IniciarSesion
Máquina arranca Windows/Linux
ogagent Windows/Linux → POST /ogagent/started
ogcore: status = WINDOWS (o LINUX)
Usuario hace login en el SO
ogagent → POST /ogagent/loggedin
ogcore llama urlLogin de UDS ← UDS sabe que la sesión está lista
UDS → POST /session { deadLine: N }
ogcore encola: popup-10, popup-5, poweroff en AgentQueue
Usuario hace logout
ogagent → POST /ogagent/loggedout
ogcore llama urlLogout de UDS
UDS → DELETE /unreserve
ogcore: limpia reserva, borra AgentQueue y trazas LOGIN PENDING, envía Apagar
```
---
## Bugs identificados y corregidos
### Bug 1 — ogagent: POST con body vacío devuelve 500 antes de ejecutar el handler
**Fichero:** `ogagent/src/opengnsys/httpserver.py`
**Problema:** `do_POST` intentaba parsear el body como JSON siempre. Cuando ogcore enviaba `Reiniciar` o `Apagar` sin body (`Content-Length: 0`), `json.loads("")` lanzaba `JSONDecodeError`. El método llamaba a `sendJsonError(500)` pero **sin `return`**, de modo que continuaba ejecutando `notifyMessage` y enviaba un segundo response 200. El cliente (ogcore) recibía el primero: el 500.
Síntoma visible en logs del agente Windows:
```
(do_POST) length: 0, content >><<
(log_message) HTTP "POST /opengnsys/Reiniciar HTTP/1.1" 500 - ← enviado primero
(process_Reiniciar) Received reboot operation
(log_message) HTTP "POST /opengnsys/Reiniciar HTTP/1.1" 200 - ← ignorado por ogcore
```
**Fix:**
```python
# antes
length = int(self.headers.get('content-length'))
content = self.rfile.read(length).decode('utf-8')
post_params = json.loads(content)
except Exception as e:
self.sendJsonError(500, exceptionToMessage(e))
# sin return → continuaba ejecutando notifyMessage
# después
length = int(self.headers.get('content-length', 0))
if length > 0:
content = self.rfile.read(length).decode('utf-8')
logger.debug('length: {0}, content >>{1}<<'.format(length, content))
post_params = json.loads(content)
else:
logger.debug('length: 0, content >><<')
except Exception as e:
self.sendJsonError(500, exceptionToMessage(e))
return # ← impide llamar a notifyMessage tras el error
```
---
### Bug 2 — ogcore: excepciones HTTP 5xx no capturadas en startClient / sendIniciarSesion
**Fichero:** `src/Controller/UDS/RemotePcController.php`
**Problema:** Los bloques `try/catch` solo capturaban `TransportExceptionInterface` (errores de red). Cuando el agente devolvía HTTP 500, Symfony lanzaba `ServerExceptionInterface` (subclase de `HttpExceptionInterface`), que no era capturada. La excepción escalaba hasta el handler global de Symfony, que devolvía un error Hydra 500 a UDS:
```json
{
"@type": "hydra:Error",
"hydra:description": "HTTP/1.0 500 Internal Server Error returned for \"https://172.16.53.196:8000/opengnsys/Reiniciar\"."
}
```
UDS interpretaba la reserva como fallida y llamaba a `unreserve` → `Apagar`.
**Fix:**
```php
// antes
} catch (TransportExceptionInterface $e) {
// después
} catch (TransportExceptionInterface | HttpExceptionInterface $e) {
```
Aplicado en `startClient` y `sendIniciarSesion`.
---
### Bug 3 — ogcore: sin timeout en llamadas HTTP al agente → UDS recibe read timeout
**Fichero:** `src/Controller/UDS/RemotePcController.php`
**Problema:** Las llamadas HTTP a `IniciarSesion`, `Reiniciar`, WoL y `Apagar` no tenían timeout. Para `NativeHttpClient` (modo síncrono), `request()` bloqueaba hasta recibir respuesta o agotar el socket timeout del sistema. Se observó que `Apagar` bloqueó 35 segundos:
```
21:38:47 Request: "POST .../Apagar"
21:39:23 WARNING: poweroff failed ← 35 segundos después
```
UDS tiene un read timeout de 10 segundos, por lo que siempre agotaba el tiempo de espera. Esto provocaba que UDS llamase a `unreserve` inmediatamente después de un `reserve` aparentemente exitoso.
**Referencia:** El código antiguo (`opengnsys/admin/WebConsole/includes/restfunctions.php`) usaba `multiRequest()` con `CURLOPT_TIMEOUT_MS => 500`.
**Fix:** Añadir `timeout: 2.0` y `->getStatusCode()` en todas las llamadas. El `getStatusCode()` es necesario para forzar la resolución de la respuesta en clientes async (`CurlHttpClient`), ya que sin él el timeout nunca se aplica:
```php
$this->httpClient->request('POST', 'https://' . $client->getIp() . ':8000/opengnsys/IniciarSesion', [
'verify_host' => false,
'timeout' => 2.0,
'json' => [...],
'headers' => ['Authorization' => $client->getToken()],
])->getStatusCode();
```
Aplicado en: `sendIniciarSesion`, `startClient` (Reiniciar y WoL) y `sendPowerOff`.
---
### Bug 4 — ogcore: executeLogin no encontraba la partición (mismatch de formato)
**Fichero:** `src/Command/ExecutePendingTracesCommand.php`
**Problema:** `RemotePcController::startClient` creaba las trazas LOGIN con `{dsk: N, par: N}` (números de disco/partición). `ExecutePendingTracesCommand::executeLogin` esperaba `{partition: UUID}`. El mismatch causaba el error:
```json
{"error": "Partition not found in trace input", "input": {"dsk": 1, "par": 1}}
```
La traza fallaba e `IniciarSesion` nunca se enviaba cuando la máquina llegaba a OGLive.
**Fix:** Soportar ambos formatos en `executeLogin`:
```php
if (isset($input['partition'])) {
$partition = $repo->findOneBy(['uuid' => $input['partition']]);
} elseif (isset($input['dsk']) && isset($input['par'])) {
$partition = $repo->findOneBy([
'client' => $client,
'diskNumber' => $input['dsk'],
'partitionNumber' => $input['par'],
]);
} else {
throw new \Exception("Partition not found in trace input");
}
```
---
### Bug 5 — ogcore: LoginAction creaba trazas de retry con input vacío
**Fichero:** `src/Controller/OgAgent/LoginAction.php`
**Problema:** Cuando el cliente no estaba en `OG_LIVE` o `IniciarSesion` fallaba, `LoginAction` creaba nuevas trazas PENDING con input `[]` vacío:
```php
$this->createService->__invoke($client, CommandTypes::LOGIN, TraceStatus::PENDING, null, []);
```
Estas trazas eran recogidas por el command processor y fallaban con "Partition not found in trace input" (Bug 4).
**Fix:** Propagar la información de partición a las trazas de retry:
```php
$partitionInput = [
'dsk' => $partition->getDiskNumber(),
'par' => $partition->getPartitionNumber(),
];
$this->createService->__invoke($client, CommandTypes::LOGIN, TraceStatus::PENDING, null, $partitionInput);
```
---
### Bug 6 — ogcore: bucle infinito de trazas LOGIN cuando el cliente está apagado
**Ficheros:** `src/Command/ExecutePendingTracesCommand.php` y `src/Controller/UDS/RemotePcController.php`
**Problema:** Cuando el cliente estaba en estado `off` o `windows`:
1. El command processor encontraba una traza LOGIN PENDING
2. Llamaba a `loginAction->__invoke`
3. `LoginAction` detectaba que el cliente no estaba en OG_LIVE, creaba **otra traza LOGIN PENDING** y devolvía 200
4. `executeLogin` marcaba la traza original como `SUCCESS`
5. La nueva traza era recogida el siguiente minuto → vuelta al paso 2
Adicionalmente, al hacer `unreserve` las trazas LOGIN PENDING del cliente no se eliminaban. El código antiguo sí borraba los comandos pendientes de la tabla `acciones`:
```sql
DELETE FROM acciones
WHERE idordenador = '$clntid'
AND descriaccion = 'RemotePC Session';
```
El nuevo ogcore no tenía equivalente, por lo que las trazas LOGIN sobrevivían al unreserve y seguían ejecutándose.
Síntoma observable: la máquina entraba en bucle continuo de reinicios.
**Fix A — executeLogin espera a que el cliente esté en OG_LIVE:**
```php
if ($client->getStatus() !== ClientStatus::OG_LIVE) {
$this->logger->info('Login trace deferred: client not in OGLive', [
'client' => $client->getUuid(),
'status' => $client->getStatus(),
]);
return false; // la traza queda PENDING hasta que el cliente esté en OGLive
}
```
**Fix B — unreserve elimina las trazas LOGIN pendientes:**
```php
$this->entityManager->createQuery(
'DELETE FROM App\Entity\Trace t
WHERE t.client = :client
AND t.command = :command
AND t.status = :status'
)
->setParameter('client', $client)
->setParameter('command', CommandTypes::LOGIN)
->setParameter('status', TraceStatus::PENDING)
->execute();
```
---
## Resumen de ficheros modificados
| Repositorio | Fichero | Bugs corregidos |
|-------------|---------|-----------------|
| `ogagent` | `src/opengnsys/httpserver.py` | #1 |
| `ogcore` | `src/Controller/UDS/RemotePcController.php` | #2, #3, #6B |
| `ogcore` | `src/Controller/OgAgent/LoginAction.php` | #5 |
| `ogcore` | `src/Command/ExecutePendingTracesCommand.php` | #4, #6A |

View File

@ -1,16 +1,12 @@
{
"vars": {
"OG_DHCP_API_URL": "127.0.0.1:8081",
"OG_CORE_IP": "127.0.0.1",
"OG_LOG_IP": "127.0.0.1",
"OG_BOOT_API_URL": "192.168.68.51:8082",
"OG_DHCP_API_URL": "192.168.68.51:8081",
"OG_CORE_IP": "192.168.68.62",
"OG_LOG_IP": "192.168.68.51",
"UDS_AUTH_LOGIN": "test",
"UDS_AUTH_USERNAME": "test",
"UDS_AUTH_PASSWORD": "test",
"UDS_URL": "https:\/\/localhost:8087\/uds\/rest\/",
"SSL_ENABLED": "false",
"OG_BOOT_IP": "127.0.0.1",
"OG_BOOT_API_PORT": "8082",
"OG_BOOT_PXE_PORT": "8082",
"OGCLIENT_API_KEY": "ogclient-super-secret-token"
"UDS_URL": "https:\/\/localhost:8087\/uds\/rest\/"
}
}

View File

@ -1,30 +0,0 @@
#!/bin/bash
# Syncs journal-pull@ systemd instances with /etc/opengnsys/journal-pull-sources.conf.
# Triggered by journal-pull-sync.path whenever the config file changes.
set -euo pipefail
CONF=/opt/opengnsys/ogcore/etc/journal-pull-sources.conf
[[ -f "$CONF" ]] || exit 0
mapfile -t WANTED < <(grep -v '^\s*#' "$CONF" | grep -v '^\s*$' | sort -u)
mapfile -t CURRENT < <(
systemctl list-units 'journal-pull@*.service' --all --plain --no-legend \
| awk '{print $1}' | sed 's/journal-pull@//;s/\.service//' | sort -u
)
for ip in "${WANTED[@]:-}"; do
[[ -z "$ip" ]] && continue
if ! printf '%s\n' "${CURRENT[@]:-}" | grep -qxF "$ip"; then
systemctl enable --now "journal-pull@${ip}.service"
echo "journal-pull-sync: enabled journal-pull@${ip}"
fi
done
for ip in "${CURRENT[@]:-}"; do
[[ -z "$ip" ]] && continue
if ! printf '%s\n' "${WANTED[@]:-}" | grep -qxF "$ip"; then
systemctl disable --now "journal-pull@${ip}.service"
echo "journal-pull-sync: disabled journal-pull@${ip}"
fi
done

View File

@ -1,4 +0,0 @@
*/2 * * * * opengnsys php -d memory_limit=512M /opt/opengnsys/ogcore/api/bin/console opengnsys:check-client-availability>> /opt/opengnsys/ogcore/api/var/log/cron.log 2>&1
*/1 * * * * opengnsys php -d memory_limit=512M /opt/opengnsys/ogcore/api/bin/console opengnsys:run-scheduled-command-tasks>> /opt/opengnsys/ogcore/api/var/log/cron.log 2>&1
*/1 * * * * opengnsys php -d memory_limit=512M /opt/opengnsys/ogcore/api/bin/console opengnsys:execute-pending-traces>> /opt/opengnsys/ogcore/api/var/log/cron.log 2>&1

View File

@ -1,9 +0,0 @@
/var/log/ogclients/*/*.log {
daily
rotate 10
compress
missingok
copytruncate
dateext
delaycompress
}

View File

@ -1,4 +1,4 @@
SERVER_NAME=":3001"
SERVER_NAME=":3000"
MERCURE_PUBLISHER_JWT_KEY="!ChangeThisMercureHubJWTSecretKey!"
MERCURE_SUBSCRIBER_JWT_KEY="!ChangeThisMercureHubJWTSecretKey!"
MERCURE_EXTRA_DIRECTIVES="cors_origins *"

View File

@ -1,23 +0,0 @@
server {
listen 3000 ssl http2;
listen [::]:3000 ssl http2;
ssl_certificate /opt/opengnsys/ogcore/etc/nginx/certs/ogcore.uds-test.net.crt.pem;
ssl_certificate_key /opt/opengnsys/ogcore/etc/nginx/certs/ogcore.uds-test.net.key.pem;
location / {
proxy_pass http://localhost:3001/;
proxy_read_timeout 24h;
proxy_http_version 1.1;
proxy_set_header Connection "";
# Enable fast reply in SSE
proxy_buffering off;
## Be sure to set USE_FORWARDED_HEADERS=1 to allow the hub to use those headers ##
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

View File

@ -7,16 +7,6 @@ server {
ssl_certificate /opt/opengnsys/ogcore/etc/nginx/certs/ogcore.uds-test.net.crt.pem;
ssl_certificate_key /opt/opengnsys/ogcore/etc/nginx/certs/ogcore.uds-test.net.key.pem;
location ~ ^/pcclients/([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)(/.*)?$ {
set $target_ip $1;
set $rest $2;
proxy_pass http://$target_ip$rest;
proxy_set_header Host $target_ip;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /opengnsys/rest/ous// {
rewrite ^/opengnsys/rest/ous//([0-9]+)/images /opengnsys/rest/ous/$1/images;
rewrite ^/opengnsys/rest/ous//([0-9]+)/labs /opengnsys/rest/ous/$1/labs;
@ -41,6 +31,7 @@ server {
location ~ \.php$ {
return 404;
}
error_log /var/log/nginx/ogcore-error.log;
access_log /var/log/nginx/ogcore-access.log;
}
}

View File

@ -1,8 +0,0 @@
[Unit]
Description=Watch journal-pull sources config
[Path]
PathModified=/opt/opengnsys/ogcore/etc/journal-pull-sources.conf
[Install]
WantedBy=multi-user.target

View File

@ -1,7 +0,0 @@
[Unit]
Description=Sync journal-pull instances from config
After=network-online.target
[Service]
Type=oneshot
ExecStart=/opt/opengnsys/ogcore/etc/bin/journal-pull-sync.sh

View File

@ -1,15 +0,0 @@
[Unit]
Description=Pull OpenGNSYS journal from %i
After=network-online.target
Wants=network-online.target
[Service]
User=systemd-journal-remote
Group=systemd-journal-remote
ExecStartPre=/bin/mkdir -p /var/log/journal/remote/%i
ExecStart=/usr/lib/systemd/systemd-journal-remote --url=http://%i:19531/entries?boot=0&SYSLOG_IDENTIFIER=ogcore&SYSLOG_IDENTIFIER=oggui&SYSLOG_IDENTIFIER=ogdhcp&SYSLOG_IDENTIFIER=ogboot&SYSLOG_IDENTIFIER=ogrepo-api&SYSLOG_IDENTIFIER=ogrepo-api_DEBUG&SYSLOG_IDENTIFIER=kea-dhcp4&SYSLOG_IDENTIFIER=kea-ctrl-agent&SYSLOG_IDENTIFIER=DhcpLFC&SYSLOG_IDENTIFIER=kea-dhcp6&SYSLOG_IDENTIFIER=tftpd-hpa&SYSLOG_IDENTIFIER=%%28smbd%%29&SYSLOG_IDENTIFIER=%%28nmbd%%29 --split-mode=host --output=/var/log/journal/remote/%i/
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target

View File

@ -1 +0,0 @@

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250325075647 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE client ADD firmware_type VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE client DROP firmware_type');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250326061450 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command ADD parameters TINYINT(1) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command DROP parameters');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250331144522 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_image_repository ADD datasize VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_image_repository DROP datasize');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250402060324 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image ADD version INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image DROP version');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250402081107 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX UNIQ_IDENTIFIER_IMAGE_REPOSITORY ON image_image_repository');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_IMAGE_REPOSITORY ON image_image_repository (image_id, repository_id)');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250402094550 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_image_repository ADD version INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_image_repository DROP version');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250407063100 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_image_repository ADD description VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_image_repository DROP description');
}
}

View File

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250407154425 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE INDEX IDX_STATUS ON client (status)');
$this->addSql('CREATE INDEX IDX_UPDATED_AT ON client (updated_at)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX IDX_STATUS ON client');
$this->addSql('DROP INDEX IDX_UPDATED_AT ON client');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250407154620 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE INDEX IDX_STATUS_UPDATED_AT ON client (status, updated_at)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX IDX_STATUS_UPDATED_AT ON client');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250408140101 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_repository ADD user VARCHAR(255) DEFAULT NULL, ADD ssh_port VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_repository DROP user, DROP ssh_port');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250409093554 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_image_repository ADD name VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_image_repository DROP name');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250421122715 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task ADD parameters LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task DROP parameters');
}
}

View File

@ -1,35 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250422092348 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE network_settings ADD pxe_template_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE network_settings ADD CONSTRAINT FK_48869B543BD7665C FOREIGN KEY (pxe_template_id) REFERENCES pxe_template (id)');
$this->addSql('CREATE INDEX IDX_48869B543BD7665C ON network_settings (pxe_template_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE network_settings DROP FOREIGN KEY FK_48869B543BD7665C');
$this->addSql('DROP INDEX IDX_48869B543BD7665C ON network_settings');
$this->addSql('ALTER TABLE network_settings DROP pxe_template_id');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250422140927 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task ADD name VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task DROP name');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250423070720 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task DROP datetime');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task ADD datetime DATETIME NOT NULL');
}
}

View File

@ -1,35 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250423071243 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task ADD organizational_unit_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE command_task ADD CONSTRAINT FK_F3D475A8FB84408A FOREIGN KEY (organizational_unit_id) REFERENCES organizational_unit (id)');
$this->addSql('CREATE INDEX IDX_F3D475A8FB84408A ON command_task (organizational_unit_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task DROP FOREIGN KEY FK_F3D475A8FB84408A');
$this->addSql('DROP INDEX IDX_F3D475A8FB84408A ON command_task');
$this->addSql('ALTER TABLE command_task DROP organizational_unit_id');
}
}

View File

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250423092037 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE command_task_schedule (id INT AUTO_INCREMENT NOT NULL, command_task_id INT NOT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', migration_id VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, recurrence_type VARCHAR(255) NOT NULL, start_time DATETIME NOT NULL, recurrence_details JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', UNIQUE INDEX UNIQ_3BEA77AD17F50A6 (uuid), INDEX IDX_3BEA77A62DC5265 (command_task_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE command_task_schedule ADD CONSTRAINT FK_3BEA77A62DC5265 FOREIGN KEY (command_task_id) REFERENCES command_task (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_schedule DROP FOREIGN KEY FK_3BEA77A62DC5265');
$this->addSql('DROP TABLE command_task_schedule');
}
}

View File

@ -1,45 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250427110103 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE command_task_scripts (id INT AUTO_INCREMENT NOT NULL, command_task_id INT NOT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', migration_id VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, content VARCHAR(255) NOT NULL, execution_order INT NOT NULL, UNIQUE INDEX UNIQ_E8950142D17F50A6 (uuid), INDEX IDX_E895014262DC5265 (command_task_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE command_task_scripts ADD CONSTRAINT FK_E895014262DC5265 FOREIGN KEY (command_task_id) REFERENCES command_task (id)');
$this->addSql('ALTER TABLE command_task_command_group DROP FOREIGN KEY FK_C43618BD62DC5265');
$this->addSql('ALTER TABLE command_task_command_group DROP FOREIGN KEY FK_C43618BDC7B800D6');
$this->addSql('ALTER TABLE command_task_command DROP FOREIGN KEY FK_BB417CA862DC5265');
$this->addSql('ALTER TABLE command_task_command DROP FOREIGN KEY FK_BB417CA833E1689A');
$this->addSql('DROP TABLE command_task_command_group');
$this->addSql('DROP TABLE command_task_command');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE command_task_command_group (command_task_id INT NOT NULL, command_group_id INT NOT NULL, INDEX IDX_C43618BD62DC5265 (command_task_id), INDEX IDX_C43618BDC7B800D6 (command_group_id), PRIMARY KEY(command_task_id, command_group_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE command_task_command (command_task_id INT NOT NULL, command_id INT NOT NULL, INDEX IDX_BB417CA862DC5265 (command_task_id), INDEX IDX_BB417CA833E1689A (command_id), PRIMARY KEY(command_task_id, command_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE command_task_command_group ADD CONSTRAINT FK_C43618BD62DC5265 FOREIGN KEY (command_task_id) REFERENCES command_task (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE command_task_command_group ADD CONSTRAINT FK_C43618BDC7B800D6 FOREIGN KEY (command_group_id) REFERENCES command_group (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE command_task_command ADD CONSTRAINT FK_BB417CA862DC5265 FOREIGN KEY (command_task_id) REFERENCES command_task (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE command_task_command ADD CONSTRAINT FK_BB417CA833E1689A FOREIGN KEY (command_id) REFERENCES command (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE command_task_scripts DROP FOREIGN KEY FK_E895014262DC5265');
$this->addSql('DROP TABLE command_task_scripts');
}
}

View File

@ -1,37 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250427125746 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE command_task_script (id INT AUTO_INCREMENT NOT NULL, command_task_id INT NOT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', migration_id VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, content VARCHAR(255) NOT NULL, execution_order INT NOT NULL, UNIQUE INDEX UNIQ_22BF0112D17F50A6 (uuid), INDEX IDX_22BF011262DC5265 (command_task_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE command_task_script ADD CONSTRAINT FK_22BF011262DC5265 FOREIGN KEY (command_task_id) REFERENCES command_task (id)');
$this->addSql('ALTER TABLE command_task_scripts DROP FOREIGN KEY FK_E895014262DC5265');
$this->addSql('DROP TABLE command_task_scripts');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE command_task_scripts (id INT AUTO_INCREMENT NOT NULL, command_task_id INT NOT NULL, uuid CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:uuid)\', migration_id VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, created_by VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, updated_by VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, content VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, execution_order INT NOT NULL, INDEX IDX_E895014262DC5265 (command_task_id), UNIQUE INDEX UNIQ_E8950142D17F50A6 (uuid), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE command_task_scripts ADD CONSTRAINT FK_E895014262DC5265 FOREIGN KEY (command_task_id) REFERENCES command_task (id)');
$this->addSql('ALTER TABLE command_task_script DROP FOREIGN KEY FK_22BF011262DC5265');
$this->addSql('DROP TABLE command_task_script');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250428065311 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_schedule ADD execution_date DATE NOT NULL, ADD execution_time TIME NOT NULL, DROP start_time');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_schedule ADD start_time DATETIME NOT NULL, DROP execution_date, DROP execution_time');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250428065937 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_schedule ADD enabled TINYINT(1) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_schedule DROP enabled');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250428070851 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_schedule CHANGE execution_date execution_date DATE DEFAULT NULL, CHANGE execution_time execution_time TIME DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_schedule CHANGE execution_date execution_date DATE NOT NULL, CHANGE execution_time execution_time TIME NOT NULL');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250429065612 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task ADD last_execution DATETIME DEFAULT NULL, ADD next_execution 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 command_task DROP last_execution, DROP next_execution');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250429091808 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task ADD scope VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task DROP scope');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250430052434 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_script ADD type VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_script DROP type');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250430053742 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_script ADD parameters LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_script DROP parameters');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250430054513 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_script CHANGE content content VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task_script CHANGE content content VARCHAR(255) NOT NULL');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250430094459 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task DROP status');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE command_task ADD status VARCHAR(255) NOT NULL');
}
}

View File

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250430135412 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE git_image_repository (id INT AUTO_INCREMENT NOT NULL, image_id INT NOT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', migration_id VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, status VARCHAR(255) NOT NULL, branch VARCHAR(255) NOT NULL, created TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_E6944D5ED17F50A6 (uuid), INDEX IDX_E6944D5E3DA5256D (image_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE git_image_repository ADD CONSTRAINT FK_E6944D5E3DA5256D FOREIGN KEY (image_id) REFERENCES image (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository DROP FOREIGN KEY FK_E6944D5E3DA5256D');
$this->addSql('DROP TABLE git_image_repository');
}
}

View File

@ -1,35 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250430140218 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository ADD image_repository_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE git_image_repository ADD CONSTRAINT FK_E6944D5E14C736FC FOREIGN KEY (image_repository_id) REFERENCES image_repository (id)');
$this->addSql('CREATE INDEX IDX_E6944D5E14C736FC ON git_image_repository (image_repository_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository DROP FOREIGN KEY FK_E6944D5E14C736FC');
$this->addSql('DROP INDEX IDX_E6944D5E14C736FC ON git_image_repository');
$this->addSql('ALTER TABLE git_image_repository DROP image_repository_id');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250430140326 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository ADD name VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository DROP name');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250506094654 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE pxe_template ADD is_default TINYINT(1) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE pxe_template DROP is_default');
}
}

View File

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250506141057 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE client DROP FOREIGN KEY FK_C74404555DA0FB8');
$this->addSql('ALTER TABLE client ADD CONSTRAINT FK_C74404555DA0FB8 FOREIGN KEY (template_id) REFERENCES pxe_template (id) ON DELETE SET NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE client DROP FOREIGN KEY FK_C74404555DA0FB8');
$this->addSql('ALTER TABLE client ADD CONSTRAINT FK_C74404555DA0FB8 FOREIGN KEY (template_id) REFERENCES pxe_template (id)');
}
}

View File

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250508134732 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE `partition` DROP FOREIGN KEY FK_9EB910E43DA5256D');
$this->addSql('ALTER TABLE `partition` ADD CONSTRAINT FK_9EB910E43DA5256D FOREIGN KEY (image_id) REFERENCES image_image_repository (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE `partition` DROP FOREIGN KEY FK_9EB910E43DA5256D');
$this->addSql('ALTER TABLE `partition` ADD CONSTRAINT FK_9EB910E43DA5256D FOREIGN KEY (image_id) REFERENCES image (id)');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250508152437 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image ADD type VARCHAR(255) NOT NULL, DROP description, DROP comments');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image ADD description VARCHAR(255) DEFAULT NULL, ADD comments VARCHAR(255) DEFAULT NULL, DROP type');
}
}

View File

@ -1,39 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250512071804 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository DROP FOREIGN KEY FK_E6944D5E14C736FC');
$this->addSql('DROP INDEX IDX_E6944D5E14C736FC ON git_image_repository');
$this->addSql('ALTER TABLE git_image_repository ADD tag VARCHAR(255) NOT NULL, CHANGE image_repository_id repository_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE git_image_repository ADD CONSTRAINT FK_E6944D5E50C9D4F7 FOREIGN KEY (repository_id) REFERENCES image_repository (id)');
$this->addSql('CREATE INDEX IDX_E6944D5E50C9D4F7 ON git_image_repository (repository_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository DROP FOREIGN KEY FK_E6944D5E50C9D4F7');
$this->addSql('DROP INDEX IDX_E6944D5E50C9D4F7 ON git_image_repository');
$this->addSql('ALTER TABLE git_image_repository DROP tag, CHANGE repository_id image_repository_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE git_image_repository ADD CONSTRAINT FK_E6944D5E14C736FC FOREIGN KEY (image_repository_id) REFERENCES image_repository (id)');
$this->addSql('CREATE INDEX IDX_E6944D5E14C736FC ON git_image_repository (image_repository_id)');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250512075927 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository CHANGE branch branch VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository CHANGE branch branch VARCHAR(255) NOT NULL');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250512081045 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository ADD version INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository DROP version');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250513050921 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository ADD description VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository DROP description');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250513055057 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_image_repository ADD partition_info VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image_image_repository DROP partition_info');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250514051344 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE client ADD token VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE client DROP token');
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250514101117 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_NAME ON command (name)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX UNIQ_IDENTIFIER_NAME ON command');
}
}

View File

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250604084222 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE `partition` DROP FOREIGN KEY FK_9EB910E43DA5256D');
$this->addSql('ALTER TABLE `partition` ADD CONSTRAINT FK_9EB910E43DA5256D FOREIGN KEY (image_id) REFERENCES image_image_repository (id) ON DELETE SET 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 FOREIGN KEY FK_9EB910E43DA5256D');
$this->addSql('ALTER TABLE `partition` ADD CONSTRAINT FK_9EB910E43DA5256D FOREIGN KEY (image_id) REFERENCES image_image_repository (id)');
}
}

View File

@ -1,37 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250618114502 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE git_repository (id INT AUTO_INCREMENT NOT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', migration_id VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_C2B3204AD17F50A6 (uuid), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE git_image_repository ADD git_repository_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE git_image_repository ADD CONSTRAINT FK_E6944D5EDCA00B70 FOREIGN KEY (git_repository_id) REFERENCES git_repository (id)');
$this->addSql('CREATE INDEX IDX_E6944D5EDCA00B70 ON git_image_repository (git_repository_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository DROP FOREIGN KEY FK_E6944D5EDCA00B70');
$this->addSql('DROP TABLE git_repository');
$this->addSql('DROP INDEX IDX_E6944D5EDCA00B70 ON git_image_repository');
$this->addSql('ALTER TABLE git_image_repository DROP git_repository_id');
}
}

View File

@ -1,35 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250618115400 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_repository ADD repository_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE git_repository ADD CONSTRAINT FK_C2B3204A50C9D4F7 FOREIGN KEY (repository_id) REFERENCES image_repository (id)');
$this->addSql('CREATE INDEX IDX_C2B3204A50C9D4F7 ON git_repository (repository_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_repository DROP FOREIGN KEY FK_C2B3204A50C9D4F7');
$this->addSql('DROP INDEX IDX_C2B3204A50C9D4F7 ON git_repository');
$this->addSql('ALTER TABLE git_repository DROP repository_id');
}
}

View File

@ -1,37 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250626145458 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_image_repository DROP FOREIGN KEY FK_E6944D5EDCA00B70');
$this->addSql('ALTER TABLE git_image_repository DROP FOREIGN KEY FK_E6944D5E3DA5256D');
$this->addSql('ALTER TABLE git_image_repository DROP FOREIGN KEY FK_E6944D5E50C9D4F7');
$this->addSql('DROP TABLE git_image_repository');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE git_image_repository (id INT AUTO_INCREMENT NOT NULL, image_id INT NOT NULL, repository_id INT DEFAULT NULL, git_repository_id INT DEFAULT NULL, uuid CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:uuid)\', migration_id VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, created_by VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, updated_by VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, status VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, branch VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, created TINYINT(1) NOT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, tag VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, version INT DEFAULT NULL, description VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, UNIQUE INDEX UNIQ_E6944D5ED17F50A6 (uuid), INDEX IDX_E6944D5E3DA5256D (image_id), INDEX IDX_E6944D5E50C9D4F7 (repository_id), INDEX IDX_E6944D5EDCA00B70 (git_repository_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE git_image_repository ADD CONSTRAINT FK_E6944D5EDCA00B70 FOREIGN KEY (git_repository_id) REFERENCES git_repository (id)');
$this->addSql('ALTER TABLE git_image_repository ADD CONSTRAINT FK_E6944D5E3DA5256D FOREIGN KEY (image_id) REFERENCES image (id)');
$this->addSql('ALTER TABLE git_image_repository ADD CONSTRAINT FK_E6944D5E50C9D4F7 FOREIGN KEY (repository_id) REFERENCES image_repository (id)');
}
}

View File

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250825085920 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image DROP FOREIGN KEY FK_C53D045F19EB6921');
$this->addSql('ALTER TABLE image ADD CONSTRAINT FK_C53D045F19EB6921 FOREIGN KEY (client_id) REFERENCES client (id) ON DELETE SET NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image DROP FOREIGN KEY FK_C53D045F19EB6921');
$this->addSql('ALTER TABLE image ADD CONSTRAINT FK_C53D045F19EB6921 FOREIGN KEY (client_id) REFERENCES client (id)');
}
}

View File

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250825095853 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_IP ON image_repository (ip)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_NAME ON image_repository (name)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX UNIQ_IDENTIFIER_IP ON image_repository');
$this->addSql('DROP INDEX UNIQ_IDENTIFIER_NAME ON image_repository');
}
}

View File

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250915162242 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_repository DROP FOREIGN KEY FK_C2B3204A50C9D4F7');
$this->addSql('ALTER TABLE git_repository ADD CONSTRAINT FK_C2B3204A50C9D4F7 FOREIGN KEY (repository_id) REFERENCES image_repository (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE git_repository DROP FOREIGN KEY FK_C2B3204A50C9D4F7');
$this->addSql('ALTER TABLE git_repository ADD CONSTRAINT FK_C2B3204A50C9D4F7 FOREIGN KEY (repository_id) REFERENCES image_repository (id)');
}
}

View File

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250915162434 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE network_settings DROP FOREIGN KEY FK_48869B5450C9D4F7');
$this->addSql('ALTER TABLE network_settings ADD CONSTRAINT FK_48869B5450C9D4F7 FOREIGN KEY (repository_id) REFERENCES image_repository (id) ON DELETE SET NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE network_settings DROP FOREIGN KEY FK_48869B5450C9D4F7');
$this->addSql('ALTER TABLE network_settings ADD CONSTRAINT FK_48869B5450C9D4F7 FOREIGN KEY (repository_id) REFERENCES image_repository (id)');
}
}

Some files were not shown because too many files have changed in this diff Show More