| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Update the session status based on the value of the "status" field
in the refresh response, the possible values are:
LINUXS, LINUX, WINS, WIN.
|
|
|
|
| |
provide a bit more information in the logs to identify the error
|
|
|
|
| |
instead of using image id that client reports
|
|
|
|
|
| |
this repository id is already added to the database when the image creation is
requested, remove this code to update it again when the client replies
|
|
|
|
|
| |
if client succeeds to create the image but server fails to register this image,
then remove the image stub in the database.
|
|
|
|
|
|
|
| |
Add last client command context that is used in the request to client.
This allows to remove the stub image entry in the database in case that the
image creation fails.
|
|
|
|
| |
just a preparation, no functional changes are intended.
|
|
|
|
| |
just a preparation, no functional changes are intended.
|
|
|
|
|
|
|
|
|
| |
Add safe_strtoull to validate the execution of strtoull.
Definining the base of the number is required becase partition
codes are base 16 but they lack the 0x prefix.
Replace uses of atoi and strtoull/strtoul and log the conversion
errors.
|
|
|
|
| |
Delete image data after a failed image creation.
|
|
|
|
| |
unused since 87be2ce08
|
|
|
|
|
| |
Move list of images in the cache to cache_data. Add new functions to
initialize cache data (image list) and release it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend database table ordenadores_particiones to add new "used_size" and "free_size" fields.
FIELD TYPE
| tamano | bigint |
| uso | tinyint |
| used_size | bigint |
| free_size | bigint |
"tamano" is the field storing the total size of the partition.
"uso" is a field storing the integer percentage of use, it is preserved for backwards compatibility with scritps that access the database.
"used_size" and "free_size" contain the used and free partition
size in bytes.
Old response from ogClient for /cache/delete, /cache/fetch
and /image/restore:
{
'cache': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
]
}
New response:
{
'cache': {
'used_size': 4520232322423,
'free_size': 48273465287452945,
'images': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
]
}
}
Parse the new "free_size" and "used_size" fields of each partition data in the response payload of /refresh
Parse "free_size" and "used_size" fields of the cache data in the reponse payload of /image/restore, /cache/delete and /cache/fetch
Replace "used_size" field of GET /client/setup with the value
of the new database field "used_size"
|
|
|
|
| |
Report failure when trying to refresh client information.
|
|
|
|
| |
json parser already validates attributes must be set on.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reimplement the legacy funcion actualizaConfiguracion with
og_update_client_config in src/client.c
if disk does not exist, add it, otherwise update disk contents.
if partition size, code, filesystem or os is different, reset image id,
otherwise update partition usage only.
delete partitions that are gone at the end.
|
|
|
|
| |
Put ogserver into diet, remove this feature, including pending command queue.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add GET /efi request to obtain information about the client's
boot entries.
Field inside the /refresh payload
'efi': {
'entries': [
{
"order": 0,
"name": "Boot0000",
"active": false,
"description": "grub"
},
{
"order": 1,
"name": "Boot0001",
"active": true,
"description": "UEFI: PXE IP4 Realtek PCIe GBE Family Controller"
}
]
}
If the client is not a EFI system it won't add the 'efi' field.
If an entry is not in the boot order it won't have the 'order' field.
GET /efi resquest payload structure:
{
'clients': ['10.141.10.21', '10.141.10.22']
}
GET /efi response's structure:
{
'clients': [
{
'ip': '10.141.10.21',
'entries': [
{
"order": 0,
"name": "Boot0000",
"active": false,
"description": "grub"
},
{
"order": 1,
"name": "Boot0001",
"active": true,
"description": "UEFI: PXE IP4 Realtek PCIe GBE Family Controller"
}
]
},
{
'ip': '10.141.10.22',
'entries': []
}
]
}
The client with ip 10.141.10.22 is a BIOS system.
If an entry does not appear in the boot order it won't have the
'order' field.
|
|
|
|
|
|
|
|
|
|
| |
Repository can have more than one single IP address.
* Add alias field to database to represent the extra IPs that are attached to
the repository, update schema and add version 9.
* Use og_dbi_get_repository_ip() to infer the repository IP address.
* Add helper functions (src/repo.c) to build a list of repositories and update
rest API to use it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add POST cache/fetch request to request download of images in
the client's cache.
Resquest payload structure:
{
'clients': ['10.141.10.21', '10.141.10.22']
'image': 'windows.img'
'type': 'TIPTORRENT'
'repository': '12.141.10.2'
}
The clients listed in the 'clients' field will receive a
cache/fetch POST request with the payload received by the server
without the 'clients' field.
The clients respond with the contents of their cache so the server
can update the database.
|
|
|
|
| |
a simple cleanup to help diagnose problems, not behaviour change expected.
|
|
|
|
|
|
|
|
| |
Revisit 6cbe69e89e71 ("rest: add cmd to shell/output") to reject response with
no 'cmd' field, otherwise strdup() crashes when dealing with NULL string.
Set retcode to zero, otherwise this value remains uninitialized if no retcode
json field is provided by the client.
|
|
|
|
|
| |
Add a new checksum attribute to GET /images, extend database to add a new
checksum field to images table.
|
|
|
|
| |
Provide a timestamp that tells when the command output from client was received.
|
|
|
|
|
| |
Add "cmd" field to json that provides the original command string, so it is
provided with the output and the return code.
|
|
|
|
| |
Add retcode field to specify return code of shell invocation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update the database with the new cache contents sent by the
client after an image/restore operation.
Resquest response structure:
{
...
'cache': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
]
...
}
Parse the contents of the 'cache' field to update the data of
the client's cache in the database.
This is one of the required changes the make cache/list coherent
and prevent cache desync between the server and clients.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add POST cache/delete request to request deletion of images in
the client's cache.
Resquest payload structure:
{
'clients': ['10.141.10.21', '10.141.10.22']
'images': ['windows.img', 'linux.img']
}
The clients listed in the 'clients' field will receive a
cache/delete POST request with the 'clients' field removed and
only containing 'images' from the payload received by the server.
Each client will try to delete as many images as available in
their cache from the list of files in 'images'.
The clients will give response with the contents of the cache so
the server can update the database.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parse the 'cache' field of the refresh payload sent by the clients.
Cache field structure in the payload:
{
...
'cache': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'},
]
...
}
Store that data in the 'cache' table of the database so it can
be obtained later on.
The table contains the following fields:
- clientid: the numeric identifier of the client.
- imagename: name of the image in cache.
- size: size in bytes of the image in cache.
- checksum: checksum of the image in cache.
|
|
|
|
| |
replace old legacy code, no functional changes are intended.
|
|
|
|
|
|
| |
Use permissions and last update from client.
update src/schema.c to add a new database version.
|
|
|
|
|
| |
Still incomplete, src/schema.c needs to be update to add a new field to the
'imagenes' table in the database.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Otherwise, administrators can not read the logging history from
WebConsole.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"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"
}
}
]
}
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Remove legacy behaviour, store it in the client object instead of a temporary
file.
|
|
|
|
| |
Make direct call to dbi API to update database instead.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Add ogServer support for parsing and storing in the DB disk type data
from ogClient refresh response.
See also commits with #1037 in ogClient and WebConsole repo.
|
|
|
|
| |
If ogClient sends an unknown attribute, ignore it.
|
|
|
|
|
|
| |
If a probe response contains speedinformation, parse and store
it inside the client struct. Speed is interpreted as an unsigned
integer representing Mbit/s.
|
|
|
|
| |
Update license header in files.
|
| |
|