Skip to content

Commit

Permalink
fix environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas committed Apr 25, 2022
1 parent 985a0ef commit 64b9d3d
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -1679,13 +1679,13 @@ def ocisServer(storage, accounts_hash_difficulty = 4, volumes = [], depends_on =
user = "0:0"
environment = {
"OCIS_URL": "https://ocis-server:9200",
"STORAGE_GATEWAY_GRPC_ADDR": "0.0.0.0:9142",
"GATEWAY_GRPC_ADDR": "0.0.0.0:9142",
"STORAGE_HOME_DRIVER": "%s" % (storage),
"STORAGE_USERS_DRIVER": "%s" % (storage),
"STORAGE_USERS_DRIVER_LOCAL_ROOT": "/srv/app/tmp/ocis/local/root",
"STORAGE_USERS_DRIVER_OCIS_ROOT": "/srv/app/tmp/ocis/storage/users",
"STORAGE_METADATA_DRIVER_OCIS_ROOT": "/srv/app/tmp/ocis/storage/metadata",
"STORAGE_SHARING_USER_JSON_FILE": "/srv/app/tmp/ocis/shares.json",
"SHARING_USER_JSON_FILE": "/srv/app/tmp/ocis/shares.json",
"PROXY_ENABLE_BASIC_AUTH": True,
"WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json",
"IDP_IDENTIFIER_REGISTRATION_CONF": "/drone/src/tests/config/drone/identifier-registration.yml",
Expand Down
2 changes: 1 addition & 1 deletion extensions/auth-basic/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type LDAPProvider struct {
UserObjectClass string
GroupObjectClass string
LoginAttributes []string
IDP string // TODO what is this for?
IDP string `env:"OCIS_URL;AUTH_BASIC_IDP_URL"` // TODO what is this for?
GatewayEndpoint string // TODO do we need this here?
UserSchema LDAPUserSchema
GroupSchema LDAPGroupSchema
Expand Down
2 changes: 1 addition & 1 deletion extensions/auth-bearer/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type AuthProviders struct {
}

type OIDCProvider struct {
Issuer string `yaml:"issuer"`
Issuer string `yaml:"issuer" env:"OCIS_URL;AUTH_BEARER_OIDC_ISSUER"`
Insecure bool `yaml:"insecure"`
IDClaim string `yaml:"id_claim"`
UIDClaim string `yaml:"uid_claim"`
Expand Down
2 changes: 1 addition & 1 deletion extensions/frontend/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Config struct {
UploadHTTPMethodOverride string `yaml:"upload_http_method_override"`
DefaultUploadProtocol string `yaml:"default_upload_protocol"`
TransferSecret string `yaml:"transfer_secret"`
PublicURL string
PublicURL string `yaml:"public_url" env:"OCIS_URL;FRONTEND_PUBLIC_URL"`

Archiver Archiver
AppProvider AppProvider
Expand Down
2 changes: 1 addition & 1 deletion extensions/group/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type LDAPDriver struct {
UserObjectClass string
GroupObjectClass string
LoginAttributes []string
IDP string // TODO what is this for?
IDP string `env:"OCIS_URL;GROUP_IDP_URL"` // TODO what is this for?
GatewayEndpoint string // TODO do we need this here?
UserSchema LDAPUserSchema
GroupSchema LDAPGroupSchema
Expand Down
4 changes: 2 additions & 2 deletions extensions/sharing/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type UserSharingDrivers struct {
}

type UserSharingJSONDriver struct {
File string
File string `env:"SHARING_USER_JSON_FILE"`
}

type UserSharingSQLDriver struct {
Expand All @@ -76,7 +76,7 @@ type UserSharingSQLDriver struct {
type UserSharingCS3Driver struct {
ProviderAddr string
ServiceUserID string
ServiceUserIDP string
ServiceUserIDP string `env:"OCIS_URL;SHARING_CS3_SERVICE_USER_IDP"`
MachineAuthAPIKey string
}

Expand Down
2 changes: 1 addition & 1 deletion extensions/storage-metadata/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ type LocalDriver struct {

type OCISDriver struct {
// Root is the absolute path to the location of the data
Root string `yaml:"root"`
Root string `yaml:"root" env:"STORAGE_METADATA_DRIVER_OCIS_ROOT"`
UserLayout string
PermissionsEndpoint string
}
Expand Down
38 changes: 19 additions & 19 deletions extensions/storage-users/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Config struct {
JWTSecret string
GatewayEndpoint string
SkipUserGroupsInToken bool
Driver string `yaml:"driver" env:"STORAGE_METADATA_AUTH_PROVIDER" desc:"The auth provider which should be used by the service"`
Driver string `yaml:"driver" env:"STORAGE_USERS_DRIVER" desc:"The storage driver which should be used by the service"`
Drivers Drivers `yaml:"drivers"`
DataServerURL string
TempFolder string
Expand All @@ -32,38 +32,38 @@ type Config struct {
ReadOnly bool
}
type Tracing struct {
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;STORAGE_METADATA_TRACING_ENABLED" desc:"Activates tracing."`
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;STORAGE_METADATA_TRACING_TYPE"`
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;STORAGE_METADATA_TRACING_ENDPOINT" desc:"The endpoint to the tracing collector."`
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;STORAGE_METADATA_TRACING_COLLECTOR"`
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;STORAGE_USERS_TRACING_ENABLED" desc:"Activates tracing."`
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;STORAGE_USERS_TRACING_TYPE"`
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;STORAGE_USERS_TRACING_ENDPOINT" desc:"The endpoint to the tracing collector."`
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;STORAGE_USERS_TRACING_COLLECTOR"`
}

type Logging struct {
Level string `yaml:"level" env:"OCIS_LOG_LEVEL;STORAGE_METADATA_LOG_LEVEL" desc:"The log level."`
Pretty bool `yaml:"pretty" env:"OCIS_LOG_PRETTY;STORAGE_METADATA_LOG_PRETTY" desc:"Activates pretty log output."`
Color bool `yaml:"color" env:"OCIS_LOG_COLOR;STORAGE_METADATA_LOG_COLOR" desc:"Activates colorized log output."`
File string `yaml:"file" env:"OCIS_LOG_FILE;STORAGE_METADATA_LOG_FILE" desc:"The target log file."`
Level string `yaml:"level" env:"OCIS_LOG_LEVEL;STORAGE_USERS_LOG_LEVEL" desc:"The log level."`
Pretty bool `yaml:"pretty" env:"OCIS_LOG_PRETTY;STORAGE_USERS_LOG_PRETTY" desc:"Activates pretty log output."`
Color bool `yaml:"color" env:"OCIS_LOG_COLOR;STORAGE_USERS_LOG_COLOR" desc:"Activates colorized log output."`
File string `yaml:"file" env:"OCIS_LOG_FILE;STORAGE_USERS_LOG_FILE" desc:"The target log file."`
}

type Service struct {
Name string `yaml:"-"`
}

type Debug struct {
Addr string `yaml:"addr" env:"STORAGE_METADATA_DEBUG_ADDR"`
Token string `yaml:"token" env:"STORAGE_METADATA_DEBUG_TOKEN"`
Pprof bool `yaml:"pprof" env:"STORAGE_METADATA_DEBUG_PPROF"`
Zpages bool `yaml:"zpages" env:"STORAGE_METADATA_DEBUG_ZPAGES"`
Addr string `yaml:"addr" env:"STORAGE_USERS_DEBUG_ADDR"`
Token string `yaml:"token" env:"STORAGE_USERS_DEBUG_TOKEN"`
Pprof bool `yaml:"pprof" env:"STORAGE_USERS_DEBUG_PPROF"`
Zpages bool `yaml:"zpages" env:"STORAGE_USERS_DEBUG_ZPAGES"`
}

type GRPCConfig struct {
Addr string `yaml:"addr" env:"STORAGE_METADATA_GRPC_ADDR" desc:"The address of the grpc service."`
Protocol string `yaml:"protocol" env:"STORAGE_METADATA_GRPC_PROTOCOL" desc:"The transport protocol of the grpc service."`
Addr string `yaml:"addr" env:"STORAGE_USERS_GRPC_ADDR" desc:"The address of the grpc service."`
Protocol string `yaml:"protocol" env:"STORAGE_USERS_GRPC_PROTOCOL" desc:"The transport protocol of the grpc service."`
}

type HTTPConfig struct {
Addr string `yaml:"addr" env:"STORAGE_METADATA_GRPC_ADDR" desc:"The address of the grpc service."`
Protocol string `yaml:"protocol" env:"STORAGE_METADATA_GRPC_PROTOCOL" desc:"The transport protocol of the grpc service."`
Addr string `yaml:"addr" env:"STORAGE_USERS_GRPC_ADDR" desc:"The address of the grpc service."`
Protocol string `yaml:"protocol" env:"STORAGE_USERS_GRPC_PROTOCOL" desc:"The transport protocol of the grpc service."`
Prefix string
}

Expand Down Expand Up @@ -124,15 +124,15 @@ type EOSDriver struct {

type LocalDriver struct {
// Root is the absolute path to the location of the data
Root string `yaml:"root"`
Root string `yaml:"root" env:"STORAGE_USERS_LOCAL_ROOT"`
//ShareFolder defines the name of the folder jailing all shares
ShareFolder string `yaml:"share_folder"`
UserLayout string
}

type OCISDriver struct {
// Root is the absolute path to the location of the data
Root string `yaml:"root"`
Root string `yaml:"root" env:"STORAGE_USERS_OCIS_ROOT"`
UserLayout string
PermissionsEndpoint string
// PersonalSpaceAliasTemplate contains the template used to construct
Expand Down
2 changes: 1 addition & 1 deletion extensions/user/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type LDAPDriver struct {
UserObjectClass string
GroupObjectClass string
LoginAttributes []string
IDP string // TODO what is this for?
IDP string `env:"OCIS_URL;USER_IDP_URL"` // TODO what is this for?
GatewayEndpoint string // TODO do we need this here?
UserSchema LDAPUserSchema
GroupSchema LDAPGroupSchema
Expand Down

0 comments on commit 64b9d3d

Please sign in to comment.