diff --git a/README.md b/README.md index 4089945..a46f9f8 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Use these to configure your Andesite instance. All are optional. "Name" refers t | `--disable-hash` | | `string[]` | none. | Any of `md5`, `sha1`, `sha256`, `sha512`, `sha3`, `blake2b`. | | `--hash-concurrency` | | `int` | cpu count | Number of hashes to run concurrently. | | `--custom-root-public` | | `string[]` | none | Similar to `"roots_public"`, passed in the form `name=path`. | +| `--custom-root-private` | | `string[]` | none | Similar to `"roots_private"`, passed in the form `name=path`. | > Note: for `--enable-search` and `--disable-search`, sending values to these flags will trigger a background scan of the root directory you point it at (whether that be `public`, `files`, etc). As such, unless content is changed or updated, it is not necessary to pass these flags across multiple runs of the app. diff --git a/main.go b/main.go index da6e39d..cb9a983 100644 --- a/main.go +++ b/main.go @@ -48,6 +48,7 @@ func main() { vflag.StringArrayVar(&idata.Config.OffHashes, "disable-hash", []string{}, "") vflag.IntVar(&idata.Config.HashPllel, "hash-concurrency", runtime.NumCPU(), "") vflag.StringArrayVar(&idata.Config.CRootsPub, "custom-root-public", []string{}, "") + vflag.StringArrayVar(&idata.Config.CRootsPrv, "custom-root-private", []string{}, "") etc.PreInit() etc.Init(&idata.Config, "./files/", db.SaveOAuth2InfoCb) @@ -87,6 +88,9 @@ func main() { for _, item := range idata.Config.CRootsPub { idata.Config.RootsPub = append(idata.Config.RootsPub, strings.SplitN(item, "=", 2)) } + for _, item := range idata.Config.CRootsPrv { + idata.Config.RootsPrv = append(idata.Config.RootsPrv, strings.SplitN(item, "=", 2)) + } // // database initialization diff --git a/pkg/itypes/config.go b/pkg/itypes/config.go index 4f7550e..d2ddee6 100644 --- a/pkg/itypes/config.go +++ b/pkg/itypes/config.go @@ -21,6 +21,7 @@ type Config struct { OffHashes []string HashPllel int CRootsPub []string + CRootsPrv []string } func (c *Config) GetDiscordClient() *oauth2.AppConf {