The goal is to manage the accountings for our beverages on our floor of a dorm conveniently
This is a Server for the HaDiBar-API. It exposes functionality to manage accounts and beverages.
The definiton of api can be found at Hadibar-API a reference implementation of a webapp that uses said API can be found at Hadibar-Webapp. The Webapp also contains some conveniance functions capsulating the ajax-calls and session management to use the api from javascript
Webapp made with Vuejs, JQuery and Bootstrap Accounts/Beverages/Users are stored in bolt key-value stores
This is meant for one person in a group of people to manage the accounts of all of them (in most cases that will be the one that manages the physical beverages as well). It is more of a convenient way of book keeping, not a way so that everyone is managing their own accounts.
There is no explicit user management right now. Usernames are aquired by logging in with the name and the password for the first time. This will hopefully be improved in the future (with password-resets/registering with an email etc,etc)
Make calls with curl like those:
Testlogin:
export SES="$(curl -X GET 127.0.0.1:8080/api/session/getid)"
curl -X POST 127.0.0.1:8080/api/session/login -H "sessionID: "$SES --form "name=Moritz" --form "password=test"
Besides the rest-api for the normal users there is an additional admin-server. It can listen on either
The admin-server uses a JSON based RPC that allows to manage all things. There is support for
The most comfortable way is probably to use the admin-client in the cmd directory. It is has support for unix-socket/tcp/tls but is not yet able to identify itself with it's own certificate. The whole 'adding a CA' to the admin server is not tested yet but should work.
Example for performing backups and put them in a directory with the current date
go run src/cmd/admin-client/main.go -s sockets/control.socket backup "backups/$(date -u +"%Y-%m-%d__%H:%M:%S")"
Example of how to use the client if all tls options are enabled:
go run cmd/admin-client/main.go --tls lsusrs --cert tlsexample/zertifikat-pub.pem --key tlsexample/zertifikat-key.pem --cacert tlsexample/ca-root.pem --servername test-server.test