Commit Graph

761 Commits

Author SHA1 Message Date
Ken Moore
70289f9d7a Oops - now the top parser will output the whole command. 2016-09-13 12:13:09 -04:00
Ken Moore
024c049f35 Merge branch 'master' of github.com:trueos/sysadm 2016-09-13 12:08:13 -04:00
Ken Moore
9df060fd3d Cleanup a couple backend API calls:
1) In the system manager "process info" function, use the -a flag for top so we get the whole command instead of just the first binary.
2)Cleanup a bit more of the backend of the new firewall manager.
2016-09-13 12:05:38 -04:00
Mrt134
3ee59ea0cc Small fix to references:
- Fixed some broken references in TrueOS handbook due to trademark symbols.
- Ported changes back to this handbook to ensure parity; no build errors created.
2016-09-13 10:48:33 -04:00
Mrt134
cf42180fbd Full review of sysadmclient.rst
- Whitespace fixes.
- Clean up unnecessary sentence fragments.
- Add guilabel roles.
- Grammar and spelling rewrites.
- PEP8 fixes.
- Trademark substitutions added.
- Added TODO comments for screenshots which require an update or new screenshot.
- Rewrote internal references to be external. The sysadm client file should now be completely agnostic, and able to be copy/pasted between the TrueOS handbook and SysAdm client handbook.
2016-09-13 10:31:42 -04:00
Ken Moore
c9f227eebc API CHANGE: last sysadm/firewall action
Final action for the sysadm/firewall class: "action" = "reset-defaults"
This will reset all the firewall settings back to defaults and restart the firewall.
NOTE: This will only work on TrueOS - plain FreeBSD does not have any concept of default firewall settings and this API call will return an error in that case.

REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
   "action" : "reset-defaults"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "args" : {
      "action" : "reset-defaults"
   },
   "namespace" : "sysadm",
   "name" : "firewall"
}

Response:
-------------------------------
{
  "args": {
    "result": "success"
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-09-13 08:07:31 -04:00
Ken Moore
c089525bf7 API CHANGE: 5 simple "actions" for sysadm/firewall
Add five new "actions" for managing the firewall:
"start" - turn on the firewall
"stop" - turn off the firewall
"restart" - reload the firewall (catches any settings changes - not generally needed)
"enable" - automatically start the firewall on bootup
"disable" - do not start the firewall on bootup

They all use the same input/output syntax, just the "action" input field is different

REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
   "action" : "restart"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "args" : {
      "action" : "restart"
   },
   "namespace" : "sysadm",
   "name" : "firewall"
}

Response:
-------------------------------
{
  "args": {
    "result": "success"
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-09-13 07:39:27 -04:00
Ken Moore
aca7bbc7b0 API CHANGE: new action for sysadm/firewall
"action":"close"
REQUIRED: "ports":["<number>/<type>", "<number2>"/"<type2>"]

This will close the designated ports in the firewall

REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
   "action" : "close",
   "ports" : [
      "12151/tcp"
   ]
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "firewall",
   "args" : {
      "ports" : [
         "12151/tcp"
      ],
      "action" : "close"
   }
}

Response:
-------------------------------
{
  "args": {
    "result": "success"
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-09-12 15:52:56 -04:00
Ken Moore
ed3296eaf3 API CHANGE: New action for sysadm/firewall
"action":"open"
REQUIRES: "ports":[<number>/<type>, <number2>/<type2>]

REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
   "action" : "open",
   "ports" : [
      "12151/tcp"
   ]
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "name" : "firewall",
   "args" : {
      "ports" : [
         "12151/tcp"
      ],
      "action" : "open"
   },
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "result": "success"
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-09-12 15:47:54 -04:00
Ken Moore
108a2da675 API CHANGE: New action for sysadm/firewall
"action":"status"
Returns the current status of the firewall

REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
   "action" : "status"
}

WebSocket Request:
-------------------------------
{
   "name" : "firewall",
   "args" : {
      "action" : "status"
   },
   "id" : "fooid",
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "is_enabled": "true",
    "is_running": "true"
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-09-12 15:29:24 -04:00
Ken Moore
6b348c3940 API CHANGE:
Add a new "action" for the new sysadm/firewall class:
"action":"list_open"
Returns an array of all the open port/type combinations for the firewall.

REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
   "action" : "list_open"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "list_open"
   },
   "id" : "fooid",
   "name" : "firewall",
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "openports": [
      "5353/udp"
    ]
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-09-12 15:21:02 -04:00
Ken Moore
45bb83a05f API CHANGE:
Add a new class to sysadm: sysadm/firewall
This is the new firewall manager (ipfw), for setting options for the system firewall.

Initial API Call: "action":"known_ports"
This will return a list of all known ports and any names/descriptions for them (this is a static list - it does not reflect which ports are in-use or opened on the system. It is just for matching a port to a name/description)

REST Request (example):
-------------------------------
PUT /sysadm/firewall
{
   "action" : "known_ports"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "namespace" : "sysadm",
   "args" : {
      "action" : "known_ports"
   },
   "name" : "firewall"
}

Response:
-------------------------------
{
  "args": {
    "1/tcp": {
      "description": "#TCP Port Service Multiplexer",
      "name": "tcpmux",
      "port": "1/tcp"
    },
    "1/udp": {
      "description": "#TCP Port Service Multiplexer",
      "name": "tcpmux",
      "port": "1/udp"
    },
    "100/tcp": {
      "description": "#[unauthorized use]",
      "name": "newacct",
      "port": "100/tcp"
    }
  }
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-09-12 13:18:32 -04:00
Ken Moore
efc7bfeaad Merge branch 'master' of github.com:trueos/sysadm 2016-09-09 15:24:44 -04:00
Ken Moore
341082fe42 Cleanup a lot of the firewall manager backend class. Should be ready for hooking up API calls now. 2016-09-09 15:24:02 -04:00
Mrt134
68e8bb16bb Add substitutions patch to conf.py for all handbooks. 2016-09-08 12:44:59 -04:00
Mrt134
5e60b7479c Update sysadmclient.rst
- Fix build errors related to internal references to the TrueOS handbook.
  Internal references have been replaced with links to specific sections of the
  online trueos handbook.
- Fix PEP8 errors and a few unfinished sentences.
- Rework introduction slightly to reference the server handbook and note the
  remote access elements are disabled by default.
2016-09-06 13:39:38 -04:00
Mrt134
d29ad39e78 Merge sysadmclient.rst from trueos-docs repo into sysadm client handbook
- Copy over sysadmclient.rst from trueos-docs repo and reconfigure index and conf files to incorporate the file.
- Add all required images for sysadmclient.rst.
2016-09-06 12:09:25 -04:00
Mrt134
49fb902581 Review server handbook:
- Rewrite Introduction section for clarity.
- Add references to other SysAdm handbooks.
- Fix whitespace issues in all files.
- Fix numerous errors in all files.
- Add note about the current WIP nature of SysAdm.
- Add note listing current default ports SysAdm needs to be opened for remote access to work.
  Also noted the user can redefine which ports SysAdm uses.
2016-09-06 10:57:30 -04:00
Jeff 'Raid' Baitis
a1dfac0392 Allow for case insensitive matching on the name of packages.
This mimics the behavior of 'pkg search', which performs a case
insensitive search.
2016-09-02 00:00:04 -07:00
Mrt134
f5d9caefed Update API reference, client, and server handbooks
- Edited link colors to be a stronger blue/red color.
- Altered hover role for links to add underlining to the link texts.
- Restyled roles
  - Unified padding boxes and colors (exception: :guilabel: uses a different color).
    All roles should now have the same height padding, which has been reduced as well.
  - Role colors have all been lightened to avoid being distracting or making
    contained text hard to read.
  - Removed bold from :menuselection:.
  - :command: now renders as a monospace font.
- Restyled admonitions
  - Darkened text inside admonition boxes.
  - Rounded border elements around boxes.
  - Reworked borders to be smaller and darker in color.
- Fixed figure captions to be smaller and fit better with the surrounding text.
- Restyled tables
  - Table captions now have the same style as figure captions.
  - Altered color for headers
  - Added hover themeing for tables: mousing over a row or header title will change its color.
2016-09-01 13:37:37 -04:00
Mrt134
cc1c83be7b API Reference Guide update:
- Add new class file: services.rst.
- Update all API calls to current: Aug 30,2016
2016-08-30 14:39:37 -04:00
Ken Moore
75f21cfe1b API CHANGE
Last round of new "action"s for the sysadm/services class,
"action":"[enable/disable]"
Required input arguments:
"services":["service1","service2","etc"]

Exactly the same syntax as the start/stop/restart API calls, just a different action and the output field is "services_[enabled/disabled]" as well.
2016-08-30 14:22:33 -04:00
Ken Moore
0408f61f4c API CHANGE
Add the "is_running" output field to the sysadm/services "list_services" output.
This also cleans up the is_enabled detection routine so it should be more reliable.
2016-08-30 13:32:53 -04:00
Ken Moore
8a594044bb API CHANGE
Add 3 new API calls (all almost the same - just different "actions" and the return message will be slightly different)

"action":"start" OR "stop" OR "restart"
This will [start/stop/restart] services on the system.
REQUIRED ARGUMENTS:
"services" : <string with a single service, or array of services>

EXAMPLE "start" command (change "services_started" in responce to "services_[started/stopped/restarted]" as needed to match the action:

REST Request (example):
-------------------------------
PUT /sysadm/services
{
   "action" : "start",
   "services" : [
      "cupsd"
   ]
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "start",
      "services" : [
         "cupsd"
      ]
   },
   "name" : "services",
   "id" : "fooid",
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "services_started": [
      "cupsd"
    ]
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-08-30 11:27:51 -04:00
Ken Moore
200a7de9e0 API CHANGE
Add a new output field to the sysadm/updates "check for updates".

args:{
  "details":"<details about updates>"
}
2016-08-30 10:04:30 -04:00
Kris Moore
cd959daa3f Ken missed a } 2016-08-29 22:54:04 -04:00
Ken Moore
ce86331f1e Clean up the new sysadm/services class just a bit more. Getting ready to add all the start/stop/restart API calls. 2016-08-29 16:09:30 -04:00
Ken Moore
0d4eb2c4f3 Cleanup the rc.conf parsing a bit more - turn of debugging messages, and ensure we use [one][start/stop/restart] as needed depending on if it is enabled or not. 2016-08-29 14:59:32 -04:00
Ken Moore
2f7bfe06aa API CHANGE
Modify the output fields for the sysadm/services, "list_services" action:
Now each service entry will look like this:
"accounting": {
        "description": "",
        "is_enabled": "false",
        "name": "accounting",
        "path": "/etc/rc.d/accounting",
        "tag": "accounting_enable"
      }

I will probably be adding an "is_running" [true/false] field here soon as well - the backend for that still needs to be written first.
2016-08-29 14:09:20 -04:00
Ken Moore
1bf0ec425f API CHANGE
Add a new API class/call to sysadm:
namespace: sysadm
name: services
This class is for managing all the background daemons on the system.

Initial API call:
args : {"action" : "list_services" }
This will return a list of all services available on the system.

*Note: return message shortened for example purposes - there are usually tons of services available

REST Request (example):
-------------------------------
PUT /sysadm/services
{
   "action" : "list_services"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "list_services"
   },
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "services"
}

Response:
-------------------------------
{
  "args": {
    "services": {
      "accounting": {
        "name": "accounting",
        "tag": "accounting_enable"
      },
      "addswap": {
        "name": "addswap",
        "tag": "addswap_enable"
      },
      "amd": {
        "name": "amd",
        "tag": "amd_enable"
      },
      "apm": {
        "name": "apm",
        "tag": "apm_enable"
      },
      "apmd": {
        "name": "apmd",
        "tag": "apmd_enable"
      },
      "atm": {
        "name": "atm",
        "tag": "atm_enable"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-08-29 11:41:15 -04:00
Kris Moore
c24bc90769 Give sysadm a proper mkport.sh script 2016-08-27 17:13:54 -04:00
Mrt134
7f76acb950 Merge branch 'master' of github.com:trueos/sysadm 2016-08-25 13:44:32 -04:00
Mrt134
65037a300c Finish in-depth review of API Guide:
- Line by line review of all .rst files in the API Reference Guide.
- Fix whitespace issues.
- Fix numerous spelling and grammar errors.
- Reworked numerous sections for clarity and flow.
- Fixed oversize tables to be fully PEP8 compliant.
2016-08-25 13:42:30 -04:00
Ken Moore
9312915ccf Cleanup the home dir creation routine a bit more in the sysadm/users class: *DO NOT* try to create a home dir if /nonexistant or /var/empty are specified. 2016-08-25 12:25:01 -04:00
Ken Moore
c0ca7a333b Merge branch 'master' of github.com:trueos/sysadm 2016-08-25 11:15:02 -04:00
Ken Moore
9f06fbb03c Fix up the addition/modification of users in the sysadm/users class. 2016-08-25 11:13:25 -04:00
Mrt134
7ec47963ac Begin in-depth review of API Reference guide.
- Whitespace fixes.
- Reworking text.
- Reducing the size of tables for better PEP8 conformity.
- Altering admonition box titles (use tip and danger).
- Update roles (use :guilabel: and verify other uses).
2016-08-24 15:57:57 -04:00
Mrt134
cf4a485382 Style and arrow patch update + general review of API and Server handbooks.
- Updated trueos_style to current.
- Updated menuselection arrow replacement patch to current.
- Reviewed API reference guide:
  - Reviewed for :guilabel: additions.
  - Added missing trademark symbols.
- Update Server handbook:
  - Added missing trademaks.
  - Replaced outdated link.
  - Updated admonition boxes.
  - Added :guilabel: role where necessary.
  - Add more descriptive text of SysAdm and the goals of the project.
  - Updated code-boxes.
2016-08-24 13:13:57 -04:00
Mrt134
9ed043f0f5 Add reworked theme values and apply menuselection arrow patch to all handbooks. 2016-08-23 13:52:55 -04:00
Mrt134
38eb34625e :guilabel: directive change to all handbooks
- Fixed themeing slightly for :guilabel: directives.
2016-08-22 10:17:12 -04:00
Ken Moore
88e501eb29 Merge pull request #24 from q5sys/master
Updating PCBSD references to TrueOS (github links and wording)
2016-08-18 14:29:45 -04:00
JT Pennington
fd6f82a91c Update README.md
Fixed other references.
2016-08-18 14:07:31 -04:00
JT Pennington
b99379f412 Update README.md
Updated links to point to trueos repo instead of the older pcbsd repo
2016-08-18 14:06:30 -04:00
Mrt134
e530a797f7 Organization update 2:
- Moved API docs to general "docs" folder; all handbooks are now in the same area.
- Deleted "pcbsd_style" from all three handbooks as it is now trueos_style.
- Fixed a number of themeing elements for server and client handbooks.
- Added logos to both handbooks.
2016-08-18 12:26:45 -04:00
Mrt134
e47ef0915e Accidental add of _build files:
Removed _build/ files which were accidentally added to the last commit.
2016-08-18 12:04:58 -04:00
Mrt134
7c73b6a282 Handbook logisitics:
- Created client handbook and started applying themeing to it.
- Moved docs files to new folder to clearly label server and client handbooks.
2016-08-18 12:02:33 -04:00
Mrt134
dd34a97f57 Update API guide to current 8/18/16
- Modified "usershow" action to add "canremove": "false".
- Added new "groupmod" action with examples.
2016-08-18 09:58:03 -04:00
Ken Moore
1fd947f5b4 API CHANGE:
Add a new action to the sysadm/users class: "groupmod"
This action allows for modifying a given group on the system

REQUIRED: "name"="<name of group to modify>"
and any one of these options is also required:
"users":["array of users"] (will set the list of users for this group)
"add_users":["array of users"] (will add the listed users to the current users)
"remove_users":["array of users"] (will remove the listed users from the current users)

Example API Request (JSON)
{
"id":"sample",
"namespace":"sysadm",
"name":"users",
"args":{
  "action":"groupmod",
  "name":"operator",
  "users":["user1","user2"]
  }
}
2016-08-17 12:15:48 -04:00
Ken Moore
8700aab62a API CHANGE
In the sysadm/users "action"="usershow" output, put a "canremove"="false" within the object of the currently-active user (so the client knows which user(s) cannot be removed right now). We might be able to extend this later on the server side to set that flag for *all* active users on the system instead.
2016-08-16 13:09:50 -04:00
Ken Moore
f073d2aa17 Merge branch 'master' of github.com:trueos/sysadm 2016-08-16 11:46:50 -04:00