Contents
* https://github.com/mrvautin/openKB
Openkb installl
Clone Repository: git clone https://github.com/mrvautin/openKB.git && cd openKB
Install dependencies: npm install
Start application: npm start
Go to http://127.0.0.1:4444 in your browser
mp2 manager
- npm install pm2 -g
pm2 start
brightmoon /mnt/play/Downloads/openKB # pm2 start app.js [PM2] Applying action restartProcessId on app [app](ids: 0) [PM2] [app](0) ✓ [PM2] Process successfully started ┌──────────┬────┬─────────┬──────┬──────┬────────┬─────────┬────────┬─────┬───────────┬──────┬──────────┐ │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │ ├──────────┼────┼─────────┼──────┼──────┼────────┼─────────┼────────┼─────┼───────────┼──────┼──────────┤ │ app │ 0 │ 1.0.23 │ fork │ 4944 │ online │ 15 │ 0s │ 0% │ 11.2 MB │ root │ disabled │ └──────────┴────┴─────────┴──────┴──────┴────────┴─────────┴────────┴─────┴───────────┴──────┴──────────┘ Use `pm2 show <id|name>` to get more details about an app brightmoon /mnt/play/Downloads/openKB # pm2 list ┌──────────┬────┬─────────┬──────┬──────┬────────┬─────────┬────────┬───────┬───────────┬──────┬──────────┐ │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │ ├──────────┼────┼─────────┼──────┼──────┼────────┼─────────┼────────┼───────┼───────────┼──────┼──────────┤ │ app │ 0 │ 1.0.23 │ fork │ 4944 │ online │ 15 │ 3s │ 15.6% │ 69.9 MB │ root │ disabled │ └──────────┴────┴─────────┴──────┴──────┴────────┴─────────┴────────┴───────┴───────────┴──────┴──────────┘ Use `pm2 show <id|name>` to get more details about an app
pm2 describe id/appName
Describing process with id 0 - name app ┌───────────────────┬───────────────────────────────────┐ │ status │ online │ │ name │ app │ │ version │ 1.0.23 │ │ restarts │ 15 │ │ uptime │ 2m │ │ script path │ /mnt/play/Downloads/openKB/app.js │ │ script args │ N/A │ │ error log path │ /root/.pm2/logs/app-error.log │ │ out log path │ /root/.pm2/logs/app-out.log │ │ pid path │ /root/.pm2/pids/app-0.pid │ │ interpreter │ node │ │ interpreter args │ N/A │ │ script id │ 0 │ │ exec cwd │ /mnt/play/Downloads/openKB │ │ exec mode │ fork_mode │ │ node.js version │ 8.12.0 │ │ node env │ N/A │ │ watch & reload │ ✘ │ │ unstable restarts │ 0 │ │ created at │ 2019-06-21T06:30:34.546Z │ └───────────────────┴───────────────────────────────────┘ Revision control metadata ┌──────────────────┬──────────────────────────────────────────┐ │ revision control │ git │ │ remote url │ https://github.com/mrvautin/openKB.git │ │ repository root │ /mnt/play/Downloads/openKB │ │ last update │ 2019-06-21T06:30:34.569Z │ │ revision │ 225365d6028e94f2d34f8bcc94bfcf18ca283283 │ │ comment │ Commit changes │ │ branch │ master │ └──────────────────┴──────────────────────────────────────────┘ Code metrics value ┌────────────────────────┬───────────┐ │ Heap Size │ 29.92 MiB │ │ Heap Usage │ 84.86 % │ │ Used Heap Size │ 25.39 MiB │ │ Active requests │ 0 │ │ Active handles │ 7 │ │ Event Loop Latency │ 0.56 ms │ │ Event Loop Latency p95 │ 1.53 ms │ └────────────────────────┴───────────┘ Divergent env variables from local env ┌───────────┬─────┐ │ GCC_SPECS │ │ │ OLDPWD │ N/A │ └───────────┴─────┘ Add your own code metrics: http://bit.ly/code-metrics Use `pm2 logs app [--lines 1000]` to display logs Use `pm2 env 0` to display environement variables Use `pm2 monit` to monitor CPU and Memory usage app
pm2 monit
- pm2 monit
nginx openKB
$ cat /etc/nginx/conf/openkb.conf
server {
listen 807;
server_name 127.0.0.1;
location / {
proxy_pass http://localhost:4444;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
$ grep -i openkb /etc/nginx/nginx.conf
include /etc/nginx/conf/openkb.conf;
$ /etc/init.d/nginx reload
Troubleshooting
Mermaid diagrams won't show up
https://github.com/mrvautin/openKB/issues/193