Commit Graph

337 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Ken Moore
a5a34512c9 Make sure the sysadm/pkg "list_categories" API call only returns non-empty categories. Also add most of the backend systems for additional pkg-modification calls (no API for them yet - that is coming soon). 2016-03-28 09:54:47 -04:00
Ken Moore
5e0cc42ab2 Add two more API calls for sysadm/pkg
1) "action"="list_categories" (optional argument: "repo"). This will list all the known categories within the given repository (local repository used by default if none specified). WARNING: Just because a category is listed from here does not mean there are packages existing within that category. This might be corrected later on to only return categories where packages reside.
2) "action"="list_repos" (no other arguments). This will scan the pkg repo config files and return any repos that pkg is currently aware of. NOTE: All of the repos returns by this function are valid as the optional "repo" argument for the other sysadm/pkg API calls.

API Call #1:

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "repo" : "local",
   "action" : "list_categories"
}

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

Response:
-------------------------------
{
  "args": {
    "list_categories": [
      "ports-mgmt",
      "x11",
      "gnome",
      "textproc",
      "devel",
      "python",
      "misc",
      "print",
      "graphics",
      "security",
      "x11-fonts",
      "lang",
      "ipv6",
      "perl5",
      "converters",
      "math",
      "x11-toolkits",
      "sysutils",
      "dns",
      "net",
      "accessibility",
      "databases",
      "shells",
      "x11-themes",
      "multimedia",
      "audio",
      "www",
      "ftp",
      "net-im",
      "archivers",
      "comms",
      "java",
      "deskutils",
      "kde",
      "mail",
      "editors",
      "emulators",
      "games",
      "irc",
      "japanese",
      "news",
      "x11-servers",
      "tk",
      "net-mgmt",
      "ruby",
      "x11-drivers",
      "x11-wm",
      "x11-clocks",
      "kld",
      "tcl",
      "enlightenment",
      "linux"
    ]
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}

API Call #2

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

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

Response:
-------------------------------
{
  "args": {
    "list_repos": [
      "local",
      "pcbsd-major"
    ]
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-25 19:36:25 -04:00
Ken Moore
cbeb80aee1 Add a new API call for sysadm/pkg: "action"="pkg_search"
This will search with the given "search_term" (required) and return the basic info on all results found.
Optional inputs:
1) "repo" - may be used to specifiy searching a particular repository (local DB if not specified).
2) "category" - may be used to restrict searches to a particular category.

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "repo" : "pcbsd-major",
   "category" : "www",
   "action" : "pkg_search",
   "search_term" : "fire"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "pkg",
   "args" : {
      "action" : "pkg_search",
      "search_term" : "fire",
      "category" : "www",
      "repo" : "pcbsd-major"
   }
}

Response:
-------------------------------
{
  "args": {
    "pkg_search": {
      "www/firefox": {
        "arch": "FreeBSD:11:amd64",
        "cksum": "cc72c379afbd66d152cf06b7d2a14ada413f338071ecb9b084899c94d39f951e",
        "comment": "Web browser based on the browser portion of Mozilla",
        "cpe": "cpe:2.3:a:mozilla:firefox:45.0:::::freebsd11:x64:1",
        "dep_formula": "",
        "desc": "Mozilla Firefox is a free and open source web browser descended from the\nMozilla Application Suite. It is small, fast and easy to use, and offers\nmany advanced features:\n\n o Popup Blocking\n o Tabbed Browsing\n o Live Bookmarks (ie. RSS)\n o Extensions\n o Themes\n o FastFind\n o Improved Security\n\nWWW: http://www.mozilla.com/firefox",
        "flatsize": "96435169",
        "icon": "\\\\\\\"http://www.pcbsd.org/appcafe/icons/www_firefox.png\\\\\\\"",
        "id": "12147",
        "licenselogic": "1",
        "maintainer": "gecko@FreeBSD.org",
        "manifestdigest": "2$0$hcbb9x7urbs9nw1e44chw9bwxn339983b6q9mixxdn5ghdwuh9ny",
        "name": "firefox",
        "no_provide_shlib": "yes",
        "olddigest": "",
        "origin": "www/firefox",
        "osversion": "",
        "path": "All/firefox-45.0_1,1.txz",
        "pkg_format_version": "",
        "pkgsize": "39935776",
        "prefix": "/usr/local",
        "screen1": "\\\\\\\"http://www.pcbsd.org/appcafe/screenshots/www/firefox/screen1.png\\\\\\\"",
        "screen2": "\\\\\\\"http://www.pcbsd.org/appcafe/screenshots/www/firefox/screen2.png\\\\\\\"",
        "version": "45.0_1,1",
        "www": "http://www.mozilla.com/firefox"
      },
      "www/firefox-esr": {
        "arch": "FreeBSD:11:amd64",
        "cksum": "811545c4da089b52db54ddee04af2ea8c439eb12e708f478b09141cdcca7aec5",
        "comment": "Web browser based on the browser portion of Mozilla",
        "cpe": "cpe:2.3:a:mozilla:firefox_esr:38.7.0:::::freebsd11:x64",
        "dep_formula": "",
        "desc": "Mozilla Firefox is a free and open source web browser descended from the\nMozilla Application Suite. It is small, fast and easy to use, and offers\nmany advanced features:\n\n o Popup Blocking\n o Tabbed Browsing\n o Live Bookmarks (ie. RSS)\n o Extensions\n o Themes\n o FastFind\n o Improved Security\n\nWWW: http://www.mozilla.com/firefox",
        "flatsize": "86940998",
        "icon": "\\\\\\\"http://www.pcbsd.org/appcafe/icons/www_firefox-esr.png\\\\\\\"",
        "id": "656",
        "licenselogic": "1",
        "maintainer": "gecko@FreeBSD.org",
        "manifestdigest": "2$0$km1kyyxoae47gyhp9gx7wz7pcnsn6jnc8yxgpz63iyynaxi7ia8y",
        "name": "firefox-esr",
        "no_provide_shlib": "yes",
        "olddigest": "",
        "origin": "www/firefox-esr",
        "osversion": "",
        "path": "All/firefox-esr-38.7.0,1.txz",
        "pkg_format_version": "",
        "pkgsize": "36352676",
        "prefix": "/usr/local",
        "version": "38.7.0,1",
        "www": "http://www.mozilla.com/firefox"
      },
      "www/firefox-esr-i18n": {
        "arch": "FreeBSD:11:*",
        "cksum": "c389f2960fa77548435e0b905b3ef6ddb48957b76c2d8346de1f9f97dd7b23ca",
        "comment": "Localized interface for Firefox",
        "dep_formula": "",
        "desc": "Language packs for Firefox\n\nWWW: http://www.mozilla.org/projects/l10n/",
        "flatsize": "102671800",
        "id": "17350",
        "licenselogic": "1",
        "maintainer": "gecko@FreeBSD.org",
        "manifestdigest": "2$0$wzmx16rcynpdej5eckeg6c8w8z6r7oha86cmjfth4pnfu9iojdmb",
        "name": "firefox-esr-i18n",
        "olddigest": "",
        "origin": "www/firefox-esr-i18n",
        "osversion": "",
        "path": "All/firefox-esr-i18n-38.7.0.txz",
        "pkg_format_version": "",
        "pkgsize": "10449532",
        "prefix": "/usr/local",
        "version": "38.7.0",
        "www": "http://www.mozilla.org/projects/l10n/"
      },
      "www/firefox-i18n": {
        "arch": "FreeBSD:11:*",
        "cksum": "11ca74215bb2c9032a316692b02d4b675cc2102b0e6c9c9f79e85cb6a292e689",
        "comment": "Localized interface for Firefox",
        "dep_formula": "",
        "desc": "Language packs for Firefox\n\nWWW: http://www.mozilla.org/projects/l10n/",
        "flatsize": "107852121",
        "id": "11462",
        "licenselogic": "1",
        "maintainer": "gecko@FreeBSD.org",
        "manifestdigest": "2$0$hozjo4sqt3kn4rqak7hfr4zubt3yahigcnhmbwad7xtuqt1qxntb",
        "name": "firefox-i18n",
        "olddigest": "",
        "origin": "www/firefox-i18n",
        "osversion": "",
        "path": "All/firefox-i18n-45.0.txz",
        "pkg_format_version": "",
        "pkgsize": "10295024",
        "prefix": "/usr/local",
        "version": "45.0",
        "www": "http://www.mozilla.org/projects/l10n/"
      },
      "www/firefox-pulse": {
        "arch": "FreeBSD:11:amd64",
        "cksum": "76bcc4096c378a647c4517ab8fac64d3ecbf2c08a1e47ab0eb9061d95d86c195",
        "comment": "Web browser based on the browser portion of Mozilla",
        "cpe": "cpe:2.3:a:mozilla:firefox:45.0:::::freebsd11:x64:1",
        "dep_formula": "",
        "desc": "Mozilla Firefox is a free and open source web browser descended from the\nMozilla Application Suite. It is small, fast and easy to use, and offers\nmany advanced features:\n\n o Popup Blocking\n o Tabbed Browsing\n o Live Bookmarks (ie. RSS)\n o Extensions\n o Themes\n o FastFind\n o Improved Security\n\nWWW: http://www.mozilla.com/firefox",
        "flatsize": "96438909",
        "icon": "\\\\\\\"http://www.pcbsd.org/appcafe/icons/www_firefox-pulse.png\\\\\\\"",
        "id": "5534",
        "licenselogic": "1",
        "maintainer": "gecko@FreeBSD.org",
        "manifestdigest": "2$0$8mb8qqmcqu3ja8uy4x9nqgyeennjemumrb1q6ugyege76i4rdefb",
        "name": "firefox-pulse",
        "no_provide_shlib": "yes",
        "olddigest": "",
        "origin": "www/firefox-pulse",
        "osversion": "",
        "path": "All/firefox-pulse-45.0_1,1.txz",
        "pkg_format_version": "",
        "pkgsize": "39959876",
        "prefix": "/usr/local",
        "screen1": "\\\\\\\"http://www.pcbsd.org/appcafe/screenshots/www/firefox/screen1.png\\\\\\\"",
        "screen2": "\\\\\\\"http://www.pcbsd.org/appcafe/screenshots/www/firefox/screen2.png\\\\\\\"",
        "version": "45.0_1,1",
        "www": "http://www.mozilla.com/firefox"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-25 16:02:45 -04:00
Ken Moore
0d478da106 Another few modifications to the sysadm/pkg - "pkg_info" action/API.
1) Add a new optional argument: "category". This option will be used if the "pkg_origins" argument is not, and limits the results to packages within the designated category.
2) Add a new optional argument: "result". This option may be set to anything other than "full" to restrict the information output to just the basic/simple information (no sub-categories of info such as "dependencies","requires","depends","options", etc...)

Example JSON request:
{"action":"pkg_info","category":"x11","result":"simple"}
These argument will result in a basic listing of all the packages within the x11 category. (name, version, origin, www, arch, comment, etc....)
{
2016-03-25 15:15:09 -04:00
Ken Moore
147f0c5338 A couple more tweaks for the new pkg_info API call: Now the "provides"/"requires" information will also be output (not too common yet), and the same function can be used for any repo file/database. 2016-03-25 14:38:41 -04:00
Ken Moore
e18efb942d Merge branch 'master' of github.com:pcbsd/sysadm 2016-03-25 12:07:10 -04:00
Ken Moore
0b70897ce8 Add a new API call/system: sysadm/pkg.
This system reads the pkg database directly and returns any relevant information about the pkgs requested.
Note: The "repo" input is optional (defaults to "local"), and the "pkg_origins" will become optional here soon as well (going to make it default to listing all pkgs if the pkg_origins variable is missing/empty).

REST Request:
-------------------------------
PUT /sysadm/pkg
{
   "pkg_origins" : [
      "x11/lumina"
   ],
   "repo" : "local",
   "action" : "pkg_info"
}

WebSocket Request:
-------------------------------
{
   "name" : "pkg",
   "namespace" : "sysadm",
   "args" : {
      "repo" : "local",
      "action" : "pkg_info",
      "pkg_origins" : [
         "x11/lumina"
      ]
   },
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "pkg_info": {
      "x11/lumina": {
        "arch": "FreeBSD:11:amd64",
        "automatic": "0",
        "comment": "Lumina Desktop Environment",
        "dep_formula": "",
        "dependencies": [
          "x11-toolkits/qt5-gui",
          "x11/qt5-x11extras",
          "x11-wm/fluxbox",
          "x11/libXdamage",
          "devel/qt5-linguist",
          "x11/numlockx",
          "devel/qt5-buildtools",
          "multimedia/qt5-multimedia",
          "graphics/qt5-svg",
          "x11/xbrightness",
          "x11/xorg",
          "devel/desktop-file-utils",
          "devel/qt5-concurrent",
          "x11/libX11",
          "net/qt5-network",
          "x11-themes/fluxbox-tenr-styles-pack",
          "x11-themes/kde4-icons-oxygen",
          "devel/qt5-core",
          "x11/xscreensaver",
          "multimedia/gstreamer1-plugins-core",
          "graphics/qt5-imageformats"
        ],
        "desc": "Lumina-DE is a lightweight, BSD licensed desktop environment,\ndesigned specifically for use on FreeBSD\n\nWWW: http://lumina-desktop.org",
        "files": [
          "/usr/local/share/licenses/lumina-0.8.8_2,1/catalog.mk",
          "/usr/local/share/licenses/lumina-0.8.8_2,1/LICENSE",
          "/usr/local/share/licenses/lumina-0.8.8_2,1/BSD3CLAUSE",
          "/usr/local/bin/Lumina-DE",
          "/usr/local/bin/lumina-config",
          "/usr/local/bin/lumina-fileinfo",
          "/usr/local/bin/lumina-fm",
          "/usr/local/bin/lumina-info",
          "/usr/local/bin/lumina-open",
          "/usr/local/bin/lumina-screenshot",
          "/usr/local/bin/lumina-search",
          "/usr/local/bin/lumina-xconfig",
          "/usr/local/etc/luminaDesktop.conf.dist",
          "/usr/local/include/LuminaOS.h",
          "/usr/local/include/LuminaSingleApplication.h",
          "/usr/local/include/LuminaThemes.h",
          "/usr/local/include/LuminaUtils.h",
          "/usr/local/include/LuminaX11.h",
          "/usr/local/include/LuminaXDG.h",
          "/usr/local/lib/libLuminaUtils.so",
          "/usr/local/lib/libLuminaUtils.so.1",
          "/usr/local/lib/libLuminaUtils.so.1.0",
          "/usr/local/lib/libLuminaUtils.so.1.0.0",
          "/usr/local/share/Lumina-DE/Login.ogg",
          "/usr/local/share/Lumina-DE/Logout.ogg",
          "/usr/local/share/Lumina-DE/colors/Black.qss.colors",
          "/usr/local/share/Lumina-DE/colors/Blue-Light.qss.colors",
          "/usr/local/share/Lumina-DE/colors/Grey-Dark.qss.colors",
          "/usr/local/share/Lumina-DE/colors/Lumina-Glass.qss.colors",
          "/usr/local/share/Lumina-DE/colors/Lumina-Gold.qss.colors",
          "/usr/local/share/Lumina-DE/colors/Lumina-Green.qss.colors",
          "/usr/local/share/Lumina-DE/colors/Lumina-Purple.qss.colors",
          "/usr/local/share/Lumina-DE/colors/Lumina-Red.qss.colors",
          "/usr/local/share/Lumina-DE/colors/PCBSD10-Default.qss.colors",
          "/usr/local/share/Lumina-DE/colors/Solarized-Dark.qss.colors",
          "/usr/local/share/Lumina-DE/colors/Solarized-Light.qss.colors",
          "/usr/local/share/Lumina-DE/desktop-background.jpg",
          "/usr/local/share/Lumina-DE/fluxbox-init-rc",
          "/usr/local/share/Lumina-DE/fluxbox-keys",
          "/usr/local/share/Lumina-DE/luminaDesktop.conf",
          "/usr/local/share/Lumina-DE/quickplugins/quick-sample.qml",
          "/usr/local/share/Lumina-DE/themes/Lumina-default.qss.template",
          "/usr/local/share/Lumina-DE/themes/None.qss.template",
          "/usr/local/share/applications/lumina-fm.desktop",
          "/usr/local/share/applications/lumina-info.desktop",
          "/usr/local/share/applications/lumina-screenshot.desktop",
          "/usr/local/share/applications/lumina-search.desktop",
          "/usr/local/share/applications/lumina-support.desktop",
          "/usr/local/share/pixmaps/Insight-FileManager.png",
          "/usr/local/share/pixmaps/Lumina-DE.png",
          "/usr/local/share/wallpapers/Lumina-DE/Lumina_Wispy_gold.jpg",
          "/usr/local/share/wallpapers/Lumina-DE/Lumina_Wispy_green.jpg",
          "/usr/local/share/wallpapers/Lumina-DE/Lumina_Wispy_purple.jpg",
          "/usr/local/share/wallpapers/Lumina-DE/Lumina_Wispy_red.jpg",
          "/usr/local/share/xsessions/Lumina-DE.desktop"
        ],
        "flatsize": "12324767",
        "icon": "\\\"http://www.pcbsd.org/appcafe/icons/x11_lumina.png\\\"",
        "id": "2541",
        "licenselogic": "1",
        "licenses": [
          "BSD3CLAUSE"
        ],
        "locked": "0",
        "maintainer": "kmoore@FreeBSD.org",
        "manifestdigest": "2$0$4ypg5zrco9upyuioczmo3uwbtdd5yart7xuit6fx3gjrn1k979qb",
        "message": "[{\"message\":\"The Lumina Desktop Environment has been installed!\\n\\nAn entry for for launching Lumina from a graphical login manager has already been added to the system, but if you with to start Lumina manually, you will need to do one of the following:\\n1) Put the line \\\"exec Lumina-DE\\\" at the end of your user's \\\"~/.xinitrc\\\" file before running startx\\n2) Wrap the Lumina binary call with an X initialization call: \\nExample: \\\"xinit ${PREFIX}/bin/Lumina-DE -- :0\\\"\\n\\nAlso note that the system-wide default settings for Lumina are contained in ${PREFIX}/etc/luminaDesktop.conf[.dist]. While it is possible to customize the desktop to the user's liking after logging in, you may want to adjust the default settings as necessary if there are multiple user accounts on this system.\"}]",
        "mtree_id": "",
        "name": "lumina",
        "options": {
          "MULTIMEDIA": "on",
          "PCBSD": "on"
        },
        "origin": "x11/lumina",
        "pkg_format_version": "",
        "prefix": "/usr/local",
        "repo_type": "binary",
        "repository": "pcbsd-major",
        "screen1": "\\\"http://www.pcbsd.org/appcafe/screenshots/x11/lumina/screen1.png\\\"",
        "shlibs_provided": [
          "libLuminaUtils.so.1"
        ],
        "shlibs_required": [
          "libxcb.so.1",
          "libxcb-composite.so.0",
          "libxcb-damage.so.0",
          "libXdamage.so.1",
          "libxcb-util.so.1",
          "libGL.so.1",
          "libQt5Core.so.5",
          "libxcb-image.so.0",
          "libxcb-icccm.so.4",
          "libxcb-ewmh.so.2",
          "libQt5Gui.so.5",
          "libQt5Network.so.5",
          "libQt5Widgets.so.5",
          "libQt5Concurrent.so.5",
          "libQt5Multimedia.so.5",
          "libQt5MultimediaWidgets.so.5",
          "libQt5Svg.so.5",
          "libQt5X11Extras.so.5"
        ],
        "time": "1458334158",
        "version": "0.8.8_2,1",
        "www": "http://lumina-desktop.org"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-25 12:03:38 -04:00
Kris Moore
3dfe44dbb0 Add new iohyve API call to set properties
Requires "name" of the VM, and then any other args
will be set on the VM as properties

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "ram" : "512M",
   "name" : "bsdguest",
   "action" : "setprop"
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "id" : "fooid",
   "args" : {
      "ram" : "512M",
      "name" : "bsdguest",
      "action" : "setprop"
   },
   "name" : "iohyve"
}

Response:
-------------------------------
{
  "args": {
    "setprop": {
      "bsdguest": {
        "ram": "512M"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-25 11:24:13 -04:00
Kris Moore
87f1b49fed Add new API call to get iohyve properties for a guest
Requires the "name" of the guest to get props for

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "action" : "getprops",
   "name" : "bsdguest"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "namespace" : "sysadm",
   "args" : {
      "name" : "bsdguest",
      "action" : "getprops"
   },
   "name" : "iohyve"
}

Response:
-------------------------------
{
  "args": {
    "getprops": {
      "bsdguest": {
        "autogrub": "\\n",
        "bargs": "-A_-H_-P",
        "boot": "0",
        "con": "nmdm0",
        "cpu": "1",
        "description": "Tue",
        "install": "no",
        "loader": "bhyveload",
        "name": "bsdguest",
        "os": "default",
        "persist": "1",
        "ram": "256M",
        "size": "10G",
        "tap": "tap0"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-25 10:40:56 -04:00
Ken Moore
4d2dc47837 For the health check - add a "priority" field within the indivual zpool object which needs attention (in addition to the overall "priority" field). This helps for parsing which individual system needs attention within the health check. 2016-03-24 10:18:30 -04:00
Ken Moore
7566f1396e Add a new "fast" mode to the sysadm-update check for updates (re-use previous update info), and setup the regular health check to report update information using this fast mode. 2016-03-24 08:58:29 -04:00
Ken Moore
0bf67bbe06 Fix the update process detection command - needs a return code of 0 to tell if there is a process running. 2016-03-23 14:34:21 -04:00
Ken Moore
bec2898567 Ensure that events also send the message to the socket through the proper thread/order. 2016-03-23 14:27:42 -04:00
Ken Moore
427eb7ec25 Turn off some minor debugging, and ensure that the system health check gets saved into temporary storage for later use as needed. 2016-03-22 10:21:46 -04:00
Ken Moore
7edfaa2321 Oops - fix a typo in the new zfs list_pools output to preserve the "%" symbols in the outputs. That symbol only needs to get trimmed out during the system health checks - not globally. 2016-03-22 10:02:35 -04:00
Ken Moore
b074a611ee Move the "zpool list" parsing function over to a new library class (sysadm::ZFS). This adjusts the sysadm/zfs "list_pools" action return message a bit - it just moves the list of pools one level down - within a "list_pools" object. 2016-03-22 09:39:39 -04:00
Ken Moore
055f6e3be8 Fix another bug in the system health checker - ensure that multiple pools are all listed and not overwriting one another. 2016-03-21 15:47:51 -04:00
Ken Moore
992bdd1f2e Fix the parsing of zpool list used for the health check. 2016-03-21 15:36:39 -04:00
Ken Moore
3060c9906d Finish fixing up the sysadm/update server backend. Now updates can properly be started and the other update flags are detected/used as needed. 2016-03-21 14:14:51 -04:00
Ken Moore
cf8cf0d429 Add a "updaterunning" status to the sysadm/update check for updates, and also setup sysadm/update to emit dispatcher events about the update process. 2016-03-21 13:08:13 -04:00
Ken Moore
638f0eb390 Fix a couple bugs in the sysadm/update check routine. Now it will report "rebootneeded" when the system is waiting to reboot to apply updates, and it allows for multiple "patch" entries now. 2016-03-18 15:16:02 -04:00
Kris Moore
4b160e2982 Cleanup pid files 2016-03-18 09:39:59 -04:00
Kris Moore
7fe1412b4e Use -f to remove iohyve disks / vms 2016-03-16 19:17:11 -04:00
Kris Moore
64366f535c Cleanup usage of RunCommand for iohyve API class 2016-03-12 06:06:21 -05:00
Ken Moore
29a51bf61e Switch the WebSocket message send mechanism over to a signal/slot combination so that we don't get threads trampling each other on high-latency connections. 2016-03-11 18:55:27 -05:00
Kris Moore
1878d25d46 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-03-11 08:10:07 -05:00
Kris Moore
cb4c4eb544 Change how we parse incoming WebSocket TCP/SSL data. Its possible
that data coming in will be mixed with several messages at once,
lets parse those properly, and also implement some sanity checking
to make sure we aren't being flooded with a potential buffer overflow
2016-03-11 08:08:51 -05:00
Kris Moore
9a8d509798 Fix seg fault getting ipv6 addr 2016-03-10 23:44:44 -05:00
Ken Moore
9f99d4c5a7 Clean up the iohyve fetch parsing a bit more, and turn off some of the debugging (leave the iohyve fetch-specific debugs on though). 2016-03-04 13:16:12 -05:00
Ken Moore
4ba9edabbe Oops - forgot to include this last change to the parsing routine to the iohyve fetch parsing. 2016-03-04 11:11:28 -05:00
Ken Moore
857919958a Update the iohyve fetch event structure, and make the whole process log structure available under the "process_details" variable in the event. 2016-03-04 11:05:39 -05:00
Kris Moore
87e40a8467 Rename DispatcherParsing.h -> DispatcherParsing.cpp
Add first parsing function for iohyve fetch, will continue
with it tomorrow
2016-03-03 16:05:18 -05:00
Ken Moore
9396d7ae1a Merge branch 'master' of github.com:pcbsd/sysadm 2016-03-03 15:19:47 -05:00
Ken Moore
d2ef14a0d1 Large update to the dispatcher/events systems. Now there is a new DispatcherParsing.h file where any subsystem-specific dispatcher calls may be detected/parsed/handled as needed, and the iohyve fetch routine was updated to use this routine (for a proof of concept - could probably still use a bit more log output). 2016-03-03 15:16:55 -05:00
Kris Moore
91a2c700cb Add API call to show iohyve version
REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "action" : "version"
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "args" : {
      "action" : "version"
   },
   "id" : "fooid",
   "name" : "iohyve"
}

Response:
-------------------------------
{
  "args": {
    "version": {
      "version": "iohyve v0.7.3 2016/01/08 Bear in a Datacenter Edition"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-03 14:22:53 -05:00
Kris Moore
9b03d42d87 Add API call to resize a VM disk
REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "disk" : "disk0",
   "name" : "bsdguest",
   "action" : "resizedisk",
   "size" : "20G"
}

WebSocket Request:
-------------------------------
{
   "name" : "iohyve",
   "id" : "fooid",
   "args" : {
      "size" : "20G",
      "action" : "resizedisk",
      "disk" : "disk0",
      "name" : "bsdguest"
   },
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "resizedisk": {
      "disk": "disk0",
      "name": "bsdguest",
      "size": "20G"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-03 13:57:16 -05:00
Kris Moore
f91651d342 Add API call to remove a disk from a VM
REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "disk" : "disk1",
   "name" : "bsdguest",
   "action" : "deletedisk"
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "id" : "fooid",
   "name" : "iohyve",
   "args" : {
      "name" : "bsdguest",
      "action" : "deletedisk",
      "disk" : "disk1"
   }
}

Response:
-------------------------------
{
  "args": {
    "deletedisk": {
      "disk": "disk1",
      "name": "bsdguest"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-03 13:37:57 -05:00
Kris Moore
04ee45494f Add new API call to add/create a disk for a VM
REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "name" : "bsdguest",
   "action" : "adddisk",
   "size" : "10G"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "size" : "10G",
      "name" : "bsdguest",
      "action" : "adddisk"
   },
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "iohyve"
}

Response:
-------------------------------
{
  "args": {
    "adddisk": {
      "bsdguest": {
        "size": "10G"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-03 13:24:02 -05:00
Kris Moore
30cb48e926 Add API call to list disks connected to a VM
REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "name" : "bsdguest",
   "action" : "listdisks"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "listdisks",
      "name" : "bsdguest"
   },
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "iohyve"
}

Response:
-------------------------------
{
  "args": {
    "listdisks": {
      "disk0": "10G"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-03 13:11:13 -05:00
Kris Moore
caf6bd1e06 Add new API call to delete an iohyve guest
REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "action" : "delete",
   "name" : "bsdguest"
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "id" : "fooid",
   "args" : {
      "action" : "delete",
      "name" : "bsdguest"
   },
   "name" : "iohyve"
}

Response:
-------------------------------
{
  "args": {
    "delete": {
      "name": "bsdguest"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-03-03 12:46:03 -05:00
Ken Moore
1fc3b3fbb4 Couple changes:
1) Fix the event registration detection (string/array for args, not object/array)
2) Add a 30 second connection timeout for the client to successfully authorize before the server will close the connection.
2016-03-03 11:57:45 -05:00