1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

fixed removal of tmp nkey file, added docker compose example, and added debug logging for when messages are read from the readfolder

This commit is contained in:
postmannen 2024-03-10 07:24:09 +01:00
parent 34e0c5d1c6
commit cef1170233
3 changed files with 30 additions and 5 deletions

19
docker-compose.yaml Normal file
View file

@ -0,0 +1,19 @@
# Example docker compose file
# Build image with:
# docker build -t ctrl:0.03 .
# Or to push to docker hub:
# docker buildx build --platform linux/amd64 --tag ctrl:amd64-0.03 --load .
# docker tag ctrl:amd64-0.03 postmannen/ctrl:amd64-0.03
# docker push postmannen/ctrl:amd64-0.03
version: "3"
services:
ctrl:
build: .
env_file:
- tmp/env.file
image: ctrl:0.02
restart: always
ports:
- "2111:2111"
- "8090:8090"

View file

@ -289,6 +289,9 @@ func (s *server) readFolder() {
s.errorKernel.errSend(s.processInitial, Message{}, er, logWarning)
}
er := fmt.Errorf("readFolder: read new message in readfolder and putting it on s.samToSendCh: %#v", sams)
s.errorKernel.errSend(s.processInitial, Message{}, er, logDebug)
// Send the SAM struct to be picked up by the ring buffer.
s.samToSendCh <- sams
s.auditLogCh <- sams

View file

@ -123,11 +123,14 @@ func NewServer(configuration *Configuration, version string) (*server, error) {
cancel()
return nil, fmt.Errorf("error: failed to read temp nkey seed file: %v", err)
}
defer func() {
err = os.Remove(pth)
if err != nil {
cancel()
return nil, fmt.Errorf("error: failed to remove temp seed file: %v", err)
log.Fatalf("error: failed to remove temp seed file: %v\n", err)
}
}()
case configuration.NkeySeedFile != "" && configuration.NkeyFromED25519SSHKeyFile == "":
var err error