Commit Graph

593 Commits (85ca21be00b2521db5c6eb2f4dc6118fd85173ea)
 

Author SHA1 Message Date
OpenGnSys Support Team 2fae5b08d7 add INSTALL file 2023-10-30 10:48:38 +01:00
OpenGnSys Support Team d3ad9e13e0 rest: use method not found instead of bad request for /clients requests
/clients says bad request for unsupported method, use correct error
report.
2023-10-19 10:46:23 +02:00
Jose M. Guisado 4fca62a8ee rest: extend /repository/add
POST /repository/add checks validity of the repository ip address
specified in the request payload.

/repository/add can optionally receive a center id parameter inside its
request payload. For backward compatibility, the default center id (1)
is used if no center is received inside the request payload.

POST /repository/add returns a JSON response payload containing relevant
fields from the inserted repository.

$ curl 	-D-
	\ -X POST
	\ -H "Authorization: a0e9ab768cbe93dab5b1998e952bcdb7"
  	\ --json '{"name": "helloworld", "ip": "192.168.21.21a", "center": 2}'
	\ localhost:8888/repository/add
HTTP/1.1 400 Bad Request
Content-Length: 0

$ curl 	-D-
	\ -X POST
	\ -H "Authorization: a0e9ab768cbe93dab5b1998e952bcdb7"
  	\ --json '{"name": "helloworld", "ip": "192.168.21.21a", "center": 2}'
	\ localhost:8888/repository/add
HTTP/1.1 200 OK
Content-Length: 54

{"id": 7, "ip": "192.168.21.21", "name": "helloworld"}
2023-10-11 10:28:22 +02:00
Jose M. Guisado 6f6372d0e0 src: move og_repository to dbi.h
Move struct og_repository to dbi.h and use field max length for name and
ip.

Use og_json_parse_string_copy instead of og_json_parse_string to check
maximum length against the request payload.

Fixes: 86ccc3c2e8 ("#915 Add POST /repository/add")
2023-10-10 18:09:19 +02:00
Jose M. Guisado dc68d0f135 rest: add POST /client/repo
Set a client repository in the OpenGnsys database using the endpoint
POST /client/repo.

Expects "clients" and "id" parameters in the request payload.

    POST /client/repo
    {
      "clients": [...],
      "id": "2"
    }

    Response:
    200 OK
2023-10-10 18:09:19 +02:00
Jose M. Guisado 51b70966fc rest: fix sql typo in og_set_client_mode
Replace invalid variable @ipserveradm by @serverip in the SQL query of
og_set_client_mode.

@ipserveradm is a typo as this variable does not exists. This ends up
feeding a string to the legacy setclientmode code and crashes.

This bug also caused problems when adding clients via ogCP or any other
command that required running the set client mode logic.

Fixes: e080fd5526
(rest: add "server=" boot param in set client mode)
2023-09-29 14:53:12 +02:00
Jose M. Guisado 35a3b0a1a3 schema: fix bug when og_dbi_open cannot open a connection
When og_dbi_open cannot open a connection during schema update, then
ogServer crashes.

og_dbi_open returns NULL when it cannot open a DB connection.

Do not use dbi variable if og_dbi_open is unable to open a DB
connection.

Add syslog message when database schema couldn't be updated.
2023-09-28 10:07:07 +02:00
Jose M. Guisado e080fd5526 rest: add "server=" boot param in set client mode
Store a client associated ogserver ip address in "server=" boot param.

Use this boot param to lookup for network-specific ogClient
configuration when launching ogClient during ogLive booting process.
2023-08-28 12:29:33 +02:00
Jose M. Guisado 18eb19ab42 rest: return server_id in GET /client/info
struct og_computer holds the value of "identorno" column inside the
server_id field.

Extend GET /client/info payload with server_id. This way clients can
get the associated server id when requesting client information.

{
...
"server_id": 1,
}
2023-08-23 15:35:34 +02:00
Jose M. Guisado 4cc2ca61fd dbi: add server_id to og_computer struct
Extend og_dbi_get_computer_info to fetch "identorno" column from
"ordenadores". "identorno" holds the row id value from the "entornos"
table (valid ogserver addresses).

Extend og_computer struct with a new field: "server_id" that will store
the value of "identorno" column fetched from the database.
2023-08-23 15:34:44 +02:00
Jose M. Guisado 44745a3f22 rest: add POST client/server method
Enable modification of the associated ogserver of a given client.

This API is exposed via the POST /client/server endpoint and expects a
JSON payload with an array of clients ("client":[]) and the "id" of the
ogserver ("identorno" column value inside the "entornos" table)

For example:

>>>
POST /client/server
{
  "client": [
    "10.141.10.100",
    "10.141.10.101",
    "10.141.10.104",
    "10.141.10.102"
  ],
  "id": "6"
}
<<<
HTTP/1.1 200 OK

If the ogserver id does not exist the foreign key constraint (ON UPDATE
RESTRICT) inside the "ordenadores" table will cancel the operation and
the server will reply with 400 Bad Request.

>>>
POST /client/server
{
  "client": [
    "10.141.10.100",
    "10.141.10.101",
    "10.141.10.104",
    "10.141.10.102"
  ],
  "id": "666"
}
<<<
HTTP/1.1 400 Bad Request

The OpenGnsys database stores different ip addresses for the ogServer
inside the "entornos" table. This table is related to the "ordenadores"
table using a foreign key on the "identorno" column.

i.e: Clients in the "ordenadores" table associate to an specific server
in the database using the "identorno" column (from "entornos" table).
2023-08-23 13:17:03 +02:00
Jose M. Guisado a67c1088ef rest: add DELETE operation to /server endpoint
Expose deletion of rows from "entornos" table via the /server
endpoint using the DELETE http request method.

The expected payload is the server id as a string. For example:

>>>
DELETE /server
{ "id": "4" }

<<<
200 OK

If the specified server is currently associated with any computer
("ordenadores" table) the foreign key contraint (ON DELETE RESTRICT)
will avoid the deletion and the server responds with
400 Bad Request.

>>>
DELETE /server
{ "id": "1" }

<<<
400 Bad Request
2023-08-23 11:39:19 +02:00
Jose M. Guisado b2c8c9d9ab rest: support DELETE HTTP request method
Reuse endpoints in order to add deletion operation such as "/server".
This way there is no need to declare a different if/else block in order
to parse a new URI for the new "*/delete" endpoint.

Current deletion operations are implemented using a different endpoint
name such as "/client/delete", "/center/delete" with POST request method.

Endpoints using "/delete" suffix may not be removed for backwards
compatibility. Adding HTTP method DELETE support for endpoints such as
"/center" or "/client" can use the already existing *_post_delete*
functions.
2023-08-23 11:39:19 +02:00
Jose M. Guisado 351069b591 rest: add /server GET and POST methods
DB stores different ogserver addresses in the "entornos" table.

Expose addition and deletion operations for the "entornos" table using
the /server endpoint.

GET /server returns a list of rows from the "entornos" table including
the "identorno" and "ipserveradm" columns. For example:

>>>
GET /server

<<<
200 OK
...
{
  "servers": [
    {
      "id": 1,
      "address": "10.141.10.1"
    }
  ]
}

POST /server inserts into the "entornos" table and returns the
id ("identorno") of the new row.

>>>
POST /server
{
  "address": "192.168.2.240"
}

<<<
200 OK
...
{
  "id": 2
}

If the server address already exists the response is 400 Bad Request
with no payload.

>>>
POST /server
{
  "address": "192.168.2.240"
}

<<<
400 Bad Request
2023-08-23 11:39:10 +02:00
Jose M. Guisado 74b6e3ec72 rest: add optional param "backup" for create_image
This parameter is used by ogServer to instruct target client if image
backup should be performed before image creation.

This parameter is optional to preserve backward compatibility with
webconsole (legacy web client) and avoid the need of updating any legacy
client.

Default is true if the REST request is missing this parameter.
2023-07-07 10:04:36 +02:00
Jose M. Guisado 3de8c25e4e core: log payload if sequences do not match
We need to inspect the received payload if any error is raised related
to the X-Sequence header. Not just when a malformed X-Sequence header is
detected.

Fixes: d2c19ef13d ("core: add X-Sequence header support")
2023-07-03 09:17:53 +02:00
Jose M. Guisado d2c19ef13d core: add X-Sequence header support
Add non-standard HTTP header "X-Sequence" to the header section of
requests (og_send_request) sent to a connected client.

Define a starting sequence number when creating a new instance of struct
og_client inside og_server_accept_cb. This sequence number is
incremented by one for each outgoing request from ogServer.

This sequence number is checked when receiving a response from a
connected client, if they do not match the connection is dropped.

Use sequence 0 for out-of-band commands (reboot, poweroff, stop). Any
client response with header "X-Sequence: 0" bypasses sequence check.
2023-06-13 14:04:54 +02:00
Jose M. Guisado 92f83c0385 client: harden og_resp_refresh
Harden refresh response logic. Check for necessary JSON fields inside
the payload.

Check if serial_number is null before calling strlen, prevent ogServer
from a malformed refresh response with missing serial_number.

Refresh uses legacy function actualizaConfiguracion that takes a long
string with the computers configuration (serialno, partitions, disks,
link speed and status). Check for an empty string before executing any
legacy code inside actualizaConfiguracion.
2023-06-07 18:32:33 +02:00
Jose M. Guisado 8cf02475ba client: increase software inventory buffer size
Large software inventory is truncated because it does not fit into the
existing buffer.

Software inventory response payload consists of a string with each
component delimited by '\n'. Large software inventories can consist of
more than 8192 bytes.

Avoid truncating any large software inventory by increasing the buffer
size where this string is stored.
2023-04-20 10:08:52 +02:00
Javier Sánchez Parra 25e21f435d Log ogClient sessions in ogagent.log
Otherwise, administrators can not read the logging history from
WebConsole.
2022-11-02 13:59:28 +01:00
Javier Sánchez Parra 2213d005ff #915 List all database images.
ogServer "GET /images" list images that exist simultaneously in database
and in disk (/opt/opengnsys/images).

With this patch, ogServer list all images in database, exist or not in
disk. If an image exists in disk, it retrieves more information about
them.

This change is useful for environments where images are in different
machines/repositories.
2022-07-07 12:29:47 +02:00
Javier Sánchez Parra 5cf2de704c #915 Add POST /repository/delete
This method deletes a repository from the database.

Request:
POST /repository/delete
{
  "id": "10"
}

Response:
200 OK
2022-07-01 12:09:16 +02:00
Javier Sánchez Parra 86ccc3c2e8 #915 Add POST /repository/add
This method adds a new repository to the database.

Request:
POST /repository/add
{
  "name": "Repository 1",
  "ip": "192.168.56.10"
}

Response:
200 OK
2022-07-01 12:09:16 +02:00
Javier Sánchez Parra 9ecf638ba2 #915 Extend GET /repositories with param id
Add id parameter to the response. This is useful to identify
repositories that have several IPs.

Request:
GET /repositories
{
  "repositories": [
    {
      "id": 1,
      "ip": "192.168.56.10",
      "name": "Repositorio (Default)"
    }
  ]
}

Response:
200 OK

Related-to: d5e6dc0 ("#915 Add API GET /repositories")
2022-06-23 13:12:59 +02:00
Javier Sánchez Parra ce4eb4d833 #915 Fix missing id on image creation
On image creation, ogServer always sends 0 as image id to clients. When
clients sends the response to the "create image" command with new
information to update the image's entry in the database, the image id is
0 and ogServer fails to update the image's entry.

This patch fixes this, assigning the correct id of the image.

Fixes: d2f20d0be0 ("#942 Create DB image when calling POST /image/create")
2022-06-20 16:07:53 +02:00
Javier Sánchez Parra 30d6af09d5 #915 Use the repository id on image list
API "GET /images" shows the repository ID the image belongs to, instead
of the IP. This is a preparative commit to the support of repositories
with several IPs.

Request GET /images
Response 200 OK:
{
  "images": [
    {
      "name": "windows10",
      "datasize": 0,
      "size": 626088433,
      "modified": "Fri Jun 10 12:20:32 2022",
      "permissions": "744",
      "software_id": 1,
      "type": 1,
      "id": 6,
      "repo_id": 1
    }
  ],
  "disk": {
    "total": 52573995008,
    "free": 38964637696
  }
}
2022-06-20 10:41:50 +02:00
Javier Sánchez Parra 52a38d3e57 #915 Use the repository id on image creation
POST /image/create has two modes, image creation and update. You can
find more information about the "creation" mode in commit:
d2f20d0be0

On image creation, use the id to identify repositories instead of the
IP. This is a preparative commit to the support of repositories with
several IPs.

On image update, "repository_id" field is not needed because the image
already has the repository assigned.

This commit maintains backward compatibility with the Web Console (old
web interface), because it only use the "update" mode of /image/create.

Request POST /create/image:
{
  "clients": [
    "192.168.56.11"
  ],
  "disk": "1",
  "partition": "1",
  "name": "archlinux",
  "repository_id": 1,
  "id": "0",
  "code": "131",
  "description": "This is a test",
  "group_id": 0,
  "center_id": 1
}
Response 200 OK
2022-06-20 10:41:32 +02:00
Javier Sánchez Parra a0a3470682 #1074 rest: set_mode: add support for different ogserver addresses
Add foreign key "identornos" from table "entornos" to table
"ordenadores".

A row in table "entornos" represent a valid ogServer address.
Multiple ogServer valid addresses can exist when running several
instances or a single ogServer instance is exposed to different networks.

Can't delete rows in "entornos" table nor update their id (primary
key) if the row has any associated clients ({ON UPDATE/ON DELETE} RESTRICT).

Allows assigning different but valid ogServer IPs to clients.
Enabling support for multiple instances of ogServer (e.g: load balancing) or
exposing a single ogServer instance to different networks (e.g: VLAN).

Look up for the valid ogServer IP of a given client when changing a
client's mode (og_set_client_mode).

Determines valid ogServer IP using a JOIN statement.

	JOIN entornos USING(identorno)

Reuses the fetched ip using a statement variable.

	@serverip:=entornos.ipserveradm

For example, for a two VLAN setup:

	vlan1 ogserver: 192.168.56.10
	vlan2 ogserver: 192.168.57.10

The "entornos" table should look like:

	identorno       ipserveradm             ...
	---------       -----------             ...
	1               192.168.56.10           ...
	2               192.168.57.10           ...

And computers in the "ordenadores" table might look like:

	idordenador     identorno       ...
	----------      ---------       ...
	1               1               ...
	2               1               ...
	3               2               ...
	4               2               ...
	...             ...             ...

Additionally, splits the SQL query for better readability.

Co-authored-by: Jose Guisado <jguisado@soleta.eu>
2022-06-01 08:51:19 +02:00
Javier Sánchez Parra c0573b9ef0 #915 Set repository on image creation
Assign to the image the repository indicated in the JSON body instead of
a default one.
2022-05-26 15:15:52 +02:00
Javier Sánchez Parra b86b6e1443 #915 Extend GET /images function with the repository IP
This extension adds the field 'repo_ip', indicating which repository has
the image. This new field is useful when restoring an image.

Request:
GET /images

Response:
200 OK
{
  "disk": {
    "free": 37091418112,
    "total": 52573995008
  },
  "images": [
    {
      "datasize": 5939200000,
      "id": 25,
      "modified": "Wed Oct 14 11:49:00 2020",
      "name": "archlinux",
      "permissions": "744",
      "size": 1844222333,
      "software_id": 19,
      "type": 1
      "repo_ip": "192.168.56.10"
    }
  ]
}
2022-05-26 15:15:52 +02:00
Javier Sánchez Parra d5e6dc0990 #915 Add API GET /repositories
This API returns a list of available images repositories.

Request:
GET /repositories

Response
200 OK
{
  "repositories": [
    {
      "ip": "192.168.56.10",
      "name": "Default"
    },
    {
      "ip": "192.168.57.10",
      "name": "Extra"
    }
  ]
}
2022-05-26 15:15:29 +02:00
Javier Sánchez Parra 9b6171300b #915 Fix conditional jump depending on uninitialised value
Valgrind says:

==9452== 1 errors in context 1 of 38:
==9452== Conditional jump or move depends on uninitialised value(s)
==9452==    at 0x11BD1E: og_resp_refresh (client.c:383)
==9452==    by 0x11CF2A: og_agent_state_process_response (client.c:822)
==9452==    by 0x112FCE: og_agent_read_cb (core.c:254)
==9452==    by 0x4E41D72: ev_invoke_pending (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==9452==    by 0x4E453DD: ev_run (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==9452==    by 0x1107CD: ev_loop (ev.h:835)
==9452==    by 0x1107CD: main (main.c:108)
==9452==  Uninitialised value was created by a stack allocation
==9452==    at 0x11BB02: og_resp_refresh (client.c:348)

Fixes: f03425e ("#915 Add support for link speed in the refresh response")
2022-05-18 16:50:24 +02:00
Javier Sánchez Parra df5161ebc3 #915 Add last_cmd to GET /clients API
"last_cmd" json object contains information of the last command executed
by the correspondent client. For now, it only includes "result" string
property, which stores "success" if the last command finished correctly
or "failure" on the contrary.

To populate "result" property, this commit also adds "last_cmd_result"
enum attribute to og_client struct. Client response processing fills
this attribute according to its success.

Clients in WOL_SENT state always have last_cmd->result = "unknown".

Request: GET /clients

Response: 200 OK
{
  "clients": [
    {
      "addr": "10.141.10.102",
      "state": "WOL_SENT",
      "last_cmd": {
        "result": "unknown"
      }
    },
    {
      "addr": "10.141.10.101",
      "state": "OPG",
      "speed": 1000,
      "last_cmd": {
        "result": "success"
      }
    },
    {
      "addr": "10.141.10.100",
      "state": "OPG",
      "speed": 1000,
      "last_cmd": {
        "result": "failure"
      }
    }
  ]
}
2022-05-18 16:50:14 +02:00
Javier Sánchez Parra f03425e6ae #915 Add support for link speed in the refresh response
Add ogServer support for parsing and storing the link speed from
ogClient's refresh response.

Probe response already has client's link speed, but this API is
deprecated.
2022-05-09 12:18:56 +02:00
Javier Sánchez Parra f2d83cef7d #915 Set boot mode to ogLive on client creation
Otherwise, users have to use POST /modes to make clients bootable.
2022-03-28 13:46:58 +02:00
Javier Sánchez Parra 0e47f675e0 #915 Remove template_name from og_set_client_mode
This argument is not needed for setting clients' boot mode.
2022-03-28 13:15:21 +02:00
OpenGnSys Support Team f3422f6afa #915 add seconds since ogserver has been launched
Extend GET /stats to show the number of seconds since the ogserver started.

{
       "time": {
          "now": 1647262765,     /* Seconds since 1970 */
          "boot": 2151909        /* Seconds since boot */
	  "start" : 1647262854,, /* Seconds since 1970 */
       },
       [...]
2022-03-25 14:58:27 +01:00
Javier Sánchez Parra 3b4aa721a4 #915 Add GET /stats REST request
This request returns certain statistics on memory and swap usage, as
well as the uptime.

The below structure gives the sizes of the memory and swap fields in
bytes.

Request: GET /stats
NO BODY

Response: 200 OK
{
   "time": {
      "now": 1647262765,     /* Seconds since 1970 */
      "boot": 2151909        /* Seconds since boot */
   },
   "memory": {
      "size": 4104679424,    /* Total usable main memory size */
      "free": 322174976      /* Available memory size */
   },
   "swap": {
      "size": 2147479552,    /* Total swap space size */
      "free": 2122563584     /* Swap space still available */
   }
}
2022-03-14 14:46:13 +01:00
Jose M. Guisado 281d661fc9 #1065 og_client_status compatible with webconsole
Report linux and windows client status in a compatible manner
with webconsole.  This way clients are colored accordingly in
a room view depending on their status.

WIN/WINS: Windows, Windows session
LNX/LNXS: Linux, Linux session
2022-02-02 17:35:49 +01:00
OpenGnSys Support Team 1379ee95f4 #1043 check for WoL pending confirmation logic only for client
REST API request does not need to perform a list lookup on the wol list.
2022-01-21 15:18:50 +01:00
OpenGnSys Support Team 20301007a1 #915 release existing client on reconnections
Trasient network problems might result in duplicated clients, drop
client object if it already exists before creating a new one.
2022-01-21 15:18:47 +01:00
OpenGnSys Support Team b8b3839bba #915 remove temporary file to store shell output
Remove legacy behaviour, store it in the client object instead of a temporary
file.
2022-01-18 10:48:59 +01:00
Javier Sánchez Parra eaf7ed9da0 #915 Initialize group when adding a new client to DB
Other methods expect not NULL clients' group.
2022-01-17 11:22:13 +01:00
OpenGnSys Support Team 4e2ef1a13e #1067 fix use-after-free in deliver pending command
Do not release the json object twice, once from og_send_request() and
again og_cmd_free().

Valgrind reports:

==11885== Invalid read of size 8
==11885==    at 0x117B9A: json_decref (jansson.h:128)
==11885==    by 0x117B9A: og_cmd_free (rest.c:2409)
==11885==    by 0x113465: og_agent_deliver_pending_cmd (core.c:211)
==11885==    by 0x113465: og_agent_read_cb (core.c:256)
==11885==    by 0x4E41D72: ev_invoke_pending (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885==    by 0x4E453DD: ev_run (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885==    by 0x110C2D: ev_loop (ev.h:835)
==11885==    by 0x110C2D: main (main.c:104)
==11885==  Address 0x8e7e988 is 8 bytes inside a block of size 72 free'd
==11885==    at 0x4C32D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11885==    by 0x117437: json_decref (jansson.h:129)
==11885==    by 0x117437: og_send_request (rest.c:330)
==11885==    by 0x113454: og_agent_deliver_pending_cmd (core.c:208)
==11885==    by 0x113454: og_agent_read_cb (core.c:256)
==11885==    by 0x4E41D72: ev_invoke_pending (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885==    by 0x4E453DD: ev_run (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885==    by 0x110C2D: ev_loop (ev.h:835)
==11885==    by 0x110C2D: main (main.c:104)
==11885==  Block was alloc'd at
==11885==    at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11885==    by 0x526461A: json_object (in /usr/lib/x86_64-linux-gnu/libjansson.so.4.11.0)
==11885==    by 0x116A07: og_cmd_legacy_image_restore (rest.c:2627)
==11885==    by 0x116A07: og_cmd_legacy (rest.c:2757)
==11885==    by 0x116A07: og_queue_task_command (rest.c:2848)
==11885==    by 0x118284: og_dbi_queue_command (rest.c:3109)
==11885==    by 0x118284: og_schedule_run (rest.c:3190)
==11885==    by 0x1147B9: og_agent_timer_cb (schedule.c:445)
==11885==    by 0x4E41D72: ev_invoke_pending (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885==    by 0x4E453DD: ev_run (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885==    by 0x110C2D: ev_loop (ev.h:835)
==11885==    by 0x110C2D: main (main.c:104)
2021-12-23 15:33:29 +01:00
OpenGnSys Support Team 216986e848 #915 consolidate WoL sender function
This patch aims simplifies the WoL sender routine.

A few related changes:
- Replace goto err to continue if IP address is malformed
- Use ret |= instead of ret &= to accumulate error code.
2021-12-22 17:30:04 +01:00
OpenGnSys Support Team 6e70916005 #915 remove shim code to update database after image restore command
Make direct call to dbi API to update database instead.
2021-12-22 17:30:04 +01:00
OpenGnSys Support Team facd0d56e7 #915 remove dead code in ogAdmLib
Remove declarations that are not used anymore in ogAdmLib.
2021-12-22 17:30:04 +01:00
OpenGnSys Support Team 41ac15d100 #915 Remove useless WoL shim code
Levanta() is not required, iterate over the array of IP address and make
direct calls to WakeUp().

This is also implicitly fixing up a memleak in og_cmd_wol().
2021-12-20 12:18:46 +01:00
Javier Sánchez Parra dd578a944e #915 Add POST /oglive/set REST request
This patch allows you to update clients' database entry and PXE boot
file with the specified ogLive.

If you specify either an incorrect or unexisting ogLive, then, clients
use the default ogLive image. You can query ogLives installed on the
server with ogServer's GET /oglive/list API.

If you set the oglive field to "default", then the default ogLive is
used.

Request: POST /oglive/set
{
  "clients": ["192.168.56.11", "192.168.56.12"],
  "name": "ogLive-5.4.0-r20200629"
}
Response: 200 OK
2021-12-17 10:31:41 +01:00
Jose M. Guisado ff9dbd9033 #1065 split og_status_session_toggle
Handles non usual situations like a client sending more than
one event of same type.

When toggling, receiving two events of the same type is the
same as receiving two different ones (eg. start, then stop).

Split into _session_start and _session_stop in order to check
valid client status.
2021-12-03 09:14:07 +01:00