From fa921f5ae8a3bdfb39d55dbbbd50d9a9a96b41ab Mon Sep 17 00:00:00 2001 From: Prabhat Khera Date: Mon, 6 Dec 2021 21:44:10 +1300 Subject: [PATCH] time new line char from encryption key --- api/cmd/portainer/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/cmd/portainer/main.go b/api/cmd/portainer/main.go index 56a4a3bff..5234daa4b 100644 --- a/api/cmd/portainer/main.go +++ b/api/cmd/portainer/main.go @@ -59,7 +59,7 @@ func initFileService(dataStorePath string) portainer.FileService { return fileService } -func initDataStore(dataStorePath string, encryptionKey string, rollback bool, fileService portainer.FileService, shutdownCtx context.Context) portainer.DataStore { +func initDataStore(dataStorePath, encryptionKey string, rollback bool, fileService portainer.FileService, shutdownCtx context.Context) portainer.DataStore { store := bolt.NewStore(dataStorePath, fileService, encryptionKey) err := store.Open() if err != nil { @@ -471,7 +471,7 @@ func initSecretKey(fileName string) string { return "" } - return string(content) + return strings.TrimSuffix(string(content), "\n") } func buildServer(flags *portainer.CLIFlags) portainer.Server {