Commit Graph

66 Commits

Author SHA1 Message Date
Luke De Mouy
fb508a8352 Move PortInfo struct out of PortLookUp class, and fiddled with the regex
to make it actually work based on testing. The filter operation now will
pickup things like 522/tcp in the QStringList if you're searching for
22/tcp, but testing seems to indicate that just taking the first one in
the list works for getting what we want.
2016-01-09 13:00:23 -07:00
Luke De Mouy
5cc11be9e6 add the port type to the PortInfo struct 2016-01-07 16:55:04 -07:00
Luke De Mouy
26f51d6822 Make portlookup take the port type into consideration when checking the
port
2016-01-07 16:42:11 -07:00
Luke De Mouy
bdac469ed3 remove unnecessary <string> include, delete the QFile once we're done
with it. Add in a constructor that initializes the port cache, and add
in a destructor to delete the cache if portlookup is deleted.
2016-01-07 03:39:50 -07:00
Luke De Mouy
19c072bc81 update library.pro to build the portlookup class
Refactor portlookup from a function that reads a file each time it is
called to a class that reads the file into a QStringList the first time
that it is called and reuses it afterwards.
2016-01-06 18:04:47 -07:00
Luke De Mouy
37c6b2a7c9 Adds in the LookUpPort function call that returns a struct containing
information about a port including it's description and keyword.
SSH and the web port are current placeholders for the recommended ports list
2016-01-06 12:59:00 -07:00
Kris Moore
2bfdc0928b Fixed up the way REST / HTTP1.1 messages are formatted when passed
back to the client. Fixes an issue with bad header formatting, and
changed JSON to be more human-readable.

Also, changed the test script to only display the verbose error
output if it fails, otherwise it'll just return the JSON response
2016-01-05 17:55:22 -05:00
Ken Moore
7ffec5003b Add PUT REST support, and clean up the bytes calculation for the output JSON data. 2016-01-05 16:20:37 -05:00
Kris Moore
18adf6d486 Use listcron instead of list-cron 2016-01-05 15:59:04 -05:00
Ken Moore
ab92721fce Merge branch 'master' of github.com:pcbsd/sysadm 2016-01-05 15:55:18 -05:00
Ken Moore
b425c7bb89 Allow "Post" Requests from REST input. 2016-01-05 15:54:55 -05:00
Kris Moore
9b62a01288 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-01-05 15:54:42 -05:00
Kris Moore
9531f29a84 Change from GET -> POST in the test example 2016-01-05 15:54:22 -05:00
Ken Moore
838a5d9f60 Fix up some REST input parsing. 2016-01-05 15:50:38 -05:00
Ken Moore
35a90406ec Oops, forgot to comment out the auth user/pass line from the log file (don't need to keep that around). 2016-01-05 15:12:07 -05:00
Ken Moore
858ed83611 Add in the REST authorization protocols so REST communications now get through to the backend systems if valid requests. 2016-01-05 15:11:01 -05:00
Ken Moore
7677ed5f65 Merge branch 'master' of github.com:pcbsd/sysadm 2016-01-05 14:46:39 -05:00
Ken Moore
c08a458127 Quick fix for the unauthorized return value for bad requests. 2016-01-05 14:46:00 -05:00
Kris Moore
32a836824d Fix REST test script, and add .gitignore for dirty directory 2016-01-05 14:44:46 -05:00
Ken Moore
6e204d19b6 Merge branch 'master' of github.com:pcbsd/sysadm 2016-01-05 14:18:41 -05:00
Ken Moore
a1ba1044ee Don't 'close' a socket after a TCP reply - instead just disconnect from the host after all data has been transmitted. 2016-01-05 14:17:46 -05:00
Kris Moore
80c649da4f Add a tests/ directory, with some basic REST testing utilities 2016-01-05 14:11:28 -05:00
Ken Moore
a5fcddcbbe Separate out the reply systems within the websocket.[cpp/h] files, and ensure that we close the TCP socket after sending back a reply. 2016-01-05 13:46:55 -05:00
Kris Moore
ad8d88fc7c Fix a bug parsing the rest URI 2016-01-05 13:35:00 -05:00
Kris Moore
ea0bbad1f6 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-01-05 13:19:16 -05:00
Kris Moore
528c247607 Add LifePreserver API first list-cron call 2016-01-05 13:19:01 -05:00
Ken Moore
adda4e7931 Merge branch 'master' of github.com:pcbsd/sysadm 2016-01-05 13:18:43 -05:00
Ken Moore
1c7dab4ab2 Fix a typo in the signal/slots for a tcp server. 2016-01-05 13:18:20 -05:00
Ken Moore
b1e451b385 Adjust the new sysadm/network function a bit - just add proper error code handling if nothing was performed. 2016-01-04 15:07:53 -05:00
Ken Moore
ace6c2ca4c Add a new subsystem to sysadm-server: the sysadm-network device information system.
To Access:
namespace="sysadm"
name="network"
args={"action" : "list-devices"}

Output arguments structure:
"<device name>" : {
 "ipv4" : <value>,
 "ipv6" : <value>,
 "netmask" : <value>,
 "description" : <value>,
 "MAC" : <value>,
 "status" : <value>,
 "is_active" : [true/false],
 "is_dhcp" : [true/false],
 "is_wireless" : [true/false]
}
2016-01-04 14:29:04 -05:00
Ken Moore
fdf06cac1e Clean up a bit more of the websocket class. 2016-01-04 13:44:58 -05:00
Ken Moore
7d53e59a1d Oops, forgot to turn off debug mode before committing. 2016-01-04 13:33:44 -05:00
Ken Moore
8d57413401 A few more updates to the input message parsing systems for the server: Ensure that both the namespace and the name of the input message are passed through to the backend parser/system (if authorized). 2016-01-04 13:30:49 -05:00
Ken Moore
87ab5f2a22 Fix the input argument parsing for sysadm-server. 2016-01-04 13:01:39 -05:00
Ken Moore
467e7d2bbe Merge branch 'master' of github.com:pcbsd/sysadm 2015-12-30 16:06:39 -05:00
Ken Moore
b0bfcb4c03 Convert the REST/JSON input/output structures quite a bit so the backend usage is now agnostic as to the type of input used. It will then convert the output format to match what was input (REST -> REST, JSON -> JSON). 2015-12-30 16:05:08 -05:00
Kris Moore
c154668747 Add sysadm-restserver and sysadm-websocket rc.d files, so we can
enable them each on their own
2015-12-29 14:09:36 -05:00
Ken Moore
508e025cea Make sure the port numbers get changed a bit, and fix some complication issues in the new backend. 2015-12-29 12:54:01 -05:00
Ken Moore
90e23c882e Merge branch 'master' of github.com:pcbsd/sysadm 2015-12-29 12:47:05 -05:00
Ken Moore
9fe2914da3 Convert sysadm-server to run either in TCP or WebSocket mode.
New CLI flags:
"-ws": Use the websocket protocols instead of tcp
"-p <port number>": Use the designated port number for the server.
2015-12-29 12:43:29 -05:00
Ken Moore
9a161644d1 Merge branch 'master' of github.com:pcbsd/sysadm 2015-12-17 17:16:06 -05:00
Ken Moore
39f36d1d4f Furthur cleanup the sysadm subsystem request forwarding mechanisms so it is easier to extend later. The return/error code for each subsystem is not used yet - will finish that within the websocket later, but the general backend systems are now setup. 2015-12-17 17:12:19 -05:00
Kris Moore
e7a7ed7dbb Rename syscache -> sysadm 2015-12-17 14:22:39 -05:00
Kris Moore
27f37a9767 Rename pcbsd-sysadm rc.d -> sysadm 2015-12-17 14:21:05 -05:00
Kris Moore
a0ae49496b Fix some issues compiling sysadm locally without it installed to
/usr/local
2015-12-17 14:19:29 -05:00
Kris Moore
6d3a8e06b2 Add rc.d script 2015-12-17 14:15:40 -05:00
Kris Moore
dcee9c38db Add port template for sysadm 2015-12-17 14:10:03 -05:00
Kris Moore
5583f4d2c0 Change port number to 12150 2015-12-17 13:25:56 -05:00
Ken Moore
0c943636bd Move/remove a couple files around. 2015-12-15 13:15:15 -05:00
Ken Moore
d639bb5a03 Merge branch 'master' of github.com:pcbsd/sysadm 2015-12-15 13:14:25 -05:00