-
Create a user/schema/database, Local Data Processing is going to use as the repository, eg in this example the Local Data Processing repository is a postgres database, so a database called hvhub6 is created in postgres with os user jigsaw
-
The example below is using HTTP port 5540 on a hubserver called malta
-
download Local Data Processing and install it, see https://www.hvr-software.com/docs/6/install-and-upgrade/installing-hvr
-
After installation, on the hubserver, create $HVR_CONFIG/etc/hvrhubserver.conf as below;
-
{
"HTTP_Port": "5540"
} -
or
hvrhubserverconfig HTTP_Port=5540
to create the above file.
-
-
start hvrhubserver, on Linux with command
-
hvrhubserver -d
-
-
on Windows with command
-
hvrhubserver -acs -P<password of logged-in OS account> or without -P to run as local system account
-
Above hvrhubserver commands will start the hvrhubserver in SETUP mode
Get Authorization bearer code
2 options, either use REST or use command line hvrlogin. If using hvrlogin the authentication code can be saved into a reusable environment variable called $HVR_LOGIN_ACCESS_TOKEN
The REST API to get the authorization token while hvrhubserver is in setup mode;
curl -X POST "http://malta:5540/auth/v1/setup" -H "Content-Type: application/json"
Set the database details for the hvrhubserver
Below example sets hub database to postgres with database name hvhub6
curl -X PATCH http://malta:5540/api/v0/hubserver/props \
-H "Authorization: Bearer <copy Authorization bearer from http://malta:5540/auth/v1/setup call>” \
-H 'Content-Type: application/json' \
--data '{"HTTP_Port":"5540","Database_Host":"localhost","Database_Port":5463,"Database_Name":"hvhub6","Database_User":"jigsaw","Database_Password":"passw","Repository_Class":"postgresql","Setup_Mode":true}'
or if using a bash script like below;
#!/bin/bash
R=http://malta:5540
eval $(hvrlogin -s -a -S -R$R)
curl -X PATCH $R/api/v0/hubserver/props \
-H "Authorization: Bearer $HVR_LOGIN_ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
--data '{"HTTP_Port":"5540","Database_Host":"localhost","Database_Port":5463,"Database_Name":"hvhub6","Database_User":"jigsaw","Database_Password":"passw","Repository_Class":"postgresql","Setup_Mode":true}'
Create Local Data Processing repository
Below command creates the repository tables in database hvhub6
curl -X POST http://malta:5540/api/v0/repos \
-H "Authorization: Bearer $HVR_LOGIN_ACCESS_TOKEN or <copy Authorization bearer from http://malta:5540/auth/v1/setup call>“
Add license to hub
Create an input file with the following content;
{"license":"<license file name>","raw":"<stringified content of generated license>"}
to stringify the original license file see https://onlinetexttools.com/json-stringify-text
curl -X POST http://malta:5540/api/v0/licenses \
-H "Authorization: Bearer $HVR_LOGIN_ACCESS_TOKEN or <copy Authorization bearer from http://malta:5540/auth/v1/setup call>“ \
-H 'Content-Type: application/json' \
--data-binary @<input file>
Add user to access the Local Data Processing system
Below example creates a Local Data Processing user called hvradmin (a Local Data Processing application user, not a real OS user, because authenticaion is local)
curl -X POST http://malta:5540/api/v0/users
-H "Authorization: Bearer $HVR_LOGIN_ACCESS_TOKEN or <copy Authorization bearer from http://malta:5540/auth/v1/setup call>“
-H 'Content-Type: application/json'
--data '{"user":"hvradmin","authentication":"local"","password":"mypass"}'
authentication can also be pam instead of local
Give user SysAdmin privilege
curl -X PATCH http://malta:5540/api/v0/repos/props \
-H "Authorization: Bearer $HVR_LOGIN_ACCESS_TOKEN or <copy Authorization bearer from http://malta:5540/auth/v1/setup call>“ \
-H 'Content-Type: application/json' \
--data '{"Access_List":[{"user":"hvradmin","level":"SysAdmin"}]}'
Create a hub
Below example creates a hub called hvrhub6
curl -X POST $R/api/v0/hubs \
-H "Authorization: Bearer $HVR_LOGIN_ACCESS_TOKEN or <copy Authorization bearer from http://malta:5540/auth/v1/setup call>“ \
-H 'Content-Type: application/json' \
--data '{"hub":"hvrhub6"}'
End hvrhubserver’s Setup mode
Below example will end the hvrhubserver’s setup mode, so channels can be created on the hub
curl -X PATCH http://malta:5540/api/v0/hubserver/props \
-H "Authorization: Bearer $HVR_LOGIN_ACCESS_TOKEN or <copy Authorization bearer from http://malta:5540/auth/v1/setup call>“ \
-H 'Content-Type: application/json' \
--data '{"Setup_Mode":null}'
At this moment you could go to the browser to malta:5540 and login with user hvradmin to create either other users or setup channels etc