diff --git a/Makefile b/Makefile index f086b1d6a..d2246f97d 100644 --- a/Makefile +++ b/Makefile @@ -34,4 +34,4 @@ run-docker: build-docker set -ex docker run --rm --privileged -it -e LOG_LEVEL=debug -e "DB_URL=bolt:///app/data/bolt.db" -v $(DIR)/data:/app/data -p 8080:8080 iron/functions -all: dep build \ No newline at end of file +all: dep build diff --git a/api/datastore/bolt/bolt.go b/api/datastore/bolt/bolt.go index 3b9373318..90e9cde58 100644 --- a/api/datastore/bolt/bolt.go +++ b/api/datastore/bolt/bolt.go @@ -29,13 +29,13 @@ type BoltDatastore struct { func New(url *url.URL) (models.Datastore, error) { dir := filepath.Dir(url.Path) log := logrus.WithFields(logrus.Fields{"db": url.Scheme, "dir": dir}) - err := os.MkdirAll(dir, 0777) + err := os.MkdirAll(dir, 0755) if err != nil { log.WithError(err).Errorln("Could not create data directory for db") return nil, err } log.Infoln("Creating bolt db at ", url.Path) - db, err := bolt.Open(url.Path, 0600, &bolt.Options{Timeout: 1 * time.Second}) + db, err := bolt.Open(url.Path, 0655, &bolt.Options{Timeout: 1 * time.Second}) if err != nil { log.WithError(err).Errorln("Error on bolt.Open") return nil, err diff --git a/api/mqs/bolt.go b/api/mqs/bolt.go index beb00db0c..836c78691 100644 --- a/api/mqs/bolt.go +++ b/api/mqs/bolt.go @@ -55,12 +55,12 @@ func timeoutName(i int) []byte { func NewBoltMQ(url *url.URL) (*BoltDbMQ, error) { dir := filepath.Dir(url.Path) log := logrus.WithFields(logrus.Fields{"mq": url.Scheme, "dir": dir}) - err := os.MkdirAll(dir, 0777) + err := os.MkdirAll(dir, 0755) if err != nil { log.WithError(err).Errorln("Could not create data directory for mq") return nil, err } - db, err := bolt.Open(url.Path, 0600, &bolt.Options{Timeout: 1 * time.Second}) + db, err := bolt.Open(url.Path, 0655, &bolt.Options{Timeout: 1 * time.Second}) if err != nil { log.WithError(err).Errorln("Could not open BoltDB file for MQ") return nil, err