Users used to control access to the Astra Web Interface as well as access to the HTTP MPEG-TS and HLS outputs
{
"enable": true,
"type": 0,
"comment": "...",
"token": "...",
"ip": "...",
"expire": 0,
"conlimit": 0
}
enable – enabled account or nottype – user type
1 - admin. full access to the Astra Web Interface2 - observer. read only access to the Astra Web Interface3 - regular user. without access to the Astra Web Interfacecomment - optional field, for user descriptionOptional fields for buil-in authorization to access HLS or HTTP MPEG-TS channels:
token - token used in HTTP requests. For example: http://server:8000/play/a001/index.m3u8?token=secretip - allow access to the channels by the client IP addressexpire - date in unix timestamp format, when access to channels will be restrictedconnlimit - limit connections to channelsRequest: POST /control/
{
"cmd": "get-user",
"id": "..."
}
id - user loginIn response will be JSON with user configuration
Request: POST /control/
{
"cmd": "set-user",
"id": "...",
"user": {
"enable": true,
"type": 0,
"password": "..."
}
}
id – user loginuser - user configurationpassword - plain password, in the config will be saved the password hashcurl -X POST -user login -d @- http://server:8000/control/ <<END
{
"cmd": "set-user",
"id": "new-admin",
"user": {
"enable": true,
"type": 1,
"password": "secret"
}
}
END
on successful Astra returns:{ "set-user": "ok" }
Request: POST /control/
{
"cmd": "set-user",
"id": "...",
"user": {
"remove": true
}
}
Request: POST /control/
Turn user on or off:
{
"cmd": "toggle-user",
"id": "..."
}
id - user logincurl \
-X POST \
-user login \
-d '{"cmd":"toggle-user", "id":"login"}' \
http://server:8000/control/
on successful Astra returns:{ "toggle-user": "ok" }