1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 07:19:41 +02:00

feat(cli): Allow adding admin password using docker secrets aka file (#1199) (#1214)

This commit is contained in:
Nenad Ilic 2017-09-25 18:13:56 +02:00 committed by Anthony Lapenna
parent e2979a631a
commit 6cfffb38f9
4 changed files with 44 additions and 10 deletions

View file

@ -1,6 +1,8 @@
package file
import (
"io/ioutil"
"github.com/portainer/portainer"
"io"
@ -162,3 +164,13 @@ func (service *Service) createFileInStore(filePath string, r io.Reader) error {
}
return nil
}
// GetStringFromFile returns a string content from file.
func GetStringFromFile(filePath string) (string, error) {
content, err := ioutil.ReadFile(filePath)
if err != nil {
return "", err
}
return string(content), nil
}