feat: add HTTP Management API, migrate CLI from Akka ClusterClient to HTTP
Replace the CLI's Akka.NET ClusterClient transport with a simple HTTP client targeting a new POST /management endpoint on the Central Host. The endpoint handles Basic Auth, LDAP authentication, role resolution, and ManagementActor dispatch in a single round-trip — eliminating the CLI's Akka, LDAP, and Security dependencies. Also fixes DCL ReSubscribeAll losing subscriptions on repeated reconnect by deriving the tag list from _subscriptionsByInstance instead of _subscriptionIds.
This commit is contained in:
@@ -185,11 +185,11 @@ curl -s http://localhost:9002/health/ready | python3 -m json.tool
|
||||
|
||||
### CLI Access
|
||||
|
||||
Connect the ScadaLink CLI to the central cluster. With OrbStack, the contact point hostname must match the container's Akka `NodeHostname` config, so use the container name directly (OrbStack resolves container names via DNS):
|
||||
The CLI connects to the Central Host's HTTP management API. With the Docker setup, the Central UI (and management API) is available at `http://localhost:9001`:
|
||||
|
||||
```bash
|
||||
dotnet run --project src/ScadaLink.CLI -- \
|
||||
--contact-points akka.tcp://scadalink@scadalink-central-a:8081 \
|
||||
--url http://localhost:9001 \
|
||||
--username multi-role --password password \
|
||||
template list
|
||||
```
|
||||
@@ -200,19 +200,11 @@ A recommended `~/.scadalink/config.json` for the Docker test environment:
|
||||
|
||||
```json
|
||||
{
|
||||
"contactPoints": ["akka.tcp://scadalink@scadalink-central-a:8081"],
|
||||
"ldap": {
|
||||
"server": "localhost",
|
||||
"port": 3893,
|
||||
"useTls": false,
|
||||
"searchBase": "dc=scadalink,dc=local",
|
||||
"serviceAccountDn": "cn=admin,dc=scadalink,dc=local",
|
||||
"serviceAccountPassword": "password"
|
||||
}
|
||||
"managementUrl": "http://localhost:9001"
|
||||
}
|
||||
```
|
||||
|
||||
With this config file in place, the contact points and LDAP settings are automatic:
|
||||
With this config file in place, the URL is automatic:
|
||||
|
||||
```bash
|
||||
dotnet run --project src/ScadaLink.CLI -- \
|
||||
|
||||
Reference in New Issue
Block a user