From b438fce511686d2451f7c5d4730c97b4a7f59fbd Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 1 Feb 2022 12:57:41 +0100 Subject: [PATCH 01/14] generate config file for accounts service --- accounts/cmd/helper/defaultconfig/main.go | 23 ++++++++ accounts/pkg/config/config.go | 65 ++++++++++++----------- accounts/pkg/config/debug.go | 8 +-- accounts/pkg/config/grpc.go | 2 +- accounts/pkg/config/http.go | 16 +++--- accounts/pkg/config/log.go | 8 +-- accounts/pkg/config/parser/parse.go | 33 +++++++++--- accounts/pkg/config/tracing.go | 8 +-- 8 files changed, 102 insertions(+), 61 deletions(-) create mode 100644 accounts/cmd/helper/defaultconfig/main.go diff --git a/accounts/cmd/helper/defaultconfig/main.go b/accounts/cmd/helper/defaultconfig/main.go new file mode 100644 index 000000000..1092497cb --- /dev/null +++ b/accounts/cmd/helper/defaultconfig/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + + "github.com/owncloud/ocis/accounts/pkg/config" + "github.com/owncloud/ocis/accounts/pkg/config/parser" + "gopkg.in/yaml.v2" +) + +func main() { + + cfg := config.DefaultConfig() + + parser.EnsureDefaults(cfg) + parser.Sanitize(cfg) + + b, err := yaml.Marshal(cfg) + if err != nil { + return + } + fmt.Println(string(b)) +} diff --git a/accounts/pkg/config/config.go b/accounts/pkg/config/config.go index 79024993b..0152e4991 100644 --- a/accounts/pkg/config/config.go +++ b/accounts/pkg/config/config.go @@ -8,78 +8,79 @@ import ( // Config combines all available configuration parts. type Config struct { - *shared.Commons + *shared.Commons `yaml:"-"` - Service Service + Service Service `yaml:"-"` - Tracing *Tracing `ocisConfig:"tracing"` - Log *Log `ocisConfig:"log"` - Debug Debug `ocisConfig:"debug"` + Tracing *Tracing + Log *Log + Debug Debug - HTTP HTTP `ocisConfig:"http"` - GRPC GRPC `ocisConfig:"grpc"` + HTTP HTTP + GRPC GRPC - TokenManager TokenManager `ocisConfig:"token_manager"` + TokenManager TokenManager - Asset Asset `ocisConfig:"asset"` - Repo Repo `ocisConfig:"repo"` - Index Index `ocisConfig:"index"` - ServiceUser ServiceUser `ocisConfig:"service_user"` - HashDifficulty int `ocisConfig:"hash_difficulty" env:"ACCOUNTS_HASH_DIFFICULTY"` - DemoUsersAndGroups bool `ocisConfig:"demo_users_and_groups" env:"ACCOUNTS_DEMO_USERS_AND_GROUPS"` + Asset Asset + Repo Repo + Index Index + ServiceUser ServiceUser + HashDifficulty int `env:"ACCOUNTS_HASH_DIFFICULTY"` + DemoUsersAndGroups bool `env:"ACCOUNTS_DEMO_USERS_AND_GROUPS"` - Context context.Context + Context context.Context `yaml:"-"` } // Asset defines the available asset configuration. type Asset struct { - Path string `ocisConfig:"path" env:"ACCOUNTS_ASSET_PATH"` + Path string `env:"ACCOUNTS_ASSET_PATH"` } // TokenManager is the config for using the reva token manager type TokenManager struct { - JWTSecret string `ocisConfig:"jwt_secret" env:"OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET"` + JWTSecret string `env:"OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET"` } // Repo defines which storage implementation is to be used. type Repo struct { - Backend string `ocisConfig:"backend" env:"ACCOUNTS_STORAGE_BACKEND"` - Disk Disk `ocisConfig:"disk"` - CS3 CS3 `ocisConfig:"cs3"` + Backend string `env:"ACCOUNTS_STORAGE_BACKEND"` + Disk Disk + CS3 CS3 } // Disk is the local disk implementation of the storage. type Disk struct { - Path string `ocisConfig:"path" env:"ACCOUNTS_STORAGE_DISK_PATH"` + Path string `env:"ACCOUNTS_STORAGE_DISK_PATH"` } // CS3 is the cs3 implementation of the storage. type CS3 struct { - ProviderAddr string `ocisConfig:"provider_addr" env:"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR"` + ProviderAddr string `env:"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR"` + JWTSecret string `env:"ACCOUNTS_STORAGE_CS3_JWT_SECRET"` } // ServiceUser defines the user required for EOS. type ServiceUser struct { - UUID string `ocisConfig:"uuid" env:"ACCOUNTS_SERVICE_USER_UUID"` - Username string `ocisConfig:"username" env:"ACCOUNTS_SERVICE_USER_USERNAME"` - UID int64 `ocisConfig:"uid" env:"ACCOUNTS_SERVICE_USER_UID"` - GID int64 `ocisConfig:"gid" env:"ACCOUNTS_SERVICE_USER_GID"` + UUID string `env:"ACCOUNTS_SERVICE_USER_UUID"` + Username string `env:"ACCOUNTS_SERVICE_USER_USERNAME"` + UID int64 `env:"ACCOUNTS_SERVICE_USER_UID"` + GID int64 `env:"ACCOUNTS_SERVICE_USER_GID"` } // Index defines config for indexes. type Index struct { - UID UIDBound `ocisConfig:"uid"` - GID GIDBound `ocisConfig:"gid"` + UID UIDBound + GID GIDBound } // GIDBound defines a lower and upper bound. type GIDBound struct { - Lower int64 `ocisConfig:"lower" env:"ACCOUNTS_GID_INDEX_LOWER_BOUND"` - Upper int64 `ocisConfig:"upper" env:"ACCOUNTS_GID_INDEX_UPPER_BOUND"` + Lower int64 `env:"ACCOUNTS_GID_INDEX_LOWER_BOUND"` + Upper int64 `env:"ACCOUNTS_GID_INDEX_UPPER_BOUND"` } // UIDBound defines a lower and upper bound. type UIDBound struct { - Lower int64 `ocisConfig:"lower" env:"ACCOUNTS_UID_INDEX_LOWER_BOUND"` - Upper int64 `ocisConfig:"upper" env:"ACCOUNTS_UID_INDEX_UPPER_BOUND"` + Lower int64 `env:"ACCOUNTS_UID_INDEX_LOWER_BOUND"` + Upper int64 `env:"ACCOUNTS_UID_INDEX_UPPER_BOUND"` } diff --git a/accounts/pkg/config/debug.go b/accounts/pkg/config/debug.go index 539b8faba..fd90aad7a 100644 --- a/accounts/pkg/config/debug.go +++ b/accounts/pkg/config/debug.go @@ -2,8 +2,8 @@ package config // Debug defines the available debug configuration. type Debug struct { - Addr string `ocisConfig:"addr" env:"ACCOUNTS_DEBUG_ADDR"` - Token string `ocisConfig:"token" env:"ACCOUNTS_DEBUG_TOKEN"` - Pprof bool `ocisConfig:"pprof" env:"ACCOUNTS_DEBUG_PPROF"` - Zpages bool `ocisConfig:"zpages" env:"ACCOUNTS_DEBUG_ZPAGES"` + Addr string `env:"ACCOUNTS_DEBUG_ADDR"` + Token string `env:"ACCOUNTS_DEBUG_TOKEN"` + Pprof bool `env:"ACCOUNTS_DEBUG_PPROF"` + Zpages bool `env:"ACCOUNTS_DEBUG_ZPAGES"` } diff --git a/accounts/pkg/config/grpc.go b/accounts/pkg/config/grpc.go index f16de42f2..55e66da11 100644 --- a/accounts/pkg/config/grpc.go +++ b/accounts/pkg/config/grpc.go @@ -2,6 +2,6 @@ package config // GRPC defines the available grpc configuration. type GRPC struct { - Addr string `ocisConfig:"addr" env:"ACCOUNTS_GRPC_ADDR"` + Addr string `env:"ACCOUNTS_GRPC_ADDR"` Namespace string } diff --git a/accounts/pkg/config/http.go b/accounts/pkg/config/http.go index c8c7ab628..c5c2e4975 100644 --- a/accounts/pkg/config/http.go +++ b/accounts/pkg/config/http.go @@ -2,17 +2,17 @@ package config // HTTP defines the available http configuration. type HTTP struct { - Addr string `ocisConfig:"addr" env:"ACCOUNTS_HTTP_ADDR"` + Addr string `env:"ACCOUNTS_HTTP_ADDR"` Namespace string - Root string `ocisConfig:"root" env:"ACCOUNTS_HTTP_ROOT"` - CacheTTL int `ocisConfig:"cache_ttl" env:"ACCOUNTS_CACHE_TTL"` - CORS CORS `ocisConfig:"cors"` + Root string `env:"ACCOUNTS_HTTP_ROOT"` + CacheTTL int `env:"ACCOUNTS_CACHE_TTL"` + CORS CORS } // CORS defines the available cors configuration. type CORS struct { - AllowedOrigins []string `ocisConfig:"allowed_origins"` - AllowedMethods []string `ocisConfig:"allowed_methods"` - AllowedHeaders []string `ocisConfig:"allowed_headers"` - AllowCredentials bool `ocisConfig:"allowed_credentials"` + AllowedOrigins []string + AllowedMethods []string + AllowedHeaders []string + AllowCredentials bool } diff --git a/accounts/pkg/config/log.go b/accounts/pkg/config/log.go index 6ada8a7dd..2d20d3005 100644 --- a/accounts/pkg/config/log.go +++ b/accounts/pkg/config/log.go @@ -2,8 +2,8 @@ package config // Log defines the available log configuration. type Log struct { - Level string `mapstructure:"level" env:"OCIS_LOG_LEVEL;ACCOUNTS_LOG_LEVEL"` - Pretty bool `mapstructure:"pretty" env:"OCIS_LOG_PRETTY;ACCOUNTS_LOG_PRETTY"` - Color bool `mapstructure:"color" env:"OCIS_LOG_COLOR;ACCOUNTS_LOG_COLOR"` - File string `mapstructure:"file" env:"OCIS_LOG_FILE;ACCOUNTS_LOG_FILE"` + Level string `env:"OCIS_LOG_LEVEL;ACCOUNTS_LOG_LEVEL"` + Pretty bool `env:"OCIS_LOG_PRETTY;ACCOUNTS_LOG_PRETTY"` + Color bool `env:"OCIS_LOG_COLOR;ACCOUNTS_LOG_COLOR"` + File string `env:"OCIS_LOG_FILE;ACCOUNTS_LOG_FILE"` } diff --git a/accounts/pkg/config/parser/parse.go b/accounts/pkg/config/parser/parse.go index fb801aed2..e437fa6a0 100644 --- a/accounts/pkg/config/parser/parse.go +++ b/accounts/pkg/config/parser/parse.go @@ -17,6 +17,28 @@ func ParseConfig(cfg *config.Config) error { return err } + err = EnsureDefaults(cfg) + if err != nil { + return err + } + + // load all env variables relevant to the config in the current context. + if err := envdecode.Decode(cfg); err != nil { + // no environment variable set for this config is an expected "error" + if !errors.Is(err, envdecode.ErrNoTargetFieldsAreSet) { + return err + } + } + + err = Sanitize(cfg) + if err != nil { + return err + } + + return nil +} + +func EnsureDefaults(cfg *config.Config) error { // provide with defaults for shared logging, since we need a valid destination address for BindEnv. if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil { cfg.Log = &config.Log{ @@ -40,19 +62,14 @@ func ParseConfig(cfg *config.Config) error { cfg.Tracing = &config.Tracing{} } - // load all env variables relevant to the config in the current context. - if err := envdecode.Decode(cfg); err != nil { - // no environment variable set for this config is an expected "error" - if !errors.Is(err, envdecode.ErrNoTargetFieldsAreSet) { - return err - } - } + return nil +} +func Sanitize(cfg *config.Config) error { // sanitize config if cfg.HTTP.Root != "/" { cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/") } cfg.Repo.Backend = strings.ToLower(cfg.Repo.Backend) - return nil } diff --git a/accounts/pkg/config/tracing.go b/accounts/pkg/config/tracing.go index fc673f824..9a7299085 100644 --- a/accounts/pkg/config/tracing.go +++ b/accounts/pkg/config/tracing.go @@ -2,8 +2,8 @@ package config // Tracing defines the available tracing configuration. type Tracing struct { - Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;ACCOUNTS_TRACING_ENABLED"` - Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;ACCOUNTS_TRACING_TYPE"` - Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;ACCOUNTS_TRACING_ENDPOINT"` - Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;ACCOUNTS_TRACING_COLLECTOR"` + Enabled bool `env:"OCIS_TRACING_ENABLED;ACCOUNTS_TRACING_ENABLED"` + Type string `env:"OCIS_TRACING_TYPE;ACCOUNTS_TRACING_TYPE"` + Endpoint string `env:"OCIS_TRACING_ENDPOINT;ACCOUNTS_TRACING_ENDPOINT"` + Collector string `env:"OCIS_TRACING_COLLECTOR;ACCOUNTS_TRACING_COLLECTOR"` } From bb6a018e9a5bbaea8f5cb2e0286974b6abd98cd6 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 1 Mar 2022 13:21:06 +0100 Subject: [PATCH 02/14] config docs prototype --- accounts/cmd/helper/configdoc/main.go | 27 +++++++++++++++ accounts/pkg/config/config.go | 4 +-- docs/templates/CONFIGURATION.tmpl | 5 +++ ocis-pkg/docs/config.go | 38 +++++++++++++++++++++ thumbnails/cmd/helper/configdoc/main.go | 11 ++++++ thumbnails/cmd/helper/defaultconfig/main.go | 23 +++++++++++++ 6 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 accounts/cmd/helper/configdoc/main.go create mode 100644 docs/templates/CONFIGURATION.tmpl create mode 100644 ocis-pkg/docs/config.go create mode 100644 thumbnails/cmd/helper/configdoc/main.go create mode 100644 thumbnails/cmd/helper/defaultconfig/main.go diff --git a/accounts/cmd/helper/configdoc/main.go b/accounts/cmd/helper/configdoc/main.go new file mode 100644 index 000000000..4866993c2 --- /dev/null +++ b/accounts/cmd/helper/configdoc/main.go @@ -0,0 +1,27 @@ +package main + +import ( + "io/ioutil" + "log" + "os" + + "text/template" + + "github.com/owncloud/ocis/accounts/pkg/config" + "github.com/owncloud/ocis/ocis-pkg/docs" +) + +func main() { + cfg := config.DefaultConfig() + fields := docs.Display(*cfg) + + content, err := ioutil.ReadFile("docs/templates/CONFIGURATION.tmpl") + if err != nil { + log.Fatal(err) + } + tpl := template.Must(template.New("").Parse(string(content))) + tpl.Execute(os.Stdout, fields) + // for _, f := range fields { + // fmt.Printf("%s %s = %v\t%s\n", f.Name, f.Type, f.DefaultValue, f.Description) + // } +} diff --git a/accounts/pkg/config/config.go b/accounts/pkg/config/config.go index 0152e4991..ba182fc34 100644 --- a/accounts/pkg/config/config.go +++ b/accounts/pkg/config/config.go @@ -25,8 +25,8 @@ type Config struct { Repo Repo Index Index ServiceUser ServiceUser - HashDifficulty int `env:"ACCOUNTS_HASH_DIFFICULTY"` - DemoUsersAndGroups bool `env:"ACCOUNTS_DEMO_USERS_AND_GROUPS"` + HashDifficulty int `env:"ACCOUNTS_HASH_DIFFICULTY" desc:"The hash difficulty makes sure that validating a password takes at least a certain amount of time."` + DemoUsersAndGroups bool `env:"ACCOUNTS_DEMO_USERS_AND_GROUPS" desc:"If this flag is set the service will setup the demo users and groups."` Context context.Context `yaml:"-"` } diff --git a/docs/templates/CONFIGURATION.tmpl b/docs/templates/CONFIGURATION.tmpl new file mode 100644 index 000000000..da7a6ec8e --- /dev/null +++ b/docs/templates/CONFIGURATION.tmpl @@ -0,0 +1,5 @@ +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +{{- range .}} +| {{.Name}} | {{.Type}} | {{.DefaultValue}} | {{.Description}}| +{{- end }} \ No newline at end of file diff --git a/ocis-pkg/docs/config.go b/ocis-pkg/docs/config.go new file mode 100644 index 000000000..c55ecde7f --- /dev/null +++ b/ocis-pkg/docs/config.go @@ -0,0 +1,38 @@ +package docs + +import ( + "fmt" + "reflect" +) + +type ConfigField struct { + Name string + DefaultValue string + Type string + Description string +} + +func Display(s interface{}) []ConfigField { + t := reflect.TypeOf(s) + v := reflect.ValueOf(s) + + var fields []ConfigField + for i := 0; i < t.NumField(); i++ { + field := t.Field(i) + value := v.Field(i) + + switch value.Kind() { + default: + desc := field.Tag.Get("desc") + env, ok := field.Tag.Lookup("env") + if !ok { + continue + } + v := fmt.Sprintf("%v", value.Interface()) + fields = append(fields, ConfigField{Name: env, DefaultValue: v, Description: desc, Type: value.Type().Name()}) + case reflect.Struct: + fields = append(fields, Display(value.Interface())...) + } + } + return fields +} diff --git a/thumbnails/cmd/helper/configdoc/main.go b/thumbnails/cmd/helper/configdoc/main.go new file mode 100644 index 000000000..5b2de3700 --- /dev/null +++ b/thumbnails/cmd/helper/configdoc/main.go @@ -0,0 +1,11 @@ +package main + +import ( + "github.com/owncloud/ocis/ocis-pkg/docs" + "github.com/owncloud/ocis/thumbnails/pkg/config" +) + +func main() { + cfg := config.DefaultConfig() + docs.Display(*cfg) +} diff --git a/thumbnails/cmd/helper/defaultconfig/main.go b/thumbnails/cmd/helper/defaultconfig/main.go new file mode 100644 index 000000000..1092497cb --- /dev/null +++ b/thumbnails/cmd/helper/defaultconfig/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + + "github.com/owncloud/ocis/accounts/pkg/config" + "github.com/owncloud/ocis/accounts/pkg/config/parser" + "gopkg.in/yaml.v2" +) + +func main() { + + cfg := config.DefaultConfig() + + parser.EnsureDefaults(cfg) + parser.Sanitize(cfg) + + b, err := yaml.Marshal(cfg) + if err != nil { + return + } + fmt.Println(string(b)) +} From 4af7f630b9fd99c472e4ca4911ad3f898f6eb218 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 1 Mar 2022 16:16:58 +0100 Subject: [PATCH 03/14] First version of the envvar docs generator Signed-off-by: Christian Richter --- docs/helpers/configenvextractor.go | 45 ++++++++++++++++++ docs/helpers/extractor.go.tmpl | 73 ++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 docs/helpers/configenvextractor.go create mode 100644 docs/helpers/extractor.go.tmpl diff --git a/docs/helpers/configenvextractor.go b/docs/helpers/configenvextractor.go new file mode 100644 index 000000000..c9b9a401f --- /dev/null +++ b/docs/helpers/configenvextractor.go @@ -0,0 +1,45 @@ +package main + +import ( + "fmt" + "io/ioutil" + "log" + "os" + "os/exec" + "path/filepath" + "strings" + "text/template" +) + +func main() { + paths, err := filepath.Glob("../../*/pkg/config/defaultconfig.go") + if err != nil { + log.Fatal(err) + } + replacer := strings.NewReplacer( + "../../", "github.com/owncloud/ocis/", + "/defaultconfig.go", "", + ) + for i := range paths { + paths[i] = replacer.Replace(paths[i]) + } + content, err := ioutil.ReadFile("extractor.go.tmpl") + if err != nil { + log.Fatal(err) + } + tpl := template.Must(template.New("").Parse(string(content))) + os.Mkdir("output", 0700) + runner, err := os.Create("output/runner.go") + if err != nil { + log.Fatal(err) + } + tpl.Execute(runner, paths) + os.Chdir("output") + out, err := exec.Command("go", "run", "runner.go").Output() + if err != nil { + log.Fatal(err) + } + os.Chdir("../") + os.RemoveAll("output") + fmt.Println(string(out)) +} diff --git a/docs/helpers/extractor.go.tmpl b/docs/helpers/extractor.go.tmpl new file mode 100644 index 000000000..1f9ea9698 --- /dev/null +++ b/docs/helpers/extractor.go.tmpl @@ -0,0 +1,73 @@ +package main + +import ( + "fmt" + "io/ioutil" + "log" + "os" + "reflect" + "strings" + "text/template" + + {{- range $key, $value := .}} + pkg{{$key}} "{{$value}}" + {{- end}}) + +type ConfigField struct { + Name string + DefaultValue string + Type string + Description string +} + +func main() { +content, err := ioutil.ReadFile("../../../docs/templates/CONFIGURATION.tmpl") +if err != nil { + log.Fatal(err) +} +replacer := strings.NewReplacer( + "github.com/owncloud/ocis/", "", + "/pkg/config", "", + ) +var fields []ConfigField +var targetFile *os.File +tpl := template.Must(template.New("").Parse(string(content))) +{{ range $key, $value := .}} + fields = GetAnnotatedVariables(*pkg{{ $key }}.DefaultConfig()) + if len(fields) > 0 { + targetFolder := "../../../docs/extensions/" + replacer.Replace("{{ $value }}") + os.MkdirAll(targetFolder, 0700) + targetFile, err = os.Create(targetFolder + "/configvars.md") + if err != nil { + log.Fatal(err) + } + tpl.Execute(targetFile, fields) + targetFile.Close() + } +{{ end }} +} + +func GetAnnotatedVariables(s interface{}) []ConfigField { + t := reflect.TypeOf(s) + v := reflect.ValueOf(s) + + var fields []ConfigField + for i := 0; i < t.NumField(); i++ { + field := t.Field(i) + value := v.Field(i) + + switch value.Kind() { + default: + desc := field.Tag.Get("desc") + env, ok := field.Tag.Lookup("env") + if !ok { + continue + } + v := fmt.Sprintf("%v", value.Interface()) + fields = append(fields, ConfigField{Name: env, DefaultValue: v, Description: desc, Type: value.Type().Name()}) + case reflect.Struct: + fields = append(fields, GetAnnotatedVariables(value.Interface())...) + } + } + return fields +} From d9bf9203072214ae83e2a880529021849d47db83 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 1 Mar 2022 16:35:08 +0100 Subject: [PATCH 04/14] remove config docs prototype --- accounts/cmd/helper/configdoc/main.go | 27 --------------- ocis-pkg/docs/config.go | 38 --------------------- thumbnails/cmd/helper/configdoc/main.go | 11 ------ thumbnails/cmd/helper/defaultconfig/main.go | 23 ------------- 4 files changed, 99 deletions(-) delete mode 100644 accounts/cmd/helper/configdoc/main.go delete mode 100644 ocis-pkg/docs/config.go delete mode 100644 thumbnails/cmd/helper/configdoc/main.go delete mode 100644 thumbnails/cmd/helper/defaultconfig/main.go diff --git a/accounts/cmd/helper/configdoc/main.go b/accounts/cmd/helper/configdoc/main.go deleted file mode 100644 index 4866993c2..000000000 --- a/accounts/cmd/helper/configdoc/main.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - "io/ioutil" - "log" - "os" - - "text/template" - - "github.com/owncloud/ocis/accounts/pkg/config" - "github.com/owncloud/ocis/ocis-pkg/docs" -) - -func main() { - cfg := config.DefaultConfig() - fields := docs.Display(*cfg) - - content, err := ioutil.ReadFile("docs/templates/CONFIGURATION.tmpl") - if err != nil { - log.Fatal(err) - } - tpl := template.Must(template.New("").Parse(string(content))) - tpl.Execute(os.Stdout, fields) - // for _, f := range fields { - // fmt.Printf("%s %s = %v\t%s\n", f.Name, f.Type, f.DefaultValue, f.Description) - // } -} diff --git a/ocis-pkg/docs/config.go b/ocis-pkg/docs/config.go deleted file mode 100644 index c55ecde7f..000000000 --- a/ocis-pkg/docs/config.go +++ /dev/null @@ -1,38 +0,0 @@ -package docs - -import ( - "fmt" - "reflect" -) - -type ConfigField struct { - Name string - DefaultValue string - Type string - Description string -} - -func Display(s interface{}) []ConfigField { - t := reflect.TypeOf(s) - v := reflect.ValueOf(s) - - var fields []ConfigField - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - value := v.Field(i) - - switch value.Kind() { - default: - desc := field.Tag.Get("desc") - env, ok := field.Tag.Lookup("env") - if !ok { - continue - } - v := fmt.Sprintf("%v", value.Interface()) - fields = append(fields, ConfigField{Name: env, DefaultValue: v, Description: desc, Type: value.Type().Name()}) - case reflect.Struct: - fields = append(fields, Display(value.Interface())...) - } - } - return fields -} diff --git a/thumbnails/cmd/helper/configdoc/main.go b/thumbnails/cmd/helper/configdoc/main.go deleted file mode 100644 index 5b2de3700..000000000 --- a/thumbnails/cmd/helper/configdoc/main.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -import ( - "github.com/owncloud/ocis/ocis-pkg/docs" - "github.com/owncloud/ocis/thumbnails/pkg/config" -) - -func main() { - cfg := config.DefaultConfig() - docs.Display(*cfg) -} diff --git a/thumbnails/cmd/helper/defaultconfig/main.go b/thumbnails/cmd/helper/defaultconfig/main.go deleted file mode 100644 index 1092497cb..000000000 --- a/thumbnails/cmd/helper/defaultconfig/main.go +++ /dev/null @@ -1,23 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/owncloud/ocis/accounts/pkg/config" - "github.com/owncloud/ocis/accounts/pkg/config/parser" - "gopkg.in/yaml.v2" -) - -func main() { - - cfg := config.DefaultConfig() - - parser.EnsureDefaults(cfg) - parser.Sanitize(cfg) - - b, err := yaml.Marshal(cfg) - if err != nil { - return - } - fmt.Println(string(b)) -} From 017de20520a29d055a0db4b9667cdfde5a1a8a96 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 1 Mar 2022 16:49:26 +0100 Subject: [PATCH 05/14] add config descriptions Co-Authored-By: Christian Richter --- accounts/pkg/config/config.go | 27 +++++++++++++-------------- accounts/pkg/config/grpc.go | 2 +- accounts/pkg/config/http.go | 6 +++--- accounts/pkg/config/log.go | 8 ++++---- accounts/pkg/config/tracing.go | 6 +++--- 5 files changed, 24 insertions(+), 25 deletions(-) diff --git a/accounts/pkg/config/config.go b/accounts/pkg/config/config.go index ba182fc34..ff321826f 100644 --- a/accounts/pkg/config/config.go +++ b/accounts/pkg/config/config.go @@ -33,38 +33,37 @@ type Config struct { // Asset defines the available asset configuration. type Asset struct { - Path string `env:"ACCOUNTS_ASSET_PATH"` + Path string `env:"ACCOUNTS_ASSET_PATH" desc:"The path to the ui assets."` } // TokenManager is the config for using the reva token manager type TokenManager struct { - JWTSecret string `env:"OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET"` + JWTSecret string `env:"OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET" desc:"The secret to mint jwt tokens."` } // Repo defines which storage implementation is to be used. type Repo struct { - Backend string `env:"ACCOUNTS_STORAGE_BACKEND"` + Backend string `env:"ACCOUNTS_STORAGE_BACKEND" desc:"Defines which storage implementation is to be used"` Disk Disk CS3 CS3 } // Disk is the local disk implementation of the storage. type Disk struct { - Path string `env:"ACCOUNTS_STORAGE_DISK_PATH"` + Path string `env:"ACCOUNTS_STORAGE_DISK_PATH" desc:"The path where the accounts data is stored."` } // CS3 is the cs3 implementation of the storage. type CS3 struct { - ProviderAddr string `env:"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR"` - JWTSecret string `env:"ACCOUNTS_STORAGE_CS3_JWT_SECRET"` + ProviderAddr string `env:"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR" desc:"The address to the storage provider."` } // ServiceUser defines the user required for EOS. type ServiceUser struct { - UUID string `env:"ACCOUNTS_SERVICE_USER_UUID"` - Username string `env:"ACCOUNTS_SERVICE_USER_USERNAME"` - UID int64 `env:"ACCOUNTS_SERVICE_USER_UID"` - GID int64 `env:"ACCOUNTS_SERVICE_USER_GID"` + UUID string `env:"ACCOUNTS_SERVICE_USER_UUID" desc:"The id of the accounts service user."` + Username string `env:"ACCOUNTS_SERVICE_USER_USERNAME" desc:"The username of the accounts service user."` + UID int64 `env:"ACCOUNTS_SERVICE_USER_UID" desc:"The uid of the accounts service user."` + GID int64 `env:"ACCOUNTS_SERVICE_USER_GID" desc:"The gid of the accounts service user."` } // Index defines config for indexes. @@ -75,12 +74,12 @@ type Index struct { // GIDBound defines a lower and upper bound. type GIDBound struct { - Lower int64 `env:"ACCOUNTS_GID_INDEX_LOWER_BOUND"` - Upper int64 `env:"ACCOUNTS_GID_INDEX_UPPER_BOUND"` + Lower int64 `env:"ACCOUNTS_GID_INDEX_LOWER_BOUND" desc:"The lowest possible gid value for the indexer."` + Upper int64 `env:"ACCOUNTS_GID_INDEX_UPPER_BOUND" desc:"The highest possible gid value for the indexer."` } // UIDBound defines a lower and upper bound. type UIDBound struct { - Lower int64 `env:"ACCOUNTS_UID_INDEX_LOWER_BOUND"` - Upper int64 `env:"ACCOUNTS_UID_INDEX_UPPER_BOUND"` + Lower int64 `env:"ACCOUNTS_UID_INDEX_LOWER_BOUND" desc:"The lowest possible uid value for the indexer."` + Upper int64 `env:"ACCOUNTS_UID_INDEX_UPPER_BOUND" desc:"The highest possible uid value for the indexer."` } diff --git a/accounts/pkg/config/grpc.go b/accounts/pkg/config/grpc.go index 55e66da11..29380f34f 100644 --- a/accounts/pkg/config/grpc.go +++ b/accounts/pkg/config/grpc.go @@ -2,6 +2,6 @@ package config // GRPC defines the available grpc configuration. type GRPC struct { - Addr string `env:"ACCOUNTS_GRPC_ADDR"` + Addr string `env:"ACCOUNTS_GRPC_ADDR" desc:"The address of the grpc service."` Namespace string } diff --git a/accounts/pkg/config/http.go b/accounts/pkg/config/http.go index c5c2e4975..3a59ea114 100644 --- a/accounts/pkg/config/http.go +++ b/accounts/pkg/config/http.go @@ -2,10 +2,10 @@ package config // HTTP defines the available http configuration. type HTTP struct { - Addr string `env:"ACCOUNTS_HTTP_ADDR"` + Addr string `env:"ACCOUNTS_HTTP_ADDR" desc:"The address of the http service."` Namespace string - Root string `env:"ACCOUNTS_HTTP_ROOT"` - CacheTTL int `env:"ACCOUNTS_CACHE_TTL"` + Root string `env:"ACCOUNTS_HTTP_ROOT" desc:"The root path of the http service."` + CacheTTL int `env:"ACCOUNTS_CACHE_TTL" desc:"The cache time for the static assets."` CORS CORS } diff --git a/accounts/pkg/config/log.go b/accounts/pkg/config/log.go index 2d20d3005..f4546fa60 100644 --- a/accounts/pkg/config/log.go +++ b/accounts/pkg/config/log.go @@ -2,8 +2,8 @@ package config // Log defines the available log configuration. type Log struct { - Level string `env:"OCIS_LOG_LEVEL;ACCOUNTS_LOG_LEVEL"` - Pretty bool `env:"OCIS_LOG_PRETTY;ACCOUNTS_LOG_PRETTY"` - Color bool `env:"OCIS_LOG_COLOR;ACCOUNTS_LOG_COLOR"` - File string `env:"OCIS_LOG_FILE;ACCOUNTS_LOG_FILE"` + Level string `env:"OCIS_LOG_LEVEL;ACCOUNTS_LOG_LEVEL" desc:"The log level."` + Pretty bool `env:"OCIS_LOG_PRETTY;ACCOUNTS_LOG_PRETTY" desc:"Activates pretty log output."` + Color bool `env:"OCIS_LOG_COLOR;ACCOUNTS_LOG_COLOR" desc:"Activates colorized log output."` + File string `env:"OCIS_LOG_FILE;ACCOUNTS_LOG_FILE" desc:"The target log file."` } diff --git a/accounts/pkg/config/tracing.go b/accounts/pkg/config/tracing.go index 9a7299085..8c8b1e0b7 100644 --- a/accounts/pkg/config/tracing.go +++ b/accounts/pkg/config/tracing.go @@ -2,8 +2,8 @@ package config // Tracing defines the available tracing configuration. type Tracing struct { - Enabled bool `env:"OCIS_TRACING_ENABLED;ACCOUNTS_TRACING_ENABLED"` + Enabled bool `env:"OCIS_TRACING_ENABLED;ACCOUNTS_TRACING_ENABLED" desc:"Activates tracing."` Type string `env:"OCIS_TRACING_TYPE;ACCOUNTS_TRACING_TYPE"` - Endpoint string `env:"OCIS_TRACING_ENDPOINT;ACCOUNTS_TRACING_ENDPOINT"` - Collector string `env:"OCIS_TRACING_COLLECTOR;ACCOUNTS_TRACING_COLLECTOR"` + Endpoint string `env:"OCIS_TRACING_ENDPOINT;ACCOUNTS_TRACING_ENDPOINT" desc:"The endpoint to the tracing collector."` + Collector string `env:"OCIS_TRACING_COLLECTOR;ACCOUNTS_TRACING_COLLECTOR" ` } From c53a9220967c5de24f2bb9ef16427bf807539829 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 2 Mar 2022 12:16:34 +0100 Subject: [PATCH 06/14] include env config options in the docs Co-Authored-By: Christian Richter Co-Authored-By: Willy Kloucek --- docs/extensions/_includes/_index.md | 3 ++ .../_includes/accounts_configvars.md | 27 +++++++++++ .../extensions/_includes/glauth_configvars.md | 15 ++++++ .../_includes/graph-explorer_configvars.md | 14 ++++++ docs/extensions/_includes/graph_configvars.md | 36 ++++++++++++++ docs/extensions/_includes/idm_configvars.md | 13 +++++ docs/extensions/_includes/idp_configvars.md | 47 +++++++++++++++++++ docs/extensions/_includes/nats_configvars.md | 10 ++++ .../_includes/notifications_configvars.md | 17 +++++++ docs/extensions/_includes/ocs_configvars.md | 16 +++++++ docs/extensions/_includes/proxy_configvars.md | 27 +++++++++++ .../_includes/settings_configvars.md | 15 ++++++ docs/extensions/_includes/store_configvars.md | 10 ++++ .../_includes/thumbnails_configvars.md | 14 ++++++ docs/extensions/_includes/web_configvars.md | 24 ++++++++++ .../extensions/_includes/webdav_configvars.md | 13 +++++ docs/extensions/accounts/.gitignore | 1 - docs/extensions/accounts/configuration.md | 12 +++++ docs/extensions/glauth/.gitignore | 1 - docs/extensions/glauth/configuration.md | 12 +++++ docs/extensions/graph-explorer/.gitignore | 1 - .../graph-explorer/configuration.md | 12 +++++ docs/extensions/graph/.gitignore | 1 - docs/extensions/graph/configuration.md | 12 +++++ docs/extensions/idm/_index.md | 16 +++++++ docs/extensions/idm/configuration.md | 12 +++++ docs/extensions/idp/.gitignore | 1 - docs/extensions/idp/configuration.md | 12 +++++ docs/extensions/nats/_index.md | 16 +++++++ docs/extensions/nats/configuration.md | 12 +++++ docs/extensions/notifications/_index.md | 16 +++++++ .../extensions/notifications/configuration.md | 12 +++++ docs/extensions/ocs/.gitignore | 1 - docs/extensions/ocs/configuration.md | 12 +++++ docs/extensions/proxy/.gitignore | 1 - docs/extensions/proxy/configuration.md | 12 +++++ docs/extensions/settings/.gitignore | 1 - docs/extensions/settings/configuration.md | 12 +++++ docs/extensions/storage/.gitignore | 1 - docs/extensions/store/.gitignore | 1 - docs/extensions/store/configuration.md | 12 +++++ docs/extensions/thumbnails/.gitignore | 1 - docs/extensions/thumbnails/configuration.md | 12 +++++ docs/extensions/web/.gitignore | 1 - docs/extensions/web/configuration.md | 12 +++++ docs/extensions/webdav/.gitignore | 1 - docs/extensions/webdav/configuration.md | 12 +++++ docs/helpers/configenvextractor.go | 1 + docs/helpers/extractor.go.tmpl | 35 +++++++++----- docs/templates/CONFIGURATION.tmpl | 2 + 50 files changed, 554 insertions(+), 26 deletions(-) create mode 100644 docs/extensions/_includes/_index.md create mode 100644 docs/extensions/_includes/accounts_configvars.md create mode 100644 docs/extensions/_includes/glauth_configvars.md create mode 100644 docs/extensions/_includes/graph-explorer_configvars.md create mode 100644 docs/extensions/_includes/graph_configvars.md create mode 100644 docs/extensions/_includes/idm_configvars.md create mode 100644 docs/extensions/_includes/idp_configvars.md create mode 100644 docs/extensions/_includes/nats_configvars.md create mode 100644 docs/extensions/_includes/notifications_configvars.md create mode 100644 docs/extensions/_includes/ocs_configvars.md create mode 100644 docs/extensions/_includes/proxy_configvars.md create mode 100644 docs/extensions/_includes/settings_configvars.md create mode 100644 docs/extensions/_includes/store_configvars.md create mode 100644 docs/extensions/_includes/thumbnails_configvars.md create mode 100644 docs/extensions/_includes/web_configvars.md create mode 100644 docs/extensions/_includes/webdav_configvars.md create mode 100644 docs/extensions/accounts/configuration.md create mode 100644 docs/extensions/glauth/configuration.md create mode 100644 docs/extensions/graph-explorer/configuration.md create mode 100644 docs/extensions/graph/configuration.md create mode 100644 docs/extensions/idm/_index.md create mode 100644 docs/extensions/idm/configuration.md create mode 100644 docs/extensions/idp/configuration.md create mode 100644 docs/extensions/nats/_index.md create mode 100644 docs/extensions/nats/configuration.md create mode 100644 docs/extensions/notifications/_index.md create mode 100644 docs/extensions/notifications/configuration.md create mode 100644 docs/extensions/ocs/configuration.md create mode 100644 docs/extensions/proxy/configuration.md create mode 100644 docs/extensions/settings/configuration.md create mode 100644 docs/extensions/store/configuration.md create mode 100644 docs/extensions/thumbnails/configuration.md create mode 100644 docs/extensions/web/configuration.md create mode 100644 docs/extensions/webdav/configuration.md diff --git a/docs/extensions/_includes/_index.md b/docs/extensions/_includes/_index.md new file mode 100644 index 000000000..b58ce0c82 --- /dev/null +++ b/docs/extensions/_includes/_index.md @@ -0,0 +1,3 @@ +--- +GeekdocHidden: true +--- \ No newline at end of file diff --git a/docs/extensions/_includes/accounts_configvars.md b/docs/extensions/_includes/accounts_configvars.md new file mode 100644 index 000000000..9599bea40 --- /dev/null +++ b/docs/extensions/_includes/accounts_configvars.md @@ -0,0 +1,27 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| ACCOUNTS_DEBUG_ADDR | string | 127.0.0.1:9182 | | +| ACCOUNTS_DEBUG_TOKEN | string | | | +| ACCOUNTS_DEBUG_PPROF | bool | false | | +| ACCOUNTS_DEBUG_ZPAGES | bool | false | | +| ACCOUNTS_HTTP_ADDR | string | 127.0.0.1:9181 | The address of the http service.| +| ACCOUNTS_HTTP_ROOT | string | / | The root path of the http service.| +| ACCOUNTS_CACHE_TTL | int | 604800 | The cache time for the static assets.| +| ACCOUNTS_GRPC_ADDR | string | 127.0.0.1:9180 | The address of the grpc service.| +| OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET | string | Pive-Fumkiu4 | The secret to mint jwt tokens.| +| ACCOUNTS_ASSET_PATH | string | | The path to the ui assets.| +| ACCOUNTS_STORAGE_BACKEND | string | CS3 | Defines which storage implementation is to be used| +| ACCOUNTS_STORAGE_DISK_PATH | string | ~/.ocis/accounts | The path where the accounts data is stored.| +| ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR | string | localhost:9215 | The address to the storage provider.| +| ACCOUNTS_UID_INDEX_LOWER_BOUND | int64 | 0 | The lowest possible uid value for the indexer.| +| ACCOUNTS_UID_INDEX_UPPER_BOUND | int64 | 1000 | The highest possible uid value for the indexer.| +| ACCOUNTS_GID_INDEX_LOWER_BOUND | int64 | 0 | The lowest possible gid value for the indexer.| +| ACCOUNTS_GID_INDEX_UPPER_BOUND | int64 | 1000 | The highest possible gid value for the indexer.| +| ACCOUNTS_SERVICE_USER_UUID | string | 95cb8724-03b2-11eb-a0a6-c33ef8ef53ad | The id of the accounts service user.| +| ACCOUNTS_SERVICE_USER_USERNAME | string | | The username of the accounts service user.| +| ACCOUNTS_SERVICE_USER_UID | int64 | 0 | The uid of the accounts service user.| +| ACCOUNTS_SERVICE_USER_GID | int64 | 0 | The gid of the accounts service user.| +| ACCOUNTS_HASH_DIFFICULTY | int | 11 | The hash difficulty makes sure that validating a password takes at least a certain amount of time.| +| ACCOUNTS_DEMO_USERS_AND_GROUPS | bool | true | If this flag is set the service will setup the demo users and groups.| \ No newline at end of file diff --git a/docs/extensions/_includes/glauth_configvars.md b/docs/extensions/_includes/glauth_configvars.md new file mode 100644 index 000000000..9211ff0dc --- /dev/null +++ b/docs/extensions/_includes/glauth_configvars.md @@ -0,0 +1,15 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| GLAUTH_DEBUG_ADDR | string | 127.0.0.1:9129 | | +| GLAUTH_DEBUG_TOKEN | string | | | +| GLAUTH_DEBUG_PPROF | bool | false | | +| GLAUTH_DEBUG_ZPAGES | bool | false | | +| GLAUTH_LDAP_ENABLED | bool | true | | +| GLAUTH_LDAP_ADDR | string | 127.0.0.1:9125 | | +| GLAUTH_LDAPS_ENABLED | bool | true | | +| GLAUTH_LDAPS_ADDR | string | 127.0.0.1:9126 | | +| GLAUTH_LDAPS_CERT | string | ~/.ocis/ldap/ldap.crt | | +| GLAUTH_LDAPS_KEY | string | ~/.ocis/ldap/ldap.key | | +| GLAUTH_ROLE_BUNDLE_ID | string | 71881883-1768-46bd-a24d-a356a2afdf7f | | \ No newline at end of file diff --git a/docs/extensions/_includes/graph-explorer_configvars.md b/docs/extensions/_includes/graph-explorer_configvars.md new file mode 100644 index 000000000..ebfd855e9 --- /dev/null +++ b/docs/extensions/_includes/graph-explorer_configvars.md @@ -0,0 +1,14 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| GRAPH_EXPLORER_DEBUG_ADDR | string | 127.0.0.1:9136 | | +| GRAPH_EXPLORER_DEBUG_TOKEN | string | | | +| GRAPH_EXPLORER_DEBUG_PPROF | bool | false | | +| GRAPH_EXPLORER_DEBUG_ZPAGES | bool | false | | +| GRAPH_EXPLORER_HTTP_ADDR | string | 127.0.0.1:9135 | | +| GRAPH_EXPLORER_HTTP_ROOT | string | /graph-explorer | | +| GRAPH_EXPLORER_CLIENT_ID | string | ocis-explorer.js | | +| OCIS_URL;GRAPH_EXPLORER_ISSUER | string | https://localhost:9200 | | +| OCIS_URL;GRAPH_EXPLORER_GRAPH_URL_BASE | string | https://localhost:9200 | | +| GRAPH_EXPLORER_GRAPH_URL_PATH | string | /graph | | \ No newline at end of file diff --git a/docs/extensions/_includes/graph_configvars.md b/docs/extensions/_includes/graph_configvars.md new file mode 100644 index 000000000..06036f1ec --- /dev/null +++ b/docs/extensions/_includes/graph_configvars.md @@ -0,0 +1,36 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| GRAPH_DEBUG_ADDR | string | 127.0.0.1:9124 | | +| GRAPH_DEBUG_TOKEN | string | | | +| GRAPH_DEBUG_PPROF | bool | false | | +| GRAPH_DEBUG_ZPAGES | bool | false | | +| GRAPH_HTTP_ADDR | string | 127.0.0.1:9120 | | +| GRAPH_HTTP_ROOT | string | /graph | | +| REVA_GATEWAY | string | 127.0.0.1:9142 | | +| OCIS_JWT_SECRET;OCS_JWT_SECRET | string | Pive-Fumkiu4 | | +| OCIS_URL;GRAPH_SPACES_WEBDAV_BASE | string | https://localhost:9200 | | +| GRAPH_SPACES_WEBDAV_PATH | string | /dav/spaces/ | | +| GRAPH_SPACES_DEFAULT_QUOTA | string | 1000000000 | | +| OCIS_INSECURE;GRAPH_SPACES_INSECURE | bool | false | | +| GRAPH_SPACES_EXTENDED_SPACE_PROPERTIES_CACHE_TTL | int | 0 | | +| GRAPH_IDENTITY_BACKEND | string | cs3 | | +| GRAPH_LDAP_URI | string | ldap://localhost:9125 | | +| OCIS_INSECURE;GRAPH_LDAP_INSECURE | bool | false | | +| GRAPH_LDAP_BIND_DN | string | | | +| GRAPH_LDAP_BIND_PASSWORD | string | | | +| GRAPH_LDAP_SERVER_UUID | bool | false | | +| GRAPH_LDAP_SERVER_WRITE_ENABLED | bool | false | | +| GRAPH_LDAP_USER_BASE_DN | string | ou=users,dc=ocis,dc=test | | +| GRAPH_LDAP_USER_SCOPE | string | sub | | +| GRAPH_LDAP_USER_FILTER | string | (objectClass=inetOrgPerson) | | +| GRAPH_LDAP_USER_EMAIL_ATTRIBUTE | string | mail | | +| GRAPH_LDAP_USER_DISPLAYNAME_ATTRIBUTE | string | displayName | | +| GRAPH_LDAP_USER_NAME_ATTRIBUTE | string | uid | | +| GRAPH_LDAP_USER_UID_ATTRIBUTE | string | owncloudUUID | | +| GRAPH_LDAP_GROUP_BASE_DN | string | ou=groups,dc=ocis,dc=test | | +| GRAPH_LDAP_GROUP_SEARCH_SCOPE | string | sub | | +| GRAPH_LDAP_GROUP_FILTER | string | (objectclass=groupOfNames) | | +| GRAPH_LDAP_GROUP_NAME_ATTRIBUTE | string | cn | | +| GRAPH_LDAP_GROUP_ID_ATTRIBUTE | string | owncloudUUID | | \ No newline at end of file diff --git a/docs/extensions/_includes/idm_configvars.md b/docs/extensions/_includes/idm_configvars.md new file mode 100644 index 000000000..42f6c3c08 --- /dev/null +++ b/docs/extensions/_includes/idm_configvars.md @@ -0,0 +1,13 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| IDM_DEBUG_ADDR | string | | | +| IDM_DEBUG_TOKEN | string | | | +| IDM_DEBUG_PPROF | bool | false | | +| IDM_DEBUG_ZPAGES | bool | false | | +| IDM_LDAPS_ADDR | string | 127.0.0.1:9235 | | +| IDM_LDAPS_CERT | string | ~/.ocis/idm/ldap.crt | | +| IDM_LDAPS_KEY | string | ~/.ocis/idm/ldap.key | | +| IDM_DATABASE_PATH | string | ~/.ocis/idm/ocis.boltdb | | +| IDM_ADMIN_PASSWORD | string | admin | | \ No newline at end of file diff --git a/docs/extensions/_includes/idp_configvars.md b/docs/extensions/_includes/idp_configvars.md new file mode 100644 index 000000000..ce0fc6261 --- /dev/null +++ b/docs/extensions/_includes/idp_configvars.md @@ -0,0 +1,47 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| IDP_DEBUG_ADDR | string | 127.0.0.1:9134 | | +| IDP_DEBUG_TOKEN | string | | | +| IDP_DEBUG_PPROF | bool | false | | +| IDP_DEBUG_ZPAGES | bool | false | | +| IDP_HTTP_ADDR | string | 127.0.0.1:9130 | | +| IDP_HTTP_ROOT | string | / | | +| IDP_TRANSPORT_TLS_CERT | string | ~/.ocis/idp/server.crt | | +| IDP_TRANSPORT_TLS_KEY | string | ~/.ocis/idp/server.key | | +| IDP_TLS | bool | false | | +| IDP_ASSET_PATH | string | | | +| OCIS_URL;IDP_ISS | string | https://localhost:9200 | | +| IDP_IDENTITY_MANAGER | string | ldap | | +| IDP_URI_BASE_PATH | string | | | +| IDP_SIGN_IN_URI | string | | | +| IDP_SIGN_OUT_URI | string | | | +| IDP_ENDPOINT_URI | string | | | +| IDP_ENDSESSION_ENDPOINT_URI | string | | | +| IDP_INSECURE | bool | false | | +| IDP_ALLOW_CLIENT_GUESTS | bool | false | | +| IDP_ALLOW_DYNAMIC_CLIENT_REGISTRATION | bool | false | | +| IDP_ENCRYPTION_SECRET | string | | | +| IDP_DISABLE_IDENTIFIER_WEBAPP | bool | true | | +| IDP_IDENTIFIER_CLIENT_PATH | string | ~/.ocis/idp | | +| IDP_IDENTIFIER_REGISTRATION_CONF | string | ~/.ocis/idp/identifier-registration.yaml | | +| IDP_IDENTIFIER_SCOPES_CONF | string | | | +| IDP_SIGNING_KID | string | | | +| IDP_SIGNING_METHOD | string | PS256 | | +| IDP_VALIDATION_KEYS_PATH | string | | | +| IDP_ACCESS_TOKEN_EXPIRATION | uint64 | 600 | | +| IDP_ID_TOKEN_EXPIRATION | uint64 | 3600 | | +| IDP_REFRESH_TOKEN_EXPIRATION | uint64 | 94608000 | | +| | uint64 | 0 | | +| IDP_LDAP_URI | string | ldap://localhost:9125 | | +| IDP_LDAP_BIND_DN | string | cn=idp,ou=sysusers,dc=ocis,dc=test | | +| IDP_LDAP_BIND_PASSWORD | string | idp | | +| IDP_LDAP_BASE_DN | string | ou=users,dc=ocis,dc=test | | +| IDP_LDAP_SCOPE | string | sub | | +| IDP_LDAP_LOGIN_ATTRIBUTE | string | cn | | +| IDP_LDAP_EMAIL_ATTRIBUTE | string | mail | | +| IDP_LDAP_NAME_ATTRIBUTE | string | sn | | +| IDP_LDAP_UUID_ATTRIBUTE | string | uid | | +| IDP_LDAP_UUID_ATTRIBUTE_TYPE | string | text | | +| IDP_LDAP_FILTER | string | (objectClass=posixaccount) | | \ No newline at end of file diff --git a/docs/extensions/_includes/nats_configvars.md b/docs/extensions/_includes/nats_configvars.md new file mode 100644 index 000000000..4d4bccfdd --- /dev/null +++ b/docs/extensions/_includes/nats_configvars.md @@ -0,0 +1,10 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| NATS_DEBUG_ADDR | string | | | +| NATS_DEBUG_TOKEN | string | | | +| NATS_DEBUG_PPROF | bool | false | | +| NATS_DEBUG_ZPAGES | bool | false | | +| NATS_NATS_HOST | string | 127.0.0.1 | | +| NATS_NATS_PORT | int | 9233 | | \ No newline at end of file diff --git a/docs/extensions/_includes/notifications_configvars.md b/docs/extensions/_includes/notifications_configvars.md new file mode 100644 index 000000000..f0d3adf8e --- /dev/null +++ b/docs/extensions/_includes/notifications_configvars.md @@ -0,0 +1,17 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| NOTIFICATIONS_DEBUG_ADDR | string | | | +| NOTIFICATIONS_DEBUG_TOKEN | string | | | +| NOTIFICATIONS_DEBUG_PPROF | bool | false | | +| NOTIFICATIONS_DEBUG_ZPAGES | bool | false | | +| NOTIFICATIONS_SMTP_HOST | string | 127.0.0.1 | | +| NOTIFICATIONS_SMTP_PORT | string | 1025 | | +| NOTIFICATIONS_SMTP_SENDER | string | god@example.com | | +| NOTIFICATIONS_SMTP_PASSWORD | string | godisdead | | +| NOTIFICATIONS_EVENTS_ENDPOINT | string | 127.0.0.1:9233 | | +| NOTIFICATIONS_EVENTS_CLUSTER | string | test-cluster | | +| NOTIFICATIONS_EVENTS_GROUP | string | notifications | | +| REVA_GATEWAY;NOTIFICATIONS_REVA_GATEWAY | string | 127.0.0.1:9142 | | +| OCIS_MACHINE_AUTH_API_KEY;NOTIFICATIONS_MACHINE_AUTH_API_KEY | string | change-me-please | | \ No newline at end of file diff --git a/docs/extensions/_includes/ocs_configvars.md b/docs/extensions/_includes/ocs_configvars.md new file mode 100644 index 000000000..0c12be151 --- /dev/null +++ b/docs/extensions/_includes/ocs_configvars.md @@ -0,0 +1,16 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| OCS_DEBUG_ADDR | string | 127.0.0.1:9114 | | +| OCS_DEBUG_TOKEN | string | | | +| OCS_DEBUG_PPROF | bool | false | | +| OCS_DEBUG_ZPAGES | bool | false | | +| OCS_HTTP_ADDR | string | 127.0.0.1:9110 | | +| OCS_HTTP_ROOT | string | /ocs | | +| OCIS_JWT_SECRET;OCS_JWT_SECRET | string | Pive-Fumkiu4 | | +| REVA_GATEWAY | string | 127.0.0.1:9142 | | +| OCIS_URL;OCS_IDM_ADDRESS | string | https://localhost:9200 | | +| OCS_ACCOUNT_BACKEND_TYPE | string | accounts | | +| STORAGE_USERS_DRIVER;OCS_STORAGE_USERS_DRIVER | string | ocis | | +| OCIS_MACHINE_AUTH_API_KEY;OCS_MACHINE_AUTH_API_KEY | string | change-me-please | | \ No newline at end of file diff --git a/docs/extensions/_includes/proxy_configvars.md b/docs/extensions/_includes/proxy_configvars.md new file mode 100644 index 000000000..a3be1d11a --- /dev/null +++ b/docs/extensions/_includes/proxy_configvars.md @@ -0,0 +1,27 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| PROXY_DEBUG_ADDR | string | 127.0.0.1:9205 | | +| PROXY_DEBUG_TOKEN | string | | | +| PROXY_DEBUG_PPROF | bool | false | | +| PROXY_DEBUG_ZPAGES | bool | false | | +| PROXY_HTTP_ADDR | string | 0.0.0.0:9200 | | +| PROXY_HTTP_ROOT | string | / | | +| PROXY_TRANSPORT_TLS_CERT | string | ~/.ocis/proxy/server.crt | | +| PROXY_TRANSPORT_TLS_KEY | string | ~/.ocis/proxy/server.key | | +| PROXY_TLS | bool | true | | +| REVA_GATEWAY | string | 127.0.0.1:9142 | | +| OCIS_URL;PROXY_OIDC_ISSUER | string | https://localhost:9200 | | +| OCIS_INSECURE;PROXY_OIDC_INSECURE | bool | true | | +| PROXY_OIDC_USERINFO_CACHE_SIZE | int | 1024 | | +| PROXY_OIDC_USERINFO_CACHE_TTL | int | 10 | | +| OCIS_JWT_SECRET;PROXY_JWT_SECRET | string | Pive-Fumkiu4 | | +| PROXY_ENABLE_PRESIGNEDURLS | bool | true | | +| PROXY_ACCOUNT_BACKEND_TYPE | string | accounts | | +| PROXY_USER_OIDC_CLAIM | string | email | | +| PROXY_USER_CS3_CLAIM | string | mail | | +| OCIS_MACHINE_AUTH_API_KEY;PROXY_MACHINE_AUTH_API_KEY | string | change-me-please | | +| PROXY_AUTOPROVISION_ACCOUNTS | bool | false | | +| PROXY_ENABLE_BASIC_AUTH | bool | false | | +| PROXY_INSECURE_BACKENDS | bool | false | | \ No newline at end of file diff --git a/docs/extensions/_includes/settings_configvars.md b/docs/extensions/_includes/settings_configvars.md new file mode 100644 index 000000000..c8136208e --- /dev/null +++ b/docs/extensions/_includes/settings_configvars.md @@ -0,0 +1,15 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| SETTINGS_DEBUG_ADDR | string | 127.0.0.1:9194 | | +| SETTINGS_DEBUG_TOKEN | string | | | +| SETTINGS_DEBUG_PPROF | bool | false | | +| SETTINGS_DEBUG_ZPAGES | bool | false | | +| SETTINGS_HTTP_ADDR | string | 127.0.0.1:9190 | | +| SETTINGS_HTTP_ROOT | string | / | | +| SETTINGS_CACHE_TTL | int | 604800 | | +| SETTINGS_GRPC_ADDR | string | 127.0.0.1:9191 | | +| SETTINGS_DATA_PATH | string | ~/.ocis/settings | | +| SETTINGS_ASSET_PATH | string | | | +| OCIS_JWT_SECRET;SETTINGS_JWT_SECRET | string | Pive-Fumkiu4 | | \ No newline at end of file diff --git a/docs/extensions/_includes/store_configvars.md b/docs/extensions/_includes/store_configvars.md new file mode 100644 index 000000000..b0afbd700 --- /dev/null +++ b/docs/extensions/_includes/store_configvars.md @@ -0,0 +1,10 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| STORE_DEBUG_ADDR | string | 127.0.0.1:9464 | | +| STORE_DEBUG_TOKEN | string | | | +| STORE_DEBUG_PPROF | bool | false | | +| STORE_DEBUG_ZPAGES | bool | false | | +| STORE_GRPC_ADDR | string | 127.0.0.1:9460 | | +| STORE_DATA_PATH | string | ~/.ocis/store | | \ No newline at end of file diff --git a/docs/extensions/_includes/thumbnails_configvars.md b/docs/extensions/_includes/thumbnails_configvars.md new file mode 100644 index 000000000..791376911 --- /dev/null +++ b/docs/extensions/_includes/thumbnails_configvars.md @@ -0,0 +1,14 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| THUMBNAILS_DEBUG_ADDR | string | 127.0.0.1:9189 | | +| THUMBNAILS_DEBUG_TOKEN | string | | | +| THUMBNAILS_DEBUG_PPROF | bool | false | | +| THUMBNAILS_DEBUG_ZPAGES | bool | false | | +| THUMBNAILS_GRPC_ADDR | string | 127.0.0.1:9185 | | +| THUMBNAILS_FILESYSTEMSTORAGE_ROOT | string | ~/.ocis/thumbnails | | +| OCIS_INSECURE;THUMBNAILS_WEBDAVSOURCE_INSECURE | bool | true | | +| OCIS_INSECURE;THUMBNAILS_CS3SOURCE_INSECURE | bool | false | | +| REVA_GATEWAY | string | 127.0.0.1:9142 | | +| THUMBNAILS_TXT_FONTMAP_FILE | string | | | \ No newline at end of file diff --git a/docs/extensions/_includes/web_configvars.md b/docs/extensions/_includes/web_configvars.md new file mode 100644 index 000000000..738506900 --- /dev/null +++ b/docs/extensions/_includes/web_configvars.md @@ -0,0 +1,24 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| WEB_DEBUG_ADDR | string | 127.0.0.1:9104 | | +| WEB_DEBUG_TOKEN | string | | | +| WEB_DEBUG_PPROF | bool | false | | +| WEB_DEBUG_ZPAGES | bool | false | | +| WEB_HTTP_ADDR | string | 127.0.0.1:9100 | | +| WEB_HTTP_ROOT | string | / | | +| WEB_CACHE_TTL | int | 604800 | | +| WEB_ASSET_PATH | string | | | +| WEB_UI_CONFIG | string | | | +| WEB_UI_PATH | string | | | +| OCIS_URL;WEB_UI_THEME_SERVER | string | https://localhost:9200 | | +| WEB_UI_THEME_PATH | string | /themes/owncloud/theme.json | | +| OCIS_URL;WEB_UI_CONFIG_SERVER | string | https://localhost:9200 | | +| | string | | | +| WEB_UI_CONFIG_VERSION | string | 0.1.0 | | +| WEB_OIDC_METADATA_URL | string | | | +| OCIS_URL;WEB_OIDC_AUTHORITY | string | https://localhost:9200 | | +| WEB_OIDC_CLIENT_ID | string | web | | +| WEB_OIDC_RESPONSE_TYPE | string | code | | +| WEB_OIDC_SCOPE | string | openid profile email | | \ No newline at end of file diff --git a/docs/extensions/_includes/webdav_configvars.md b/docs/extensions/_includes/webdav_configvars.md new file mode 100644 index 000000000..a4767cfb0 --- /dev/null +++ b/docs/extensions/_includes/webdav_configvars.md @@ -0,0 +1,13 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| WEBDAV_DEBUG_ADDR | string | 127.0.0.1:9119 | | +| WEBDAV_DEBUG_TOKEN | string | | | +| WEBDAV_DEBUG_PPROF | bool | false | | +| WEBDAV_DEBUG_ZPAGES | bool | false | | +| WEBDAV_HTTP_ADDR | string | 127.0.0.1:9115 | | +| WEBDAV_HTTP_ROOT | string | / | | +| OCIS_URL;OCIS_PUBLIC_URL | string | https://127.0.0.1:9200 | | +| STORAGE_WEBDAV_NAMESPACE | string | /users/{{.Id.OpaqueId}} | | +| REVA_GATEWAY | string | 127.0.0.1:9142 | | \ No newline at end of file diff --git a/docs/extensions/accounts/.gitignore b/docs/extensions/accounts/.gitignore index 582a0f847..63536ebfa 100644 --- a/docs/extensions/accounts/.gitignore +++ b/docs/extensions/accounts/.gitignore @@ -1,2 +1 @@ -configuration.md grpc.md diff --git a/docs/extensions/accounts/configuration.md b/docs/extensions/accounts/configuration.md new file mode 100644 index 000000000..584b5b183 --- /dev/null +++ b/docs/extensions/accounts/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/accounts +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/accounts_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/glauth/.gitignore b/docs/extensions/glauth/.gitignore index 582a0f847..63536ebfa 100644 --- a/docs/extensions/glauth/.gitignore +++ b/docs/extensions/glauth/.gitignore @@ -1,2 +1 @@ -configuration.md grpc.md diff --git a/docs/extensions/glauth/configuration.md b/docs/extensions/glauth/configuration.md new file mode 100644 index 000000000..7132fe0e5 --- /dev/null +++ b/docs/extensions/glauth/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/glauth +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/glauth_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/graph-explorer/.gitignore b/docs/extensions/graph-explorer/.gitignore index b0c8840e2..e69de29bb 100644 --- a/docs/extensions/graph-explorer/.gitignore +++ b/docs/extensions/graph-explorer/.gitignore @@ -1 +0,0 @@ -configuration.md diff --git a/docs/extensions/graph-explorer/configuration.md b/docs/extensions/graph-explorer/configuration.md new file mode 100644 index 000000000..c27fe2467 --- /dev/null +++ b/docs/extensions/graph-explorer/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/graph-explorer +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/graph-explorer_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/graph/.gitignore b/docs/extensions/graph/.gitignore index b0c8840e2..e69de29bb 100644 --- a/docs/extensions/graph/.gitignore +++ b/docs/extensions/graph/.gitignore @@ -1 +0,0 @@ -configuration.md diff --git a/docs/extensions/graph/configuration.md b/docs/extensions/graph/configuration.md new file mode 100644 index 000000000..786dfb133 --- /dev/null +++ b/docs/extensions/graph/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/graph +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/graph_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/idm/_index.md b/docs/extensions/idm/_index.md new file mode 100644 index 000000000..19306118e --- /dev/null +++ b/docs/extensions/idm/_index.md @@ -0,0 +1,16 @@ +--- +title: IDM +date: 2022-03-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/idm +geekdocFilePath: _index.md +geekdocCollapseSection: true +--- + +## Abstract + + +## Table of Contents + +{{< toc-tree >}} diff --git a/docs/extensions/idm/configuration.md b/docs/extensions/idm/configuration.md new file mode 100644 index 000000000..14200bcde --- /dev/null +++ b/docs/extensions/idm/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/idm +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/idm_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/idp/.gitignore b/docs/extensions/idp/.gitignore index 582a0f847..63536ebfa 100644 --- a/docs/extensions/idp/.gitignore +++ b/docs/extensions/idp/.gitignore @@ -1,2 +1 @@ -configuration.md grpc.md diff --git a/docs/extensions/idp/configuration.md b/docs/extensions/idp/configuration.md new file mode 100644 index 000000000..bc6011eac --- /dev/null +++ b/docs/extensions/idp/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/idp +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/idp_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/nats/_index.md b/docs/extensions/nats/_index.md new file mode 100644 index 000000000..bd785e222 --- /dev/null +++ b/docs/extensions/nats/_index.md @@ -0,0 +1,16 @@ +--- +title: NATS +date: 2022-03-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/nats +geekdocFilePath: _index.md +geekdocCollapseSection: true +--- + +## Abstract + + +## Table of Contents + +{{< toc-tree >}} \ No newline at end of file diff --git a/docs/extensions/nats/configuration.md b/docs/extensions/nats/configuration.md new file mode 100644 index 000000000..20ba82f34 --- /dev/null +++ b/docs/extensions/nats/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/nats +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/nats_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/notifications/_index.md b/docs/extensions/notifications/_index.md new file mode 100644 index 000000000..c0ad0f7a5 --- /dev/null +++ b/docs/extensions/notifications/_index.md @@ -0,0 +1,16 @@ +--- +title: Notifications +date: 2022-03-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/notifications +geekdocFilePath: _index.md +geekdocCollapseSection: true +--- + +## Abstract + + +## Table of Contents + +{{< toc-tree >}} \ No newline at end of file diff --git a/docs/extensions/notifications/configuration.md b/docs/extensions/notifications/configuration.md new file mode 100644 index 000000000..7da0ba47b --- /dev/null +++ b/docs/extensions/notifications/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/notifications +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/notifications_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/ocs/.gitignore b/docs/extensions/ocs/.gitignore index 582a0f847..63536ebfa 100644 --- a/docs/extensions/ocs/.gitignore +++ b/docs/extensions/ocs/.gitignore @@ -1,2 +1 @@ -configuration.md grpc.md diff --git a/docs/extensions/ocs/configuration.md b/docs/extensions/ocs/configuration.md new file mode 100644 index 000000000..502fead64 --- /dev/null +++ b/docs/extensions/ocs/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/ocs +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/ocs_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/proxy/.gitignore b/docs/extensions/proxy/.gitignore index 582a0f847..63536ebfa 100644 --- a/docs/extensions/proxy/.gitignore +++ b/docs/extensions/proxy/.gitignore @@ -1,2 +1 @@ -configuration.md grpc.md diff --git a/docs/extensions/proxy/configuration.md b/docs/extensions/proxy/configuration.md new file mode 100644 index 000000000..785922489 --- /dev/null +++ b/docs/extensions/proxy/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/proxy +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/proxy_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/settings/.gitignore b/docs/extensions/settings/.gitignore index 582a0f847..63536ebfa 100644 --- a/docs/extensions/settings/.gitignore +++ b/docs/extensions/settings/.gitignore @@ -1,2 +1 @@ -configuration.md grpc.md diff --git a/docs/extensions/settings/configuration.md b/docs/extensions/settings/configuration.md new file mode 100644 index 000000000..b20e913a7 --- /dev/null +++ b/docs/extensions/settings/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/settings +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/settings_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/storage/.gitignore b/docs/extensions/storage/.gitignore index 582a0f847..63536ebfa 100644 --- a/docs/extensions/storage/.gitignore +++ b/docs/extensions/storage/.gitignore @@ -1,2 +1 @@ -configuration.md grpc.md diff --git a/docs/extensions/store/.gitignore b/docs/extensions/store/.gitignore index 582a0f847..63536ebfa 100644 --- a/docs/extensions/store/.gitignore +++ b/docs/extensions/store/.gitignore @@ -1,2 +1 @@ -configuration.md grpc.md diff --git a/docs/extensions/store/configuration.md b/docs/extensions/store/configuration.md new file mode 100644 index 000000000..a974e254a --- /dev/null +++ b/docs/extensions/store/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/store +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/store_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/thumbnails/.gitignore b/docs/extensions/thumbnails/.gitignore index 582a0f847..63536ebfa 100644 --- a/docs/extensions/thumbnails/.gitignore +++ b/docs/extensions/thumbnails/.gitignore @@ -1,2 +1 @@ -configuration.md grpc.md diff --git a/docs/extensions/thumbnails/configuration.md b/docs/extensions/thumbnails/configuration.md new file mode 100644 index 000000000..7b6e85bde --- /dev/null +++ b/docs/extensions/thumbnails/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/thumbnails +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/thumbnails_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/web/.gitignore b/docs/extensions/web/.gitignore index 582a0f847..63536ebfa 100644 --- a/docs/extensions/web/.gitignore +++ b/docs/extensions/web/.gitignore @@ -1,2 +1 @@ -configuration.md grpc.md diff --git a/docs/extensions/web/configuration.md b/docs/extensions/web/configuration.md new file mode 100644 index 000000000..d55237fd9 --- /dev/null +++ b/docs/extensions/web/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/web +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/web_configvars.md" >}} \ No newline at end of file diff --git a/docs/extensions/webdav/.gitignore b/docs/extensions/webdav/.gitignore index 582a0f847..63536ebfa 100644 --- a/docs/extensions/webdav/.gitignore +++ b/docs/extensions/webdav/.gitignore @@ -1,2 +1 @@ -configuration.md grpc.md diff --git a/docs/extensions/webdav/configuration.md b/docs/extensions/webdav/configuration.md new file mode 100644 index 000000000..7ae4a0486 --- /dev/null +++ b/docs/extensions/webdav/configuration.md @@ -0,0 +1,12 @@ +--- +title: Service Configuration +date: 2018-05-02T00:00:00+00:00 +weight: 20 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/extensions/webdav +geekdocFilePath: configuration.md +geekdocCollapseSection: true +--- + + +{{< include file="extensions/_includes/webdav_configvars.md" >}} \ No newline at end of file diff --git a/docs/helpers/configenvextractor.go b/docs/helpers/configenvextractor.go index c9b9a401f..b932d318f 100644 --- a/docs/helpers/configenvextractor.go +++ b/docs/helpers/configenvextractor.go @@ -35,6 +35,7 @@ func main() { } tpl.Execute(runner, paths) os.Chdir("output") + os.Setenv("OCIS_BASE_DATA_PATH", "~/.ocis") out, err := exec.Command("go", "run", "runner.go").Output() if err != nil { log.Fatal(err) diff --git a/docs/helpers/extractor.go.tmpl b/docs/helpers/extractor.go.tmpl index 1f9ea9698..b07ee1fa0 100644 --- a/docs/helpers/extractor.go.tmpl +++ b/docs/helpers/extractor.go.tmpl @@ -5,8 +5,9 @@ import ( "io/ioutil" "log" "os" + "path/filepath" "reflect" - "strings" + "strings" "text/template" {{- range $key, $value := .}} @@ -32,19 +33,27 @@ replacer := strings.NewReplacer( var fields []ConfigField var targetFile *os.File tpl := template.Must(template.New("").Parse(string(content))) -{{ range $key, $value := .}} - fields = GetAnnotatedVariables(*pkg{{ $key }}.DefaultConfig()) - if len(fields) > 0 { - targetFolder := "../../../docs/extensions/" + replacer.Replace("{{ $value }}") - os.MkdirAll(targetFolder, 0700) - targetFile, err = os.Create(targetFolder + "/configvars.md") - if err != nil { - log.Fatal(err) - } - tpl.Execute(targetFile, fields) - targetFile.Close() + +m := map[string]interface{}{ +{{- range $key, $value := .}} + "{{$value}}": *pkg{{$key}}.DefaultConfig(), +{{- end }} +} + + targetFolder := "../../../docs/extensions/_includes/" + for pkg, conf := range m { + fields = GetAnnotatedVariables(conf) + if len(fields) > 0 { + targetFile, err = os.Create(filepath.Join(targetFolder, replacer.Replace(pkg) + "_configvars.md")) + if err != nil { + log.Fatalf("Failed to create target file: %s", err) + } + defer targetFile.Close() + if err := tpl.Execute(targetFile, fields); err != nil { + log.Fatalf("Failed to execute template: %s", err) + } + } } -{{ end }} } func GetAnnotatedVariables(s interface{}) []ConfigField { diff --git a/docs/templates/CONFIGURATION.tmpl b/docs/templates/CONFIGURATION.tmpl index da7a6ec8e..ffa87ae79 100644 --- a/docs/templates/CONFIGURATION.tmpl +++ b/docs/templates/CONFIGURATION.tmpl @@ -1,3 +1,5 @@ +## Environment Variables + | Name | Type | Default Value | Description | |------|------|---------------|-------------| {{- range .}} From f6656fa6ac66cdc5a67639caedbdb45af283962d Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 2 Mar 2022 14:40:15 +0100 Subject: [PATCH 07/14] include config env extractor to docs-generate step --- docs/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Makefile b/docs/Makefile index 66ec7e7b9..12121bd84 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -8,6 +8,7 @@ help: .PHONY: docs-generate docs-generate: ## run docs-generate for all oCIS extensions + @pushd helpers && go run configenvextractor.go; popd @$(MAKE) --no-print-directory -C ../ docs-generate .PHONY: docs-init From 15e1139b8d0a396931507023ddf1dbd2f3a04709 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 2 Mar 2022 15:11:12 +0100 Subject: [PATCH 08/14] revert ocisConfig changes --- accounts/pkg/config/config.go | 60 +++++++++++++++++------------------ accounts/pkg/config/debug.go | 8 ++--- accounts/pkg/config/grpc.go | 2 +- accounts/pkg/config/http.go | 6 ++-- accounts/pkg/config/log.go | 8 ++--- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/accounts/pkg/config/config.go b/accounts/pkg/config/config.go index ff321826f..78d76ba40 100644 --- a/accounts/pkg/config/config.go +++ b/accounts/pkg/config/config.go @@ -8,78 +8,78 @@ import ( // Config combines all available configuration parts. type Config struct { - *shared.Commons `yaml:"-"` + *shared.Commons - Service Service `yaml:"-"` + Service Service - Tracing *Tracing - Log *Log - Debug Debug + Tracing *Tracing `ocisConfig:"tracing"` + Log *Log `ocisConfig:"log"` + Debug Debug `ocisConfig:"debug"` - HTTP HTTP - GRPC GRPC + HTTP HTTP `ocisConfig:"http"` + GRPC GRPC `ocisConfig:"grpc"` - TokenManager TokenManager + TokenManager TokenManager `ocisConfig:"token_manager"` - Asset Asset - Repo Repo - Index Index - ServiceUser ServiceUser - HashDifficulty int `env:"ACCOUNTS_HASH_DIFFICULTY" desc:"The hash difficulty makes sure that validating a password takes at least a certain amount of time."` - DemoUsersAndGroups bool `env:"ACCOUNTS_DEMO_USERS_AND_GROUPS" desc:"If this flag is set the service will setup the demo users and groups."` + Asset Asset `ocisConfig:"asset"` + Repo Repo `ocisConfig:"repo"` + Index Index `ocisConfig:"index"` + ServiceUser ServiceUser `ocisConfig:"service_user"` + HashDifficulty int `ocisConfig:"hash_difficulty" env:"ACCOUNTS_HASH_DIFFICULTY" desc:"The hash difficulty makes sure that validating a password takes at least a certain amount of time."` + DemoUsersAndGroups bool `ocisConfig:"demo_users_and_groups" env:"ACCOUNTS_DEMO_USERS_AND_GROUPS" desc:"If this flag is set the service will setup the demo users and groups."` - Context context.Context `yaml:"-"` + Context context.Context } // Asset defines the available asset configuration. type Asset struct { - Path string `env:"ACCOUNTS_ASSET_PATH" desc:"The path to the ui assets."` + Path string `ocisConfig:"path" env:"ACCOUNTS_ASSET_PATH" desc:"The path to the ui assets."` } // TokenManager is the config for using the reva token manager type TokenManager struct { - JWTSecret string `env:"OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET" desc:"The secret to mint jwt tokens."` + JWTSecret string `ocisConfig:"jwt_secret" env:"OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET" desc:"The secret to mint jwt tokens."` } // Repo defines which storage implementation is to be used. type Repo struct { - Backend string `env:"ACCOUNTS_STORAGE_BACKEND" desc:"Defines which storage implementation is to be used"` + Backend string `ocisConfig:"backend" env:"ACCOUNTS_STORAGE_BACKEND" desc:"Defines which storage implementation is to be used"` Disk Disk CS3 CS3 } // Disk is the local disk implementation of the storage. type Disk struct { - Path string `env:"ACCOUNTS_STORAGE_DISK_PATH" desc:"The path where the accounts data is stored."` + Path string `ocisConfig:"path" env:"ACCOUNTS_STORAGE_DISK_PATH" desc:"The path where the accounts data is stored."` } // CS3 is the cs3 implementation of the storage. type CS3 struct { - ProviderAddr string `env:"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR" desc:"The address to the storage provider."` + ProviderAddr string `ocisConfig:"provider_addr" env:"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR" desc:"The address to the storage provider."` } // ServiceUser defines the user required for EOS. type ServiceUser struct { - UUID string `env:"ACCOUNTS_SERVICE_USER_UUID" desc:"The id of the accounts service user."` - Username string `env:"ACCOUNTS_SERVICE_USER_USERNAME" desc:"The username of the accounts service user."` - UID int64 `env:"ACCOUNTS_SERVICE_USER_UID" desc:"The uid of the accounts service user."` - GID int64 `env:"ACCOUNTS_SERVICE_USER_GID" desc:"The gid of the accounts service user."` + UUID string `ocisConfig:"uuid" env:"ACCOUNTS_SERVICE_USER_UUID" desc:"The id of the accounts service user."` + Username string `ocisConfig:"username" env:"ACCOUNTS_SERVICE_USER_USERNAME" desc:"The username of the accounts service user."` + UID int64 `ocisConfig:"uid" env:"ACCOUNTS_SERVICE_USER_UID" desc:"The uid of the accounts service user."` + GID int64 `ocisConfig:"gid" env:"ACCOUNTS_SERVICE_USER_GID" desc:"The gid of the accounts service user."` } // Index defines config for indexes. type Index struct { - UID UIDBound - GID GIDBound + UID UIDBound `ocisConfig:"uid"` + GID GIDBound `ocisConfig:"gid"` } // GIDBound defines a lower and upper bound. type GIDBound struct { - Lower int64 `env:"ACCOUNTS_GID_INDEX_LOWER_BOUND" desc:"The lowest possible gid value for the indexer."` - Upper int64 `env:"ACCOUNTS_GID_INDEX_UPPER_BOUND" desc:"The highest possible gid value for the indexer."` + Lower int64 `ocisConfig:"lower" env:"ACCOUNTS_GID_INDEX_LOWER_BOUND" desc:"The lowest possible gid value for the indexer."` + Upper int64 `ocisConfig:"upper" env:"ACCOUNTS_GID_INDEX_UPPER_BOUND" desc:"The highest possible gid value for the indexer."` } // UIDBound defines a lower and upper bound. type UIDBound struct { - Lower int64 `env:"ACCOUNTS_UID_INDEX_LOWER_BOUND" desc:"The lowest possible uid value for the indexer."` - Upper int64 `env:"ACCOUNTS_UID_INDEX_UPPER_BOUND" desc:"The highest possible uid value for the indexer."` + Lower int64 `ocisConfig:"lower" env:"ACCOUNTS_UID_INDEX_LOWER_BOUND" desc:"The lowest possible uid value for the indexer."` + Upper int64 `ocisConfig:"upper" env:"ACCOUNTS_UID_INDEX_UPPER_BOUND" desc:"The highest possible uid value for the indexer."` } diff --git a/accounts/pkg/config/debug.go b/accounts/pkg/config/debug.go index fd90aad7a..539b8faba 100644 --- a/accounts/pkg/config/debug.go +++ b/accounts/pkg/config/debug.go @@ -2,8 +2,8 @@ package config // Debug defines the available debug configuration. type Debug struct { - Addr string `env:"ACCOUNTS_DEBUG_ADDR"` - Token string `env:"ACCOUNTS_DEBUG_TOKEN"` - Pprof bool `env:"ACCOUNTS_DEBUG_PPROF"` - Zpages bool `env:"ACCOUNTS_DEBUG_ZPAGES"` + Addr string `ocisConfig:"addr" env:"ACCOUNTS_DEBUG_ADDR"` + Token string `ocisConfig:"token" env:"ACCOUNTS_DEBUG_TOKEN"` + Pprof bool `ocisConfig:"pprof" env:"ACCOUNTS_DEBUG_PPROF"` + Zpages bool `ocisConfig:"zpages" env:"ACCOUNTS_DEBUG_ZPAGES"` } diff --git a/accounts/pkg/config/grpc.go b/accounts/pkg/config/grpc.go index 29380f34f..a89e0ca00 100644 --- a/accounts/pkg/config/grpc.go +++ b/accounts/pkg/config/grpc.go @@ -2,6 +2,6 @@ package config // GRPC defines the available grpc configuration. type GRPC struct { - Addr string `env:"ACCOUNTS_GRPC_ADDR" desc:"The address of the grpc service."` + Addr string `ocisConfig:"addr" env:"ACCOUNTS_GRPC_ADDR" desc:"The address of the grpc service."` Namespace string } diff --git a/accounts/pkg/config/http.go b/accounts/pkg/config/http.go index 3a59ea114..81971eba1 100644 --- a/accounts/pkg/config/http.go +++ b/accounts/pkg/config/http.go @@ -2,10 +2,10 @@ package config // HTTP defines the available http configuration. type HTTP struct { - Addr string `env:"ACCOUNTS_HTTP_ADDR" desc:"The address of the http service."` + Addr string `ocisConfig:"addr" env:"ACCOUNTS_HTTP_ADDR" desc:"The address of the http service."` Namespace string - Root string `env:"ACCOUNTS_HTTP_ROOT" desc:"The root path of the http service."` - CacheTTL int `env:"ACCOUNTS_CACHE_TTL" desc:"The cache time for the static assets."` + Root string `ocisConfig:"root" env:"ACCOUNTS_HTTP_ROOT" desc:"The root path of the http service."` + CacheTTL int `ocisConfig:"cache_ttl" env:"ACCOUNTS_CACHE_TTL" desc:"The cache time for the static assets."` CORS CORS } diff --git a/accounts/pkg/config/log.go b/accounts/pkg/config/log.go index f4546fa60..f9548ed77 100644 --- a/accounts/pkg/config/log.go +++ b/accounts/pkg/config/log.go @@ -2,8 +2,8 @@ package config // Log defines the available log configuration. type Log struct { - Level string `env:"OCIS_LOG_LEVEL;ACCOUNTS_LOG_LEVEL" desc:"The log level."` - Pretty bool `env:"OCIS_LOG_PRETTY;ACCOUNTS_LOG_PRETTY" desc:"Activates pretty log output."` - Color bool `env:"OCIS_LOG_COLOR;ACCOUNTS_LOG_COLOR" desc:"Activates colorized log output."` - File string `env:"OCIS_LOG_FILE;ACCOUNTS_LOG_FILE" desc:"The target log file."` + Level string `ocisConfig:"level" env:"OCIS_LOG_LEVEL;ACCOUNTS_LOG_LEVEL" desc:"The log level."` + Pretty bool `ocisConfig:"pretty" env:"OCIS_LOG_PRETTY;ACCOUNTS_LOG_PRETTY" desc:"Activates pretty log output."` + Color bool `ocisConfig:"color" env:"OCIS_LOG_COLOR;ACCOUNTS_LOG_COLOR" desc:"Activates colorized log output."` + File string `ocisConfig:"file" env:"OCIS_LOG_FILE;ACCOUNTS_LOG_FILE" desc:"The target log file."` } From 63818e0fa472851dabe678c6b44a9d6e8a307ce4 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 2 Mar 2022 15:12:34 +0100 Subject: [PATCH 09/14] revert ocisConfig changes part 2 --- accounts/pkg/config/http.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accounts/pkg/config/http.go b/accounts/pkg/config/http.go index 81971eba1..6a8828ea9 100644 --- a/accounts/pkg/config/http.go +++ b/accounts/pkg/config/http.go @@ -11,8 +11,8 @@ type HTTP struct { // CORS defines the available cors configuration. type CORS struct { - AllowedOrigins []string - AllowedMethods []string - AllowedHeaders []string - AllowCredentials bool + AllowedOrigins []string `ocisConfig:"allowed_origins"` + AllowedMethods []string `ocisConfig:"allowed_methods"` + AllowedHeaders []string `ocisConfig:"allowed_headers"` + AllowCredentials bool `ocisConfig:"allowed_credentials"` } From 4f18908016ca5494c1d1d57bd19e82d1fa4f86cc Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Wed, 2 Mar 2022 15:12:55 +0100 Subject: [PATCH 10/14] Add output to configenvextractor --- docs/helpers/configenvextractor.go | 6 +++++- docs/helpers/extractor.go.tmpl | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/helpers/configenvextractor.go b/docs/helpers/configenvextractor.go index b932d318f..bc504fc32 100644 --- a/docs/helpers/configenvextractor.go +++ b/docs/helpers/configenvextractor.go @@ -12,6 +12,7 @@ import ( ) func main() { + fmt.Println("Getting relevant packages") paths, err := filepath.Glob("../../*/pkg/config/defaultconfig.go") if err != nil { log.Fatal(err) @@ -27,6 +28,7 @@ func main() { if err != nil { log.Fatal(err) } + fmt.Println("Generating intermediate go code") tpl := template.Must(template.New("").Parse(string(content))) os.Mkdir("output", 0700) runner, err := os.Create("output/runner.go") @@ -34,13 +36,15 @@ func main() { log.Fatal(err) } tpl.Execute(runner, paths) + fmt.Println("Running intermediate go code") os.Chdir("output") os.Setenv("OCIS_BASE_DATA_PATH", "~/.ocis") out, err := exec.Command("go", "run", "runner.go").Output() if err != nil { log.Fatal(err) } + fmt.Println(string(out)) + fmt.Println("Cleaning up") os.Chdir("../") os.RemoveAll("output") - fmt.Println(string(out)) } diff --git a/docs/helpers/extractor.go.tmpl b/docs/helpers/extractor.go.tmpl index b07ee1fa0..3503ea227 100644 --- a/docs/helpers/extractor.go.tmpl +++ b/docs/helpers/extractor.go.tmpl @@ -22,6 +22,7 @@ type ConfigField struct { } func main() { +fmt.Println("Generating documentation for environment variables:") content, err := ioutil.ReadFile("../../../docs/templates/CONFIGURATION.tmpl") if err != nil { log.Fatal(err) @@ -44,6 +45,7 @@ m := map[string]interface{}{ for pkg, conf := range m { fields = GetAnnotatedVariables(conf) if len(fields) > 0 { + fmt.Printf("... %s\n", pkg) targetFile, err = os.Create(filepath.Join(targetFolder, replacer.Replace(pkg) + "_configvars.md")) if err != nil { log.Fatalf("Failed to create target file: %s", err) @@ -54,6 +56,7 @@ m := map[string]interface{}{ } } } + fmt.Println("done") } func GetAnnotatedVariables(s interface{}) []ConfigField { From 1db1c7b6781720c4ef2e1dd7694dfe2a0eadf880 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 2 Mar 2022 15:16:44 +0100 Subject: [PATCH 11/14] remove generated configvars files from repo --- docs/extensions/_includes/.gitignore | 1 + .../_includes/accounts_configvars.md | 27 ----------- .../extensions/_includes/glauth_configvars.md | 15 ------ .../_includes/graph-explorer_configvars.md | 14 ------ docs/extensions/_includes/graph_configvars.md | 36 -------------- docs/extensions/_includes/idm_configvars.md | 13 ----- docs/extensions/_includes/idp_configvars.md | 47 ------------------- docs/extensions/_includes/nats_configvars.md | 10 ---- .../_includes/notifications_configvars.md | 17 ------- docs/extensions/_includes/ocs_configvars.md | 16 ------- docs/extensions/_includes/proxy_configvars.md | 27 ----------- .../_includes/settings_configvars.md | 15 ------ docs/extensions/_includes/store_configvars.md | 10 ---- .../_includes/thumbnails_configvars.md | 14 ------ docs/extensions/_includes/web_configvars.md | 24 ---------- .../extensions/_includes/webdav_configvars.md | 13 ----- 16 files changed, 1 insertion(+), 298 deletions(-) create mode 100644 docs/extensions/_includes/.gitignore delete mode 100644 docs/extensions/_includes/accounts_configvars.md delete mode 100644 docs/extensions/_includes/glauth_configvars.md delete mode 100644 docs/extensions/_includes/graph-explorer_configvars.md delete mode 100644 docs/extensions/_includes/graph_configvars.md delete mode 100644 docs/extensions/_includes/idm_configvars.md delete mode 100644 docs/extensions/_includes/idp_configvars.md delete mode 100644 docs/extensions/_includes/nats_configvars.md delete mode 100644 docs/extensions/_includes/notifications_configvars.md delete mode 100644 docs/extensions/_includes/ocs_configvars.md delete mode 100644 docs/extensions/_includes/proxy_configvars.md delete mode 100644 docs/extensions/_includes/settings_configvars.md delete mode 100644 docs/extensions/_includes/store_configvars.md delete mode 100644 docs/extensions/_includes/thumbnails_configvars.md delete mode 100644 docs/extensions/_includes/web_configvars.md delete mode 100644 docs/extensions/_includes/webdav_configvars.md diff --git a/docs/extensions/_includes/.gitignore b/docs/extensions/_includes/.gitignore new file mode 100644 index 000000000..a463a88c5 --- /dev/null +++ b/docs/extensions/_includes/.gitignore @@ -0,0 +1 @@ +*_configvars.md diff --git a/docs/extensions/_includes/accounts_configvars.md b/docs/extensions/_includes/accounts_configvars.md deleted file mode 100644 index 9599bea40..000000000 --- a/docs/extensions/_includes/accounts_configvars.md +++ /dev/null @@ -1,27 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| ACCOUNTS_DEBUG_ADDR | string | 127.0.0.1:9182 | | -| ACCOUNTS_DEBUG_TOKEN | string | | | -| ACCOUNTS_DEBUG_PPROF | bool | false | | -| ACCOUNTS_DEBUG_ZPAGES | bool | false | | -| ACCOUNTS_HTTP_ADDR | string | 127.0.0.1:9181 | The address of the http service.| -| ACCOUNTS_HTTP_ROOT | string | / | The root path of the http service.| -| ACCOUNTS_CACHE_TTL | int | 604800 | The cache time for the static assets.| -| ACCOUNTS_GRPC_ADDR | string | 127.0.0.1:9180 | The address of the grpc service.| -| OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET | string | Pive-Fumkiu4 | The secret to mint jwt tokens.| -| ACCOUNTS_ASSET_PATH | string | | The path to the ui assets.| -| ACCOUNTS_STORAGE_BACKEND | string | CS3 | Defines which storage implementation is to be used| -| ACCOUNTS_STORAGE_DISK_PATH | string | ~/.ocis/accounts | The path where the accounts data is stored.| -| ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR | string | localhost:9215 | The address to the storage provider.| -| ACCOUNTS_UID_INDEX_LOWER_BOUND | int64 | 0 | The lowest possible uid value for the indexer.| -| ACCOUNTS_UID_INDEX_UPPER_BOUND | int64 | 1000 | The highest possible uid value for the indexer.| -| ACCOUNTS_GID_INDEX_LOWER_BOUND | int64 | 0 | The lowest possible gid value for the indexer.| -| ACCOUNTS_GID_INDEX_UPPER_BOUND | int64 | 1000 | The highest possible gid value for the indexer.| -| ACCOUNTS_SERVICE_USER_UUID | string | 95cb8724-03b2-11eb-a0a6-c33ef8ef53ad | The id of the accounts service user.| -| ACCOUNTS_SERVICE_USER_USERNAME | string | | The username of the accounts service user.| -| ACCOUNTS_SERVICE_USER_UID | int64 | 0 | The uid of the accounts service user.| -| ACCOUNTS_SERVICE_USER_GID | int64 | 0 | The gid of the accounts service user.| -| ACCOUNTS_HASH_DIFFICULTY | int | 11 | The hash difficulty makes sure that validating a password takes at least a certain amount of time.| -| ACCOUNTS_DEMO_USERS_AND_GROUPS | bool | true | If this flag is set the service will setup the demo users and groups.| \ No newline at end of file diff --git a/docs/extensions/_includes/glauth_configvars.md b/docs/extensions/_includes/glauth_configvars.md deleted file mode 100644 index 9211ff0dc..000000000 --- a/docs/extensions/_includes/glauth_configvars.md +++ /dev/null @@ -1,15 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| GLAUTH_DEBUG_ADDR | string | 127.0.0.1:9129 | | -| GLAUTH_DEBUG_TOKEN | string | | | -| GLAUTH_DEBUG_PPROF | bool | false | | -| GLAUTH_DEBUG_ZPAGES | bool | false | | -| GLAUTH_LDAP_ENABLED | bool | true | | -| GLAUTH_LDAP_ADDR | string | 127.0.0.1:9125 | | -| GLAUTH_LDAPS_ENABLED | bool | true | | -| GLAUTH_LDAPS_ADDR | string | 127.0.0.1:9126 | | -| GLAUTH_LDAPS_CERT | string | ~/.ocis/ldap/ldap.crt | | -| GLAUTH_LDAPS_KEY | string | ~/.ocis/ldap/ldap.key | | -| GLAUTH_ROLE_BUNDLE_ID | string | 71881883-1768-46bd-a24d-a356a2afdf7f | | \ No newline at end of file diff --git a/docs/extensions/_includes/graph-explorer_configvars.md b/docs/extensions/_includes/graph-explorer_configvars.md deleted file mode 100644 index ebfd855e9..000000000 --- a/docs/extensions/_includes/graph-explorer_configvars.md +++ /dev/null @@ -1,14 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| GRAPH_EXPLORER_DEBUG_ADDR | string | 127.0.0.1:9136 | | -| GRAPH_EXPLORER_DEBUG_TOKEN | string | | | -| GRAPH_EXPLORER_DEBUG_PPROF | bool | false | | -| GRAPH_EXPLORER_DEBUG_ZPAGES | bool | false | | -| GRAPH_EXPLORER_HTTP_ADDR | string | 127.0.0.1:9135 | | -| GRAPH_EXPLORER_HTTP_ROOT | string | /graph-explorer | | -| GRAPH_EXPLORER_CLIENT_ID | string | ocis-explorer.js | | -| OCIS_URL;GRAPH_EXPLORER_ISSUER | string | https://localhost:9200 | | -| OCIS_URL;GRAPH_EXPLORER_GRAPH_URL_BASE | string | https://localhost:9200 | | -| GRAPH_EXPLORER_GRAPH_URL_PATH | string | /graph | | \ No newline at end of file diff --git a/docs/extensions/_includes/graph_configvars.md b/docs/extensions/_includes/graph_configvars.md deleted file mode 100644 index 06036f1ec..000000000 --- a/docs/extensions/_includes/graph_configvars.md +++ /dev/null @@ -1,36 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| GRAPH_DEBUG_ADDR | string | 127.0.0.1:9124 | | -| GRAPH_DEBUG_TOKEN | string | | | -| GRAPH_DEBUG_PPROF | bool | false | | -| GRAPH_DEBUG_ZPAGES | bool | false | | -| GRAPH_HTTP_ADDR | string | 127.0.0.1:9120 | | -| GRAPH_HTTP_ROOT | string | /graph | | -| REVA_GATEWAY | string | 127.0.0.1:9142 | | -| OCIS_JWT_SECRET;OCS_JWT_SECRET | string | Pive-Fumkiu4 | | -| OCIS_URL;GRAPH_SPACES_WEBDAV_BASE | string | https://localhost:9200 | | -| GRAPH_SPACES_WEBDAV_PATH | string | /dav/spaces/ | | -| GRAPH_SPACES_DEFAULT_QUOTA | string | 1000000000 | | -| OCIS_INSECURE;GRAPH_SPACES_INSECURE | bool | false | | -| GRAPH_SPACES_EXTENDED_SPACE_PROPERTIES_CACHE_TTL | int | 0 | | -| GRAPH_IDENTITY_BACKEND | string | cs3 | | -| GRAPH_LDAP_URI | string | ldap://localhost:9125 | | -| OCIS_INSECURE;GRAPH_LDAP_INSECURE | bool | false | | -| GRAPH_LDAP_BIND_DN | string | | | -| GRAPH_LDAP_BIND_PASSWORD | string | | | -| GRAPH_LDAP_SERVER_UUID | bool | false | | -| GRAPH_LDAP_SERVER_WRITE_ENABLED | bool | false | | -| GRAPH_LDAP_USER_BASE_DN | string | ou=users,dc=ocis,dc=test | | -| GRAPH_LDAP_USER_SCOPE | string | sub | | -| GRAPH_LDAP_USER_FILTER | string | (objectClass=inetOrgPerson) | | -| GRAPH_LDAP_USER_EMAIL_ATTRIBUTE | string | mail | | -| GRAPH_LDAP_USER_DISPLAYNAME_ATTRIBUTE | string | displayName | | -| GRAPH_LDAP_USER_NAME_ATTRIBUTE | string | uid | | -| GRAPH_LDAP_USER_UID_ATTRIBUTE | string | owncloudUUID | | -| GRAPH_LDAP_GROUP_BASE_DN | string | ou=groups,dc=ocis,dc=test | | -| GRAPH_LDAP_GROUP_SEARCH_SCOPE | string | sub | | -| GRAPH_LDAP_GROUP_FILTER | string | (objectclass=groupOfNames) | | -| GRAPH_LDAP_GROUP_NAME_ATTRIBUTE | string | cn | | -| GRAPH_LDAP_GROUP_ID_ATTRIBUTE | string | owncloudUUID | | \ No newline at end of file diff --git a/docs/extensions/_includes/idm_configvars.md b/docs/extensions/_includes/idm_configvars.md deleted file mode 100644 index 42f6c3c08..000000000 --- a/docs/extensions/_includes/idm_configvars.md +++ /dev/null @@ -1,13 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| IDM_DEBUG_ADDR | string | | | -| IDM_DEBUG_TOKEN | string | | | -| IDM_DEBUG_PPROF | bool | false | | -| IDM_DEBUG_ZPAGES | bool | false | | -| IDM_LDAPS_ADDR | string | 127.0.0.1:9235 | | -| IDM_LDAPS_CERT | string | ~/.ocis/idm/ldap.crt | | -| IDM_LDAPS_KEY | string | ~/.ocis/idm/ldap.key | | -| IDM_DATABASE_PATH | string | ~/.ocis/idm/ocis.boltdb | | -| IDM_ADMIN_PASSWORD | string | admin | | \ No newline at end of file diff --git a/docs/extensions/_includes/idp_configvars.md b/docs/extensions/_includes/idp_configvars.md deleted file mode 100644 index ce0fc6261..000000000 --- a/docs/extensions/_includes/idp_configvars.md +++ /dev/null @@ -1,47 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| IDP_DEBUG_ADDR | string | 127.0.0.1:9134 | | -| IDP_DEBUG_TOKEN | string | | | -| IDP_DEBUG_PPROF | bool | false | | -| IDP_DEBUG_ZPAGES | bool | false | | -| IDP_HTTP_ADDR | string | 127.0.0.1:9130 | | -| IDP_HTTP_ROOT | string | / | | -| IDP_TRANSPORT_TLS_CERT | string | ~/.ocis/idp/server.crt | | -| IDP_TRANSPORT_TLS_KEY | string | ~/.ocis/idp/server.key | | -| IDP_TLS | bool | false | | -| IDP_ASSET_PATH | string | | | -| OCIS_URL;IDP_ISS | string | https://localhost:9200 | | -| IDP_IDENTITY_MANAGER | string | ldap | | -| IDP_URI_BASE_PATH | string | | | -| IDP_SIGN_IN_URI | string | | | -| IDP_SIGN_OUT_URI | string | | | -| IDP_ENDPOINT_URI | string | | | -| IDP_ENDSESSION_ENDPOINT_URI | string | | | -| IDP_INSECURE | bool | false | | -| IDP_ALLOW_CLIENT_GUESTS | bool | false | | -| IDP_ALLOW_DYNAMIC_CLIENT_REGISTRATION | bool | false | | -| IDP_ENCRYPTION_SECRET | string | | | -| IDP_DISABLE_IDENTIFIER_WEBAPP | bool | true | | -| IDP_IDENTIFIER_CLIENT_PATH | string | ~/.ocis/idp | | -| IDP_IDENTIFIER_REGISTRATION_CONF | string | ~/.ocis/idp/identifier-registration.yaml | | -| IDP_IDENTIFIER_SCOPES_CONF | string | | | -| IDP_SIGNING_KID | string | | | -| IDP_SIGNING_METHOD | string | PS256 | | -| IDP_VALIDATION_KEYS_PATH | string | | | -| IDP_ACCESS_TOKEN_EXPIRATION | uint64 | 600 | | -| IDP_ID_TOKEN_EXPIRATION | uint64 | 3600 | | -| IDP_REFRESH_TOKEN_EXPIRATION | uint64 | 94608000 | | -| | uint64 | 0 | | -| IDP_LDAP_URI | string | ldap://localhost:9125 | | -| IDP_LDAP_BIND_DN | string | cn=idp,ou=sysusers,dc=ocis,dc=test | | -| IDP_LDAP_BIND_PASSWORD | string | idp | | -| IDP_LDAP_BASE_DN | string | ou=users,dc=ocis,dc=test | | -| IDP_LDAP_SCOPE | string | sub | | -| IDP_LDAP_LOGIN_ATTRIBUTE | string | cn | | -| IDP_LDAP_EMAIL_ATTRIBUTE | string | mail | | -| IDP_LDAP_NAME_ATTRIBUTE | string | sn | | -| IDP_LDAP_UUID_ATTRIBUTE | string | uid | | -| IDP_LDAP_UUID_ATTRIBUTE_TYPE | string | text | | -| IDP_LDAP_FILTER | string | (objectClass=posixaccount) | | \ No newline at end of file diff --git a/docs/extensions/_includes/nats_configvars.md b/docs/extensions/_includes/nats_configvars.md deleted file mode 100644 index 4d4bccfdd..000000000 --- a/docs/extensions/_includes/nats_configvars.md +++ /dev/null @@ -1,10 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| NATS_DEBUG_ADDR | string | | | -| NATS_DEBUG_TOKEN | string | | | -| NATS_DEBUG_PPROF | bool | false | | -| NATS_DEBUG_ZPAGES | bool | false | | -| NATS_NATS_HOST | string | 127.0.0.1 | | -| NATS_NATS_PORT | int | 9233 | | \ No newline at end of file diff --git a/docs/extensions/_includes/notifications_configvars.md b/docs/extensions/_includes/notifications_configvars.md deleted file mode 100644 index f0d3adf8e..000000000 --- a/docs/extensions/_includes/notifications_configvars.md +++ /dev/null @@ -1,17 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| NOTIFICATIONS_DEBUG_ADDR | string | | | -| NOTIFICATIONS_DEBUG_TOKEN | string | | | -| NOTIFICATIONS_DEBUG_PPROF | bool | false | | -| NOTIFICATIONS_DEBUG_ZPAGES | bool | false | | -| NOTIFICATIONS_SMTP_HOST | string | 127.0.0.1 | | -| NOTIFICATIONS_SMTP_PORT | string | 1025 | | -| NOTIFICATIONS_SMTP_SENDER | string | god@example.com | | -| NOTIFICATIONS_SMTP_PASSWORD | string | godisdead | | -| NOTIFICATIONS_EVENTS_ENDPOINT | string | 127.0.0.1:9233 | | -| NOTIFICATIONS_EVENTS_CLUSTER | string | test-cluster | | -| NOTIFICATIONS_EVENTS_GROUP | string | notifications | | -| REVA_GATEWAY;NOTIFICATIONS_REVA_GATEWAY | string | 127.0.0.1:9142 | | -| OCIS_MACHINE_AUTH_API_KEY;NOTIFICATIONS_MACHINE_AUTH_API_KEY | string | change-me-please | | \ No newline at end of file diff --git a/docs/extensions/_includes/ocs_configvars.md b/docs/extensions/_includes/ocs_configvars.md deleted file mode 100644 index 0c12be151..000000000 --- a/docs/extensions/_includes/ocs_configvars.md +++ /dev/null @@ -1,16 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| OCS_DEBUG_ADDR | string | 127.0.0.1:9114 | | -| OCS_DEBUG_TOKEN | string | | | -| OCS_DEBUG_PPROF | bool | false | | -| OCS_DEBUG_ZPAGES | bool | false | | -| OCS_HTTP_ADDR | string | 127.0.0.1:9110 | | -| OCS_HTTP_ROOT | string | /ocs | | -| OCIS_JWT_SECRET;OCS_JWT_SECRET | string | Pive-Fumkiu4 | | -| REVA_GATEWAY | string | 127.0.0.1:9142 | | -| OCIS_URL;OCS_IDM_ADDRESS | string | https://localhost:9200 | | -| OCS_ACCOUNT_BACKEND_TYPE | string | accounts | | -| STORAGE_USERS_DRIVER;OCS_STORAGE_USERS_DRIVER | string | ocis | | -| OCIS_MACHINE_AUTH_API_KEY;OCS_MACHINE_AUTH_API_KEY | string | change-me-please | | \ No newline at end of file diff --git a/docs/extensions/_includes/proxy_configvars.md b/docs/extensions/_includes/proxy_configvars.md deleted file mode 100644 index a3be1d11a..000000000 --- a/docs/extensions/_includes/proxy_configvars.md +++ /dev/null @@ -1,27 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| PROXY_DEBUG_ADDR | string | 127.0.0.1:9205 | | -| PROXY_DEBUG_TOKEN | string | | | -| PROXY_DEBUG_PPROF | bool | false | | -| PROXY_DEBUG_ZPAGES | bool | false | | -| PROXY_HTTP_ADDR | string | 0.0.0.0:9200 | | -| PROXY_HTTP_ROOT | string | / | | -| PROXY_TRANSPORT_TLS_CERT | string | ~/.ocis/proxy/server.crt | | -| PROXY_TRANSPORT_TLS_KEY | string | ~/.ocis/proxy/server.key | | -| PROXY_TLS | bool | true | | -| REVA_GATEWAY | string | 127.0.0.1:9142 | | -| OCIS_URL;PROXY_OIDC_ISSUER | string | https://localhost:9200 | | -| OCIS_INSECURE;PROXY_OIDC_INSECURE | bool | true | | -| PROXY_OIDC_USERINFO_CACHE_SIZE | int | 1024 | | -| PROXY_OIDC_USERINFO_CACHE_TTL | int | 10 | | -| OCIS_JWT_SECRET;PROXY_JWT_SECRET | string | Pive-Fumkiu4 | | -| PROXY_ENABLE_PRESIGNEDURLS | bool | true | | -| PROXY_ACCOUNT_BACKEND_TYPE | string | accounts | | -| PROXY_USER_OIDC_CLAIM | string | email | | -| PROXY_USER_CS3_CLAIM | string | mail | | -| OCIS_MACHINE_AUTH_API_KEY;PROXY_MACHINE_AUTH_API_KEY | string | change-me-please | | -| PROXY_AUTOPROVISION_ACCOUNTS | bool | false | | -| PROXY_ENABLE_BASIC_AUTH | bool | false | | -| PROXY_INSECURE_BACKENDS | bool | false | | \ No newline at end of file diff --git a/docs/extensions/_includes/settings_configvars.md b/docs/extensions/_includes/settings_configvars.md deleted file mode 100644 index c8136208e..000000000 --- a/docs/extensions/_includes/settings_configvars.md +++ /dev/null @@ -1,15 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| SETTINGS_DEBUG_ADDR | string | 127.0.0.1:9194 | | -| SETTINGS_DEBUG_TOKEN | string | | | -| SETTINGS_DEBUG_PPROF | bool | false | | -| SETTINGS_DEBUG_ZPAGES | bool | false | | -| SETTINGS_HTTP_ADDR | string | 127.0.0.1:9190 | | -| SETTINGS_HTTP_ROOT | string | / | | -| SETTINGS_CACHE_TTL | int | 604800 | | -| SETTINGS_GRPC_ADDR | string | 127.0.0.1:9191 | | -| SETTINGS_DATA_PATH | string | ~/.ocis/settings | | -| SETTINGS_ASSET_PATH | string | | | -| OCIS_JWT_SECRET;SETTINGS_JWT_SECRET | string | Pive-Fumkiu4 | | \ No newline at end of file diff --git a/docs/extensions/_includes/store_configvars.md b/docs/extensions/_includes/store_configvars.md deleted file mode 100644 index b0afbd700..000000000 --- a/docs/extensions/_includes/store_configvars.md +++ /dev/null @@ -1,10 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| STORE_DEBUG_ADDR | string | 127.0.0.1:9464 | | -| STORE_DEBUG_TOKEN | string | | | -| STORE_DEBUG_PPROF | bool | false | | -| STORE_DEBUG_ZPAGES | bool | false | | -| STORE_GRPC_ADDR | string | 127.0.0.1:9460 | | -| STORE_DATA_PATH | string | ~/.ocis/store | | \ No newline at end of file diff --git a/docs/extensions/_includes/thumbnails_configvars.md b/docs/extensions/_includes/thumbnails_configvars.md deleted file mode 100644 index 791376911..000000000 --- a/docs/extensions/_includes/thumbnails_configvars.md +++ /dev/null @@ -1,14 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| THUMBNAILS_DEBUG_ADDR | string | 127.0.0.1:9189 | | -| THUMBNAILS_DEBUG_TOKEN | string | | | -| THUMBNAILS_DEBUG_PPROF | bool | false | | -| THUMBNAILS_DEBUG_ZPAGES | bool | false | | -| THUMBNAILS_GRPC_ADDR | string | 127.0.0.1:9185 | | -| THUMBNAILS_FILESYSTEMSTORAGE_ROOT | string | ~/.ocis/thumbnails | | -| OCIS_INSECURE;THUMBNAILS_WEBDAVSOURCE_INSECURE | bool | true | | -| OCIS_INSECURE;THUMBNAILS_CS3SOURCE_INSECURE | bool | false | | -| REVA_GATEWAY | string | 127.0.0.1:9142 | | -| THUMBNAILS_TXT_FONTMAP_FILE | string | | | \ No newline at end of file diff --git a/docs/extensions/_includes/web_configvars.md b/docs/extensions/_includes/web_configvars.md deleted file mode 100644 index 738506900..000000000 --- a/docs/extensions/_includes/web_configvars.md +++ /dev/null @@ -1,24 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| WEB_DEBUG_ADDR | string | 127.0.0.1:9104 | | -| WEB_DEBUG_TOKEN | string | | | -| WEB_DEBUG_PPROF | bool | false | | -| WEB_DEBUG_ZPAGES | bool | false | | -| WEB_HTTP_ADDR | string | 127.0.0.1:9100 | | -| WEB_HTTP_ROOT | string | / | | -| WEB_CACHE_TTL | int | 604800 | | -| WEB_ASSET_PATH | string | | | -| WEB_UI_CONFIG | string | | | -| WEB_UI_PATH | string | | | -| OCIS_URL;WEB_UI_THEME_SERVER | string | https://localhost:9200 | | -| WEB_UI_THEME_PATH | string | /themes/owncloud/theme.json | | -| OCIS_URL;WEB_UI_CONFIG_SERVER | string | https://localhost:9200 | | -| | string | | | -| WEB_UI_CONFIG_VERSION | string | 0.1.0 | | -| WEB_OIDC_METADATA_URL | string | | | -| OCIS_URL;WEB_OIDC_AUTHORITY | string | https://localhost:9200 | | -| WEB_OIDC_CLIENT_ID | string | web | | -| WEB_OIDC_RESPONSE_TYPE | string | code | | -| WEB_OIDC_SCOPE | string | openid profile email | | \ No newline at end of file diff --git a/docs/extensions/_includes/webdav_configvars.md b/docs/extensions/_includes/webdav_configvars.md deleted file mode 100644 index a4767cfb0..000000000 --- a/docs/extensions/_includes/webdav_configvars.md +++ /dev/null @@ -1,13 +0,0 @@ -## Environment Variables - -| Name | Type | Default Value | Description | -|------|------|---------------|-------------| -| WEBDAV_DEBUG_ADDR | string | 127.0.0.1:9119 | | -| WEBDAV_DEBUG_TOKEN | string | | | -| WEBDAV_DEBUG_PPROF | bool | false | | -| WEBDAV_DEBUG_ZPAGES | bool | false | | -| WEBDAV_HTTP_ADDR | string | 127.0.0.1:9115 | | -| WEBDAV_HTTP_ROOT | string | / | | -| OCIS_URL;OCIS_PUBLIC_URL | string | https://127.0.0.1:9200 | | -| STORAGE_WEBDAV_NAMESPACE | string | /users/{{.Id.OpaqueId}} | | -| REVA_GATEWAY | string | 127.0.0.1:9142 | | \ No newline at end of file From aeeff600116952b06292e56e8c3530d83c041fed Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 2 Mar 2022 15:18:43 +0100 Subject: [PATCH 12/14] remove config file related code --- accounts/cmd/helper/defaultconfig/main.go | 23 ---------------- accounts/pkg/config/parser/parse.go | 33 ++++++----------------- 2 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 accounts/cmd/helper/defaultconfig/main.go diff --git a/accounts/cmd/helper/defaultconfig/main.go b/accounts/cmd/helper/defaultconfig/main.go deleted file mode 100644 index 1092497cb..000000000 --- a/accounts/cmd/helper/defaultconfig/main.go +++ /dev/null @@ -1,23 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/owncloud/ocis/accounts/pkg/config" - "github.com/owncloud/ocis/accounts/pkg/config/parser" - "gopkg.in/yaml.v2" -) - -func main() { - - cfg := config.DefaultConfig() - - parser.EnsureDefaults(cfg) - parser.Sanitize(cfg) - - b, err := yaml.Marshal(cfg) - if err != nil { - return - } - fmt.Println(string(b)) -} diff --git a/accounts/pkg/config/parser/parse.go b/accounts/pkg/config/parser/parse.go index e437fa6a0..fb801aed2 100644 --- a/accounts/pkg/config/parser/parse.go +++ b/accounts/pkg/config/parser/parse.go @@ -17,28 +17,6 @@ func ParseConfig(cfg *config.Config) error { return err } - err = EnsureDefaults(cfg) - if err != nil { - return err - } - - // load all env variables relevant to the config in the current context. - if err := envdecode.Decode(cfg); err != nil { - // no environment variable set for this config is an expected "error" - if !errors.Is(err, envdecode.ErrNoTargetFieldsAreSet) { - return err - } - } - - err = Sanitize(cfg) - if err != nil { - return err - } - - return nil -} - -func EnsureDefaults(cfg *config.Config) error { // provide with defaults for shared logging, since we need a valid destination address for BindEnv. if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil { cfg.Log = &config.Log{ @@ -62,14 +40,19 @@ func EnsureDefaults(cfg *config.Config) error { cfg.Tracing = &config.Tracing{} } - return nil -} + // load all env variables relevant to the config in the current context. + if err := envdecode.Decode(cfg); err != nil { + // no environment variable set for this config is an expected "error" + if !errors.Is(err, envdecode.ErrNoTargetFieldsAreSet) { + return err + } + } -func Sanitize(cfg *config.Config) error { // sanitize config if cfg.HTTP.Root != "/" { cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/") } cfg.Repo.Backend = strings.ToLower(cfg.Repo.Backend) + return nil } From f266f91bc4478d23902cdb81389ba5c718c4bfd7 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 2 Mar 2022 15:21:47 +0100 Subject: [PATCH 13/14] revert ocisConfig changes part 3 --- accounts/pkg/config/config.go | 4 ++-- accounts/pkg/config/tracing.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/accounts/pkg/config/config.go b/accounts/pkg/config/config.go index 78d76ba40..9a4609d7e 100644 --- a/accounts/pkg/config/config.go +++ b/accounts/pkg/config/config.go @@ -44,8 +44,8 @@ type TokenManager struct { // Repo defines which storage implementation is to be used. type Repo struct { Backend string `ocisConfig:"backend" env:"ACCOUNTS_STORAGE_BACKEND" desc:"Defines which storage implementation is to be used"` - Disk Disk - CS3 CS3 + Disk Disk `ocisConfig:"disk"` + CS3 CS3 `ocisConfig:"cs3"` } // Disk is the local disk implementation of the storage. diff --git a/accounts/pkg/config/tracing.go b/accounts/pkg/config/tracing.go index 8c8b1e0b7..4bd0c7924 100644 --- a/accounts/pkg/config/tracing.go +++ b/accounts/pkg/config/tracing.go @@ -2,8 +2,8 @@ package config // Tracing defines the available tracing configuration. type Tracing struct { - Enabled bool `env:"OCIS_TRACING_ENABLED;ACCOUNTS_TRACING_ENABLED" desc:"Activates tracing."` - Type string `env:"OCIS_TRACING_TYPE;ACCOUNTS_TRACING_TYPE"` - Endpoint string `env:"OCIS_TRACING_ENDPOINT;ACCOUNTS_TRACING_ENDPOINT" desc:"The endpoint to the tracing collector."` - Collector string `env:"OCIS_TRACING_COLLECTOR;ACCOUNTS_TRACING_COLLECTOR" ` + Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;ACCOUNTS_TRACING_ENABLED" desc:"Activates tracing."` + Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;ACCOUNTS_TRACING_TYPE"` + Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;ACCOUNTS_TRACING_ENDPOINT" desc:"The endpoint to the tracing collector."` + Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;ACCOUNTS_TRACING_COLLECTOR"` } From d5aed899e70796e0101179a4b89f8d9f2effb99d Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 2 Mar 2022 15:31:58 +0100 Subject: [PATCH 14/14] use docs/docs-generate also in CI --- .drone.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index ee45183af..7ac4513fe 100644 --- a/.drone.star +++ b/.drone.star @@ -1260,7 +1260,7 @@ def docs(ctx): { "name": "docs-generate", "image": OC_CI_GOLANG, - "commands": ["make -C %s docs-generate" % (module) for module in config["modules"]], + "commands": ["make -C docs docs-generate"], }, { "name": "prepare",