WORKING: join/authz
This commit is contained in:
parent
24a983f2b5
commit
2bde94657d
|
|
@ -49,7 +49,7 @@ git pull origin main
|
||||||
(Debian, Ubuntu, Linux Mint, Zorin OS, Raspbian)
|
(Debian, Ubuntu, Linux Mint, Zorin OS, Raspbian)
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt -y install gawk coreutils curl jq grep sed sha256sum tar unzip netcat-openbsd
|
sudo apt -y install gawk coreutils curl jq grep sed tar unzip netcat-openbsd
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Installation
|
#### Installation
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ function addWorker(state, workerData) {
|
||||||
state.workers[sdl_id] = {
|
state.workers[sdl_id] = {
|
||||||
sdl_id: workerData.sdl_id,
|
sdl_id: workerData.sdl_id,
|
||||||
hostname: workerData.hostname,
|
hostname: workerData.hostname,
|
||||||
version: workerData.version,
|
version: workerData.sdl_version,
|
||||||
platform: workerData.platform,
|
platform: workerData.platform,
|
||||||
arch: workerData.arch,
|
arch: workerData.arch,
|
||||||
distro: workerData.distro || "Unknown",
|
distro: workerData.distro || "Unknown",
|
||||||
|
|
@ -238,7 +238,9 @@ function startJoinHandler() {
|
||||||
log(`${module}: received join request from ${joinReq.host} (${joinReq.sdl_id})`);
|
log(`${module}: received join request from ${joinReq.host} (${joinReq.sdl_id})`);
|
||||||
|
|
||||||
// Validate version
|
// Validate version
|
||||||
const workerVersion = joinReq.msg?.worker?.version;
|
const workerData = joinReq.msg['sdl-wkr'];
|
||||||
|
const workerVersion = workerData?.sdl_version;
|
||||||
|
// const workerVersion = joinReq.msg?.worker?.version;
|
||||||
const clusterVersion = config.package.version;
|
const clusterVersion = config.package.version;
|
||||||
|
|
||||||
let authorized = false;
|
let authorized = false;
|
||||||
|
|
@ -248,7 +250,7 @@ function startJoinHandler() {
|
||||||
authorized = true;
|
authorized = true;
|
||||||
|
|
||||||
// Add worker to cluster state
|
// Add worker to cluster state
|
||||||
clusterState = addWorker(clusterState, joinReq.msg.worker);
|
clusterState = addWorker(clusterState, workerData);
|
||||||
clusterState = computeStats(clusterState);
|
clusterState = computeStats(clusterState);
|
||||||
saveClusterState(config, clusterState);
|
saveClusterState(config, clusterState);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ git pull origin main
|
||||||
(Debian, Ubuntu, Linux Mint, Zorin OS, Raspbian)
|
(Debian, Ubuntu, Linux Mint, Zorin OS, Raspbian)
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt -y install gawk coreutils curl jq grep sed sha256sum tar unzip netcat-openbsd
|
sudo apt -y install gawk coreutils curl jq grep sed tar unzip netcat-openbsd
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Installation
|
#### Installation
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue