Ken Moore
083b8ad694
Oops - forgot to add the new RestStructs.cpp file to GIT.
2016-05-09 14:50:10 -04:00
Ken Moore
e2c66ceef7
Merge branch 'master' of github.com:pcbsd/sysadm
2016-05-09 13:37:35 -04:00
Ken Moore
1fea33c354
Get the sysadm server message parsing system all setup for bridge relays (no additional encryption/decryption layer yet)
2016-05-09 13:36:40 -04:00
Kris Moore
6c07e17e8b
Merge branch 'master' of https://github.com/pcbsd/sysadm
2016-05-09 11:32:13 -04:00
Kris Moore
2e4c3d8068
Update the api-test script with optional way to enable REST mode
2016-05-09 11:31:52 -04:00
Dru Lavigne
6351f7714e
Merge pull request #15 from Mrt134/master
...
Adding PCBSD style to sysadm server handbook
2016-05-09 11:27:41 -04:00
Mrt134
32ffd85af7
Merge branch 'master' of https://github.com/pcbsd/sysadm
2016-05-09 11:23:38 -04:00
Mrt134
e9c0da79e0
Added PCBSD style to sysadm handbook
...
- Changed SysAdm handbook style to pair with the PCBSD handbook
2016-05-09 11:21:33 -04:00
Ken Moore
9287390e54
Fix up the parsing/usage of REST requests in the sysadm server. A Websocket-specific filtering rule was put in place earlier which was filtering out all the REST messages.
2016-05-09 10:15:59 -04:00
Ken Moore
c736015324
Merge branch 'master' of github.com:pcbsd/sysadm
2016-05-09 09:36:13 -04:00
Ken Moore
34e7fb4754
Fix up the api-test script so that it runs REST requests properly (WS disabled for the moment - while REST is enabled)
2016-05-09 09:34:05 -04:00
Kris Moore
129285945d
Minor update to test script to use correct variables for REST
2016-05-07 20:22:05 -04:00
dlavigne
97695ef4f1
Doc list_ssl_checksums.
2016-05-05 10:19:12 -04:00
Ken Moore
aa9e7583a7
Merge branch 'master' of github.com:pcbsd/sysadm
2016-05-05 09:58:56 -04:00
Ken Moore
f9af7c2efe
Add a API call to the server:
...
rpc/settings: "action" = "list_ssl_checksums"
This will list the MD5 checksums of all the known SSL keys (in no particular order)
REST Request:
-------------------------------
PUT /rpc/settings
{
"action" : "list_ssl_checksums"
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "list_ssl_checksums"
},
"namespace" : "rpc",
"name" : "settings",
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"md5_keys": [
"0`H\u0013\r*\u00023\u000bc"
]
},
"id": "fooid",
"name": "response",
"namespace": "rpc"
}
2016-05-05 09:55:38 -04:00
Ken Moore
8154d8f345
Enable the 30 second window for a client to successfully authorize before the connection is closed.
2016-05-04 14:54:04 -04:00
Ken Moore
45cec48f3c
Setup the authorization manager for the sysadm-bridge. The SSL authentication procedures for Bridge<-->System should now be completely functional.
2016-05-04 14:45:59 -04:00
dlavigne
0f9a73de2f
Add identify RPC call.
2016-05-03 14:20:44 -04:00
Ken Moore
4ef706afee
Get the bridge setup with the rpc/identify API call as well. Also get it all setup for adding additional API calls.
2016-05-03 11:03:53 -04:00
Ken Moore
7f38c91420
Merge branch 'master' of github.com:pcbsd/sysadm
2016-05-03 10:40:16 -04:00
Ken Moore
f7333470a9
API Change:
...
Add a new API call to the sysadm-server: rpc/identify (no arguments)
This generates a responce identifying the type of sysadm system ("server" in this case). This will be important and I am going to be adding this same API call to all the various sysadm utilities so they can identify which one they are ("server", "bridge", "client").
REST Request:
-------------------------------
PUT /rpc/identify
{}
WebSocket Request:
-------------------------------
{
"args" : {},
"namespace" : "rpc",
"id" : "fooid",
"name" : "identify"
}
Response:
-------------------------------
{
"args": {
"type": "server"
},
"id": "fooid",
"name": "response",
"namespace": "rpc"
}
2016-05-03 10:26:08 -04:00
Kris Moore
bc2d2e4fa6
Merge branch 'master' of https://github.com/pcbsd/sysadm
2016-05-02 15:04:50 -04:00
Kris Moore
ef792121e5
Use script as rc.d target
2016-05-02 15:04:34 -04:00
Kris Moore
e584066f3c
Add rc.d and sysadm-bridge-start
2016-05-02 15:04:07 -04:00
Ken Moore
26f54ff4f0
Simply the server layout of the bridge
2016-05-02 14:57:49 -04:00
Ken Moore
eb0b691c1d
Merge branch 'master' of github.com:pcbsd/sysadm
2016-05-02 14:35:24 -04:00
Ken Moore
bd863b70d7
Add the beginning of a new "sysadm-bridge" utility.
2016-05-02 14:34:18 -04:00
Ken Moore
b27166d1d4
Add a couple new settings:
...
auth/allowUserPassAuth [bool]: Enable username/password combinations for authentication (default value: true)
auth/allowServiceAuth [bool]: Allow local services to connect to the server with reduced priviledges (default value: false)
2016-04-29 14:37:55 -04:00
Ken Moore
6d47bf00bd
oops. fix a typo.
2016-04-29 13:41:25 -04:00
Ken Moore
71f507e9b7
Merge branch 'master' of github.com:pcbsd/sysadm
2016-04-29 13:11:11 -04:00
Ken Moore
60fc3e1c5a
API CHANGE:
...
Change the sysadm/settings class to rpc/settings
While here also add automatic log pruning capabilities (90 days of logs kept by default).
2016-04-29 13:10:11 -04:00
dlavigne
52d599dc82
Doc the namespace change of the sysadm/logs class to rpc/logs.
2016-04-29 11:06:53 -04:00
dlavigne
85ffdab597
Doc kill action.
2016-04-29 11:03:52 -04:00
dlavigne
b473ea7314
Add new dispatcher class.
2016-04-29 10:59:16 -04:00
Ken Moore
78b4dcf62a
API CHANGE
...
Change the namespace of the sysadm/logs class to rpc/logs for consistency between internal/external classes.
2016-04-29 10:58:14 -04:00
Ken Moore
d56e90d557
Add a new API call: rpc/dispatcher -> "action":"kill"
...
This allows a user with full access to cancel pending/running jobs within the dispatcher system.
Required arguments: "job_id" : <ID string> or [<ID1>, <ID2>, etc..]
REST Request:
-------------------------------
PUT /rpc/dispatcher
{
"action" : "kill",
"job_id" : "sysadm_pkg_install-{9c079421-ace9-4b6e-8870-d023b48f4c49}"
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "kill",
"job_id" : "sysadm_pkg_install-{9c079421-ace9-4b6e-8870-d023b48f4c49}"
},
"namespace" : "rpc",
"name" : "dispatcher",
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"killed": {
"jobs": ["sysadm_pkg_install-{9c079421-ace9-4b6e-8870-d023b48f4c49}"]
}
},
"id": "fooid",
"name": "response",
"namespace": "rpc"
}
2016-04-29 10:25:36 -04:00
Ken Moore
aa055be7a2
Merge branch 'master' of github.com:pcbsd/sysadm
2016-04-29 10:04:57 -04:00
Ken Moore
caad04ece9
Add a new API call:
...
rpc/dispatcher -> "action":"list"
This will list all the currently running/pending processes within the dispatcher queues.
Possible Queues: "no_queue", "pkg_queue", "iocage_queue"
REST Request:
-------------------------------
PUT /rpc/dispatcher
{
"action" : "list"
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "list"
},
"namespace" : "rpc",
"name" : "dispatcher",
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"jobs": {
"pkg_queue": {
"sysadm_pkg_install-{9c079421-ace9-4b6e-8870-d023b48f4c49}": {
"commands": [
"pkg install -y --repository \"pcbsd-major\" misc/pcbsd-meta-mate"
],
"queue_position": "0",
"state": "running"
}
}
}
},
"id": "fooid",
"name": "response",
"namespace": "rpc"
}
2016-04-29 10:00:43 -04:00
dlavigne
3131b73a5e
Add new logs class. While here, fix a grammo.
2016-04-28 09:13:58 -04:00
Ken Moore
4cee9244e4
Add a new API call/class:
...
namespace: "sysadm"
name: "logs"
This is a class used for interacting with the log files created by the sysadm server.
"action":"read_logs"
Optional Arguments:
"logs" : array/string of log type(s) (valid types: "hostinfo", "dispatcher", "events-dispatcher","events-lifepreserver","events-state"
"time_format" : one of the following formats (required for custom start/end times below). Valid Formats: "time_t_seconds", "epoch_mseconds, "relative_[day/month/second]", or a QDateTime String code (see http://doc.qt.io/qt-5/qdatetime.html#fromString for details).
"start_time" : "<number/string corresponding to format above>"
"end_time" : "<number/string corresponding to format above>"
If the time_format is missing, or the start/end times are not defined, the end time will be the current date/time, and the start time will be 12 hours previous.
If the "logs" argument is missing/empty, then all logs matching the search parameters will be returned.
Example Input:
{
"action" : "read_logs",
"time_format" : "relative_second",
"start_time" : "-3600"
}
This returns all log entries within the last hour.
Return Format:
"args" : {
"<log_file_type>" : {
"<date_time_stamp>" : <message>,
"<date_timo_stamp2>" : <message>
}
}
2016-04-27 16:41:17 -04:00
dlavigne
1d041b47f9
Update name of Guide. While here, fix a mangled table.
2016-04-27 14:37:39 -04:00
dlavigne
fe58a46838
Doc pkg_autoremove action.
2016-04-27 09:34:06 -04:00
Ken Moore
0acebe7435
Fix up a couple LP API calls. Now they function properly again.
2016-04-26 13:59:53 -04:00
Ken Moore
cd3078c708
Add a note about the day-codes for the lifepreserver scrub schedule: 01 is Monday, 07 is Sunday.
2016-04-26 13:45:45 -04:00
Ken Moore
1b29b2966f
Merge branch 'master' of github.com:pcbsd/sysadm
2016-04-26 09:43:24 -04:00
Ken Moore
b07f11bfe3
API Change: Add a simple "pkg_autoremove" action for the sysadm/pkg subsystem (no additional inputs). This will queue up the pkg autoremove action which prunes all orphaned packages on the systems.
2016-04-26 09:41:58 -04:00
dlavigne
0cd90b3558
Doc new fs class.
2016-04-22 12:29:56 -04:00
Kris Moore
dd33e9648c
Merge branch 'master' of https://github.com/pcbsd/sysadm
2016-04-21 14:55:20 -04:00
Kris Moore
b2a4386c36
Add a new 'fs' class to sysadm API, along with the initial "dirlist"
...
command which will return a listing of the requested directory
REST Request:
-------------------------------
PUT /sysadm/fs
{
"dir" : "/root",
"action" : "dirlist"
}
WebSocket Request:
-------------------------------
{
"args" : {
"dir" : "/root",
"action" : "dirlist"
},
"id" : "fooid",
"name" : "fs",
"namespace" : "sysadm"
}
Response:
-------------------------------
{
"args": {
"dirlist": {
"VirtualBox VMs": {
"dir": true
},
"freenas-auto.iso": {
"group": "wheel",
"owner": "root",
"size": 408049664
},
"ixbuild": {
"dir": true
},
"pc-sysinstall.cfg": {
"group": "wheel",
"owner": "root",
"size": 1741
},
"pc-sysinstall.log": {
"group": "wheel",
"owner": "root",
"size": 125408
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
2016-04-21 14:54:12 -04:00
dlavigne
cf1c16de27
Doc datasets action.
2016-04-21 13:45:16 -04:00