- instalar dependencias
composer install
- Copiar archvo de configuración
cp .env.example .env
- Definir base de datos. Modificar en el archivo
.env
DB_CONNECTION=MySQL
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=api-laravel-54
DB_USERNAME=homestead
DB_PASSWORD=secret
- Crear tablas
php artisan migrate
- Editar en el software bamboo
hotel5/RadiusConfig.php
segun el servidor freeradius a usar:
<?php
$radius_config = [
'radius_api' => 'http://server/public/index.php', // IP, ruta o URL del servidor de aplicación freeradius
'radius_db_host' => '172.16.32.133', // Dirección IP de la base de datos del servidor freeradius
'radius_db_database' => 'radius' // Nombre de la base de datos del servidor freeradius
];
POST
http://server/api/databases
{
"driver": "mysql",
"host": "192.168.0.29",
"port": "3306",
"database": "radius",
"username": "radiu",
"password": "radpass"
}
{
"message": "OK",
"data": {
"driver": "mysql",
"host": "192.168.0.29",
"port": "3306",
"database": "radius",
"username": "radiu",
"password": "radpass",
"updated_at": "2020-01-16 13:32:32",
"created_at": "2020-01-16 13:32:32",
"id": 2
}
}
PUT
http://server/api/databases/{id}
{
"driver": "mysql",
"host": "172.16.32.133",
"port": "3306",
"database": "radius",
"username": "radius",
"password": "radpass"
}
{
"message": "OK",
"data": {
"id": 1,
"driver": "mysql",
"host": "172.16.32.133",
"port": "3306",
"database": "radius",
"username": "radius",
"password": "radpass",
"created_at": "2020-01-16 00:00:00",
"updated_at": "2020-01-16 00:00:00"
}
}
GET
http://server/api/databases
NULL
{
"message": "OK",
"data": [
{
"id": 1,
"driver": "mysql",
"host": "172.16.32.133",
"port": "3306",
"database": "radius",
"username": "radius",
"password": "radpass",
"created_at": "2020-01-16 00:00:00",
"updated_at": "2020-01-16 00:00:00"
}
]
}
GET
http://server/api/radius/users
{
"host": "172.16.32.133",
"database": "radius"
}
{
"message": "OK",
"data": [
{
"id": 1,
"username": "test_user",
"attribute": "User-Password",
"op": ":=",
"value": "password"
},
{
"id": 18,
"username": "someuser2",
"attribute": "User-Password",
"op": "==",
"value": "12345"
},
{
"id": 20,
"username": "112",
"attribute": "User-Password",
"op": "==",
"value": "nZqIy0jkFN"
}
]
}
GET
http://server/api/radius/users/{username}
{
"host": "172.16.32.133",
"database": "radius"
}
{
"message": "OK",
"data": {
"id": 18,
"username": "username",
"attribute": "User-Password",
"op": "==",
"value": "12345"
}
}
POST
http://server/api/radius/users
{
"host": "172.16.32.133",
"database": "radius",
"username": "someuser",
"value": "12345"
}
{
"message": "OK",
"data": {
"username": "someuser",
"attribute": "User-Password",
"value": "12345",
"id": 18
}
}
DELETE
http://server/api/radius/users/{username}
{
"host": "172.16.32.133",
"database": "radius"
}
{
"message": "Usuario eliminado!"
}