Commit Graph

632 Commits (acf9c072360b796489a44967c10cdc8ba3f7e627)
 

Author SHA1 Message Date
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
Jose M. Guisado 772811e76f #1065 Add support for client events
ogServer supports events from clients in an agent mode
(linux/windows).

Client sends event information (eg. user login/logout)
via a 103 Early Hints http response message.
2021-12-01 15:14:24 +01:00
Javier Sánchez Parra a801e788e8 #915 Add folders to scope
The database represents rooms groups and computers groups scope sets
with "grupos" (groups) and "gruposordenadores" (computers groups) tables
respectively. With this commit, ogServer abstracts both sets and offers
them though the API as the set "folder".

"grupos" table do not only group rooms, it can group other
elements of the database. You can see which kind of elements groups
looking at the column "tipo".

This commit often refers "rooms group" as group and "computers
group" as computers.

Request:
GET /scopes
NO BODY

Response
200 OK
{
  "scope": [
    {
      "name": "center1",
      "type": "center",
      "id": 1,
      "scope": [
        {
          "name": "folder1",
          "type": "folder",
          "id": 1,
          "scope": [
            {
              "name": "folder2",
              "type": "folder",
              "id": 2,
              "scope": []
            },
            {
              "name": "room1",
              "type": "room",
              "id": 2,
              "scope": [
                {
                  "name": "folder3",
                  "type": "folder",
                  "id": 3,
                  "scope": [
                    {
                      "name": "folder4",
                      "type": "folder",
                      "id": 4,
                      "scope": []
                    },
                    {
                      "name": "computer1",
                      "type": "computer",
                      "id": 8,
                      "scope": [],
                      "ip": "192.168.56.12"
                    }
                  ]
                },
                {
                  "name": "computer2",
                  "type": "computer",
                  "id": 7,
                  "scope": [],
                  "ip": "172.18.0.71"
                }
              ]
            }
          ]
        },
        {
          "name": "room2",
          "type": "room",
          "id": 1,
          "scope": []
        }
      ]
    }
  ]
}
2021-11-26 16:48:41 +01:00
OpenGnSys Support Team 64bbc0cf3f #1043 fix timeout refresh
as described by man(3) ev, to make it work with ev_timer_again()
otherwise timer might not ever expire.
2021-11-23 13:58:12 +01:00
Jose M. Guisado b6b1040997 #1065 client: add support for ogclient win state
ogClient can be run in windows mode, enabling connection with ogServer
when running on a Windows machine.

Don't expect the same payload in windows mode as a in live or virtual.
Client in windows mode does not send partition setup information, only
the status/state. (same case for linux mode)
2021-11-17 10:36:50 +01:00
Jose M. Guisado 5a3fd51261 #1065 client: add support for ogclient linux state
ogClient can be run in linux mode, intended for exposing some
ogServer commands when running in a linux distribution.

When connecting with a client in linux mode, do not expect a full
partition setup response. Just expect a 'status', and then accept
the connection without updating any partition information in
the database.
2021-11-17 09:07:57 +01:00
OpenGnSys Support Team ac3ce22c35 #1064 revisit error handling from ogClient
200 => successful command, run next pending command
202 => successful command in progress, do not run next pending command
403 => server sent a malformed HTTP header, should not ever happen,
       close connection (server is buggy?).
500 => client fails to run command, report error and run next pending command
503 => client is busy, report error and do not run next pending command

Anything else, should not ever happen (client is buggy?), close connection with
client.

On error, when processing response from ogClient, do not close the connection,
instead annotate in the database that command was not successful and run next
pending command.

*Only* if client replies status code 500 set last_cmd to UNSPEC so its state is
not BSY as reported by og_client_status function and pending cmds can be
sent.
2021-11-12 11:06:13 +01:00
OpenGnSys Support Team 6fc89cdfc4 #1042 incorrect initialization of software profiles array
The position 0 of the software profiles array is not initialized,
this triggers a bug randomly on image creation if the position 0
comes zero. Adjust the loop to initialize position 0 accordingly.
2021-10-20 09:57:41 +02:00
Jose M. Guisado e16f36cdef #915 Fix create image payload parsing
Commit 141b0797e1 introduced command scheduling rest api to
ogserver. Part of this changeset included
og_json_parse_create_image as a utility funtion to parse the json
payload of a "create image" command.

og_json_parse_create_image did not include the parsing of optional
parameters "description", "center_id" and "group_id". New components
like ogCP or ogCLI use these parameters.

Fix this by adding a struct og_image member to the struct og_msg_params
and assigning it when processing a "create image" command.

This could be extended to further payload parsing for image related
commands in the future.
2021-10-19 07:54:35 +00:00
Javier Sánchez Parra 36f02324e0 #915 Add POST /image/delete method
Delete operation for images stored in the server. It deletes an image
from the database and filesystem, thus images must exists in both places.

POST /image/delete
{
	"image": "3"
}
2021-10-04 17:44:50 +02:00
Jose M. Guisado 2d68f8a0ec #1061 add timeout to pending scheduled commands
Pending schedule commands can deny ogLive boot of clients due
to filling of pending cmd queue with commands such as "Iniciar Sesión".

For example: Using RemotePC to serve clients that do not boot into
ogLive will fill up the pending command queue with "Iniciar Sesión".

Introduce a safety timeout for pending (scheduled) commands to
avoid this situation.
2021-09-06 12:32:38 +02:00
Jose M. Guisado 5558fbcf0b #981 Use 'Wants' for mysql systemd unit dependency
Unnattended upgrades from Ubuntu can cause a stop and start of mysql
service, this in turn makes ogserver go down.

Avoid ogserver shutting down when mysql does. It's not necessary,
ogserver can report if it can't connect to the database.

'Wants' declare a weak dependency as described in
https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Wants=
2021-07-27 17:12:40 +02:00