diff --git a/cmd/qri.go b/cmd/qri.go index ebef28ed2..7b67a6ca4 100644 --- a/cmd/qri.go +++ b/cmd/qri.go @@ -145,10 +145,16 @@ func (o *QriOptions) Init() (err error) { } var fs *ipfs.Filestore - fs, err = ipfs.NewFilestore(func(cfg *ipfs.StoreCfg) { - cfg.FsRepoPath = o.ipfsFsPath - // cfg.Online = online - }) + + fsOpts := []ipfs.Option{ + func(cfg *ipfs.StoreCfg) { + cfg.FsRepoPath = o.ipfsFsPath + // cfg.Online = online + }, + ipfs.OptsFromMap(o.config.Store.Options), + } + + fs, err = ipfs.NewFilestore(fsOpts...) if err != nil { return } diff --git a/config/store.go b/config/store.go index 2eab64820..ed0527deb 100644 --- a/config/store.go +++ b/config/store.go @@ -4,13 +4,17 @@ import "github.com/qri-io/jsonschema" // Store configures a qri content addessed file store (cafs) type Store struct { - Type string `json:"type"` + Type string `json:"type"` + Options map[string]interface{} `json:"options,omitempty"` } // DefaultStore returns a new default Store configuration func DefaultStore() *Store { return &Store{ Type: "ipfs", + Options: map[string]interface{}{ + "api": true, + }, } } @@ -38,7 +42,8 @@ func (cfg Store) Validate() error { // Copy returns a deep copy of the Store struct func (cfg *Store) Copy() *Store { res := &Store{ - Type: cfg.Type, + Type: cfg.Type, + Options: cfg.Options, } return res