@konsumation/konsum
TypeScript icon, indicating that this package has built-in type declarations

6.11.11 • Public • Published

npm License Typed with TypeScript bundlejs downloads Build Status Styled with prettier Commitizen friendly Known Vulnerabilities Coverage Status

konsum

Collect resource usage in a home environment.

run

start server

konsum --config=<<some dir>> start

list

konsum --config=<<some dir>> list [category]
konsum --config=<<some dir>> insert category value [time]

create backup

konsum --config=<<some dir>> backup [file]

restore backup

konsum --config=<<some dir>> restore [file]

install

npm -g install konsum

create a linux package

npx npm-pkgbuild

how to configure

create self signed cert

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes

JWT

token setup

openssl genrsa -out demo.rsa 2048
openssl rsa -in demo.rsa -pubout > demo.rsa.pub

test with:

TOKEN=$(curl -s -H "Content-Type: application/json" \
     -d '{"username":"admin","password":"start123"}' \
     -X POST http://localhost:12345/authenticate|jq -r .access_token)

and exec a request

curl -H "Authorization: Bearer $TOKEN" \
     http://localhost:12345/category
TOKEN=...
CATEGORY=...
curl -H "Authorization: Bearer $TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"value":"1234.5","time":"1995-12-17T03:24:00"}' \
     http://localhost:12345/category/$CATEGORY/value

Or directly calling the executable

konsum insert ev 90091.3 '2019-06-22T13:44:17'

openapi

see openapi

API

Table of Contents

addRoute

Stop konsum server.

addRoute

Reload konsum systemd config.

addRoute

Create backup on server.

addRoute

Backup data as text.

addRoute

Create token.

addRoute

Retrieve service state.

addRoute

Login to request api token. At least one entitlement starting with "konsum" is required.

Readme

Keywords

none

Package Sidebar

Install

npm i @konsumation/konsum

Weekly Downloads

587

Version

6.11.11

License

BSD-2-Clause

Unpacked Size

25.9 kB

Total Files

8

Last publish

Collaborators

  • k0nsti
  • arlac77