diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..d9798c9 --- /dev/null +++ b/docker-compose.yaml @@ -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" diff --git a/message_readers.go b/message_readers.go index 21a7103..d1f3745 100644 --- a/message_readers.go +++ b/message_readers.go @@ -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 diff --git a/server.go b/server.go index fd32b32..bb56ef9 100644 --- a/server.go +++ b/server.go @@ -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) } - err = os.Remove(pth) - if err != nil { - cancel() - return nil, fmt.Errorf("error: failed to remove temp seed file: %v", err) - } + + defer func() { + err = os.Remove(pth) + if err != nil { + cancel() + log.Fatalf("error: failed to remove temp seed file: %v\n", err) + } + }() case configuration.NkeySeedFile != "" && configuration.NkeyFromED25519SSHKeyFile == "": var err error