From bdfc1c346bca9a2e83f6c672823b0f84a58e4891 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Thu, 23 Jul 2020 21:14:54 -0600 Subject: [PATCH] Default to bolt db proper --- config/config.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 77b5d42..179c5f3 100644 --- a/config/config.go +++ b/config/config.go @@ -1,6 +1,10 @@ package config -import "local/args" +import ( + "io/ioutil" + "local/args" + "os" +) type Config struct { Port int @@ -14,8 +18,14 @@ type Config struct { func New() Config { as := args.NewArgSet() + f, err := ioutil.TempFile(os.TempDir(), "bolt.db.*") + if err != nil { + panic(err) + } + f.Close() + as.Append(args.INT, "p", "port to listen on", 18114) - as.Append(args.STRING, "dburi", "database uri", "mongodb://localhost:27017") + as.Append(args.STRING, "dburi", "database uri", f.Name()) as.Append(args.STRING, "fileprefix", "path prefix for file service", "/__files__") as.Append(args.STRING, "fileroot", "path to file hosting root", "/tmp/") as.Append(args.STRING, "database", "database name to use", "db")