error init cli hints

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2025-01-14 12:47:52 +01:00
parent 5aa5ab843a
commit 97250d5b06
6 changed files with 18 additions and 18 deletions

View File

@@ -2,7 +2,7 @@ package init
// TODO: use the oCIS config struct instead of this custom struct
// We can't use it right now, because it would need "omitempty" on
// all elements, in order to produce a slim config file with `ocis init`.
// all elements, in order to produce a slim config file with `opencloud init`.
// We can't just add these "omitempty" tags, since we want to generate
// full example configuration files with that struct, too.
// Proposed solution to get rid of this temporary solution:

View File

@@ -9,7 +9,7 @@ import (
func MissingMachineAuthApiKeyError(service string) error {
return fmt.Errorf("The Machineauth API key has not been configured for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in "+
"(e.g. by using 'opencloud init --diff' and applying the patch or setting a value manually in "+
"the config/corresponding environment variable).",
service, defaults.BaseConfigPath())
}
@@ -17,7 +17,7 @@ func MissingMachineAuthApiKeyError(service string) error {
func MissingSystemUserApiKeyError(service string) error {
return fmt.Errorf("The SystemUser API key has not been configured for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in "+
"(e.g. by using 'opencloud init --diff' and applying the patch or setting a value manually in "+
"the config/corresponding environment variable).",
service, defaults.BaseConfigPath())
}
@@ -25,7 +25,7 @@ func MissingSystemUserApiKeyError(service string) error {
func MissingJWTTokenError(service string) error {
return fmt.Errorf("The jwt_secret has not been set properly in your config for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in "+
"(e.g. by using 'opencloud init --diff' and applying the patch or setting a value manually in "+
"the config/corresponding environment variable).",
service, defaults.BaseConfigPath())
}
@@ -33,7 +33,7 @@ func MissingJWTTokenError(service string) error {
func MissingRevaTransferSecretError(service string) error {
return fmt.Errorf("The transfer_secret has not been set properly in your config for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in "+
"(e.g. by using 'opencloud init --diff' and applying the patch or setting a value manually in "+
"the config/corresponding environment variable).",
service, defaults.BaseConfigPath())
}
@@ -41,7 +41,7 @@ func MissingRevaTransferSecretError(service string) error {
func MissingLDAPBindPassword(service string) error {
return fmt.Errorf("The ldap bind_password has not been set properly in your config for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in "+
"(e.g. by using 'opencloud init --diff' and applying the patch or setting a value manually in "+
"the config/corresponding environment variable).",
service, defaults.BaseConfigPath())
}
@@ -49,7 +49,7 @@ func MissingLDAPBindPassword(service string) error {
func MissingServiceUserPassword(service, serviceUser string) error {
return fmt.Errorf("The password of service user %s has not been set properly in your config for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in "+
"(e.g. by using 'opencloud init --diff' and applying the patch or setting a value manually in "+
"the config/corresponding environment variable).",
serviceUser, service, defaults.BaseConfigPath())
}
@@ -57,7 +57,7 @@ func MissingServiceUserPassword(service, serviceUser string) error {
func MissingSystemUserID(service string) error {
return fmt.Errorf("The system user ID has not been configured for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in "+
"(e.g. by using 'opencloud init --diff' and applying the patch or setting a value manually in "+
"the config/corresponding environment variable).",
service, defaults.BaseConfigPath())
}
@@ -65,7 +65,7 @@ func MissingSystemUserID(service string) error {
func MissingAdminUserID(service string) error {
return fmt.Errorf("The admin user ID has not been configured for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in "+
"(e.g. by using 'opencloud init --diff' and applying the patch or setting a value manually in "+
"the config/corresponding environment variable).",
service, defaults.BaseConfigPath())
}
@@ -73,7 +73,7 @@ func MissingAdminUserID(service string) error {
func MissingServiceAccountID(service string) error {
return fmt.Errorf("The service account id has not been configured for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in "+
"(e.g. by using 'opencloud init --diff' and applying the patch or setting a value manually in "+
"the config/corresponding environment variable).",
service, defaults.BaseConfigPath())
}
@@ -81,7 +81,7 @@ func MissingServiceAccountID(service string) error {
func MissingServiceAccountSecret(service string) error {
return fmt.Errorf("The service account secret has not been configured for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in "+
"(e.g. by using 'opencloud init --diff' and applying the patch or setting a value manually in "+
"the config/corresponding environment variable).",
service, defaults.BaseConfigPath())
}
@@ -89,7 +89,7 @@ func MissingServiceAccountSecret(service string) error {
func MissingWOPISecretError(service string) error {
return fmt.Errorf("The WOPI secret has not been set properly in your config for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by using 'ocis init --diff' and applying the patch or setting a value manually in "+
"(e.g. by using 'opencloud init --diff' and applying the patch or setting a value manually in "+
"the config/corresponding environment variable).",
service, defaults.BaseConfigPath())
}

View File

@@ -47,14 +47,14 @@ func Validate(cfg *config.Config) error {
if err != nil {
return fmt.Errorf("The WOPI Src has not been set properly in your config for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by running ocis init or setting it manually in "+
"(e.g. by running opencloud init or setting it manually in "+
"the config/corresponding environment variable): %s",
cfg.Service.Name, ocisdefaults.BaseConfigPath(), err.Error())
}
if url.Path != "" {
return fmt.Errorf("The WOPI Src must not contain a path in your config for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by running ocis init or setting it manually in "+
"(e.g. by running opencloud init or setting it manually in "+
"the config/corresponding environment variable)",
cfg.Service.Name, ocisdefaults.BaseConfigPath())
}

View File

@@ -46,7 +46,7 @@ func Validate(cfg *config.Config) error {
if cfg.StorageRegistry.StorageUsersMountID == "" {
return fmt.Errorf("The storage users mount ID has not been configured for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by running ocis init or setting it manually in "+
"(e.g. by running opencloud init or setting it manually in "+
"the config/corresponding environment variable).",
"gateway", defaults2.BaseConfigPath())
}

View File

@@ -51,7 +51,7 @@ func Validate(cfg *config.Config) error {
if cfg.Application.ID == "" {
return fmt.Errorf("The application ID has not been configured for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by running ocis init or setting it manually in "+
"(e.g. by running opencloud init or setting it manually in "+
"the config/corresponding environment variable).",
"graph", defaults2.BaseConfigPath())
}
@@ -61,7 +61,7 @@ func Validate(cfg *config.Config) error {
default:
return fmt.Errorf("The username match validator is invalid for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by running ocis init or setting it manually in "+
"(e.g. by running opencloud init or setting it manually in "+
"the config/corresponding environment variable).",
"graph", defaults2.BaseConfigPath())
}

View File

@@ -43,7 +43,7 @@ func Validate(cfg *config.Config) error {
if cfg.MountID == "" {
return fmt.Errorf("The storage users mount ID has not been configured for %s. "+
"Make sure your %s config contains the proper values "+
"(e.g. by running ocis init or setting it manually in "+
"(e.g. by running opencloud init or setting it manually in "+
"the config/corresponding environment variable).",
"storage-users", defaults2.BaseConfigPath())
}