From 193469b0e550488d61984dda5365d6851480acb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Fri, 17 Jan 2025 10:27:27 +0100 Subject: [PATCH] Rebrand settings --- services/settings/README.md | 28 +++++++++---------- services/settings/pkg/command/root.go | 4 +-- services/settings/pkg/config/config.go | 4 +-- services/settings/pkg/service/v0/service.go | 2 +- .../pkg/service/v0/servicedecorator.go | 2 +- .../settings/pkg/store/defaults/defaults.go | 12 ++++---- .../pkg/store/metadata/assignments_test.go | 4 +-- services/settings/pkg/store/metadata/store.go | 2 +- .../settings/pkg/store/metadata/store_test.go | 2 +- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/services/settings/README.md b/services/settings/README.md index 9e6da1fe96..a20e5f4356 100644 --- a/services/settings/README.md +++ b/services/settings/README.md @@ -15,18 +15,18 @@ As an example, user profile settings that can be changed in the Web UI must be p The settings service persists the settings data via the `storage-system` service. @@ -54,11 +54,11 @@ Store specific notes: ## Settings Management -Infinite Scale services can register *settings bundles* with the settings service. +OpenCloud services can register *settings bundles* with the settings service. ## Settings Usage -Services can set or query Infinite Scale *setting values* of a user from settings bundles. +Services can set or query OpenCloud *setting values* of a user from settings bundles. ## Service Accounts @@ -78,7 +78,7 @@ For example, for the language `de`, one needs to place the corresponding transla -Important: For the time being, the embedded ownCloud Web frontend only supports the main language code but does not handle any territory. When strings are available in the language code `language_territory`, the web frontend does not see it as it only requests `language`. In consequence, any translations made must exist in the requested `language` to avoid a fallback to the default. +Important: For the time being, the embedded OpenCloud Web frontend only supports the main language code but does not handle any territory. When strings are available in the language code `language_territory`, the web frontend does not see it as it only requests `language`. In consequence, any translations made must exist in the requested `language` to avoid a fallback to the default. ### Translation Rules @@ -90,7 +90,7 @@ which is the source of the texts provided by the code. The default language can be defined via the `OC_DEFAULT_LANGUAGE` environment variable. If this variable is not defined, English will be used as default. The value has the ISO 639-1 format ("de", "en", etc.) and is limited by the list supported languages. This setting can be used to set the default language for notification and invitation emails. -Important developer note: the list of supported languages is at the moment not easy defineable, as it is the minimum intersection of languages shown in the WebUI and languages defined in the ocis code for the use of notifications and userlog. Even more, not all languages where there are translations available on transifex, are available in the WebUI respectively for ocis notifications, and the translation rate for existing languages is partially not that high. You will see therefore quite often English default strings though a supported language may exist and was selected. +Important developer note: the list of supported languages is at the moment not easy defineable, as it is the minimum intersection of languages shown in the WebUI and languages defined in the OpenCloud code for the use of notifications and userlog. Even more, not all languages where there are translations available on transifex, are available in the WebUI respectively for OpenCloud notifications, and the translation rate for existing languages is partially not that high. You will see therefore quite often English default strings though a supported language may exist and was selected. The `OC_DEFAULT_LANGUAGE` setting impacts the `notification` and `userlog` services and the WebUI. Note that translations must exist for all named components to be presented correctly. @@ -104,7 +104,7 @@ The `OC_DEFAULT_LANGUAGE` setting impacts the `notification` and `userlog` servi ## Custom Roles -It is possible to replace the default ocis roles (`admin`, `user`) with custom roles that contain custom permissions. One can set `SETTINGS_BUNDLES_PATH` to the path of a `json` file containing the new roles. +It is possible to replace the default OpenCloud roles (`admin`, `user`) with custom roles that contain custom permissions. One can set `SETTINGS_BUNDLES_PATH` to the path of a `json` file containing the new roles. Role Example: ```json @@ -113,7 +113,7 @@ Role Example: "id": "38071a68-456a-4553-846a-fa67bf5596cc", // ID of the role. Recommendation is to use a random uuidv4. But any unique string will do. "name": "user-light", // Internal name of the role. This is used by the system to identify the role. Any string will do here, but it should be unique among the other roles. "type": "TYPE_ROLE", // Always use `TYPE_ROLE` - "extension": "ocis-roles", // Always use `ocis-roles` + "extension": "opencloud-roles", // Always use `opencloud-roles` "displayName": "User Light", // DisplayName of the role used in webui "settings": [ ], // Permissions attached to the role. See Details below. @@ -128,7 +128,7 @@ To create custom roles: * Copy the role example to a `json` file. * Change `id`, `name`, and `displayName` to your liking. * Copy the desired permissions from the `user-all-permissions` example below to the `settings` array of the role. -* Set the `SETTINGS_BUNDLE_PATH` envvar to the path of the json file and start ocis +* Set the `SETTINGS_BUNDLE_PATH` envvar to the path of the json file and start OpenCloud Example File: ```json @@ -137,7 +137,7 @@ Example File: "id": "38071a68-456a-4553-846a-fa67bf5596cc", "name": "user-1-permission", "type": "TYPE_ROLE", - "extension": "ocis-roles", + "extension": "opencloud-roles", "displayName": "User with one permission only", "settings": [ { @@ -162,7 +162,7 @@ Example File: "id": "71881883-1768-46bd-a24d-a356a2afdf7f", "name": "user-all-permissions", "type": "TYPE_ROLE", - "extension": "ocis-roles", + "extension": "opencloud-roles", "displayName": "User with all available permissions", "settings": [ { diff --git a/services/settings/pkg/command/root.go b/services/settings/pkg/command/root.go index 710be9c022..80d57bc1a4 100644 --- a/services/settings/pkg/command/root.go +++ b/services/settings/pkg/command/root.go @@ -22,11 +22,11 @@ func GetCommands(cfg *config.Config) cli.Commands { } } -// Execute is the entry point for the ocis-settings command. +// Execute is the entry point for the opencloud-settings command. func Execute(cfg *config.Config) error { app := clihelper.DefaultApp(&cli.App{ Name: "settings", - Usage: "Provide settings and permissions for oCIS", + Usage: "Provide settings and permissions for OpenCloud", Commands: GetCommands(cfg), }) diff --git a/services/settings/pkg/config/config.go b/services/settings/pkg/config/config.go index 69d1c0b203..9b25ac737a 100644 --- a/services/settings/pkg/config/config.go +++ b/services/settings/pkg/config/config.go @@ -48,8 +48,8 @@ type Metadata struct { GatewayAddress string `yaml:"gateway_addr" env:"SETTINGS_STORAGE_GATEWAY_GRPC_ADDR;STORAGE_GATEWAY_GRPC_ADDR" desc:"GRPC address of the STORAGE-SYSTEM service." introductionVersion:"pre5.0"` StorageAddress string `yaml:"storage_addr" env:"SETTINGS_STORAGE_GRPC_ADDR;STORAGE_GRPC_ADDR" desc:"GRPC address of the STORAGE-SYSTEM service." introductionVersion:"pre5.0"` - SystemUserID string `yaml:"system_user_id" env:"OC_SYSTEM_USER_ID;SETTINGS_SYSTEM_USER_ID" desc:"ID of the oCIS STORAGE-SYSTEM system user. Admins need to set the ID for the STORAGE-SYSTEM system user in this config option which is then used to reference the user. Any reasonable long string is possible, preferably this would be an UUIDv4 format." introductionVersion:"pre5.0"` - SystemUserIDP string `yaml:"system_user_idp" env:"OC_SYSTEM_USER_IDP;SETTINGS_SYSTEM_USER_IDP" desc:"IDP of the oCIS STORAGE-SYSTEM system user." introductionVersion:"pre5.0"` + SystemUserID string `yaml:"system_user_id" env:"OC_SYSTEM_USER_ID;SETTINGS_SYSTEM_USER_ID" desc:"ID of the OpenCloud STORAGE-SYSTEM system user. Admins need to set the ID for the STORAGE-SYSTEM system user in this config option which is then used to reference the user. Any reasonable long string is possible, preferably this would be an UUIDv4 format." introductionVersion:"pre5.0"` + SystemUserIDP string `yaml:"system_user_idp" env:"OC_SYSTEM_USER_IDP;SETTINGS_SYSTEM_USER_IDP" desc:"IDP of the OpenCloud STORAGE-SYSTEM system user." introductionVersion:"pre5.0"` SystemUserAPIKey string `yaml:"system_user_api_key" env:"OC_SYSTEM_USER_API_KEY" desc:"API key for the STORAGE-SYSTEM system user." introductionVersion:"pre5.0"` Cache *Cache `yaml:"cache"` } diff --git a/services/settings/pkg/service/v0/service.go b/services/settings/pkg/service/v0/service.go index e2ba8ca95c..57a1f49705 100644 --- a/services/settings/pkg/service/v0/service.go +++ b/services/settings/pkg/service/v0/service.go @@ -43,7 +43,7 @@ type Service struct { // NewService returns a service implementation for Service. func NewService(cfg *config.Config, logger log.Logger) settings.ServiceHandler { service := Service{ - id: "ocis-settings", + id: "opencloud-settings", config: cfg, logger: logger, } diff --git a/services/settings/pkg/service/v0/servicedecorator.go b/services/settings/pkg/service/v0/servicedecorator.go index 2d44c07eb3..d639b73c90 100644 --- a/services/settings/pkg/service/v0/servicedecorator.go +++ b/services/settings/pkg/service/v0/servicedecorator.go @@ -71,7 +71,7 @@ func (s *defaultLanguageDecorator) ListValues(ctx context.Context, req *settings func (s *defaultLanguageDecorator) withDefaultLanguageSetting(accountUUID string) *settingsmsg.ValueWithIdentifier { return &settingsmsg.ValueWithIdentifier{ Identifier: &settingsmsg.Identifier{ - Extension: "ocis-accounts", + Extension: "opencloud-accounts", Bundle: "profile", Setting: "language", }, diff --git a/services/settings/pkg/store/defaults/defaults.go b/services/settings/pkg/store/defaults/defaults.go index d5fa7466ad..09b0bcb986 100644 --- a/services/settings/pkg/store/defaults/defaults.go +++ b/services/settings/pkg/store/defaults/defaults.go @@ -69,7 +69,7 @@ func ServiceAccountBundle() *settingsmsg.Bundle { Id: BundleUUIDServiceAccount, Name: "service-account", Type: settingsmsg.Bundle_TYPE_ROLE, - Extension: "ocis-roles", + Extension: "opencloud-roles", DisplayName: "Service Account", Resource: &settingsmsg.Resource{ Type: settingsmsg.Resource_TYPE_SYSTEM, @@ -104,7 +104,7 @@ func generateBundleAdminRole() *settingsmsg.Bundle { Id: BundleUUIDRoleAdmin, Name: "admin", Type: settingsmsg.Bundle_TYPE_ROLE, - Extension: "ocis-roles", + Extension: "opencloud-roles", DisplayName: "Admin", Resource: &settingsmsg.Resource{ Type: settingsmsg.Resource_TYPE_SYSTEM, @@ -150,7 +150,7 @@ func generateBundleSpaceAdminRole() *settingsmsg.Bundle { Id: BundleUUIDRoleSpaceAdmin, Name: "spaceadmin", Type: settingsmsg.Bundle_TYPE_ROLE, - Extension: "ocis-roles", + Extension: "opencloud-roles", DisplayName: "Space Admin", Resource: &settingsmsg.Resource{ Type: settingsmsg.Resource_TYPE_SYSTEM, @@ -190,7 +190,7 @@ func generateBundleUserRole() *settingsmsg.Bundle { Id: BundleUUIDRoleUser, Name: "user", Type: settingsmsg.Bundle_TYPE_ROLE, - Extension: "ocis-roles", + Extension: "opencloud-roles", DisplayName: "User", Resource: &settingsmsg.Resource{ Type: settingsmsg.Resource_TYPE_SYSTEM, @@ -224,7 +224,7 @@ func generateBundleUserLightRole() *settingsmsg.Bundle { Id: BundleUUIDRoleUserLight, Name: "user-light", Type: settingsmsg.Bundle_TYPE_ROLE, - Extension: "ocis-roles", + Extension: "opencloud-roles", DisplayName: "User Light", Resource: &settingsmsg.Resource{ Type: settingsmsg.Resource_TYPE_SYSTEM, @@ -242,7 +242,7 @@ func generateBundleProfileRequest() *settingsmsg.Bundle { return &settingsmsg.Bundle{ Id: BundleUUIDProfile, Name: "profile", - Extension: "ocis-accounts", + Extension: "opencloud-accounts", Type: settingsmsg.Bundle_TYPE_DEFAULT, Resource: &settingsmsg.Resource{ Type: settingsmsg.Resource_TYPE_SYSTEM, diff --git a/services/settings/pkg/store/metadata/assignments_test.go b/services/settings/pkg/store/metadata/assignments_test.go index 121f994f75..48e55cae33 100644 --- a/services/settings/pkg/store/metadata/assignments_test.go +++ b/services/settings/pkg/store/metadata/assignments_test.go @@ -33,7 +33,7 @@ var ( Type: settingsmsg.Bundle_TYPE_ROLE, DisplayName: "test role - reads | update", Name: "TEST_ROLE", - Extension: "ocis-settings", + Extension: "opencloud-settings", Resource: &settingsmsg.Resource{ Type: settingsmsg.Resource_TYPE_BUNDLE, }, @@ -69,7 +69,7 @@ var ( Type: settingsmsg.Bundle_TYPE_ROLE, DisplayName: "another", Name: "ANOTHER_TEST_ROLE", - Extension: "ocis-settings", + Extension: "opencloud-settings", Resource: &settingsmsg.Resource{ Type: settingsmsg.Resource_TYPE_BUNDLE, }, diff --git a/services/settings/pkg/store/metadata/store.go b/services/settings/pkg/store/metadata/store.go index dc47263915..451d938130 100644 --- a/services/settings/pkg/store/metadata/store.go +++ b/services/settings/pkg/store/metadata/store.go @@ -19,7 +19,7 @@ import ( var ( // Name is the default name for the settings store - Name = "ocis-settings" + Name = "opencloud-settings" managerName = "metadata" settingsSpaceID = "f1bdd61a-da7c-49fc-8203-0558109d1b4f" // uuid.Must(uuid.NewV4()).String() rootFolderLocation = "settings" diff --git a/services/settings/pkg/store/metadata/store_test.go b/services/settings/pkg/store/metadata/store_test.go index 18388a62b1..76d1554a64 100644 --- a/services/settings/pkg/store/metadata/store_test.go +++ b/services/settings/pkg/store/metadata/store_test.go @@ -39,7 +39,7 @@ const ( value3 = "b42702d2-5e4d-4d73-b133-e1f9e285355e" ) -// use "unit" or "integration" do define test type. You need a running ocis instance for integration tests +// use "unit" or "integration" do define test type. You need a running OpenCloud instance for integration tests var testtype = "unit" // MockedMetadataClient mocks the metadataservice inmemory