Commit Graph

539 Commits

Author SHA1 Message Date
Ken Moore
b7273f7e19 Make sure that when starting updates via sysadm - it will remove the temporary/last update log file so the next check is forced to re-run. 2016-04-05 10:22:37 -04:00
Ken Moore
36b30e6c9c Finish cleaning up the new "pending" state for dispatcher processes. 2016-04-05 10:19:05 -04:00
Ken Moore
8ad8babafa Adjust the pkg search routine to also detect exact name matches. 2016-04-05 09:43:17 -04:00
Ken Moore
9409ef7908 Setup the dispatcher system to have "pending" processes send out regular pings about still being pending. 2016-04-05 09:38:39 -04:00
Ken Moore
d99e3443bd Merge branch 'master' of github.com:pcbsd/sysadm 2016-04-05 09:10:54 -04:00
Ken Moore
72e337f10b Fix up the SQL connection queue issues. Now it works a little faster and multiple threads accessing the same database will not cause crashes. 2016-04-05 09:10:04 -04:00
Dru Lavigne
f1fe85150e Merge pull request #12 from Mrt134/master
-Added tm to 'SysAdm'
2016-04-04 14:10:21 -04:00
Tim Moore II
b11281e2bc -Added tm to 'SysAdm' 2016-04-04 13:48:55 -04:00
Dru Lavigne
895821ad0e Merge pull request #11 from Mrt134/master
Content addition to the SysAdm server docs
2016-04-04 13:40:14 -04:00
Tim Moore II
185f064b34 Text addition to manage.rst
- added sysadm default config settings and the process to create custom configs to manage.rst
2016-04-04 13:34:52 -04:00
Tim Moore II
919457d54f Forgot to add the new files from the previous commit. 2016-04-04 13:11:32 -04:00
Tim Moore II
bfb99d34ce Content addition to the SysAdm server docs
-Added two new docs as chapters
-Bringing readme information over to .rst for downloading and building SysAdm
2016-04-04 13:06:12 -04:00
Ken Moore
89fbc1293c Merge branch 'master' of github.com:pcbsd/sysadm 2016-04-01 15:06:51 -04:00
Ken Moore
221b666262 Turn off some debugging, and switch the pkg database connection system over to a clone system so one request cannot interfere with another. 2016-04-01 15:06:10 -04:00
Dru Lavigne
070fa8578c Merge pull request #10 from Mrt134/master
A few error fixes
2016-03-31 15:14:35 -04:00
Tim Moore II
6cdd3d2cbf A few error fixes
- updated sysadm server documentation with correct title.
 - cleaned up a few json errors in dispatcher event reply messages.
2016-03-31 13:54:26 -04:00
Ken Moore
e5d8c33b81 Remove some comments from the pkg interface, and make sure the dispatcher sends out a full update when starting for the first time (in case the proc is a special subsystem process). 2016-03-31 10:09:37 -04:00
Ken Moore
341a546c4b Fix a bug in the new annotations streamline - now it gets added to the proper sub-object. 2016-03-31 08:19:28 -04:00
Ken Moore
23a688bd75 Also speed up the annotations pkg_info listing - now it only uses 2 queries total instead of 1+(2*<number of options>) queries. 2016-03-30 21:35:24 -04:00
Ken Moore
4abaac9b75 Merge branch 'master' of github.com:pcbsd/sysadm 2016-03-30 21:20:21 -04:00
Ken Moore
096fb2c5be Reduce the number of queries to get all the options for a pkg down to a single query (across a couple tables). 2016-03-30 21:19:36 -04:00
Dru Lavigne
44d1166023 Merge pull request #9 from Mrt134/master
Working on section 3 of PC-BSD API 1.0 documentation.
2016-03-30 09:17:44 -04:00
Ken Moore
08af33c778 Fix up the dispatcher queueing system (for real this time). Now the processes will properly get removed when they are finished, and the next process started up. 2016-03-29 20:21:43 -04:00
Tim Moore II
b7be4faa31 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-03-29 16:23:59 -04:00
Tim Moore II
9a371de28d Working on section 3 of PC-BSD API 1.0 documentation.
Added subsections to section 3: dispatcher, life preserver, and system state.
Added examples of dispatcher messaging to parts of section 4: Classes.
Added further examples of messaging to section 3 in the subsections.
2016-03-29 16:17:26 -04:00
dlavigne
f66656675b Remove placeholders for now as they can be readded as calls are created. 2016-03-29 10:21:18 -04:00
dlavigne
6705c0b70c Remove redundancy. Events will now be described in each section, as required. 2016-03-29 10:06:52 -04:00
dlavigne
842a594ce3 Doc extra arguments to pkg_info. 2016-03-28 14:08:53 -04:00
dlavigne
d68499f0e4 Doc pkg_remove action. 2016-03-28 13:25:40 -04:00
dlavigne
89bf8df311 Doc pkg_install action. 2016-03-28 13:04:50 -04:00
dlavigne
f72f2db240 doc pkg_lock and pkg_unlock actions. 2016-03-28 12:51:22 -04:00
dlavigne
6e046d5782 Doc pkg_update action. 2016-03-28 12:40:37 -04:00
dlavigne
069e0467a4 Doc pkg_check_upgrade action. 2016-03-28 12:28:51 -04:00
Ken Moore
b7471bf44e Fix a threading issue in the dispatcher which was preventing queued processes from getting started. 2016-03-28 12:20:01 -04:00
Ken Moore
033bea2e7b Add a new API call: sysadm/pkg, "action"="pkg_remove".
This will remove the given packages from the system.
Required arguments:
"pkg_origins" = (single origin string or array of origin strings).
Optional arguments:
"recursive" = "true" or "false" (default: "true"). If true, other packages which depend on this package will also be removed (no broken dependencies).
NOTE: The actual information will be returned as a Dispatcher event - this API call just queues up the pkg operation (limitation of pkg - only one process call at a time)

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "recursive" : "false",
   "action" : "pkg_remove",
   "pkg_origins" : "games/angband"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "name" : "pkg",
   "namespace" : "sysadm",
   "args" : {
      "action" : "pkg_remove",
      "recursive" : "false",
      "pkg_origins" : "games/angband"
   }
}

Response:
-------------------------------
{
  "args": {
    "pkg_remove": {
      "proc_cmd": "pkg delete -y games/angband",
      "proc_id": "sysadm_pkg_remove-{2aa844aa-f6a8-4e8f-ae71-b56af735ccb8}",
      "status": "pending"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-28 11:59:42 -04:00
Ken Moore
9a0ac8e403 Merge branch 'master' of github.com:pcbsd/sysadm 2016-03-28 11:53:11 -04:00
Ken Moore
ab0ce827cf Add a new API call: sysadm/pkg, "action"="pkg_install".
This will install the given packages on the system.
Required arguments:
"pkg_origins" = (single origin string or array of origin strings).
Optional arguments:
"repo": Name of the remote repository to use (if not supplied, pkg will automatically determine repository).
NOTE: The actual information will be returned as a Dispatcher event - this API call just queues up the pkg operation (limitation of pkg - only one process call at a time)

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "pkg_origins" : "games/angband",
   "action" : "pkg_install",
   "repo" : "pcbsd-major"
}

WebSocket Request:
-------------------------------
{
   "name" : "pkg",
   "namespace" : "sysadm",
   "id" : "fooid",
   "args" : {
      "action" : "pkg_install",
      "pkg_origins" : "games/angband",
      "repo" : "pcbsd-major"
   }
}

Response:
-------------------------------
{
  "args": {
    "pkg_install": {
      "proc_cmd": "pkg install -y --repository \"pcbsd-major\" games/angband",
      "proc_id": "sysadm_pkg_install-{ae444472-47df-4a65-91eb-013cc82ce4ad}",
      "status": "pending"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-28 11:50:31 -04:00
dlavigne
dd19b3cf88 Doc pkg_upgrade action. 2016-03-28 11:47:58 -04:00
dlavigne
7aa65f4d22 Doc the pkg_audit action. 2016-03-28 11:40:38 -04:00
Ken Moore
31593708bf Merge branch 'master' of github.com:pcbsd/sysadm 2016-03-28 11:33:39 -04:00
Ken Moore
d00ccb071c Add 2 new API calls: sysadm/pkg, "action"="pkg_[un]lock".
This will [un]lock the given packages on the system.
Required argument: "pkg_origins" = (single origin string or array of origin strings).
NOTE: The actual information will be returned as a Dispatcher event - this API call just queues up the pkg operation (limitation of pkg - only one process call at a time)

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "pkg_origins" : [
      "misc/pcbsd-base"
   ],
   "action" : "pkg_lock"
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "id" : "fooid",
   "name" : "pkg",
   "args" : {
      "pkg_origins" : [
         "misc/pcbsd-base"
      ],
      "action" : "pkg_lock"
   }
}

Response:
-------------------------------
{
  "args": {
    "pkg_lock": {
      "proc_cmd": "pkg lock -y misc/pcbsd-base",
      "proc_id": "sysadm_pkg_lock-{352f7f66-d036-4c16-8978-67950957bf22}",
      "status": "pending"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "action" : "pkg_unlock",
   "pkg_origins" : "misc/pcbsd-base"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "args" : {
      "action" : "pkg_unlock",
      "pkg_origins" : "misc/pcbsd-base"
   },
   "name" : "pkg",
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "pkg_unlock": {
      "proc_cmd": "pkg unlock -y misc/pcbsd-base",
      "proc_id": "sysadm_pkg_unlock-{d1771b41-c1ca-480a-a3ce-42d4eddbfae8}",
      "status": "pending"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-28 11:30:46 -04:00
dlavigne
5d7bd03cc1 Doc list_categories and list_repos actions. 2016-03-28 11:22:32 -04:00
Ken Moore
cbd250edda Add a new API call: sysadm/pkg, "action"="pkg_update".
This will have pkg update it's databases if necessary (not typically used).
Optional argument: "force" = "true" or "false" (default: "false"). If true, this will force pkg to completely re-sync all databases with all known repos (may take some time).
NOTE: The actual information will be returned as a Dispatcher event - this API call just queues up the pkg operation (limitation of pkg - only one process call at a time)

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "force" : "true",
   "action" : "pkg_update"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "name" : "pkg",
   "namespace" : "sysadm",
   "args" : {
      "force" : "true",
      "action" : "pkg_update"
   }
}

Response:
-------------------------------
{
  "args": {
    "pkg_update": {
      "proc_cmd": "pkg update -f",
      "proc_id": "sysadm_pkg_update-{8d65bbc5-fefc-4f34-8743-167e61a54c4c}",
      "status": "pending"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-28 11:08:44 -04:00
Ken Moore
8680d309a5 Add a new API call: sysadm/pkg, "action"="pkg_check_upgrade".
This will have pkg check to see if there are any package updates available.
NOTE: The actual information will be returned as a Dispatcher event - this API call just queues up the pkg operation (limitation of pkg - only one process call at a time)

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "action" : "pkg_check_upgrade"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "pkg_check_upgrade"
   },
   "namespace" : "sysadm",
   "name" : "pkg",
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "pkg_check_upgrade": {
      "proc_cmd": "pkg upgrade -n",
      "proc_id": "sysadm_pkg_check_upgrade-{c5e9d9a1-7c49-4a70-9d7c-4a84277c83b0}",
      "status": "pending"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-28 11:00:59 -04:00
Ken Moore
df3196a54e Add a new API call: sysadm/pkg, "action"="pkg_upgrade".
This will have pkg upgrade all currently-installed packages.
NOTE: The actual information will be returned as a Dispatcher event - this API call just queues up the pkg operation (limitation of pkg - only one process call at a time)

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "action" : "pkg_upgrade"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "pkg_upgrade"
   },
   "name" : "pkg",
   "namespace" : "sysadm",
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "pkg_upgrade": {
      "proc_cmd": "pkg upgrade -y",
      "proc_id": "sysadm_pkg_upgrade-{19ace7c9-0d83-4a0d-9249-0b56cb105762}",
      "status": "pending"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-28 10:55:40 -04:00
Ken Moore
01e47a358e Merge branch 'master' of github.com:pcbsd/sysadm 2016-03-28 10:51:25 -04:00
dlavigne
34dcdf1aef Doc pkg_info action. 2016-03-28 10:39:55 -04:00
Ken Moore
203c18752f Add a new API call: sysadm/pkg, "action" = "pkg_audit".
This will perform an audit of all installed packages and report any vulnerable packages and which other packages these impact. NOTE: The actual information will be returned as a Dispatcher event - this API call just queues up the pkg operation (limitation of pkg - only one process call at a time)

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "action" : "pkg_audit"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "pkg_audit"
   },
   "name" : "pkg",
   "id" : "fooid",
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "pkg_audit": {
      "proc_cmd": "pkg audit -qr",
      "proc_id": "sysadm_pkg_audit-{257cc46b-9178-4990-810a-12416ddfad79}",
      "status": "pending"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-28 10:37:05 -04:00
dlavigne
428e8d93b0 Prep for changes to pkg class. 2016-03-28 10:23:34 -04:00
dlavigne
8119f440a5 Doc setprop action. 2016-03-28 10:01:41 -04:00