add missing extensions
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
@@ -22,9 +22,9 @@ type Config struct {
|
|||||||
|
|
||||||
// Notifications definces the config options for the notifications service.
|
// Notifications definces the config options for the notifications service.
|
||||||
type Notifications struct {
|
type Notifications struct {
|
||||||
SMTP SMTP `yaml:"SMTP"`
|
SMTP SMTP `yaml:"SMTP,omitempty"`
|
||||||
Events Events `yaml:"events"`
|
Events Events `yaml:"events,omitempty"`
|
||||||
RevaGateway string `yaml:"reva_gateway" env:"REVA_GATEWAY;NOTIFICATIONS_REVA_GATEWAY"`
|
RevaGateway string `yaml:"reva_gateway,omitempty" env:"REVA_GATEWAY;NOTIFICATIONS_REVA_GATEWAY"`
|
||||||
MachineAuthSecret string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;NOTIFICATIONS_MACHINE_AUTH_API_KEY"`
|
MachineAuthSecret string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;NOTIFICATIONS_MACHINE_AUTH_API_KEY"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ type Asset struct {
|
|||||||
|
|
||||||
// Metadata configures the metadata store to use
|
// Metadata configures the metadata store to use
|
||||||
type Metadata struct {
|
type Metadata struct {
|
||||||
GatewayAddress string `yaml:"gateway_addr" env:"STORAGE_GATEWAY_GRPC_ADDR"`
|
GatewayAddress string `yaml:"gateway_addr,omitempty" env:"STORAGE_GATEWAY_GRPC_ADDR"`
|
||||||
StorageAddress string `yaml:"storage_addr" env:"STORAGE_GRPC_ADDR"`
|
StorageAddress string `yaml:"storage_addr,omitempty" env:"STORAGE_GRPC_ADDR"`
|
||||||
|
|
||||||
ServiceUserID string `yaml:"service_user_id" env:"METADATA_SERVICE_USER_UUID"`
|
ServiceUserID string `yaml:"service_user_id,omitempty" env:"METADATA_SERVICE_USER_UUID"`
|
||||||
ServiceUserIDP string `yaml:"service_user_idp" env:"OCIS_URL;METADATA_SERVICE_USER_IDP"`
|
ServiceUserIDP string `yaml:"service_user_idp,omitempty" env:"OCIS_URL;METADATA_SERVICE_USER_IDP"`
|
||||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"`
|
MachineAuthAPIKey string `yaml:"machine_auth_api_key,omitempty" env:"OCIS_MACHINE_AUTH_API_KEY"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ type FileSystemSource struct {
|
|||||||
|
|
||||||
// Thumbnail defines the available thumbnail related configuration.
|
// Thumbnail defines the available thumbnail related configuration.
|
||||||
type Thumbnail struct {
|
type Thumbnail struct {
|
||||||
Resolutions []string `yaml:"resolutions"`
|
Resolutions []string `yaml:"resolutions,omitempty"`
|
||||||
FileSystemStorage FileSystemStorage `yaml:"filesystem_storage"`
|
FileSystemStorage FileSystemStorage `yaml:"filesystem_storage,omitempty"`
|
||||||
WebdavAllowInsecure bool `yaml:"webdav_allow_insecure" env:"OCIS_INSECURE;THUMBNAILS_WEBDAVSOURCE_INSECURE"`
|
WebdavAllowInsecure bool `yaml:"webdav_allow_insecure,omitempty" env:"OCIS_INSECURE;THUMBNAILS_WEBDAVSOURCE_INSECURE"`
|
||||||
CS3AllowInsecure bool `yaml:"cs3_allow_insecure" env:"OCIS_INSECURE;THUMBNAILS_CS3SOURCE_INSECURE"`
|
CS3AllowInsecure bool `yaml:"cs3_allow_insecure,omitempty" env:"OCIS_INSECURE;THUMBNAILS_CS3SOURCE_INSECURE"`
|
||||||
RevaGateway string `yaml:"reva_gateway" env:"REVA_GATEWAY"` //TODO: use REVA config
|
RevaGateway string `yaml:"reva_gateway,omitempty" env:"REVA_GATEWAY"` //TODO: use REVA config
|
||||||
FontMapFile string `yaml:"font_map_file" env:"THUMBNAILS_TXT_FONTMAP_FILE"`
|
FontMapFile string `yaml:"font_map_file,omitempty" env:"THUMBNAILS_TXT_FONTMAP_FILE"`
|
||||||
TransferTokenSecret string `yaml:"transfer_token" env:"THUMBNAILS_TRANSFER_TOKEN"`
|
TransferTokenSecret string `yaml:"transfer_token,omitempty" env:"THUMBNAILS_TRANSFER_TOKEN"`
|
||||||
DataEndpoint string `yaml:"data_endpoint" env:"THUMBNAILS_DATA_ENDPOINT"`
|
DataEndpoint string `yaml:"data_endpoint,omitempty" env:"THUMBNAILS_DATA_ENDPOINT"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ import (
|
|||||||
accounts "github.com/owncloud/ocis/extensions/accounts/pkg/config"
|
accounts "github.com/owncloud/ocis/extensions/accounts/pkg/config"
|
||||||
graph "github.com/owncloud/ocis/extensions/graph/pkg/config"
|
graph "github.com/owncloud/ocis/extensions/graph/pkg/config"
|
||||||
idm "github.com/owncloud/ocis/extensions/idm/pkg/config"
|
idm "github.com/owncloud/ocis/extensions/idm/pkg/config"
|
||||||
|
notifications "github.com/owncloud/ocis/extensions/notifications/pkg/config"
|
||||||
|
ocs "github.com/owncloud/ocis/extensions/ocs/pkg/config"
|
||||||
proxy "github.com/owncloud/ocis/extensions/proxy/pkg/config"
|
proxy "github.com/owncloud/ocis/extensions/proxy/pkg/config"
|
||||||
|
settings "github.com/owncloud/ocis/extensions/settings/pkg/config"
|
||||||
|
thumbnails "github.com/owncloud/ocis/extensions/thumbnails/pkg/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configFilename string = "ocis.yml"
|
const configFilename string = "ocis.yml"
|
||||||
@@ -105,17 +109,17 @@ func createConfig(insecure, forceOverwrite bool, configPath string) error {
|
|||||||
IDM: &idm.Config{},
|
IDM: &idm.Config{},
|
||||||
//IDP: &idp.Config{},
|
//IDP: &idp.Config{},
|
||||||
//Nats: &nats.Config{},
|
//Nats: &nats.Config{},
|
||||||
//Notifications: ¬ifications.Config{},
|
Notifications: ¬ifications.Config{},
|
||||||
//OCS: &ocs.Config{},
|
Proxy: &proxy.Config{},
|
||||||
//Settings: &settings.Config{},
|
OCS: &ocs.Config{},
|
||||||
|
Settings: &settings.Config{},
|
||||||
//Storage: &storage.Config{},
|
//Storage: &storage.Config{},
|
||||||
//Thumbnails: &thumbnails.Config{},
|
Thumbnails: &thumbnails.Config{},
|
||||||
//Web: &web.Config{},
|
//Web: &web.Config{},
|
||||||
//WebDAV: &webdav.Config{},
|
//WebDAV: &webdav.Config{},
|
||||||
}
|
}
|
||||||
|
|
||||||
if insecure {
|
if insecure {
|
||||||
cfg.Proxy = &proxy.Config{}
|
|
||||||
cfg.Proxy.InsecureBackends = insecure
|
cfg.Proxy.InsecureBackends = insecure
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,8 +143,15 @@ func createConfig(insecure, forceOverwrite bool, configPath string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Could not generate random password for tokenmanager: %s", err)
|
return fmt.Errorf("Could not generate random password for tokenmanager: %s", err)
|
||||||
}
|
}
|
||||||
|
machineAuthSecret, err := generateRandomPassword(passwordLength)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("Could not generate random password for machineauthsecret: %s", err)
|
||||||
|
}
|
||||||
|
thumbnailTransferTokenSecret, err := generateRandomPassword(passwordLength)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("Could not generate random password for machineauthsecret: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: generate outputs for all occurences above
|
|
||||||
cfg.TokenManager.JWTSecret = tokenManagerJwtSecret
|
cfg.TokenManager.JWTSecret = tokenManagerJwtSecret
|
||||||
cfg.Accounts.TokenManager.JWTSecret = tokenManagerJwtSecret
|
cfg.Accounts.TokenManager.JWTSecret = tokenManagerJwtSecret
|
||||||
cfg.Graph.TokenManager.JWTSecret = tokenManagerJwtSecret
|
cfg.Graph.TokenManager.JWTSecret = tokenManagerJwtSecret
|
||||||
@@ -148,6 +159,13 @@ func createConfig(insecure, forceOverwrite bool, configPath string) error {
|
|||||||
cfg.IDM.ServiceUserPasswords.Idp = idpServicePassword
|
cfg.IDM.ServiceUserPasswords.Idp = idpServicePassword
|
||||||
cfg.IDM.ServiceUserPasswords.OcisAdmin = ocisAdminServicePassword
|
cfg.IDM.ServiceUserPasswords.OcisAdmin = ocisAdminServicePassword
|
||||||
cfg.IDM.ServiceUserPasswords.Reva = revaServicePassword
|
cfg.IDM.ServiceUserPasswords.Reva = revaServicePassword
|
||||||
|
cfg.Notifications.Notifications.MachineAuthSecret = machineAuthSecret
|
||||||
|
cfg.OCS.MachineAuthAPIKey = machineAuthSecret
|
||||||
|
cfg.Proxy.TokenManager.JWTSecret = tokenManagerJwtSecret
|
||||||
|
cfg.Proxy.MachineAuthAPIKey = machineAuthSecret
|
||||||
|
cfg.Settings.Metadata.MachineAuthAPIKey = machineAuthSecret
|
||||||
|
cfg.Settings.TokenManager.JWTSecret = tokenManagerJwtSecret
|
||||||
|
cfg.Thumbnails.Thumbnail.TransferTokenSecret = thumbnailTransferTokenSecret
|
||||||
yamlOutput, err := yaml.Marshal(cfg)
|
yamlOutput, err := yaml.Marshal(cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Could not marshall config into yaml: %s", err)
|
return fmt.Errorf("Could not marshall config into yaml: %s", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user