Skip to content

Commit

Permalink
go-ipfs-config: Merge pull request ipfs#43 from ipfs/feat/plugin-config
Browse files Browse the repository at this point in the history
add plugins config section
  • Loading branch information
Stebalien committed Aug 29, 2019
2 parents 3692ba8 + a04a858 commit 1f6f939
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type Config struct {
Provider Provider
Reprovider Reprovider
Experimental Experiments
Plugins Plugins
}

const (
Expand Down
4 changes: 2 additions & 2 deletions config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ func DefaultDatastoreConfig() Datastore {
func identityConfig(out io.Writer, nbits int) (Identity, error) {
// TODO guard higher up
ident := Identity{}
if nbits < 1024 {
return ident, errors.New("bitsize less than 1024 is considered unsafe")
if nbits < 2048 {
return ident, errors.New("bitsize less than 2048 is considered unsafe")
}

fmt.Fprintf(out, "generating %v-bit RSA keypair...", nbits)
Expand Down
11 changes: 11 additions & 0 deletions config/plugins.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package config

type Plugins struct {
Plugins map[string]Plugin `json:",omitempty"`
// TODO: Loader Path? Leaving that out for now due to security concerns.
}

type Plugin struct {
Disabled bool
Config interface{}
}

0 comments on commit 1f6f939

Please sign in to comment.