Enrich the client list based on current connection info.
Note that this depends on turris/foris-controller/foris-controller-openvpn-module!11
The items in the client list has a new field connections
where info regarding current connections (per client) are stored.
{
"module": "openvpn",
"action": "get_status",
"kind": "reply",
"data": {
"status": "ready",
"clients": [
{
"id": "02",
"name": "client1",
"status": "revoked",
"connections": [
{
"address": "192.168.1.111",
"port": 11111,
"in_bytes": 8811,
"out_bytes": 7711,
"connected_since": "2024-01-01T00:00:00"
},
]
},
{
"id": "03",
"name": "client2",
"status": "valid",
"connections": [
{
"address": "192.168.1.222",
"port": 22222,
"in_bytes": 8822,
"out_bytes": 7722,
"connected_since": "2024-02-01T00:00:00"
}
],
},
{
"id": "04",
"name": "client3",
"status": "generating",
"connections": [],
},
],
}
So we can display that e.g. client is connected and other things.
Note the data are obtained from openvpn status file /tmp/openvpn-status.log
, which is updated once per minute, so it doesn't reflect changes immediately.