refs #401 deletes innecesaries directories

pull/3/head
Luis Gerardo Romero Garcia 2024-07-15 11:23:47 +02:00
parent 6b47c4be93
commit 8b4b204c71
24 changed files with 0 additions and 1193 deletions

View File

@ -1,6 +0,0 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots

View File

@ -1,130 +0,0 @@
TFTPSERV=tftp
TFTPCFGDIR=/var/lib/tftpboot
function createDirs()
{
if [ $# -ne 1 ]; then
errorAndLog "${FUNCNAME}(): invalid number of parameters"
exit 1
fi
local path_ogboot_base="$1"
# Crear estructura de directorios.
echoAndLog "${FUNCNAME}(): creating directory paths in $path_ogboot_base"
mkdir -p $path_ogboot_base
mkdir -p $path_ogboot_base/bin
mkdir -p $path_ogboot_base/client/{cache,images,log}
mkdir -p $path_ogboot_base/doc
mkdir -p $path_ogboot_base/etc
mkdir -p $path_ogboot_base/lib
mkdir -p $path_ogboot_base/log/clients
ln -fs $path_ogboot_base/log /var/log/ogboot
mkdir -p $TFTPCFGDIR
ln -fs $TFTPCFGDIR $path_ogboot_base/tftpboot
mkdir -p $path_ogboot_base/tftpboot/{menu.lst,grub}
if [ $? -ne 0 ]; then
errorAndLog "${FUNCNAME}(): error while creating dirs. Do you have write permissions?"
return 1
fi
# Crear usuario ficticio.
if id -u $OPENGNSYS_CLIENT_USER &>/dev/null; then
echoAndLog "${FUNCNAME}(): user \"$OPENGNSYS_CLIENT_USER\" is already created"
else
echoAndLog "${FUNCNAME}(): creating OpenGnsys user"
useradd $OPENGNSYS_CLIENT_USER 2>/dev/null
if [ $? -ne 0 ]; then
errorAndLog "${FUNCNAME}(): error creating OpenGnsys user"
return 1
fi
fi
# Mover el fichero de registro de instalación al directorio de logs.
echoAndLog "${FUNCNAME}(): moving installation log file"
mv $LOG_FILE $OGLOGFILE && LOG_FILE=$OGLOGFILE
chmod 600 $LOG_FILE
echoAndLog "${FUNCNAME}(): directory paths created"
return 0
}
# Copia ficheros de configuración y ejecutables genéricos del servidor.
function copyServerFiles ()
{
if [ $# -ne 1 ]; then
errorAndLog "${FUNCNAME}(): invalid number of parameters"
exit 1
fi
local path_ogboot_base="$1"
# Lista de ficheros y directorios origen y de directorios destino.
local SOURCES=( server/tftpboot \
/usr/lib/shim/shimx64.efi.signed \
/usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed \
)
local TARGETS=( tftpboot \
tftpboot \
tftpboot/grubx64.efi \
)
if [ ${#SOURCES[@]} != ${#TARGETS[@]} ]; then
errorAndLog "${FUNCNAME}(): inconsistent number of array items"
exit 1
fi
# Copiar ficheros.
echoAndLog "${FUNCNAME}(): copying files to server directories"
pushd $WORKDIR/ogboot
local i
for (( i = 0; i < ${#SOURCES[@]}; i++ )); do
if [ -f "${SOURCES[$i]}" ]; then
echoAndLog "Copying ${SOURCES[$i]} to $path_ogboot_base/${TARGETS[$i]}"
cp -a "${SOURCES[$i]}" "${path_ogboot_base}/${TARGETS[$i]}"
elif [ -d "${SOURCES[$i]}" ]; then
echoAndLog "Copying content of ${SOURCES[$i]} to $path_ogboot_base/${TARGETS[$i]}"
cp -a "${SOURCES[$i]}"/* "${path_ogboot_base}/${TARGETS[$i]}"
else
warningAndLog "Unable to copy ${SOURCES[$i]} to $path_ogboot_base/${TARGETS[$i]}"
fi
done
popd
}
############################################################
### Esqueleto para el Servicio pxe y contenedor tftpboot ###
############################################################
function tftpConfigure()
{
echoAndLog "${FUNCNAME}(): Configuring TFTP service."
# Habilitar TFTP y reiniciar Inetd.
if [ -n "$TFTPSERV" ]; then
if [ -f $INETDCFGDIR/$TFTPSERV ]; then
perl -pi -e 's/disable.*/disable = no/' $INETDCFGDIR/$TFTPSERV
else
service=$TFTPSERV
$ENABLESERVICE; $STARTSERVICE
fi
fi
service=$INETDSERV
$ENABLESERVICE; $STARTSERVICE
# comprobamos el servicio tftp
sleep 1
testPxe
}
# Comprueba que haya conexión al servicio TFTP/PXE.
function testPxe ()
{
echoAndLog "${FUNCNAME}(): Checking TFTP service... please wait."
echo "test" >$TFTPCFGDIR/testpxe
tftp -v 127.0.0.1 -c get testpxe /tmp/testpxe && echoAndLog "TFTP service is OK." || errorAndLog "TFTP service is down."
rm -f $TFTPCFGDIR/testpxe /tmp/testpxe
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

View File

@ -1,16 +0,0 @@
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
body {
margin: 0;
background: #fafafa;
}

View File

@ -1,19 +0,0 @@
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
<link rel="stylesheet" type="text/css" href="index.css" />
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
<script src="./swagger-initializer.js" charset="UTF-8"> </script>
</body>
</html>

View File

@ -1,9 +0,0 @@
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};

View File

@ -1,79 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<title>Swagger UI: OAuth2 Redirect</title>
</head>
<body>
<script>
'use strict';
function run () {
var oauth2 = window.opener.swaggerUIRedirectOauth2;
var sentState = oauth2.state;
var redirectUrl = oauth2.redirectUrl;
var isValid, qp, arr;
if (/code|token|error/.test(window.location.hash)) {
qp = window.location.hash.substring(1).replace('?', '&');
} else {
qp = location.search.substring(1);
}
arr = qp.split("&");
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
qp = qp ? JSON.parse('{' + arr.join() + '}',
function (key, value) {
return key === "" ? value : decodeURIComponent(value);
}
) : {};
isValid = qp.state === sentState;
if ((
oauth2.auth.schema.get("flow") === "accessCode" ||
oauth2.auth.schema.get("flow") === "authorizationCode" ||
oauth2.auth.schema.get("flow") === "authorization_code"
) && !oauth2.auth.code) {
if (!isValid) {
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "warning",
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
});
}
if (qp.code) {
delete oauth2.state;
oauth2.auth.code = qp.code;
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
} else {
let oauthErrorMsg;
if (qp.error) {
oauthErrorMsg = "["+qp.error+"]: " +
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
(qp.error_uri ? "More info: "+qp.error_uri : "");
}
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "error",
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
});
}
} else {
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
}
window.close();
}
if (document.readyState !== 'loading') {
run();
} else {
document.addEventListener('DOMContentLoaded', function () {
run();
});
}
</script>
</body>
</html>

View File

@ -1,20 +0,0 @@
window.onload = function() {
//<editor-fold desc="Changeable Configuration Block">
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
window.ui = SwaggerUIBundle({
url: "http://192.168.0.27:8080/swagger.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
//</editor-fold>
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,549 +0,0 @@
{
"openapi": "3.0.0",
"info": {
"title": "My API",
"version": "1.0"
},
"paths": {
"/opengnsys3/rest/dhcp/subnet": {
"get": {
"operationId": "ece42bc4084486aedf42734bdb0b84cb",
"responses": {
"200": {
"description": "Devuelve todas las subredes",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Subnet"
}
}
}
}
},
"400": {
"description": "Error al obtener las subredes"
}
}
},
"post": {
"summary": "Add a new DHCP subnet",
"operationId": "36e86a6932056e774180d074d3d63ad0",
"requestBody": {
"description": "JSON payload",
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"subnetId": {
"type": "integer",
"example": 2
},
"mask": {
"type": "string",
"example": "255.255.255.0"
},
"address": {
"type": "string",
"example": "192.168.1.0"
},
"nextServer": {
"type": "string",
"example": "192.168.1.1"
},
"bootFileName": {
"type": "string",
"example": "pxelinux.0"
}
},
"type": "object"
}
}
}
},
"responses": {
"200": {
"description": "Subnet added successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"success": {
"type": "string"
}
},
"type": "object"
}
}
}
},
"400": {
"description": "Error occurred",
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
}
}
}
}
},
"/opengnsys3/rest/dhcp/subnet/{subnetId}": {
"put": {
"summary": "Modify a DHCP subnet",
"operationId": "c002afa59d07660be24fda34e1498c13",
"parameters": [
{
"name": "subnetId",
"in": "path",
"description": "ID of the subnet to modify",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"description": "Data to modify the subnet",
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"mask": {
"type": "string"
},
"address": {
"type": "string"
},
"nextServer": {
"type": "string"
},
"bootFileName": {
"type": "string"
}
},
"type": "object"
}
}
}
},
"responses": {
"200": {
"description": "Subnet modified successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"success": {
"type": "string"
}
},
"type": "object"
}
}
}
},
"400": {
"description": "Error occurred",
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
}
}
}
},
"delete": {
"summary": "Delete a DHCP subnet",
"operationId": "299c4287d729ca98c47ef613720051f4",
"parameters": [
{
"name": "subnetId",
"in": "path",
"description": "ID of the subnet to delete",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Subnet deleted successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"success": {
"type": "string"
}
},
"type": "object"
}
}
}
},
"400": {
"description": "Error occurred",
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
}
}
}
}
},
"/opengnsys3/rest/dhcp/subnet/{subnetId}/host": {
"get": {
"summary": "Get all hosts in a subnet",
"operationId": "2511366de74accc3d7356814ced1cf50",
"parameters": [
{
"name": "subnetId",
"in": "path",
"description": "The ID of the subnet",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "List of hosts in the subnet",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Host"
}
}
}
}
},
"400": {
"description": "Error occurred",
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
}
}
}
},
"put": {
"summary": "Update a DHCP host",
"operationId": "6106fe2802e2f913ddb35df61b5fde35",
"parameters": [
{
"name": "subnetId",
"in": "path",
"description": "The ID of the subnet",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"description": "Data for the host to update",
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"host": {
"type": "string",
"example": "pc11"
},
"oldMacAddress": {
"type": "string",
"example": "56:6f:c7:4f:00:4f"
},
"oldAddress": {
"type": "string",
"example": "192.168.1.11"
},
"macAddress": {
"type": "string",
"example": "56:6f:c7:4f:01:01"
},
"address": {
"type": "string",
"example": "192.168.1.11"
}
},
"type": "object"
}
}
}
},
"responses": {
"200": {
"description": "Host updated successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"success": {
"type": "string"
}
},
"type": "object"
}
}
}
},
"400": {
"description": "Error occurred",
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
}
}
}
},
"post": {
"summary": "Add a DHCP host to a subnet",
"operationId": "f5d3e1de64faa4e5b14cdc7d3bd0c427",
"parameters": [
{
"name": "subnetId",
"in": "path",
"description": "ID of the subnet to add the host to",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"description": "Data for the new host",
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"host": {
"type": "string",
"example": "pc11"
},
"macAddress": {
"type": "string",
"example": "56:6f:c7:4f:00:4f"
},
"address": {
"type": "string",
"example": "172.30.4.11"
}
},
"type": "object"
}
}
}
},
"responses": {
"200": {
"description": "Host added successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"success": {
"type": "string"
}
},
"type": "object"
}
}
}
},
"400": {
"description": "Error occurred",
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
}
}
}
},
"delete": {
"summary": "Delete a DHCP host from a specific subnet",
"operationId": "542cc5fc093ff121c154504e9cad270f",
"parameters": [
{
"name": "subnetId",
"in": "path",
"description": "The ID of the subnet",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"description": "Data for the host to delete",
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"host": {
"type": "string",
"example": "pc11"
}
},
"type": "object"
}
}
}
},
"responses": {
"200": {
"description": "Host deleted successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"success": {
"type": "string"
}
},
"type": "object"
}
}
}
},
"400": {
"description": "Error occurred",
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"type": "string"
}
},
"type": "object"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Subnet": {
"properties": {
"id": {
"description": "The ID of the subnet",
"type": "integer"
},
"subnet": {
"description": "The name of the subnet",
"type": "string"
},
"next-server": {
"description": "The next server in the subnet",
"type": "string"
},
"boot-file-name": {
"description": "The boot file name for the subnet",
"type": "string"
},
"reservations": {
"type": "array",
"items": {
"description": "The reservations in the subnet",
"type": "object"
}
}
},
"type": "object"
},
"Host": {
"properties": {
"host": {
"type": "string",
"example": "pc11"
},
"macAddress": {
"type": "string",
"example": "56:6f:c7:4f:00:4f"
},
"address": {
"type": "string",
"example": "172.30.4.11"
}
},
"type": "object"
}
}
}
}

View File

@ -1,341 +0,0 @@
openapi: 3.0.0
info:
title: 'Ogdhcp API'
version: '1.0'
paths:
/opengnsys3/rest/dhcp/subnets:
get:
operationId: 8f92a1cbcb8cd176bdc4ae272b3ad303
responses:
'200':
description: 'Devuelve todas las subredes'
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Subnet'
'400':
description: 'Error al obtener las subredes'
post:
summary: 'Add a new DHCP subnet'
operationId: 88949bae5e7784ce2721ffafe7c88c0a
requestBody:
description: 'JSON payload'
required: true
content:
application/json:
schema:
properties:
subnetId:
type: integer
example: 2
mask:
type: string
example: 255.255.255.0
address:
type: string
example: 192.168.1.0
nextServer:
type: string
example: 192.168.1.1
bootFileName:
type: string
example: pxelinux.0
type: object
responses:
'200':
description: 'Subnet added successfully'
content:
application/json:
schema:
properties:
success: { type: string }
type: object
'400':
description: 'Error occurred'
content:
application/json:
schema:
properties:
error: { type: string }
type: object
'/opengnsys3/rest/dhcp/subnets/{subnetId}':
put:
summary: 'Modify a DHCP subnet'
operationId: 548b55fc0e1ad59ea5b5c909dfd07c71
parameters:
-
name: subnetId
in: path
description: 'ID of the subnet to modify'
required: true
schema:
type: integer
requestBody:
description: 'Data to modify the subnet'
required: true
content:
application/json:
schema:
properties:
mask:
type: string
address:
type: string
nextServer:
type: string
bootFileName:
type: string
type: object
responses:
'200':
description: 'Subnet modified successfully'
content:
application/json:
schema:
properties:
success: { type: string }
type: object
'400':
description: 'Error occurred'
content:
application/json:
schema:
properties:
error: { type: string }
type: object
delete:
summary: 'Delete a DHCP subnet'
operationId: c1c1c34729bdd85857b22e6e2bdc41de
parameters:
-
name: subnetId
in: path
description: 'ID of the subnet to delete'
required: true
schema:
type: integer
responses:
'200':
description: 'Subnet deleted successfully'
content:
application/json:
schema:
properties:
success: { type: string }
type: object
'400':
description: 'Error occurred'
content:
application/json:
schema:
properties:
error: { type: string }
type: object
'/opengnsys3/rest/dhcp/subnets/{subnetId}/hosts':
get:
summary: 'Get all hosts in a subnet'
operationId: 0989ca622a6a7e23f5af8e3bdd6f6b05
parameters:
-
name: subnetId
in: path
description: 'The ID of the subnet'
required: true
schema:
type: integer
responses:
'200':
description: 'List of hosts in the subnet'
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Host'
'400':
description: 'Error occurred'
content:
application/json:
schema:
properties:
error: { type: string }
type: object
'500':
description: 'Server error'
content:
application/json:
schema:
properties:
error: { type: string }
type: object
put:
summary: 'Update a DHCP host'
operationId: 1541441cd53685aaf6df45ab48befaa8
parameters:
-
name: subnetId
in: path
description: 'The ID of the subnet'
required: true
schema:
type: integer
requestBody:
description: 'Data for the host to update'
required: true
content:
application/json:
schema:
properties:
host:
type: string
example: pc11
oldMacAddress:
type: string
example: '56:6f:c7:4f:00:4f'
oldAddress:
type: string
example: 192.168.1.11
macAddress:
type: string
example: '56:6f:c7:4f:01:01'
address:
type: string
example: 192.168.1.11
type: object
responses:
'200':
description: 'Host updated successfully'
content:
application/json:
schema:
properties:
success: { type: string }
type: object
'400':
description: 'Error occurred'
content:
application/json:
schema:
properties:
error: { type: string }
type: object
post:
summary: 'Add a DHCP host to a subnet'
operationId: 3f897dcd7c04787ac9c42ddbb57cb800
parameters:
-
name: subnetId
in: path
description: 'ID of the subnet to add the host to'
required: true
schema:
type: integer
requestBody:
description: 'Data for the new host'
required: true
content:
application/json:
schema:
properties:
host:
type: string
example: pc11
macAddress:
type: string
example: '56:6f:c7:4f:00:4f'
address:
type: string
example: 172.30.4.11
type: object
responses:
'200':
description: 'Host added successfully'
content:
application/json:
schema:
properties:
success: { type: string }
type: object
'400':
description: 'Error occurred'
content:
application/json:
schema:
properties:
error: { type: string }
type: object
delete:
summary: 'Delete a DHCP host from a specific subnet'
operationId: f652c52b39d57d283401df66a7930b5f
parameters:
-
name: subnetId
in: path
description: 'The ID of the subnet'
required: true
schema:
type: integer
requestBody:
description: 'Data for the host to delete'
required: true
content:
application/json:
schema:
properties:
host:
type: string
example: pc11
type: object
responses:
'200':
description: 'Host deleted successfully'
content:
application/json:
schema:
properties:
success: { type: string }
type: object
'400':
description: 'Error occurred'
content:
application/json:
schema:
properties:
error: { type: string }
type: object
components:
schemas:
Subnet:
properties:
id:
description: 'The ID of the subnet'
type: integer
subnet:
description: 'The name of the subnet'
type: string
next-server:
description: 'The next server in the subnet'
type: string
boot-file-name:
description: 'The boot file name for the subnet'
type: string
reservations:
type: array
items:
description: 'The reservations in the subnet'
type: object
type: object
Host:
properties:
host:
type: string
example: pc11
macAddress:
type: string
example: '56:6f:c7:4f:00:4f'
address:
type: string
example: 172.30.4.11
type: object

View File

@ -1 +0,0 @@
[]