summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* #941 Extend og_dbi_get_computer_info(...)Roberto Hueso Gómez2020-09-223-16/+80
| | | | | | For the strings in og_computer we do not need to know the max size in advance but instead we need to free up memmory using og_dbi_free_computer_info(...) function.
* #941 pass og_dbi to og_dbi_get_computer_info()OpenGnSys Support Team2020-09-183-52/+55
| | | | Reuse the existing dbi handler, instead of opening a new one.
* #941 move og_dbi_get_computer_info() to dbiOpenGnSys Support Team2020-09-183-59/+65
| | | | Move this function to the dbi.{h,c} files.
* #988 fix compilation warning in json configuration file to legacyOpenGnSys Support Team2020-09-151-8/+8
| | | | | src/cfg.c: In function ‘from_json_to_legacy’: src/cfg.c:161:2: warning: format not a string literal and no format arguments [-Wformat-security]
* Fix size of og_cmd_get_client_setup() return arrayRoberto Hueso Gómez2020-09-151-1/+2
| | | | The return array needs to store 1 extra element for the disk setup.
* #1004 Add GET /client/setup HTTP REST methodRoberto Hueso Gómez2020-09-141-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | This method provides the partitions setup for a specific client. The request must contain exactly 1 client's IP. Request: GET /client/setup {'client': ['192.168.56.12']} Response: 200 OK { "partitions": [ { "disk": 1, "partition": 0, "code": 0, "size": 20971520, "used_size": 0, "filesystem": 0, "os": 0, "image": 0, "software": 0 } ] }
* #971 replace reservaMemoria() by calloc()OpenGnSys Support Team2020-09-102-21/+1
| | | | reservaMemoria() is only used once, remove it.
* #971 remove unused functions in ogAdmLibOpenGnSys Support Team2020-09-102-127/+0
| | | | Remove unused legacy code.
* #1004 Handle new fields in /image/create responseJavier Sánchez Parra2020-09-103-3/+58
| | | | | | | | | | | | | | | | | | | | | | | | ogClient now includes more information regarding the new image. This patch modifies ogServer to support new elements sent in ogClient /image/create response and store them in the database. Example of new /image/create response: { "disk": "1", "partition": "1", "code": "131", "id": "1", "name": "ubuntu", "repository": "192.168.56.10", "software": "Ubuntu 18.04.5 LTS \naccountsservice 0.6.45\n...", "clonator": "PARTCLONE", "compressor": "LZOP", "filesystem": "EXTFS", "datasize": 2100000 } New fields are "clonator", "compressor", "filesystem" and "datasize".
* #980 do not report busy client if probing is pendingOpenGnSys Support Team2020-08-211-1/+6
| | | | og_client_status() should not report busy when probing is going on.
* #980 Add 'ip' field in GET /scopes requestRoberto Hueso Gómez2020-08-141-4/+4
| | | | | The 'ip' field is added to the json for scopes that have an IP (i.e. computers).
* #980 Select POST /mode clients by ip instead of scope nameRoberto Hueso Gómez2020-08-141-14/+18
| | | | | | This patch selects clients whose modes need to be changed in the current request. This patch makes POST /mode consistent with the rest of the REST API where clients are selected and filtered by ip.
* #998 disable incremental image APIOpenGnSys Support Team2020-08-146-566/+0
| | | | This API is not supported by ogClient yet and it uses the obsolete socket hydra API.
* #990 add wol_socket_open()OpenGnSys Support Team2020-08-063-20/+25
| | | | Add wol_socket_open() to initialize the WoL socket
* #980 fix compile warning in og_set_client_modeOpenGnSys Support Team2020-08-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | CC src/rest.o src/rest.c: In function ‘og_cmd_post_modes.isra.27’: src/rest.c:966:4: warning: ‘%s’ directive output may be truncated writing up to 4096 bytes into a region of size between 3018 and 4041 -Wformat-truncation=] "MODE_FILE='%s'\nMAC='%s'\nDATA='%s'\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/rest.c:1085:7: template_name, scope_name); ~~~~~~~~~~~~~ src/rest.c:967:33: note: format string is defined here "MODE='PERM'\nTEMPLATE_NAME='%s'", ^~ src/rest.c:965:2: note: ‘snprintf’ output 57 or more bytes (assuming 5176) into a destination of size 4096 snprintf(cmd_params, sizeof(cmd_params), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "MODE_FILE='%s'\nMAC='%s'\nDATA='%s'\n" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "MODE='PERM'\nTEMPLATE_NAME='%s'", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mode, mac, params, template_name); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* #980 error reporting in setclientmodeOpenGnSys Support Team2020-08-061-1/+3
| | | | Add syslog and use exit()
* #986 Fixs error in 'Advanced Netboot' caused by loss information from ↵Irina Gómez2020-08-051-7/+12
| | | | ogserver process owner (author Roberto Hueso Gómez).
* #980 Change GET and POST /modes URI to /modeRoberto Hueso Gómez2020-08-031-2/+2
| | | | | This patch changes the URI since it is semantically more correct to use the singular.
* #980 Fix POST /modes to use 'setclientmode' scriptRoberto Hueso Gómez2020-07-291-35/+140
| | | | | | | | | | | Now POST /modes does not only write to the database, it also uses the external bash script 'setclientmode' to generate configured PXE templates for each machine. NOTE: This fix requires that room and computer names are unique in the OpenGnsys DB. This behaviour is inherited from the previous 'setclientmode' script but, eventually, it should be replaced for an actual scope selector.
* #988 Check DB port size is in [0, UINT16_MAX]Roberto Hueso Gómez2020-07-151-1/+2
| | | | | Max port number is UINT16_MAX, so this checks whether this config parameter is in the correct range.
* #988 Add DB port option to ogserver.json config fileRoberto Hueso Gómez2020-07-107-0/+15
| | | | | This patch provides functionality to select a database port. It also adds a default IP for the database.
* Add GET /hardware REST requestRoberto Hueso Gómez2020-07-081-2/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements HTTP GET /hardware request which returns a list of the hardware associated with a particular computer. Request: GET /hardware { "scope": { "id": 6, "type": "computer" } } Response: 200 OK { "hardware": [ { "type": "Microprocesadores", "description": "CPU arch:x86 target:x86_64 cores:4" }, { "type": "Memorias", "description": "QEMU 4096MiB" }, { "type": "Tarjetas gráficas", "description": "Red Hat, Inc Virtio GPU" }, { "type": "Tarjetas de Red", "description": "Intel Corporation 82540EM Gigabit Ethernet Controller QEMU Virtual Machine" }, { "type": "Controladores IDE", "description": "Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] Qemu virtual machine" } ] }
* Add POST /modes REST requestRoberto Hueso Gómez2020-07-063-2/+136
| | | | | | | | | | | | | This patch implements HTTP POST /modes request which can change the mode of any particular scope. Request: POST /modes { "scope": {"id": 1, "type": "computer"}, "mode": "pxe" } Response: 200 OK
* #971 split wake on lan codeOpenGnSys Support Team2020-07-064-69/+93
| | | | Add wol.c and wol.h that implements WakeOnLan.
* #990 Use client broadcast address on WoLJavier Sánchez Parra2020-07-034-12/+35
| | | | | | | | | | | | | | | | Some universities have computers in a different subnet where the ogServer is, but ogServer WoL functionality only supported to send packet to its own subnets. This commit solves this. Now ogServer sends two WoL packets per client, one with the broadcast address of the interface indicated in the config file, the other with the broadcast address calculated with the address and netmask of the client. To ensure that the second WoL works correctly you must configure correctly the IP and netmask of the clients. Also, you have to configure the network of your organization to route WoL packet to the correct subnet.
* #971 linkage error after splitOpenGnSys Support Team2020-07-025-26/+27
| | | | | | | | | /usr/bin/ld: src/cfg.o:/home/opengnsys/ogServer/src/ogAdmServer.h:25: multiple definition of `servidoradm'; src/ogAdmServer.o:/home/javi/trabajo/soleta/opengnsys/ogServer/src/ogAdmServer.h:25: first defined here /usr/bin/ld: src/cfg.o:/home/opengnsys/ogServer/src/ogAdmServer.h:26: multiple definition of `puerto'; src/ogAdmServer.o:/home/javi/trabajo/soleta/opengnsys/ogServer/src/ogAdmServer.h:26: first defined here /usr/bin/ld: src/cfg.o:/home/opengnsys/ogServer/src/ogAdmServer.h:35: multiple definition of `tbsockets'; src/ogAdmServer.o:/home/javi/trabajo/soleta/opengnsys/ogServer/src/ogAdmServer.h:35: first defined here /usr/bin/ld: src/cfg.o:/home/opengnsys/ogServer/src/ogAdmLib.h:81: multiple definition of `ndebug'; src/ogAdmServer.o:/home/javi/trabajo/soleta/opengnsys/ogServer/src/ogAdmLib.h:81: first defined here /usr/bin/ld: src/cfg.o:/home/opengnsys/ogServer/src/ogAdmLib.h:80: multiple definition of `szPathFileLog'; src/ogAdmServer.o:/home/javi/trabajo/soleta/opengnsys/ogServer/src/ogAdmLib.h:80: first defined here /usr/bin/ld: src/cfg.o:/home/opengnsys/ogServer/src/ogAdmLib.h:80: multiple definition of `szPathFileCfg'; src/ogAdmServer.o:/home/javi/trabajo/soleta/opengnsys/ogServer/src/ogAdmLib.h:80: first defined here
* #980 Refactor GET /scopes backendRoberto Hueso Gómez2020-07-021-64/+68
| | | | | | This improves style and fixes some memleaks. Co-authored-by: OpenGnSys Support Team <soporte-og@soleta.eu>
* #980 Fix memleak in og_cmd_get_modes()OpenGnSys Support Team2020-06-301-0/+1
| | | | Missing closedir() call.
* #980 Fix memleak in og_cmd_scope_getRoberto Hueso Gómez2020-06-301-1/+6
| | | | | If either root or children_root fail to be created but the other one does not, then reserved memory for the successful one would not be freed.
* #980 Add GET /modes REST requestRoberto Hueso Gómez2020-06-301-0/+54
| | | | | | | | | | | | | | | | | | | This patch implements HTTP GET /modes request which returns all modes available for clients: Request: GET /modes HTTP/1.0 Response: 200 OK { "modes": [ "pxe", "10", "13", "00unknown", "11", "19pxeADMIN", "12" ] }
* #971 rename sources folder to srcOpenGnSys Support Team2020-06-2623-11/+11
| | | | Use the same folder as in ogClient.
* #988 fix json file open error checkOpenGnSys Support Team2020-06-261-1/+1
| | | | if open() fails it returns a negative value.
* #988 use ogserver.json fallback to legacy configuration fileOpenGnSys Support Team2020-06-261-5/+6
| | | | Check for ogserver.json file first, then fall back to legacy.
* #988 add json configuration fileRoberto Hueso Gómez2020-06-268-9/+230
| | | | New configuration file at /opt/opengnsys/cfg/ogserver.json
* #980 Add Virtual statusJavier Sánchez Parra2020-06-263-0/+5
| | | | | Since version 1.2.0, OpenGnsys supports ogVDI hypervisor OS. This commit a new status which indicates that clients are running ogVDI.
* #971 syslog on error from the initialization pathOpenGnSys Support Team2020-06-241-3/+9
|
* #971 rename ogAdmServer to ogserver in syslogOpenGnSys Support Team2020-06-241-1/+1
|
* #971 split socket core logic and main filesOpenGnSys Support Team2020-06-249-473/+536
| | | | Extract socket core and main from ogAdmServer file.
* #980 coding style cleanupOpenGnSys Support Team2020-06-241-10/+11
| | | | | * Curly braces after function definition * use _dbi_ infix for function name
* #980 Add GET /scopes REST requestRoberto Hueso Gómez2020-06-242-0/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements HTTP GET /scopes request which returns the scopes hierarchy: Request: HTTP GET /scopes Response: 200 OK { "scope": [ { "name": "Center 1", "type": "center", "id": 1, "scope": [ { "name": "Room 1", "type": "room", "id": 1, "scope": [ { "name": "Computer 1", "type": "computer", "id": 1, "scope": [] }, { "name": "Computer 3", "type": "computer", "id": 2, "scope": [] } ] } ] } ] }
* #941 Move OG_COMPUTER_NAME_MAXLEN to dbi.hRoberto Hueso Gómez2020-06-242-4/+3
| | | | | This parameter is actually a database related parameter so now it is renamed to OG_DB_COMPUTER_NAME_MAXLEN.
* #986 Rename configuration and systemd to ogserverJavier Sánchez Parra2020-06-192-0/+0
| | | | Step forward to rename all ogAdmServer references to ogServer
* #986 rename to ogserverOpenGnSys Support Team2020-06-196-18/+18
|
* #971 move configuration file to cfg folderOpenGnSys Support Team2020-06-182-0/+0
|
* #971 split into smaller fileOpenGnSys Support Team2020-06-1811-3997/+4118
| | | | | | | | Split ogAdmServer into several files: * sources/rest.c that implements the server REST API. * sources/client.c that implements the client REST API. * sources/json.c that provides a few JSON helpers.
* #985 add COPYING fileOpenGnSys Support Team2020-06-181-0/+661
|
* #985 add .gitignore fileOpenGnSys Support Team2020-06-171-0/+11
|
* #981 Add ogAdmServer own systemd unit fileJavier Sánchez Parra2020-06-161-0/+13
| | | | | This commit is a step in the direction to remove the old unit file. It also allow us to move ogAdmServer to its own repo.
* #971 move ogAdmLib to ogAdmServerOpenGnSys Support Team2020-06-094-3/+482
| | | | Move remaining ogAdmLib code to ogAdmServer
* #971 add str_toupper()OpenGnSys Support Team2020-06-084-9/+31
| | | | Add new utils.c file and replace old StrToUpper().