initialize insecure options

This commit is contained in:
Willy Kloucek
2022-04-27 15:46:17 +02:00
parent a261fc8c88
commit 5b572b3852
4 changed files with 111 additions and 68 deletions
+48 -48
View File
@@ -5,51 +5,51 @@ import "github.com/owncloud/ocis/ocis-pkg/shared"
type Config struct {
*shared.Commons `yaml:"-"`
Service Service `yaml:"-"`
Tracing *Tracing `yaml:"tracing"`
Logging *Logging `yaml:"log"`
Debug Debug `yaml:"debug"`
Supervised bool
Tracing *Tracing `yaml:"tracing,omitempty"`
Logging *Logging `yaml:"log,omitempty"`
Debug Debug `yaml:"debug,omitempty"`
Supervised bool `yaml:"-"`
HTTP HTTPConfig `yaml:"http"`
HTTP HTTPConfig `yaml:"http,omitempty"`
// JWTSecret used to verify reva access token
TransferSecret string `yaml:"transfer_secret" env:"STORAGE_TRANSFER_SECRET"`
TransferSecret string `yaml:"transfer_secret,omitempty" env:"STORAGE_TRANSFER_SECRET"`
TokenManager *TokenManager `yaml:"token_manager,omitempty"`
Reva *Reva `yaml:"reva,omitempty"`
SkipUserGroupsInToken bool
SkipUserGroupsInToken bool `yaml:"skip_users_groups_in_token,omitempty"`
EnableFavorites bool `yaml:"favorites"`
EnableProjectSpaces bool
UploadMaxChunkSize int `yaml:"upload_max_chunk_size"`
UploadHTTPMethodOverride string `yaml:"upload_http_method_override"`
DefaultUploadProtocol string `yaml:"default_upload_protocol"`
EnableFavorites bool `yaml:"favorites,omitempty"`
EnableProjectSpaces bool `yaml:"enable_project_spaces,omitempty"`
UploadMaxChunkSize int `yaml:"upload_max_chunk_size,omitempty"`
UploadHTTPMethodOverride string `yaml:"upload_http_method_override,omitempty"`
DefaultUploadProtocol string `yaml:"default_upload_protocol,omitempty"`
PublicURL string `yaml:"public_url" env:"OCIS_URL;FRONTEND_PUBLIC_URL"`
PublicURL string `yaml:"public_url,omitempty" env:"OCIS_URL;FRONTEND_PUBLIC_URL"`
Archiver Archiver
AppProvider AppProvider
DataGateway DataGateway
OCS OCS
AuthMachine AuthMachine
Checksums Checksums
Archiver Archiver `yaml:"archiver,omitempty"`
AppProvider AppProvider `yaml:"app_provider,omitempty"`
DataGateway DataGateway `yaml:"data_gateway,omitempty"`
OCS OCS `yaml:"ocs,omitempty"`
AuthMachine AuthMachine `yaml:"auth_machine,omitempty"`
Checksums Checksums `yaml:"checksums,omitempty"`
Middleware Middleware
Middleware Middleware `yaml:"middleware,omitempty"`
}
type Tracing struct {
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;FRONTEND_TRACING_ENABLED" desc:"Activates tracing."`
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;FRONTEND_TRACING_TYPE"`
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;FRONTEND_TRACING_ENDPOINT" desc:"The endpoint to the tracing collector."`
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;FRONTEND_TRACING_COLLECTOR"`
Enabled bool `yaml:"enabled,omitempty" env:"OCIS_TRACING_ENABLED;FRONTEND_TRACING_ENABLED" desc:"Activates tracing."`
Type string `yaml:"type,omitempty" env:"OCIS_TRACING_TYPE;FRONTEND_TRACING_TYPE"`
Endpoint string `yaml:"endpoint,omitempty" env:"OCIS_TRACING_ENDPOINT;FRONTEND_TRACING_ENDPOINT" desc:"The endpoint to the tracing collector."`
Collector string `yaml:"collector,omitempty" env:"OCIS_TRACING_COLLECTOR;FRONTEND_TRACING_COLLECTOR"`
}
type Logging struct {
Level string `yaml:"level" env:"OCIS_LOG_LEVEL;FRONTEND_LOG_LEVEL" desc:"The log level."`
Pretty bool `yaml:"pretty" env:"OCIS_LOG_PRETTY;FRONTEND_LOG_PRETTY" desc:"Activates pretty log output."`
Color bool `yaml:"color" env:"OCIS_LOG_COLOR;FRONTEND_LOG_COLOR" desc:"Activates colorized log output."`
File string `yaml:"file" env:"OCIS_LOG_FILE;FRONTEND_LOG_FILE" desc:"The target log file."`
Level string `yaml:"level,omitempty" env:"OCIS_LOG_LEVEL;FRONTEND_LOG_LEVEL" desc:"The log level."`
Pretty bool `yaml:"pretty,omitempty" env:"OCIS_LOG_PRETTY;FRONTEND_LOG_PRETTY" desc:"Activates pretty log output."`
Color bool `yaml:"color,omitempty" env:"OCIS_LOG_COLOR;FRONTEND_LOG_COLOR" desc:"Activates colorized log output."`
File string `yaml:"file,omitempty" env:"OCIS_LOG_FILE;FRONTEND_LOG_FILE" desc:"The target log file."`
}
type Service struct {
@@ -57,44 +57,44 @@ type Service struct {
}
type Debug struct {
Addr string `yaml:"addr" env:"FRONTEND_DEBUG_ADDR"`
Token string `yaml:"token" env:"FRONTEND_DEBUG_TOKEN"`
Pprof bool `yaml:"pprof" env:"FRONTEND_DEBUG_PPROF"`
Zpages bool `yaml:"zpages" env:"FRONTEND_DEBUG_ZPAGES"`
Addr string `yaml:"addr,omitempty" env:"FRONTEND_DEBUG_ADDR"`
Token string `yaml:"token,omitempty" env:"FRONTEND_DEBUG_TOKEN"`
Pprof bool `yaml:"pprof,omitempty" env:"FRONTEND_DEBUG_PPROF"`
Zpages bool `yaml:"zpages,omitempty" env:"FRONTEND_DEBUG_ZPAGES"`
}
type HTTPConfig struct {
Addr string `yaml:"addr" env:"FRONTEND_HTTP_ADDR" desc:"The address of the http service."`
Protocol string `yaml:"protocol" env:"FRONTEND_HTTP_PROTOCOL" desc:"The transport protocol of the http service."`
Prefix string `yaml:"prefix"`
Addr string `yaml:"addr,omitempty" env:"FRONTEND_HTTP_ADDR" desc:"The address of the http service."`
Protocol string `yaml:"protocol,omitempty" env:"FRONTEND_HTTP_PROTOCOL" desc:"The transport protocol of the http service."`
Prefix string `yaml:"prefix,omitempty"`
}
// Middleware configures reva middlewares.
type Middleware struct {
Auth Auth `yaml:"auth"`
Auth Auth `yaml:"auth,omitempty"`
}
// Auth configures reva http auth middleware.
type Auth struct {
CredentialsByUserAgent map[string]string `yaml:"credentials_by_user_agenr"`
CredentialsByUserAgent map[string]string `yaml:"credentials_by_user_agent,omitempty"`
}
type Archiver struct {
MaxNumFiles int64 `yaml:"max_num_files"`
MaxSize int64 `yaml:"max_size"`
Prefix string
Insecure bool `env:"OCIS_INSECURE;FRONTEND_ARCHIVER_INSECURE"`
MaxNumFiles int64 `yaml:"max_num_files,omitempty"`
MaxSize int64 `yaml:"max_size,omitempty"`
Prefix string `yaml:"-"`
Insecure bool `yaml:"insecure,omitempty" env:"OCIS_INSECURE;FRONTEND_ARCHIVER_INSECURE"`
}
type AppProvider struct {
ExternalAddr string `yaml:"external_addr"`
Driver string `yaml:"driver"`
ExternalAddr string `yaml:"external_addr,omitempty"`
Driver string `yaml:"driver,omitempty"`
// WopiDriver WopiDriver `yaml:"wopi_driver"`
AppsURL string `yaml:"apps_url"`
OpenURL string `yaml:"open_url"`
NewURL string `yaml:"new_url"`
Prefix string
Insecure bool `env:"OCIS_INSECURE;FRONTEND_APPPROVIDER_INSECURE"`
AppsURL string `yaml:"-"`
OpenURL string `yaml:"-"`
NewURL string `yaml:"-"`
Prefix string `yaml:"-"`
Insecure bool `yaml:"insecure,omitempty" env:"OCIS_INSECURE;FRONTEND_APPPROVIDER_INSECURE"`
}
type DataGateway struct {