mirror of
https://github.com/postmannen/ctrl.git
synced 2025-03-31 01:24:31 +00:00
updated key comments, and added doc section for central node
This commit is contained in:
parent
0d6517f6ec
commit
ca1ce3c534
8 changed files with 32 additions and 13 deletions
|
@ -133,14 +133,14 @@ func (c *centralAuth) addPublicKey(proc process, msg Message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
c.pki.nodeNotAckedPublicKeys.mu.Lock()
|
c.pki.nodeNotAckedPublicKeys.mu.Lock()
|
||||||
existingNotAckedKey, ok := c.pki.nodeNotAckedPublicKeys.KeyMap[msg.FromNode]
|
// existingNotAckedKey, ok := c.pki.nodeNotAckedPublicKeys.KeyMap[msg.FromNode]
|
||||||
// We only want to send one notification to the error kernel about new key detection,
|
// // We only want to send one notification to the error kernel about new key detection,
|
||||||
// so we check if the values are the same as the one we already got before we continue
|
// // so we check if the values are the same as the one we already got before we continue
|
||||||
// with registering and logging for the the new key.
|
// // with registering and logging for the the new key.
|
||||||
if ok && bytes.Equal(existingNotAckedKey, msg.Data) {
|
// if ok && bytes.Equal(existingNotAckedKey, msg.Data) {
|
||||||
c.pki.nodeNotAckedPublicKeys.mu.Unlock()
|
// c.pki.nodeNotAckedPublicKeys.mu.Unlock()
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
c.pki.nodeNotAckedPublicKeys.KeyMap[msg.FromNode] = msg.Data
|
c.pki.nodeNotAckedPublicKeys.KeyMap[msg.FromNode] = msg.Data
|
||||||
c.pki.nodeNotAckedPublicKeys.mu.Unlock()
|
c.pki.nodeNotAckedPublicKeys.mu.Unlock()
|
||||||
|
|
|
@ -20,6 +20,11 @@
|
||||||
- [{{CTRL_DATA}} variable](./core_messaging_CTRL_DATA.md)
|
- [{{CTRL_DATA}} variable](./core_messaging_CTRL_DATA.md)
|
||||||
- [{{CTRL_FILE}} variable](./core_messaging_CTRL_FILE.md)
|
- [{{CTRL_FILE}} variable](./core_messaging_CTRL_FILE.md)
|
||||||
- [Errors](./core_errors.md)
|
- [Errors](./core_errors.md)
|
||||||
|
- [central](./core_central.md)
|
||||||
|
- [hello messages](./core_hello_messages.md)
|
||||||
|
- [signing keys](./core_signing_keys.md)
|
||||||
|
- [ACL](./core_acl.md)
|
||||||
|
- [audit log](./core_audit_log.md)
|
||||||
|
|
||||||
# Examples standard messages
|
# Examples standard messages
|
||||||
|
|
||||||
|
@ -32,4 +37,4 @@
|
||||||
|
|
||||||
# Using ctrl
|
# Using ctrl
|
||||||
|
|
||||||
- [ctrl as github action runner](usecase-ctrl-as-github-action-runner)
|
- [ctrl as github action runner](usecase-ctrl-as-github-action-runner)
|
||||||
|
|
1
doc/src/core_acl.md
Normal file
1
doc/src/core_acl.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# ACL
|
1
doc/src/core_audit_log.md
Normal file
1
doc/src/core_audit_log.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# audit log
|
3
doc/src/core_central.md
Normal file
3
doc/src/core_central.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# central
|
||||||
|
|
||||||
|
To get functionality like central audit log, signing keys, authorization with ACL's and hello messages one node should be started with the node name **central**
|
11
doc/src/core_hello_messages.md
Normal file
11
doc/src/core_hello_messages.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Hello messages
|
||||||
|
|
||||||
|
All nodes can send hello messages to inform that they are up. The interval between sending a hello message can be set with the `START_PUB_HELLO` environment variable.
|
||||||
|
|
||||||
|
Hello messages are sent to the node with the name **central**. When a hello message are received on central, information with the time and node name will be stored in the **ctrl data folder**
|
||||||
|
|
||||||
|
## Public keys
|
||||||
|
|
||||||
|
ctrl nodes can use ed25519 keys for signing messages, so each ctrl instance will generate a public and private key pair on startup. The public keys are sent to the central server with the hello messages.
|
||||||
|
|
||||||
|
To read more about signing keys here: [signing keys](./core_signing_keys.md)
|
1
doc/src/core_signing_keys.md
Normal file
1
doc/src/core_signing_keys.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# signing keys
|
|
@ -49,10 +49,7 @@ func methodHello(proc process, message Message, node string) ([]byte, error) {
|
||||||
proc.errorKernel.errSend(proc, message, er, logWarning)
|
proc.errorKernel.errSend(proc, message, er, logWarning)
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------
|
// The handling of the public key that is in the message.Data field is handled in the procfunc.
|
||||||
|
|
||||||
// send the message to the procFuncCh which is running alongside the process
|
|
||||||
// and can hold registries and handle special things for an individual process.
|
|
||||||
proc.procFuncCh <- message
|
proc.procFuncCh <- message
|
||||||
|
|
||||||
ackMsg := []byte("confirmed from: " + node + ": " + fmt.Sprint(message.ID))
|
ackMsg := []byte("confirmed from: " + node + ": " + fmt.Sprint(message.ID))
|
||||||
|
|
Loading…
Add table
Reference in a new issue