diff --git a/pkg/config/config.go b/pkg/config/config.go index 5659d623f..d78df6d8d 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -69,9 +69,9 @@ type Config struct { HTTPServiceTLS shared.HTTPServiceTLS `yaml:"http_service_tls"` Reva *shared.Reva `yaml:"reva"` - Mode Mode // DEPRECATED - File string - OcisURL string `yaml:"ocis_url" env:"OC_URL" desc:"URL, where oCIS is reachable for users." introductionVersion:"pre5.0"` + Mode Mode // DEPRECATED + File string + OpenCloudURL string `yaml:"opencloud_url" env:"OC_URL" desc:"URL, where OpenCloudURL is reachable for users." introductionVersion:"pre5.0"` Registry string `yaml:"registry"` TokenManager *shared.TokenManager `yaml:"token_manager"` diff --git a/pkg/config/defaultconfig.go b/pkg/config/defaultconfig.go index d891130b2..00cade7fb 100644 --- a/pkg/config/defaultconfig.go +++ b/pkg/config/defaultconfig.go @@ -48,7 +48,7 @@ import ( func DefaultConfig() *Config { return &Config{ - OcisURL: "https://localhost:9200", + OpenCloudURL: "https://localhost:9200", Runtime: Runtime{ Port: "9250", Host: "localhost", diff --git a/pkg/config/parser/parse.go b/pkg/config/parser/parse.go index a763e2a6b..3101c4492 100644 --- a/pkg/config/parser/parse.go +++ b/pkg/config/parser/parse.go @@ -110,8 +110,8 @@ func EnsureCommons(cfg *config.Config) { cfg.Commons.AdminUserID = cfg.AdminUserID } - if cfg.OcisURL != "" { - cfg.Commons.OcisURL = cfg.OcisURL + if cfg.OpenCloudURL != "" { + cfg.Commons.OpenCloudURL = cfg.OpenCloudURL } cfg.Commons.Reva = structs.CopyOrZeroValue(cfg.Reva) diff --git a/pkg/shared/shared_types.go b/pkg/shared/shared_types.go index 95d7353b2..52309eabc 100644 --- a/pkg/shared/shared_types.go +++ b/pkg/shared/shared_types.go @@ -75,7 +75,7 @@ type Commons struct { GRPCClientTLS *GRPCClientTLS `yaml:"grpc_client_tls"` GRPCServiceTLS *GRPCServiceTLS `yaml:"grpc_service_tls"` HTTPServiceTLS HTTPServiceTLS `yaml:"http_service_tls"` - OcisURL string `yaml:"ocis_url" env:"OC_URL" desc:"URL, where oCIS is reachable for users." introductionVersion:"pre5.0"` + OpenCloudURL string `yaml:"opencloud_url" env:"OC_URL" desc:"URL, where OpenCloud is reachable for users." introductionVersion:"pre5.0"` TokenManager *TokenManager `mask:"struct" yaml:"token_manager"` Reva *Reva `yaml:"reva"` MachineAuthAPIKey string `mask:"password" yaml:"machine_auth_api_key" env:"OC_MACHINE_AUTH_API_KEY" desc:"Machine auth API key used to validate internal requests necessary for the access to resources from other services." introductionVersion:"pre5.0"` diff --git a/services/collaboration/pkg/connector/fileconnector.go b/services/collaboration/pkg/connector/fileconnector.go index 98ae5b313..ae94317f6 100644 --- a/services/collaboration/pkg/connector/fileconnector.go +++ b/services/collaboration/pkg/connector/fileconnector.go @@ -735,7 +735,7 @@ func (f *FileConnector) PutRelativeFileSuggested(ctx context.Context, ccs Conten Str("FinalReference", wopiContext.FileReference.String()). Msg("PutRelativeFileSuggested: success") - webURL, err := url.Parse(f.cfg.Commons.OcisURL) + webURL, err := url.Parse(f.cfg.Commons.OpenCloudURL) if err != nil { return nil, err } @@ -827,7 +827,7 @@ func (f *FileConnector) PutRelativeFileRelative(ctx context.Context, ccs Content } var newInfo *providerv1beta1.ResourceInfo - webURL, err := url.Parse(f.cfg.Commons.OcisURL) + webURL, err := url.Parse(f.cfg.Commons.OpenCloudURL) if err != nil { return nil, err } @@ -1215,7 +1215,7 @@ func (f *FileConnector) CheckFileInfo(ctx context.Context) (*ConnectorResponse, breadcrumbFolderName = statRes.GetInfo().GetSpace().GetName() } - ocURL, err := url.Parse(f.cfg.Commons.OcisURL) + ocURL, err := url.Parse(f.cfg.Commons.OpenCloudURL) if err != nil { return nil, err } @@ -1270,7 +1270,7 @@ func (f *FileConnector) CheckFileInfo(ctx context.Context) (*ConnectorResponse, fileinfo.KeyUserFriendlyName: userFriendlyName, fileinfo.KeyUserID: userId, - fileinfo.KeyPostMessageOrigin: f.cfg.Commons.OcisURL, + fileinfo.KeyPostMessageOrigin: f.cfg.Commons.OpenCloudURL, fileinfo.KeyLicenseCheckForEditIsEnabled: f.cfg.App.LicenseCheckEnable, } diff --git a/services/collaboration/pkg/connector/fileconnector_test.go b/services/collaboration/pkg/connector/fileconnector_test.go index a008c5d4e..fd00d108b 100644 --- a/services/collaboration/pkg/connector/fileconnector_test.go +++ b/services/collaboration/pkg/connector/fileconnector_test.go @@ -46,7 +46,7 @@ var _ = Describe("FileConnector", func() { BeforeEach(func() { cfg = &config.Config{ Commons: &shared.Commons{ - OcisURL: "https://cloud.opencloud.test", + OpenCloudURL: "https://cloud.opencloud.test", }, App: config.App{ Name: "test", diff --git a/services/frontend/pkg/config/defaults/defaultconfig.go b/services/frontend/pkg/config/defaults/defaultconfig.go index 6a5190192..3e91b4456 100644 --- a/services/frontend/pkg/config/defaults/defaultconfig.go +++ b/services/frontend/pkg/config/defaults/defaultconfig.go @@ -186,11 +186,11 @@ func EnsureDefaults(cfg *config.Config) { cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey } - if (cfg.Commons != nil && cfg.Commons.OcisURL != "") && + if (cfg.Commons != nil && cfg.Commons.OpenCloudURL != "") && (cfg.HTTP.CORS.AllowedOrigins == nil || len(cfg.HTTP.CORS.AllowedOrigins) == 1 && cfg.HTTP.CORS.AllowedOrigins[0] == "https://localhost:9200") { - cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OcisURL} + cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OpenCloudURL} } } diff --git a/services/idp/pkg/service/v0/service.go b/services/idp/pkg/service/v0/service.go index fb5838850..faa8cda2b 100644 --- a/services/idp/pkg/service/v0/service.go +++ b/services/idp/pkg/service/v0/service.go @@ -48,7 +48,7 @@ func NewService(opts ...Option) Service { if err := createTemporaryClientsConfig( options.Config.IDP.IdentifierRegistrationConf, - options.Config.Commons.OcisURL, + options.Config.Commons.OpenCloudURL, options.Config.Clients, ); err != nil { logger.Fatal().Err(err).Msg("could not create default config") @@ -141,7 +141,7 @@ type temporaryClientConfig struct { Clients []config.Client `yaml:"clients"` } -func createTemporaryClientsConfig(filePath, ocisURL string, clients []config.Client) error { +func createTemporaryClientsConfig(filePath, openCloudURL string, clients []config.Client) error { folder := path.Dir(filePath) if _, err := os.Stat(folder); os.IsNotExist(err) { if err := os.MkdirAll(folder, 0o700); err != nil { @@ -152,10 +152,10 @@ func createTemporaryClientsConfig(filePath, ocisURL string, clients []config.Cli for i, client := range clients { for i, entry := range client.RedirectURIs { - client.RedirectURIs[i] = strings.ReplaceAll(entry, "{{OC_URL}}", strings.TrimRight(ocisURL, "/")) + client.RedirectURIs[i] = strings.ReplaceAll(entry, "{{OC_URL}}", strings.TrimRight(openCloudURL, "/")) } for i, entry := range client.Origins { - client.Origins[i] = strings.ReplaceAll(entry, "{{OC_URL}}", strings.TrimRight(ocisURL, "/")) + client.Origins[i] = strings.ReplaceAll(entry, "{{OC_URL}}", strings.TrimRight(openCloudURL, "/")) } clients[i] = client } diff --git a/services/invitations/pkg/config/defaults/defaultconfig.go b/services/invitations/pkg/config/defaults/defaultconfig.go index 8a688f9c0..7da0027ff 100644 --- a/services/invitations/pkg/config/defaults/defaultconfig.go +++ b/services/invitations/pkg/config/defaults/defaultconfig.go @@ -78,11 +78,11 @@ func EnsureDefaults(cfg *config.Config) { cfg.TokenManager = &config.TokenManager{} } - if (cfg.Commons != nil && cfg.Commons.OcisURL != "") && + if (cfg.Commons != nil && cfg.Commons.OpenCloudURL != "") && (cfg.HTTP.CORS.AllowedOrigins == nil || len(cfg.HTTP.CORS.AllowedOrigins) == 1 && cfg.HTTP.CORS.AllowedOrigins[0] == "https://localhost:9200") { - cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OcisURL} + cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OpenCloudURL} } } diff --git a/services/notifications/pkg/service/service.go b/services/notifications/pkg/service/service.go index ebb87626b..b9efd5e11 100644 --- a/services/notifications/pkg/service/service.go +++ b/services/notifications/pkg/service/service.go @@ -53,7 +53,7 @@ func NewEventsNotifier( logger log.Logger, gatewaySelector pool.Selectable[gateway.GatewayAPIClient], valueService settingssvc.ValueService, - serviceAccountID, serviceAccountSecret, emailTemplatePath, defaultLanguage, ocisURL, translationPath, emailSender string, + serviceAccountID, serviceAccountSecret, emailTemplatePath, defaultLanguage, openCloudURL, translationPath, emailSender string, store store.Store, historyClient ehsvc.EventHistoryService, registeredEvents map[string]events.Unmarshaller) Service { @@ -70,7 +70,7 @@ func NewEventsNotifier( emailTemplatePath: emailTemplatePath, defaultLanguage: defaultLanguage, defaultEmailSender: emailSender, - ocisURL: ocisURL, + openCloudURL: openCloudURL, translationPath: translationPath, filter: newNotificationFilter(logger, valueService), splitter: newIntervalSplitter(logger, valueService), @@ -90,7 +90,7 @@ type eventsNotifier struct { translationPath string defaultLanguage string defaultEmailSender string - ocisURL string + openCloudURL string serviceAccountID string serviceAccountSecret string filter *notificationFilter diff --git a/services/notifications/pkg/service/shares.go b/services/notifications/pkg/service/shares.go index adb031760..23b6fe897 100644 --- a/services/notifications/pkg/service/shares.go +++ b/services/notifications/pkg/service/shares.go @@ -2,6 +2,7 @@ package service import ( "context" + user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/utils" @@ -70,7 +71,7 @@ func (s eventsNotifier) prepareShareCreated(logger zerolog.Logger, e events.Shar } shareFolder = resourceInfo.Name - shareLink, err = urlJoinPath(s.ocisURL, "files/shares/with-me") + shareLink, err = urlJoinPath(s.openCloudURL, "files/shares/with-me") if err != nil { logger.Error(). Err(err). diff --git a/services/notifications/pkg/service/spaces.go b/services/notifications/pkg/service/spaces.go index 8d1c77ab1..903070418 100644 --- a/services/notifications/pkg/service/spaces.go +++ b/services/notifications/pkg/service/spaces.go @@ -2,6 +2,7 @@ package service import ( "context" + user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/storagespace" @@ -85,7 +86,7 @@ func (s eventsNotifier) prepareSpaceShared(logger zerolog.Logger, e events.Space } spaceName = resourceInfo.GetSpace().GetName() - shareLink, err = urlJoinPath(s.ocisURL, "f", e.ID.OpaqueId) + shareLink, err = urlJoinPath(s.openCloudURL, "f", e.ID.OpaqueId) if err != nil { logger.Error(). Err(err). @@ -170,7 +171,7 @@ func (s eventsNotifier) prepareSpaceUnshared(logger zerolog.Logger, e events.Spa } spaceName = resourceInfo.GetSpace().GetName() - shareLink, err = urlJoinPath(s.ocisURL, "f", e.ID.OpaqueId) + shareLink, err = urlJoinPath(s.openCloudURL, "f", e.ID.OpaqueId) if err != nil { logger.Error(). Err(err). diff --git a/services/ocdav/pkg/config/defaults/defaultconfig.go b/services/ocdav/pkg/config/defaults/defaultconfig.go index 4e4f621e9..cd8aa867e 100644 --- a/services/ocdav/pkg/config/defaults/defaultconfig.go +++ b/services/ocdav/pkg/config/defaults/defaultconfig.go @@ -138,11 +138,11 @@ func EnsureDefaults(cfg *config.Config) { cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey } - if (cfg.Commons != nil && cfg.Commons.OcisURL != "") && + if (cfg.Commons != nil && cfg.Commons.OpenCloudURL != "") && (cfg.HTTP.CORS.AllowedOrigins == nil || len(cfg.HTTP.CORS.AllowedOrigins) == 1 && cfg.HTTP.CORS.AllowedOrigins[0] == "https://localhost:9200") { - cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OcisURL} + cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OpenCloudURL} } } diff --git a/services/ocm/pkg/config/defaults/defaultconfig.go b/services/ocm/pkg/config/defaults/defaultconfig.go index af873f9cc..2b3a400ea 100644 --- a/services/ocm/pkg/config/defaults/defaultconfig.go +++ b/services/ocm/pkg/config/defaults/defaultconfig.go @@ -182,11 +182,11 @@ func EnsureDefaults(cfg *config.Config) { cfg.GRPC.TLS = structs.CopyOrZeroValue(cfg.Commons.GRPCServiceTLS) } - if (cfg.Commons != nil && cfg.Commons.OcisURL != "") && + if (cfg.Commons != nil && cfg.Commons.OpenCloudURL != "") && (cfg.HTTP.CORS.AllowedOrigins == nil || len(cfg.HTTP.CORS.AllowedOrigins) == 1 && cfg.HTTP.CORS.AllowedOrigins[0] == "https://localhost:9200") { - cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OcisURL} + cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OpenCloudURL} } } diff --git a/services/ocm/pkg/revaconfig/config.go b/services/ocm/pkg/revaconfig/config.go index cab5e6814..5499cb227 100644 --- a/services/ocm/pkg/revaconfig/config.go +++ b/services/ocm/pkg/revaconfig/config.go @@ -13,7 +13,7 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter // Construct the ocm provider domain from the oCIS URL providerDomain := "" - u, err := url.Parse(cfg.Commons.OcisURL) + u, err := url.Parse(cfg.Commons.OpenCloudURL) switch { case err != nil: logger.Error().Err(err).Msg("could not parse oCIS URL") @@ -60,7 +60,7 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter "prefix": ".well-known", "ocmprovider": map[string]interface{}{ "ocm_prefix": cfg.OCMD.Prefix, - "endpoint": cfg.Commons.OcisURL, + "endpoint": cfg.Commons.OpenCloudURL, "provider": "OpenCloud", "webdav_root": "/dav/ocm", "webapp_root": cfg.ScienceMesh.Prefix, @@ -157,7 +157,7 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter }, "gatewaysvc": cfg.Reva.Address, "provider_domain": providerDomain, - "webdav_endpoint": cfg.Commons.OcisURL, + "webdav_endpoint": cfg.Commons.OpenCloudURL, "webapp_template": cfg.OCMShareProvider.WebappTemplate, "client_insecure": cfg.OCMShareProvider.Insecure, }, diff --git a/services/storage-users/pkg/config/defaults/defaultconfig.go b/services/storage-users/pkg/config/defaults/defaultconfig.go index 6c9f0d40e..95e6ad211 100644 --- a/services/storage-users/pkg/config/defaults/defaultconfig.go +++ b/services/storage-users/pkg/config/defaults/defaultconfig.go @@ -220,11 +220,11 @@ func EnsureDefaults(cfg *config.Config) { cfg.Tasks.PurgeTrashBin.UserID = cfg.Commons.AdminUserID } - if (cfg.Commons != nil && cfg.Commons.OcisURL != "") && + if (cfg.Commons != nil && cfg.Commons.OpenCloudURL != "") && (cfg.HTTP.CORS.AllowedOrigins == nil || len(cfg.HTTP.CORS.AllowedOrigins) == 1 && cfg.HTTP.CORS.AllowedOrigins[0] == "https://localhost:9200") { - cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OcisURL} + cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OpenCloudURL} } } diff --git a/services/web/pkg/config/defaults/defaultconfig.go b/services/web/pkg/config/defaults/defaultconfig.go index 781108794..4d13d1d03 100644 --- a/services/web/pkg/config/defaults/defaultconfig.go +++ b/services/web/pkg/config/defaults/defaultconfig.go @@ -156,11 +156,11 @@ func EnsureDefaults(cfg *config.Config) { cfg.HTTP.TLS = cfg.Commons.HTTPServiceTLS } - if (cfg.Commons != nil && cfg.Commons.OcisURL != "") && + if (cfg.Commons != nil && cfg.Commons.OpenCloudURL != "") && (cfg.HTTP.CORS.AllowedOrigins == nil || len(cfg.HTTP.CORS.AllowedOrigins) == 1 && cfg.HTTP.CORS.AllowedOrigins[0] == "https://localhost:9200") { - cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OcisURL} + cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OpenCloudURL} } } diff --git a/services/webfinger/pkg/command/server.go b/services/webfinger/pkg/command/server.go index 0115e8aad..cc558df3f 100644 --- a/services/webfinger/pkg/command/server.go +++ b/services/webfinger/pkg/command/server.go @@ -132,7 +132,7 @@ func getRelationProviders(cfg *config.Config) (map[string]service.RelationProvid rels[relationURI] = relations.OpenIDDiscovery(cfg.IDP) case relations.OwnCloudInstanceRel: var err error - rels[relationURI], err = relations.OwnCloudInstance(cfg.Instances, cfg.OcisURL) + rels[relationURI], err = relations.OwnCloudInstance(cfg.Instances, cfg.OpenCloudURL) if err != nil { return nil, err } diff --git a/services/webfinger/pkg/config/config.go b/services/webfinger/pkg/config/config.go index 1760e9d24..df7e20fc3 100644 --- a/services/webfinger/pkg/config/config.go +++ b/services/webfinger/pkg/config/config.go @@ -18,11 +18,11 @@ type Config struct { HTTP HTTP `yaml:"http"` - Instances []Instance `yaml:"instances"` - Relations []string `yaml:"relations" env:"WEBFINGER_RELATIONS" desc:"A list of relation URIs or registered relation types to add to webfinger responses. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"` - IDP string `yaml:"idp" env:"OC_URL;OC_OIDC_ISSUER;WEBFINGER_OIDC_ISSUER" desc:"The identity provider href for the openid-discovery relation." introductionVersion:"pre5.0"` - OcisURL string `yaml:"ocis_url" env:"OC_URL;WEBFINGER_OWNCLOUD_SERVER_INSTANCE_URL" desc:"The URL for the legacy ownCloud server instance relation (not to be confused with the product ownCloud Server). It defaults to the OC_URL but can be overridden to support some reverse proxy corner cases. To shard the deployment, multiple instances can be configured in the configuration file." introductionVersion:"pre5.0"` - Insecure bool `yaml:"insecure" env:"OC_INSECURE;WEBFINGER_INSECURE" desc:"Allow insecure connections to the WEBFINGER service." introductionVersion:"pre5.0"` + Instances []Instance `yaml:"instances"` + Relations []string `yaml:"relations" env:"WEBFINGER_RELATIONS" desc:"A list of relation URIs or registered relation types to add to webfinger responses. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"` + IDP string `yaml:"idp" env:"OC_URL;OC_OIDC_ISSUER;WEBFINGER_OIDC_ISSUER" desc:"The identity provider href for the openid-discovery relation." introductionVersion:"pre5.0"` + OpenCloudURL string `yaml:"opencloud_url" env:"OC_URL;WEBFINGER_OPENCLOUD_SERVER_INSTANCE_URL" desc:"The URL for the legacy OpenCloud server instance relation (not to be confused with the product OpenCloud Server). It defaults to the OC_URL but can be overridden to support some reverse proxy corner cases. To shard the deployment, multiple instances can be configured in the configuration file." introductionVersion:"pre5.0"` + Insecure bool `yaml:"insecure" env:"OC_INSECURE;WEBFINGER_INSECURE" desc:"Allow insecure connections to the WEBFINGER service." introductionVersion:"pre5.0"` Context context.Context `yaml:"-"` } diff --git a/services/webfinger/pkg/config/defaults/defaultconfig.go b/services/webfinger/pkg/config/defaults/defaultconfig.go index b1f367623..c7d7fc156 100644 --- a/services/webfinger/pkg/config/defaults/defaultconfig.go +++ b/services/webfinger/pkg/config/defaults/defaultconfig.go @@ -37,8 +37,8 @@ func DefaultConfig() *config.Config { Name: "webfinger", }, - OcisURL: "https://localhost:9200", - Relations: []string{relations.OpenIDConnectRel, relations.OwnCloudInstanceRel}, + OpenCloudURL: "https://localhost:9200", + Relations: []string{relations.OpenIDConnectRel, relations.OwnCloudInstanceRel}, Instances: []config.Instance{ { Claim: "sub", @@ -83,11 +83,11 @@ func EnsureDefaults(cfg *config.Config) { cfg.HTTP.TLS = cfg.Commons.HTTPServiceTLS } - if (cfg.Commons != nil && cfg.Commons.OcisURL != "") && + if (cfg.Commons != nil && cfg.Commons.OpenCloudURL != "") && (cfg.HTTP.CORS.AllowedOrigins == nil || len(cfg.HTTP.CORS.AllowedOrigins) == 1 && cfg.HTTP.CORS.AllowedOrigins[0] == "https://localhost:9200") { - cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OcisURL} + cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OpenCloudURL} } } diff --git a/services/webfinger/pkg/relations/owncloud_instance.go b/services/webfinger/pkg/relations/owncloud_instance.go index 3a839ecdc..e8766d977 100644 --- a/services/webfinger/pkg/relations/owncloud_instance.go +++ b/services/webfinger/pkg/relations/owncloud_instance.go @@ -25,12 +25,12 @@ type compiledInstance struct { type ownCloudInstance struct { instances []compiledInstance - ocisURL string + openCloudURL string instanceHost string } // OwnCloudInstance adds one or more ownCloud instance relations -func OwnCloudInstance(instances []config.Instance, ocisURL string) (service.RelationProvider, error) { +func OwnCloudInstance(instances []config.Instance, openCloudURL string) (service.RelationProvider, error) { compiledInstances := make([]compiledInstance, 0, len(instances)) var err error for _, instance := range instances { @@ -46,13 +46,13 @@ func OwnCloudInstance(instances []config.Instance, ocisURL string) (service.Rela compiledInstances = append(compiledInstances, compiled) } - u, err := url.Parse(ocisURL) + u, err := url.Parse(openCloudURL) if err != nil { return nil, err } return &ownCloudInstance{ instances: compiledInstances, - ocisURL: ocisURL, + openCloudURL: openCloudURL, instanceHost: u.Host + u.Path, }, nil } @@ -68,7 +68,7 @@ func (l *ownCloudInstance) Add(ctx context.Context, jrd *webfinger.JSONResourceD jrd.Subject = "mailto:" + value } // allow referencing OC_URL in the template - claims["OC_URL"] = l.ocisURL + claims["OC_URL"] = l.openCloudURL for _, instance := range l.instances { if value, ok := claims[instance.Claim].(string); ok && instance.compiledRegex.MatchString(value) { var tmplWriter strings.Builder