1
0
Fork 0
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:
postmannen 2024-12-18 15:47:05 +01:00
parent 0d6517f6ec
commit ca1ce3c534
8 changed files with 32 additions and 13 deletions

View file

@ -133,14 +133,14 @@ func (c *centralAuth) addPublicKey(proc process, msg Message) {
}
c.pki.nodeNotAckedPublicKeys.mu.Lock()
existingNotAckedKey, ok := c.pki.nodeNotAckedPublicKeys.KeyMap[msg.FromNode]
// 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
// with registering and logging for the the new key.
if ok && bytes.Equal(existingNotAckedKey, msg.Data) {
c.pki.nodeNotAckedPublicKeys.mu.Unlock()
return
}
// existingNotAckedKey, ok := c.pki.nodeNotAckedPublicKeys.KeyMap[msg.FromNode]
// // 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
// // with registering and logging for the the new key.
// if ok && bytes.Equal(existingNotAckedKey, msg.Data) {
// c.pki.nodeNotAckedPublicKeys.mu.Unlock()
// return
// }
c.pki.nodeNotAckedPublicKeys.KeyMap[msg.FromNode] = msg.Data
c.pki.nodeNotAckedPublicKeys.mu.Unlock()

View file

@ -20,6 +20,11 @@
- [{{CTRL_DATA}} variable](./core_messaging_CTRL_DATA.md)
- [{{CTRL_FILE}} variable](./core_messaging_CTRL_FILE.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
@ -32,4 +37,4 @@
# 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
View file

@ -0,0 +1 @@
# ACL

View file

@ -0,0 +1 @@
# audit log

3
doc/src/core_central.md Normal file
View 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**

View 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)

View file

@ -0,0 +1 @@
# signing keys

View file

@ -49,10 +49,7 @@ func methodHello(proc process, message Message, node string) ([]byte, error) {
proc.errorKernel.errSend(proc, message, er, logWarning)
}
// --------------------------
// send the message to the procFuncCh which is running alongside the process
// and can hold registries and handle special things for an individual process.
// The handling of the public key that is in the message.Data field is handled in the procfunc.
proc.procFuncCh <- message
ackMsg := []byte("confirmed from: " + node + ": " + fmt.Sprint(message.ID))