From e96819bce83dde85aeba7c3602bf2afb59eead38 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 4 Aug 2022 17:38:55 +0200 Subject: [PATCH 01/53] rewrite the auth middleware The old approach of the authentication middlewares had the problem that when an authenticator could not authenticate a request it would still send it to the next handler, in case that the next one can authenticate it. But if no authenticator could successfully authenticate the request, it would still be handled, which leads to unauthorized access. --- services/proxy/pkg/command/server.go | 107 ++++++---- .../proxy/pkg/middleware/authentication.go | 184 ++++++++++++----- services/proxy/pkg/middleware/basic_auth.go | 159 +++----------- .../proxy/pkg/middleware/basic_auth_test.go | 4 +- services/proxy/pkg/middleware/oidc_auth.go | 194 ++++++++---------- .../proxy/pkg/middleware/public_share_auth.go | 110 +++++----- .../proxy/pkg/middleware/signed_url_auth.go | 47 +++-- .../pkg/middleware/signed_url_auth_test.go | 12 +- 8 files changed, 423 insertions(+), 394 deletions(-) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 81342945f12..9e372e44816 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -16,9 +16,9 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/log" pkgmiddleware "github.com/owncloud/ocis/v2/ocis-pkg/middleware" "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" + "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" settingssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0" - storesvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/store/v0" "github.com/owncloud/ocis/v2/services/proxy/pkg/config" "github.com/owncloud/ocis/v2/services/proxy/pkg/config/parser" "github.com/owncloud/ocis/v2/services/proxy/pkg/cs3" @@ -149,7 +149,7 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) logger.Fatal().Msgf("Invalid accounts backend type '%s'", cfg.AccountBackend) } - storeClient := storesvc.NewStoreService("com.owncloud.api.store", grpc.DefaultClient) + // storeClient := storesvc.NewStoreService("com.owncloud.api.store", grpc.DefaultClient) if err != nil { logger.Error().Err(err). Str("gateway", cfg.Reva.Address). @@ -166,6 +166,38 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) Timeout: time.Second * 10, } + var authenticators []middleware.Authenticator + if cfg.EnableBasicAuth { + logger.Warn().Msg("basic auth enabled, use only for testing or development") + authenticators = append(authenticators, middleware.BasicAuthenticator{ + Logger: logger, + UserProvider: userProvider, + }) + } + tokenCache := sync.NewCache(cfg.OIDC.UserinfoCache.Size) + authenticators = append(authenticators, middleware.OIDCAuthenticator{ + Logger: logger, + TokenCache: &tokenCache, + TokenCacheTTL: time.Duration(cfg.OIDC.UserinfoCache.TTL), + HTTPClient: oidcHTTPClient, + OIDCIss: cfg.OIDC.Issuer, + ProviderFunc: func() (middleware.OIDCProvider, error) { + // Initialize a provider by specifying the issuer URL. + // it will fetch the keys from the issuer using the .well-known + // endpoint + return oidc.NewProvider( + context.WithValue(ctx, oauth2.HTTPClient, oidcHTTPClient), + cfg.OIDC.Issuer, + ) + }, + JWKSOptions: cfg.OIDC.JWKS, + AccessTokenVerifyMethod: cfg.OIDC.AccessTokenVerifyMethod, + }) + // authenticators = append(authenticators, middleware.PublicShareAuthenticator{ + // Logger: logger, + // RevaGatewayClient: revaClient, + // }) + return alice.New( // first make sure we log all requests and redirect to https if necessary pkgmiddleware.TraceContext, @@ -179,39 +211,44 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) oidcHTTPClient, ), - // now that we established the basics, on with authentication middleware - middleware.Authentication( - // OIDC Options - middleware.OIDCProviderFunc(func() (middleware.OIDCProvider, error) { - // Initialize a provider by specifying the issuer URL. - // it will fetch the keys from the issuer using the .well-known - // endpoint - return oidc.NewProvider( - context.WithValue(ctx, oauth2.HTTPClient, oidcHTTPClient), - cfg.OIDC.Issuer, - ) - }), - middleware.HTTPClient(oidcHTTPClient), - middleware.TokenCacheSize(cfg.OIDC.UserinfoCache.Size), - middleware.TokenCacheTTL(time.Second*time.Duration(cfg.OIDC.UserinfoCache.TTL)), - middleware.AccessTokenVerifyMethod(cfg.OIDC.AccessTokenVerifyMethod), - middleware.JWKSOptions(cfg.OIDC.JWKS), + // middleware.AuthenticationOld( + // // OIDC Options + // middleware.OIDCProviderFunc(func() (middleware.OIDCProvider, error) { + // // Initialize a provider by specifying the issuer URL. + // // it will fetch the keys from the issuer using the .well-known + // // endpoint + // return oidc.NewProvider( + // context.WithValue(ctx, oauth2.HTTPClient, oidcHTTPClient), + // cfg.OIDC.Issuer, + // ) + // }), - // basic Options - middleware.Logger(logger), - middleware.EnableBasicAuth(cfg.EnableBasicAuth), - middleware.UserProvider(userProvider), - middleware.OIDCIss(cfg.OIDC.Issuer), - middleware.UserOIDCClaim(cfg.UserOIDCClaim), - middleware.UserCS3Claim(cfg.UserCS3Claim), + middleware.Authentication( + authenticators, middleware.CredentialsByUserAgent(cfg.AuthMiddleware.CredentialsByUserAgent), - ), - middleware.SignedURLAuth( middleware.Logger(logger), - middleware.PreSignedURLConfig(cfg.PreSignedURL), - middleware.UserProvider(userProvider), - middleware.Store(storeClient), + middleware.OIDCIss(cfg.OIDC.Issuer), + middleware.EnableBasicAuth(cfg.EnableBasicAuth), ), + // middleware.HTTPClient(oidcHTTPClient), + // middleware.TokenCacheSize(cfg.OIDC.UserinfoCache.Size), + // middleware.TokenCacheTTL(time.Second*time.Duration(cfg.OIDC.UserinfoCache.TTL)), + // + // // basic Options + // middleware.Logger(logger), + // middleware.EnableBasicAuth(cfg.EnableBasicAuth), + // middleware.UserProvider(userProvider), + // middleware.OIDCIss(cfg.OIDC.Issuer), + // middleware.UserOIDCClaim(cfg.UserOIDCClaim), + // middleware.UserCS3Claim(cfg.UserCS3Claim), + // middleware.CredentialsByUserAgent(cfg.AuthMiddleware.CredentialsByUserAgent), + // ), + // middleware.SignedURLAuth( + // middleware.Logger(logger), + // middleware.PreSignedURLConfig(cfg.PreSignedURL), + // middleware.UserProvider(userProvider), + // middleware.Store(storeClient), + // ), middleware.AccountResolver( middleware.Logger(logger), middleware.UserProvider(userProvider), @@ -233,9 +270,9 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) middleware.TokenManagerConfig(*cfg.TokenManager), middleware.RevaGatewayClient(revaClient), ), - middleware.PublicShareAuth( - middleware.Logger(logger), - middleware.RevaGatewayClient(revaClient), - ), + // middleware.PublicShareAuth( + // middleware.Logger(logger), + // middleware.RevaGatewayClient(revaClient), + // ), ) } diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 15fa4ec4299..651876f35f4 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -5,6 +5,8 @@ import ( "net/http" "regexp" "strings" + + "github.com/owncloud/ocis/v2/services/proxy/pkg/webdav" ) var ( @@ -12,48 +14,97 @@ var ( SupportedAuthStrategies []string // ProxyWwwAuthenticate is a list of endpoints that do not rely on reva underlying authentication, such as ocs. - // services that fallback to reva authentication are declared in the "frontend" command on oCIS. It is a list of strings - // to be regexp compiled. - ProxyWwwAuthenticate = []string{"/ocs/v[12].php/cloud/"} + // services that fallback to reva authentication are declared in the "frontend" command on oCIS. It is a list of + // regexp.Regexp which are safe to use concurrently. + ProxyWwwAuthenticate = []regexp.Regexp{*regexp.MustCompile("/ocs/v[12].php/cloud/")} - // WWWAuthenticate captures the Www-Authenticate header string. - WWWAuthenticate = "Www-Authenticate" + _publicPaths = []string{ + "/dav/public-files/", + "/remote.php/dav/public-files/", + "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", + "/ocs/v1.php/cloud/capabilities", + "/data", + } ) -// userAgentLocker aids in dependency injection for helper methods. The set of fields is arbitrary and the only relation -// they share is to fulfill their duty and lock a User-Agent to its correct challenge if configured. -type userAgentLocker struct { - w http.ResponseWriter - r *http.Request - locks map[string]string // locks represents a reva user-agent:challenge mapping. - fallback string +const ( + // WwwAuthenticate captures the Www-Authenticate header string. + WwwAuthenticate = "Www-Authenticate" +) + +// Authenticator is the common interface implemented by all request authenticators. +// The Authenticator may augment the request with user info or anything related to the +// authentication and return the augmented request. +type Authenticator interface { + Authenticate(*http.Request) (*http.Request, bool) } // Authentication is a higher order authentication middleware. -func Authentication(opts ...Option) func(next http.Handler) http.Handler { +func Authentication(auths []Authenticator, opts ...Option) func(next http.Handler) http.Handler { options := newOptions(opts...) - configureSupportedChallenges(options) - oidc := newOIDCAuth(options) - basic := newBasicAuth(options) return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if options.OIDCIss != "" && options.EnableBasicAuth { - oidc(basic(next)).ServeHTTP(w, r) + if isOIDCTokenAuth(r) || + r.URL.Path == "/" || + strings.HasPrefix(r.URL.Path, "/.well-known") || + r.URL.Path == "/login" || + strings.HasPrefix(r.URL.Path, "/js") || + strings.HasPrefix(r.URL.Path, "/themes") || + strings.HasPrefix(r.URL.Path, "/signin") || + strings.HasPrefix(r.URL.Path, "/konnect") || + r.URL.Path == "/config.json" || + r.URL.Path == "/oidc-callback.html" || + r.URL.Path == "/oidc-callback" || + r.URL.Path == "/settings.js" { + // The authentication for this request is handled by the IdP. + next.ServeHTTP(w, r) + return } - if options.OIDCIss != "" && !options.EnableBasicAuth { - oidc(next).ServeHTTP(w, r) + for _, a := range auths { + if req, ok := a.Authenticate(r); ok { + next.ServeHTTP(w, req) + return + } } + if !isPublicPath(r.URL.Path) { + for _, s := range SupportedAuthStrategies { + userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, s) + } + } + w.WriteHeader(http.StatusUnauthorized) + // if the request is a PROPFIND return a WebDAV error code. + // TODO: The proxy has to be smart enough to detect when a request is directed towards a webdav server + // and react accordingly. + if webdav.IsWebdavRequest(r) { + b, err := webdav.Marshal(webdav.Exception{ + Code: webdav.SabredavPermissionDenied, + Message: "Authentication error", + }) - if options.OIDCIss == "" && options.EnableBasicAuth { - basic(next).ServeHTTP(w, r) + webdav.HandleWebdavError(w, b, err) } }) } } +// The token auth endpoint uses basic auth for clients, see https://openid.net/specs/openid-connect-basic-1_0.html#TokenRequest +// > The Client MUST authenticate to the Token Endpoint using the HTTP Basic method, as described in 2.3.1 of OAuth 2.0. +func isOIDCTokenAuth(req *http.Request) bool { + return req.URL.Path == "/konnect/v1/token" +} + +func isPublicPath(p string) bool { + for _, pp := range _publicPaths { + if strings.HasPrefix(p, pp) { + return true + } + } + return false +} + // configureSupportedChallenges adds known authentication challenges to the current session. func configureSupportedChallenges(options Options) { if options.OIDCIss != "" { @@ -66,13 +117,22 @@ func configureSupportedChallenges(options Options) { } func writeSupportedAuthenticateHeader(w http.ResponseWriter, r *http.Request) { - for i := 0; i < len(SupportedAuthStrategies); i++ { - w.Header().Add(WWWAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(SupportedAuthStrategies[i]), r.Host)) + for _, s := range SupportedAuthStrategies { + w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(s), r.Host)) } } func removeSuperfluousAuthenticate(w http.ResponseWriter) { - w.Header().Del(WWWAuthenticate) + w.Header().Del(WwwAuthenticate) +} + +// userAgentLocker aids in dependency injection for helper methods. The set of fields is arbitrary and the only relation +// they share is to fulfill their duty and lock a User-Agent to its correct challenge if configured. +type userAgentLocker struct { + w http.ResponseWriter + r *http.Request + locks map[string]string // locks represents a reva user-agent:challenge mapping. + fallback string } // userAgentAuthenticateLockIn sets Www-Authenticate according to configured user agents. This is useful for the case of @@ -86,22 +146,48 @@ func userAgentAuthenticateLockIn(w http.ResponseWriter, r *http.Request, locks m fallback: fallback, } - for i := 0; i < len(ProxyWwwAuthenticate); i++ { - evalRequestURI(&u, i) + for _, r := range ProxyWwwAuthenticate { + evalRequestURI(u, r) } } -func evalRequestURI(l *userAgentLocker, i int) { - r := regexp.MustCompile(ProxyWwwAuthenticate[i]) - if r.Match([]byte(l.r.RequestURI)) { - for k, v := range l.locks { - if strings.Contains(k, l.r.UserAgent()) { - removeSuperfluousAuthenticate(l.w) - l.w.Header().Add(WWWAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), l.r.Host)) - return - } +func evalRequestURI(l userAgentLocker, r regexp.Regexp) { + if !r.MatchString(l.r.RequestURI) { + return + } + for k, v := range l.locks { + if strings.Contains(k, l.r.UserAgent()) { + removeSuperfluousAuthenticate(l.w) + l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), l.r.Host)) + return } - l.w.Header().Add(WWWAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(l.fallback), l.r.Host)) + } + l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(l.fallback), l.r.Host)) +} + +// AuthenticationOld is a higher order authentication middleware. +func AuthenticationOld(opts ...Option) func(next http.Handler) http.Handler { + options := newOptions(opts...) + + configureSupportedChallenges(options) + oidc := newOIDCAuth(options) + // basic := newBasicAuth(options) + + return func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if options.OIDCIss != "" && options.EnableBasicAuth { + //oidc(basic(next)).ServeHTTP(w, r) + oidc(next).ServeHTTP(w, r) + } + + if options.OIDCIss != "" && !options.EnableBasicAuth { + oidc(next).ServeHTTP(w, r) + } + + // if options.OIDCIss == "" && options.EnableBasicAuth { + // basic(next).ServeHTTP(w, r) + // } + }) } } @@ -120,15 +206,15 @@ func newOIDCAuth(options Options) func(http.Handler) http.Handler { ) } -// newBasicAuth returns a configured basic middleware -func newBasicAuth(options Options) func(http.Handler) http.Handler { - return BasicAuth( - UserProvider(options.UserProvider), - Logger(options.Logger), - EnableBasicAuth(options.EnableBasicAuth), - OIDCIss(options.OIDCIss), - UserOIDCClaim(options.UserOIDCClaim), - UserCS3Claim(options.UserCS3Claim), - CredentialsByUserAgent(options.CredentialsByUserAgent), - ) -} +// // newBasicAuth returns a configured basic middleware +// func newBasicAuth(options Options) func(http.Handler) http.Handler { +// return BasicAuth( +// UserProvider(options.UserProvider), +// Logger(options.Logger), +// EnableBasicAuth(options.EnableBasicAuth), +// OIDCIss(options.OIDCIss), +// UserOIDCClaim(options.UserOIDCClaim), +// UserCS3Claim(options.UserCS3Claim), +// CredentialsByUserAgent(options.CredentialsByUserAgent), +// ) +// } diff --git a/services/proxy/pkg/middleware/basic_auth.go b/services/proxy/pkg/middleware/basic_auth.go index b7d480d87bc..4771e57f217 100644 --- a/services/proxy/pkg/middleware/basic_auth.go +++ b/services/proxy/pkg/middleware/basic_auth.go @@ -1,145 +1,52 @@ package middleware import ( - "fmt" "net/http" - "strings" "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/ocis-pkg/oidc" "github.com/owncloud/ocis/v2/services/proxy/pkg/user/backend" - "github.com/owncloud/ocis/v2/services/proxy/pkg/webdav" ) -// BasicAuth provides a middleware to check if BasicAuth is provided -func BasicAuth(optionSetters ...Option) func(next http.Handler) http.Handler { - options := newOptions(optionSetters...) - logger := options.Logger - - if options.EnableBasicAuth { - options.Logger.Warn().Msg("basic auth enabled, use only for testing or development") - } - - h := basicAuth{ - logger: logger, - enabled: options.EnableBasicAuth, - userProvider: options.UserProvider, - } - - return func(next http.Handler) http.Handler { - return http.HandlerFunc( - func(w http.ResponseWriter, req *http.Request) { - if h.isPublicLink(req) || !h.isBasicAuth(req) || h.isOIDCTokenAuth(req) { - if !h.isPublicLink(req) { - userAgentAuthenticateLockIn(w, req, options.CredentialsByUserAgent, "basic") - } - next.ServeHTTP(w, req) - return - } - - removeSuperfluousAuthenticate(w) - login, password, _ := req.BasicAuth() - user, _, err := h.userProvider.Authenticate(req.Context(), login, password) - - // touch is a user agent locking guard, when touched changes to true it indicates the User-Agent on the - // request is configured to support only one challenge, it it remains untouched, there are no considera- - // tions and we should write all available authentication challenges to the response. - touch := false - - if err != nil { - for k, v := range options.CredentialsByUserAgent { - if strings.Contains(k, req.UserAgent()) { - removeSuperfluousAuthenticate(w) - w.Header().Add("Www-Authenticate", fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), req.Host)) - touch = true - break - } - } - - // if the request is not bound to any user agent, write all available challenges - if !touch { - writeSupportedAuthenticateHeader(w, req) - } - - // if the request is a PROPFIND return a WebDAV error code. - // TODO: The proxy has to be smart enough to detect when a request is directed towards a webdav server - // and react accordingly. - - w.WriteHeader(http.StatusUnauthorized) - - if webdav.IsWebdavRequest(req) { - b, err := webdav.Marshal(webdav.Exception{ - Code: webdav.SabredavPermissionDenied, - Message: "Authentication error", - }) - - webdav.HandleWebdavError(w, b, err) - return - } - - return - } - - // fake oidc claims - claims := map[string]interface{}{ - oidc.Iss: user.Id.Idp, - oidc.PreferredUsername: user.Username, - oidc.Email: user.Mail, - oidc.OwncloudUUID: user.Id.OpaqueId, - } - - if options.UserCS3Claim == "userid" { - // set the custom user claim only if users will be looked up by the userid on the CS3api - // OpaqueId contains the userid configured in STORAGE_LDAP_USER_SCHEMA_UID - claims[options.UserOIDCClaim] = user.Id.OpaqueId - - } - - next.ServeHTTP(w, req.WithContext(oidc.NewContext(req.Context(), claims))) - }, - ) - } +type BasicAuthenticator struct { + Logger log.Logger + UserProvider backend.UserBackend + UserCS3Claim string + UserOIDCClaim string } -type basicAuth struct { - logger log.Logger - enabled bool - userProvider backend.UserBackend -} - -func (m basicAuth) isPublicLink(req *http.Request) bool { - login, _, ok := req.BasicAuth() - - if !ok || login != "public" { - return false +func (m BasicAuthenticator) Authenticate(req *http.Request) (*http.Request, bool) { + if isPublicPath(req.URL.Path) { + // The authentication of public path requests is handled by another authenticator. + // Since we can't guarantee the order of execution of the authenticators, we better + // implement an early return here for paths we can't authenticate in this authenticator. + return nil, false } - publicPaths := []string{ - "/dav/public-files/", - "/remote.php/dav/public-files/", - "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", - "/ocs/v1.php/cloud/capabilities", - "/data", - } - isPublic := false - - for _, p := range publicPaths { - if strings.HasPrefix(req.URL.Path, p) { - isPublic = true - break - } + login, password, ok := req.BasicAuth() + if !ok { + return nil, false } - return isPublic -} + user, _, err := m.UserProvider.Authenticate(req.Context(), login, password) + if err != nil { + // TODO add log line + return nil, false + } -// The token auth endpoint uses basic auth for clients, see https://openid.net/specs/openid-connect-basic-1_0.html#TokenRequest -// > The Client MUST authenticate to the Token Endpoint using the HTTP Basic method, as described in 2.3.1 of OAuth 2.0. -func (m basicAuth) isOIDCTokenAuth(req *http.Request) bool { - return req.URL.Path == "/konnect/v1/token" -} + // fake oidc claims + claims := map[string]interface{}{ + oidc.Iss: user.Id.Idp, + oidc.PreferredUsername: user.Username, + oidc.Email: user.Mail, + oidc.OwncloudUUID: user.Id.OpaqueId, + } -func (m basicAuth) isBasicAuth(req *http.Request) bool { - _, _, ok := req.BasicAuth() - return m.enabled && ok + if m.UserCS3Claim == "userid" { + // set the custom user claim only if users will be looked up by the userid on the CS3api + // OpaqueId contains the userid configured in STORAGE_LDAP_USER_SCHEMA_UID + claims[m.UserOIDCClaim] = user.Id.OpaqueId + + } + return req.WithContext(oidc.NewContext(req.Context(), claims)), true } diff --git a/services/proxy/pkg/middleware/basic_auth_test.go b/services/proxy/pkg/middleware/basic_auth_test.go index 46c7f48285e..77279d66b4c 100644 --- a/services/proxy/pkg/middleware/basic_auth_test.go +++ b/services/proxy/pkg/middleware/basic_auth_test.go @@ -23,8 +23,6 @@ func TestBasicAuth__isPublicLink(t *testing.T) { {url: "/ocs/v1.php/cloud/capabilities", username: "public", expected: true}, {url: "/ocs/v1.php/cloud/users/admin", username: "public", expected: false}, } - ba := basicAuth{} - for _, tt := range tests { req := httptest.NewRequest("", tt.url, nil) @@ -32,7 +30,7 @@ func TestBasicAuth__isPublicLink(t *testing.T) { req.SetBasicAuth(tt.username, "") } - result := ba.isPublicLink(req) + result := isPublicPath(req.URL.Path) if result != tt.expected { t.Errorf("with %s expected %t got %t", tt.url, tt.expected, result) } diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index ae3b313f086..97a71962ff4 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -25,80 +25,29 @@ type OIDCProvider interface { UserInfo(ctx context.Context, ts oauth2.TokenSource) (*gOidc.UserInfo, error) } -// OIDCAuth provides a middleware to check access secured by a static token. -func OIDCAuth(optionSetters ...Option) func(next http.Handler) http.Handler { - options := newOptions(optionSetters...) - tokenCache := osync.NewCache(options.UserinfoCacheSize) +type OIDCAuthenticator struct { + Logger log.Logger + HTTPClient *http.Client + OIDCIss string + TokenCache *osync.Cache + TokenCacheTTL time.Duration + ProviderFunc func() (OIDCProvider, error) + AccessTokenVerifyMethod string + JWKSOptions config.JWKS - h := oidcAuth{ - logger: options.Logger, - providerFunc: options.OIDCProviderFunc, - httpClient: options.HTTPClient, - oidcIss: options.OIDCIss, - tokenCache: &tokenCache, - tokenCacheTTL: options.UserinfoCacheTTL, - accessTokenVerifyMethod: options.AccessTokenVerifyMethod, - jwksOptions: options.JWKS, - jwksLock: &sync.Mutex{}, - providerLock: &sync.Mutex{}, - } + providerLock *sync.Mutex + provider OIDCProvider - return func(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - // there is no bearer token on the request, - if !h.shouldServe(req) { - // oidc supported but token not present, add header and handover to the next middleware. - userAgentAuthenticateLockIn(w, req, options.CredentialsByUserAgent, "bearer") - next.ServeHTTP(w, req) - return - } - - if h.getProvider() == nil { - w.WriteHeader(http.StatusInternalServerError) - return - } - - // Force init of jwks keyfunc if needed (contacts the .well-known and jwks endpoints on first call) - if h.accessTokenVerifyMethod == config.AccessTokenVerificationJWT && h.getKeyfunc() == nil { - w.WriteHeader(http.StatusInternalServerError) - return - } - - token := strings.TrimPrefix(req.Header.Get("Authorization"), "Bearer ") - - claims, status := h.getClaims(token, req) - if status != 0 { - w.WriteHeader(status) - return - } - - // inject claims to the request context for the account_resolver middleware. - next.ServeHTTP(w, req.WithContext(oidc.NewContext(req.Context(), claims))) - }) - } + jwksLock *sync.Mutex + JWKS *keyfunc.JWKS } -type oidcAuth struct { - logger log.Logger - provider OIDCProvider - providerLock *sync.Mutex - jwksOptions config.JWKS - jwks *keyfunc.JWKS - jwksLock *sync.Mutex - providerFunc func() (OIDCProvider, error) - httpClient *http.Client - oidcIss string - tokenCache *osync.Cache - tokenCacheTTL time.Duration - accessTokenVerifyMethod string -} - -func (m oidcAuth) getClaims(token string, req *http.Request) (claims map[string]interface{}, status int) { - hit := m.tokenCache.Load(token) +func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (claims map[string]interface{}, status int) { + hit := m.TokenCache.Load(token) if hit == nil { aClaims, err := m.verifyAccessToken(token) if err != nil { - m.logger.Error().Err(err).Msg("Failed to verify access token") + m.Logger.Error().Err(err).Msg("Failed to verify access token") status = http.StatusUnauthorized return } @@ -108,25 +57,25 @@ func (m oidcAuth) getClaims(token string, req *http.Request) (claims map[string] } userInfo, err := m.getProvider().UserInfo( - context.WithValue(req.Context(), oauth2.HTTPClient, m.httpClient), + context.WithValue(req.Context(), oauth2.HTTPClient, m.HTTPClient), oauth2.StaticTokenSource(oauth2Token), ) if err != nil { - m.logger.Error().Err(err).Msg("Failed to get userinfo") + m.Logger.Error().Err(err).Msg("Failed to get userinfo") status = http.StatusUnauthorized return } if err := userInfo.Claims(&claims); err != nil { - m.logger.Error().Err(err).Interface("userinfo", userInfo).Msg("failed to unmarshal userinfo claims") + m.Logger.Error().Err(err).Interface("userinfo", userInfo).Msg("failed to unmarshal userinfo claims") status = http.StatusInternalServerError return } expiration := m.extractExpiration(aClaims) - m.tokenCache.Store(token, claims, expiration) + m.TokenCache.Store(token, claims, expiration) - m.logger.Debug().Interface("claims", claims).Interface("userInfo", userInfo).Time("expiration", expiration.UTC()).Msg("unmarshalled and cached userinfo") + m.Logger.Debug().Interface("claims", claims).Interface("userInfo", userInfo).Time("expiration", expiration.UTC()).Msg("unmarshalled and cached userinfo") return } @@ -135,25 +84,25 @@ func (m oidcAuth) getClaims(token string, req *http.Request) (claims map[string] status = http.StatusInternalServerError return } - m.logger.Debug().Interface("claims", claims).Msg("cache hit for userinfo") + m.Logger.Debug().Interface("claims", claims).Msg("cache hit for userinfo") return } -func (m oidcAuth) verifyAccessToken(token string) (jwt.RegisteredClaims, error) { - switch m.accessTokenVerifyMethod { +func (m OIDCAuthenticator) verifyAccessToken(token string) (jwt.RegisteredClaims, error) { + switch m.AccessTokenVerifyMethod { case config.AccessTokenVerificationJWT: return m.verifyAccessTokenJWT(token) case config.AccessTokenVerificationNone: - m.logger.Debug().Msg("Access Token verification disabled") + m.Logger.Debug().Msg("Access Token verification disabled") return jwt.RegisteredClaims{}, nil default: - m.logger.Error().Str("access_token_verify_method", m.accessTokenVerifyMethod).Msg("Unknown Access Token verification setting") + m.Logger.Error().Str("access_token_verify_method", m.AccessTokenVerifyMethod).Msg("Unknown Access Token verification setting") return jwt.RegisteredClaims{}, errors.New("Unknown Access Token Verification method") } } // verifyAccessTokenJWT tries to parse and verify the access token as a JWT. -func (m oidcAuth) verifyAccessTokenJWT(token string) (jwt.RegisteredClaims, error) { +func (m OIDCAuthenticator) verifyAccessTokenJWT(token string) (jwt.RegisteredClaims, error) { var claims jwt.RegisteredClaims jwks := m.getKeyfunc() if jwks == nil { @@ -161,13 +110,13 @@ func (m oidcAuth) verifyAccessTokenJWT(token string) (jwt.RegisteredClaims, erro } _, err := jwt.ParseWithClaims(token, &claims, jwks.Keyfunc) - m.logger.Debug().Interface("access token", &claims).Msg("parsed access token") + m.Logger.Debug().Interface("access token", &claims).Msg("parsed access token") if err != nil { - m.logger.Info().Err(err).Msg("Failed to parse/verify the access token.") + m.Logger.Info().Err(err).Msg("Failed to parse/verify the access token.") return claims, err } - if !claims.VerifyIssuer(m.oidcIss, true) { + if !claims.VerifyIssuer(m.OIDCIss, true) { vErr := jwt.ValidationError{} vErr.Inner = jwt.ErrTokenInvalidIssuer vErr.Errors |= jwt.ValidationErrorIssuer @@ -180,19 +129,19 @@ func (m oidcAuth) verifyAccessTokenJWT(token string) (jwt.RegisteredClaims, erro // extractExpiration tries to extract the expriration time from the access token // If the access token does not have an exp claim it will fallback to the configured // default expiration -func (m oidcAuth) extractExpiration(aClaims jwt.RegisteredClaims) time.Time { - defaultExpiration := time.Now().Add(m.tokenCacheTTL) +func (m OIDCAuthenticator) extractExpiration(aClaims jwt.RegisteredClaims) time.Time { + defaultExpiration := time.Now().Add(m.TokenCacheTTL) if aClaims.ExpiresAt != nil { - m.logger.Debug().Str("exp", aClaims.ExpiresAt.String()).Msg("Expiration Time from access_token") + m.Logger.Debug().Str("exp", aClaims.ExpiresAt.String()).Msg("Expiration Time from access_token") return aClaims.ExpiresAt.Time } return defaultExpiration } -func (m oidcAuth) shouldServe(req *http.Request) bool { +func (m OIDCAuthenticator) shouldServe(req *http.Request) bool { header := req.Header.Get("Authorization") - if m.oidcIss == "" { + if m.OIDCIss == "" { return false } @@ -211,58 +160,58 @@ type jwksJSON struct { JWKSURL string `json:"jwks_uri"` } -func (m *oidcAuth) getKeyfunc() *keyfunc.JWKS { +func (m *OIDCAuthenticator) getKeyfunc() *keyfunc.JWKS { m.jwksLock.Lock() defer m.jwksLock.Unlock() - if m.jwks == nil { - wellKnown := strings.TrimSuffix(m.oidcIss, "/") + "/.well-known/openid-configuration" + if m.JWKS == nil { + wellKnown := strings.TrimSuffix(m.OIDCIss, "/") + "/.well-known/openid-configuration" - resp, err := m.httpClient.Get(wellKnown) + resp, err := m.HTTPClient.Get(wellKnown) if err != nil { - m.logger.Error().Err(err).Msg("Failed to set request for .well-known/openid-configuration") + m.Logger.Error().Err(err).Msg("Failed to set request for .well-known/openid-configuration") return nil } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { - m.logger.Error().Err(err).Msg("unable to read discovery response body") + m.Logger.Error().Err(err).Msg("unable to read discovery response body") return nil } if resp.StatusCode != http.StatusOK { - m.logger.Error().Str("status", resp.Status).Str("body", string(body)).Msg("error requesting openid-configuration") + m.Logger.Error().Str("status", resp.Status).Str("body", string(body)).Msg("error requesting openid-configuration") return nil } var j jwksJSON err = json.Unmarshal(body, &j) if err != nil { - m.logger.Error().Err(err).Msg("failed to decode provider openid-configuration") + m.Logger.Error().Err(err).Msg("failed to decode provider openid-configuration") return nil } - m.logger.Debug().Str("jwks", j.JWKSURL).Msg("discovered jwks endpoint") + m.Logger.Debug().Str("jwks", j.JWKSURL).Msg("discovered jwks endpoint") options := keyfunc.Options{ - Client: m.httpClient, + Client: m.HTTPClient, RefreshErrorHandler: func(err error) { - m.logger.Error().Err(err).Msg("There was an error with the jwt.Keyfunc") + m.Logger.Error().Err(err).Msg("There was an error with the jwt.Keyfunc") }, - RefreshInterval: time.Minute * time.Duration(m.jwksOptions.RefreshInterval), - RefreshRateLimit: time.Second * time.Duration(m.jwksOptions.RefreshRateLimit), - RefreshTimeout: time.Second * time.Duration(m.jwksOptions.RefreshTimeout), - RefreshUnknownKID: m.jwksOptions.RefreshUnknownKID, + RefreshInterval: time.Minute * time.Duration(m.JWKSOptions.RefreshInterval), + RefreshRateLimit: time.Second * time.Duration(m.JWKSOptions.RefreshRateLimit), + RefreshTimeout: time.Second * time.Duration(m.JWKSOptions.RefreshTimeout), + RefreshUnknownKID: m.JWKSOptions.RefreshUnknownKID, } - m.jwks, err = keyfunc.Get(j.JWKSURL, options) + m.JWKS, err = keyfunc.Get(j.JWKSURL, options) if err != nil { - m.jwks = nil - m.logger.Error().Err(err).Msg("Failed to create JWKS from resource at the given URL.") + m.JWKS = nil + m.Logger.Error().Err(err).Msg("Failed to create JWKS from resource at the given URL.") return nil } } - return m.jwks + return m.JWKS } -func (m *oidcAuth) getProvider() OIDCProvider { +func (m *OIDCAuthenticator) getProvider() OIDCProvider { m.providerLock.Lock() defer m.providerLock.Unlock() if m.provider == nil { @@ -271,9 +220,9 @@ func (m *oidcAuth) getProvider() OIDCProvider { // provider needs to be cached as when it is created // it will fetch the keys from the issuer using the .well-known // endpoint - provider, err := m.providerFunc() + provider, err := m.ProviderFunc() if err != nil { - m.logger.Error().Err(err).Msg("could not initialize oidcAuth provider") + m.Logger.Error().Err(err).Msg("could not initialize oidcAuth provider") return nil } @@ -281,3 +230,32 @@ func (m *oidcAuth) getProvider() OIDCProvider { } return m.provider } + +func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { + // there is no bearer token on the request, + if !m.shouldServe(r) { + // // oidc supported but token not present, add header and handover to the next middleware. + // userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, "bearer") + // next.ServeHTTP(w, r) + return nil, false + } + + if m.getProvider() == nil { + // w.WriteHeader(http.StatusInternalServerError) + return nil, false + } + // Force init of jwks keyfunc if needed (contacts the .well-known and jwks endpoints on first call) + if m.AccessTokenVerifyMethod == config.AccessTokenVerificationJWT && m.getKeyfunc() == nil { + return nil, false + } + + token := strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer ") + + claims, status := m.getClaims(token, r) + if status != 0 { + // w.WriteHeader(status) + // TODO log + return nil, false + } + return r.WithContext(oidc.NewContext(r.Context(), claims)), true +} diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index 9b3ddcd5ffd..6d6d0fa747d 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -5,6 +5,7 @@ import ( "strings" gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" + "github.com/owncloud/ocis/v2/ocis-pkg/log" ) const ( @@ -14,59 +15,58 @@ const ( authenticationType = "publicshares" ) -// PublicShareAuth ... -func PublicShareAuth(opts ...Option) func(next http.Handler) http.Handler { - options := newOptions(opts...) - logger := options.Logger - - return func(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - shareToken := r.Header.Get(headerShareToken) - if shareToken == "" { - shareToken = r.URL.Query().Get(headerShareToken) - } - - // Currently we only want to authenticate app open request coming from public shares. - if shareToken == "" { - // Don't authenticate - next.ServeHTTP(w, r) - return - } - - var sharePassword string - if signature := r.URL.Query().Get("signature"); signature != "" { - expiration := r.URL.Query().Get("expiration") - if expiration == "" { - logger.Warn().Str("signature", signature).Msg("cannot do signature auth without the expiration") - next.ServeHTTP(w, r) - return - } - sharePassword = strings.Join([]string{"signature", signature, expiration}, "|") - } else { - // We can ignore the username since it is always set to "public" in public shares. - _, password, ok := r.BasicAuth() - - sharePassword = basicAuthPasswordPrefix - if ok { - sharePassword += password - } - } - - authResp, err := options.RevaGatewayClient.Authenticate(r.Context(), &gateway.AuthenticateRequest{ - Type: authenticationType, - ClientId: shareToken, - ClientSecret: sharePassword, - }) - - if err != nil { - logger.Debug().Err(err).Str("public_share_token", shareToken).Msg("could not authenticate public share") - // try another middleware - next.ServeHTTP(w, r) - return - } - - r.Header.Add(headerRevaAccessToken, authResp.Token) - next.ServeHTTP(w, r) - }) - } +type PublicShareAuthenticator struct { + Logger log.Logger + RevaGatewayClient gateway.GatewayAPIClient +} + +func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { + if !isPublicPath(r.URL.Path) { + return nil, false + } + + query := r.URL.Query() + shareToken := r.Header.Get(headerShareToken) + if shareToken == "" { + shareToken = query.Get(headerShareToken) + } + + // Currently we only want to authenticate app open request coming from public shares. + if shareToken == "" { + // Don't authenticate + return nil, false + } + + var sharePassword string + if signature := query.Get("signature"); signature != "" { + expiration := query.Get("expiration") + if expiration == "" { + a.Logger.Warn().Str("signature", signature).Msg("cannot do signature auth without the expiration") + return nil, false + } + sharePassword = strings.Join([]string{"signature", signature, expiration}, "|") + } else { + // We can ignore the username since it is always set to "public" in public shares. + _, password, ok := r.BasicAuth() + + sharePassword = basicAuthPasswordPrefix + if ok { + sharePassword += password + } + } + + authResp, err := a.RevaGatewayClient.Authenticate(r.Context(), &gateway.AuthenticateRequest{ + Type: authenticationType, + ClientId: shareToken, + ClientSecret: sharePassword, + }) + + if err != nil { + a.Logger.Debug().Err(err).Str("public_share_token", shareToken).Msg("could not authenticate public share") + // try another middleware + return nil, false + } + + r.Header.Add(headerRevaAccessToken, authResp.Token) + return r, false } diff --git a/services/proxy/pkg/middleware/signed_url_auth.go b/services/proxy/pkg/middleware/signed_url_auth.go index d71036d5a7f..094c279ad49 100644 --- a/services/proxy/pkg/middleware/signed_url_auth.go +++ b/services/proxy/pkg/middleware/signed_url_auth.go @@ -25,7 +25,7 @@ func SignedURLAuth(optionSetters ...Option) func(next http.Handler) http.Handler options := newOptions(optionSetters...) return func(next http.Handler) http.Handler { - return &signedURLAuth{ + return &SignedURLAuthenticator{ next: next, logger: options.Logger, preSignedURLConfig: options.PreSignedURLConfig, @@ -35,7 +35,7 @@ func SignedURLAuth(optionSetters ...Option) func(next http.Handler) http.Handler } } -type signedURLAuth struct { +type SignedURLAuthenticator struct { next http.Handler logger log.Logger preSignedURLConfig config.PreSignedURL @@ -43,7 +43,7 @@ type signedURLAuth struct { store storesvc.StoreService } -func (m signedURLAuth) ServeHTTP(w http.ResponseWriter, req *http.Request) { +func (m SignedURLAuthenticator) ServeHTTP(w http.ResponseWriter, req *http.Request) { if !m.shouldServe(req) { m.next.ServeHTTP(w, req) return @@ -67,14 +67,14 @@ func (m signedURLAuth) ServeHTTP(w http.ResponseWriter, req *http.Request) { m.next.ServeHTTP(w, req) } -func (m signedURLAuth) shouldServe(req *http.Request) bool { +func (m SignedURLAuthenticator) shouldServe(req *http.Request) bool { if !m.preSignedURLConfig.Enabled { return false } return req.URL.Query().Get("OC-Signature") != "" } -func (m signedURLAuth) validate(req *http.Request) (err error) { +func (m SignedURLAuthenticator) validate(req *http.Request) (err error) { query := req.URL.Query() if ok, err := m.allRequiredParametersArePresent(query); !ok { @@ -100,7 +100,7 @@ func (m signedURLAuth) validate(req *http.Request) (err error) { return nil } -func (m signedURLAuth) allRequiredParametersArePresent(query url.Values) (ok bool, err error) { +func (m SignedURLAuthenticator) allRequiredParametersArePresent(query url.Values) (ok bool, err error) { // check if required query parameters exist in given request query parameters // OC-Signature - the computed signature - server will verify the request upon this REQUIRED // OC-Credential - defines the user scope (shall we use the owncloud user id here - this might leak internal data ....) REQUIRED @@ -122,7 +122,7 @@ func (m signedURLAuth) allRequiredParametersArePresent(query url.Values) (ok boo return true, nil } -func (m signedURLAuth) requestMethodMatches(meth string, query url.Values) (ok bool, err error) { +func (m SignedURLAuthenticator) requestMethodMatches(meth string, query url.Values) (ok bool, err error) { // check if given url query parameter OC-Verb matches given request method if !strings.EqualFold(meth, query.Get("OC-Verb")) { return false, errors.New("required OC-Verb parameter did not match request method") @@ -131,7 +131,7 @@ func (m signedURLAuth) requestMethodMatches(meth string, query url.Values) (ok b return true, nil } -func (m signedURLAuth) requestMethodIsAllowed(meth string) (ok bool, err error) { +func (m SignedURLAuthenticator) requestMethodIsAllowed(meth string) (ok bool, err error) { // check if given request method is allowed methodIsAllowed := false for _, am := range m.preSignedURLConfig.AllowedHTTPMethods { @@ -147,7 +147,7 @@ func (m signedURLAuth) requestMethodIsAllowed(meth string) (ok bool, err error) return true, nil } -func (m signedURLAuth) urlIsExpired(query url.Values, now func() time.Time) (expired bool, err error) { +func (m SignedURLAuthenticator) urlIsExpired(query url.Values, now func() time.Time) (expired bool, err error) { // check if url is expired by checking if given date (OC-Date) + expires in seconds (OC-Expires) is after now validFrom, err := time.Parse(time.RFC3339, query.Get("OC-Date")) if err != nil { @@ -164,7 +164,7 @@ func (m signedURLAuth) urlIsExpired(query url.Values, now func() time.Time) (exp return !(now().After(validFrom) && now().Before(validTo)), nil } -func (m signedURLAuth) signatureIsValid(req *http.Request) (ok bool, err error) { +func (m SignedURLAuthenticator) signatureIsValid(req *http.Request) (ok bool, err error) { u := revactx.ContextMustGetUser(req.Context()) signingKey, err := m.getSigningKey(req.Context(), u.Id.OpaqueId) if err != nil { @@ -187,7 +187,7 @@ func (m signedURLAuth) signatureIsValid(req *http.Request) (ok bool, err error) return m.createSignature(url, signingKey) == signature, nil } -func (m signedURLAuth) createSignature(url string, signingKey []byte) string { +func (m SignedURLAuthenticator) createSignature(url string, signingKey []byte) string { // the oc10 signature check: $hash = \hash_pbkdf2("sha512", $url, $signingKey, 10000, 64, false); // - sets the length of the output string to 64 // - sets raw output to false -> if raw_output is FALSE length corresponds to twice the byte-length of the derived key (as every byte of the key is returned as two hexits). @@ -197,7 +197,7 @@ func (m signedURLAuth) createSignature(url string, signingKey []byte) string { return hex.EncodeToString(hash) } -func (m signedURLAuth) getSigningKey(ctx context.Context, ocisID string) ([]byte, error) { +func (m SignedURLAuthenticator) getSigningKey(ctx context.Context, ocisID string) ([]byte, error) { res, err := m.store.Read(ctx, &storesvc.ReadRequest{ Options: &storemsg.ReadOptions{ Database: "proxy", @@ -211,3 +211,26 @@ func (m signedURLAuth) getSigningKey(ctx context.Context, ocisID string) ([]byte return res.Records[0].Value, nil } + +func (m SignedURLAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { + if !m.shouldServe(r) { + return nil, false + } + + user, _, err := m.userProvider.GetUserByClaims(r.Context(), "username", r.URL.Query().Get("OC-Credential"), true) + if err != nil { + m.logger.Error().Err(err).Msg("Could not get user by claim") + return nil, false + } + + ctx := revactx.ContextSetUser(r.Context(), user) + + r = r.WithContext(ctx) + + if err := m.validate(r); err != nil { + // http.Error(w, "Invalid url signature", http.StatusUnauthorized) + return nil, false + } + + return r, true +} diff --git a/services/proxy/pkg/middleware/signed_url_auth_test.go b/services/proxy/pkg/middleware/signed_url_auth_test.go index 856fcdb0e2a..01311b731e8 100644 --- a/services/proxy/pkg/middleware/signed_url_auth_test.go +++ b/services/proxy/pkg/middleware/signed_url_auth_test.go @@ -7,7 +7,7 @@ import ( ) func TestSignedURLAuth_shouldServe(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} tests := []struct { url string enabled bool @@ -31,7 +31,7 @@ func TestSignedURLAuth_shouldServe(t *testing.T) { } func TestSignedURLAuth_allRequiredParametersPresent(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} baseURL := "https://example.com/example.jpg?" tests := []struct { params string @@ -54,7 +54,7 @@ func TestSignedURLAuth_allRequiredParametersPresent(t *testing.T) { } func TestSignedURLAuth_requestMethodMatches(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} tests := []struct { method string url string @@ -75,7 +75,7 @@ func TestSignedURLAuth_requestMethodMatches(t *testing.T) { } func TestSignedURLAuth_requestMethodIsAllowed(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} tests := []struct { method string allowed []string @@ -99,7 +99,7 @@ func TestSignedURLAuth_requestMethodIsAllowed(t *testing.T) { } func TestSignedURLAuth_urlIsExpired(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} nowFunc := func() time.Time { t, _ := time.Parse(time.RFC3339, "2020-02-02T12:30:00.000Z") return t @@ -126,7 +126,7 @@ func TestSignedURLAuth_urlIsExpired(t *testing.T) { } func TestSignedURLAuth_createSignature(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} expected := "27d2ebea381384af3179235114801dcd00f91e46f99fca72575301cf3948101d" s := pua.createSignature("something", []byte("somerandomkey")) From f35c8b9205c79470da0bdc3d7ed7188886740711 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 8 Aug 2022 15:49:22 +0200 Subject: [PATCH 02/53] clean up the authenticators middlewares --- services/proxy/pkg/command/server.go | 53 ++------- .../proxy/pkg/middleware/authentication.go | 56 +-------- services/proxy/pkg/middleware/basic_auth.go | 20 +++- services/proxy/pkg/middleware/oidc_auth.go | 63 +++++----- .../proxy/pkg/middleware/public_share_auth.go | 20 +++- .../proxy/pkg/middleware/signed_url_auth.go | 111 ++++++++---------- 6 files changed, 126 insertions(+), 197 deletions(-) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 9e372e44816..7377d958290 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -19,6 +19,7 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" settingssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0" + storesvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/store/v0" "github.com/owncloud/ocis/v2/services/proxy/pkg/config" "github.com/owncloud/ocis/v2/services/proxy/pkg/config/parser" "github.com/owncloud/ocis/v2/services/proxy/pkg/cs3" @@ -149,7 +150,7 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) logger.Fatal().Msgf("Invalid accounts backend type '%s'", cfg.AccountBackend) } - // storeClient := storesvc.NewStoreService("com.owncloud.api.store", grpc.DefaultClient) + storeClient := storesvc.NewStoreService("com.owncloud.api.store", grpc.DefaultClient) if err != nil { logger.Error().Err(err). Str("gateway", cfg.Reva.Address). @@ -193,10 +194,17 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) JWKSOptions: cfg.OIDC.JWKS, AccessTokenVerifyMethod: cfg.OIDC.AccessTokenVerifyMethod, }) - // authenticators = append(authenticators, middleware.PublicShareAuthenticator{ - // Logger: logger, - // RevaGatewayClient: revaClient, - // }) + authenticators = append(authenticators, middleware.PublicShareAuthenticator{ + Logger: logger, + RevaGatewayClient: revaClient, + }) + + authenticators = append(authenticators, middleware.SignedURLAuthenticator{ + Logger: logger, + PreSignedURLConfig: cfg.PreSignedURL, + UserProvider: userProvider, + Store: storeClient, + }) return alice.New( // first make sure we log all requests and redirect to https if necessary @@ -211,18 +219,6 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) oidcHTTPClient, ), - // middleware.AuthenticationOld( - // // OIDC Options - // middleware.OIDCProviderFunc(func() (middleware.OIDCProvider, error) { - // // Initialize a provider by specifying the issuer URL. - // // it will fetch the keys from the issuer using the .well-known - // // endpoint - // return oidc.NewProvider( - // context.WithValue(ctx, oauth2.HTTPClient, oidcHTTPClient), - // cfg.OIDC.Issuer, - // ) - // }), - middleware.Authentication( authenticators, middleware.CredentialsByUserAgent(cfg.AuthMiddleware.CredentialsByUserAgent), @@ -230,25 +226,6 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) middleware.OIDCIss(cfg.OIDC.Issuer), middleware.EnableBasicAuth(cfg.EnableBasicAuth), ), - // middleware.HTTPClient(oidcHTTPClient), - // middleware.TokenCacheSize(cfg.OIDC.UserinfoCache.Size), - // middleware.TokenCacheTTL(time.Second*time.Duration(cfg.OIDC.UserinfoCache.TTL)), - // - // // basic Options - // middleware.Logger(logger), - // middleware.EnableBasicAuth(cfg.EnableBasicAuth), - // middleware.UserProvider(userProvider), - // middleware.OIDCIss(cfg.OIDC.Issuer), - // middleware.UserOIDCClaim(cfg.UserOIDCClaim), - // middleware.UserCS3Claim(cfg.UserCS3Claim), - // middleware.CredentialsByUserAgent(cfg.AuthMiddleware.CredentialsByUserAgent), - // ), - // middleware.SignedURLAuth( - // middleware.Logger(logger), - // middleware.PreSignedURLConfig(cfg.PreSignedURL), - // middleware.UserProvider(userProvider), - // middleware.Store(storeClient), - // ), middleware.AccountResolver( middleware.Logger(logger), middleware.UserProvider(userProvider), @@ -270,9 +247,5 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) middleware.TokenManagerConfig(*cfg.TokenManager), middleware.RevaGatewayClient(revaClient), ), - // middleware.PublicShareAuth( - // middleware.Logger(logger), - // middleware.RevaGatewayClient(revaClient), - // ), ) } diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 651876f35f4..6c961657d10 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -18,7 +18,7 @@ var ( // regexp.Regexp which are safe to use concurrently. ProxyWwwAuthenticate = []regexp.Regexp{*regexp.MustCompile("/ocs/v[12].php/cloud/")} - _publicPaths = []string{ + _publicPaths = [...]string{ "/dav/public-files/", "/remote.php/dav/public-files/", "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", @@ -164,57 +164,3 @@ func evalRequestURI(l userAgentLocker, r regexp.Regexp) { } l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(l.fallback), l.r.Host)) } - -// AuthenticationOld is a higher order authentication middleware. -func AuthenticationOld(opts ...Option) func(next http.Handler) http.Handler { - options := newOptions(opts...) - - configureSupportedChallenges(options) - oidc := newOIDCAuth(options) - // basic := newBasicAuth(options) - - return func(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if options.OIDCIss != "" && options.EnableBasicAuth { - //oidc(basic(next)).ServeHTTP(w, r) - oidc(next).ServeHTTP(w, r) - } - - if options.OIDCIss != "" && !options.EnableBasicAuth { - oidc(next).ServeHTTP(w, r) - } - - // if options.OIDCIss == "" && options.EnableBasicAuth { - // basic(next).ServeHTTP(w, r) - // } - }) - } -} - -// newOIDCAuth returns a configured oidc middleware -func newOIDCAuth(options Options) func(http.Handler) http.Handler { - return OIDCAuth( - Logger(options.Logger), - OIDCProviderFunc(options.OIDCProviderFunc), - HTTPClient(options.HTTPClient), - OIDCIss(options.OIDCIss), - TokenCacheSize(options.UserinfoCacheSize), - TokenCacheTTL(options.UserinfoCacheTTL), - CredentialsByUserAgent(options.CredentialsByUserAgent), - AccessTokenVerifyMethod(options.AccessTokenVerifyMethod), - JWKSOptions(options.JWKS), - ) -} - -// // newBasicAuth returns a configured basic middleware -// func newBasicAuth(options Options) func(http.Handler) http.Handler { -// return BasicAuth( -// UserProvider(options.UserProvider), -// Logger(options.Logger), -// EnableBasicAuth(options.EnableBasicAuth), -// OIDCIss(options.OIDCIss), -// UserOIDCClaim(options.UserOIDCClaim), -// UserCS3Claim(options.UserCS3Claim), -// CredentialsByUserAgent(options.CredentialsByUserAgent), -// ) -// } diff --git a/services/proxy/pkg/middleware/basic_auth.go b/services/proxy/pkg/middleware/basic_auth.go index 4771e57f217..eaccd704254 100644 --- a/services/proxy/pkg/middleware/basic_auth.go +++ b/services/proxy/pkg/middleware/basic_auth.go @@ -15,22 +15,26 @@ type BasicAuthenticator struct { UserOIDCClaim string } -func (m BasicAuthenticator) Authenticate(req *http.Request) (*http.Request, bool) { - if isPublicPath(req.URL.Path) { +func (m BasicAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { + if isPublicPath(r.URL.Path) { // The authentication of public path requests is handled by another authenticator. // Since we can't guarantee the order of execution of the authenticators, we better // implement an early return here for paths we can't authenticate in this authenticator. return nil, false } - login, password, ok := req.BasicAuth() + login, password, ok := r.BasicAuth() if !ok { return nil, false } - user, _, err := m.UserProvider.Authenticate(req.Context(), login, password) + user, _, err := m.UserProvider.Authenticate(r.Context(), login, password) if err != nil { - // TODO add log line + m.Logger.Error(). + Err(err). + Str("authenticator", "basic"). + Str("path", r.URL.Path). + Msg("failed to authenticate request") return nil, false } @@ -48,5 +52,9 @@ func (m BasicAuthenticator) Authenticate(req *http.Request) (*http.Request, bool claims[m.UserOIDCClaim] = user.Id.OpaqueId } - return req.WithContext(oidc.NewContext(req.Context(), claims)), true + m.Logger.Debug(). + Str("authenticator", "basic"). + Str("path", r.URL.Path). + Msg("successfully authenticated request") + return r.WithContext(oidc.NewContext(r.Context(), claims)), true } diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index 97a71962ff4..5d740843d1c 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -3,7 +3,6 @@ package middleware import ( "context" "encoding/json" - "errors" "io/ioutil" "net/http" "strings" @@ -17,9 +16,20 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/oidc" osync "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/services/proxy/pkg/config" + "github.com/pkg/errors" "golang.org/x/oauth2" ) +const ( + _headerAuthorization = "Authorization" + _bearerPrefix = "Bearer " +) + +var ( + // _unauthenticatePaths contains paths which don't need to be authenticated. + _unauthenticatePaths = [...]string{"/konnect/v1/userinfo", "/status.php"} +) + // OIDCProvider used to mock the oidc provider during tests type OIDCProvider interface { UserInfo(ctx context.Context, ts oauth2.TokenSource) (*gOidc.UserInfo, error) @@ -42,14 +52,13 @@ type OIDCAuthenticator struct { JWKS *keyfunc.JWKS } -func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (claims map[string]interface{}, status int) { +func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (map[string]interface{}, error) { + var claims map[string]interface{} hit := m.TokenCache.Load(token) if hit == nil { aClaims, err := m.verifyAccessToken(token) if err != nil { - m.Logger.Error().Err(err).Msg("Failed to verify access token") - status = http.StatusUnauthorized - return + return nil, errors.Wrap(err, "failed to verify access token") } oauth2Token := &oauth2.Token{ @@ -61,31 +70,25 @@ func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (claims ma oauth2.StaticTokenSource(oauth2Token), ) if err != nil { - m.Logger.Error().Err(err).Msg("Failed to get userinfo") - status = http.StatusUnauthorized - return + return nil, errors.Wrap(err, "failed to get userinfo") } - if err := userInfo.Claims(&claims); err != nil { - m.Logger.Error().Err(err).Interface("userinfo", userInfo).Msg("failed to unmarshal userinfo claims") - status = http.StatusInternalServerError - return + return nil, errors.Wrap(err, "failed to unmarshal userinfo claims") } expiration := m.extractExpiration(aClaims) m.TokenCache.Store(token, claims, expiration) m.Logger.Debug().Interface("claims", claims).Interface("userInfo", userInfo).Time("expiration", expiration.UTC()).Msg("unmarshalled and cached userinfo") - return + return claims, nil } var ok bool if claims, ok = hit.V.(map[string]interface{}); !ok { - status = http.StatusInternalServerError - return + return nil, errors.New("failed to cast claims from the cache") } m.Logger.Debug().Interface("claims", claims).Msg("cache hit for userinfo") - return + return claims, nil } func (m OIDCAuthenticator) verifyAccessToken(token string) (jwt.RegisteredClaims, error) { @@ -139,21 +142,20 @@ func (m OIDCAuthenticator) extractExpiration(aClaims jwt.RegisteredClaims) time. } func (m OIDCAuthenticator) shouldServe(req *http.Request) bool { - header := req.Header.Get("Authorization") - if m.OIDCIss == "" { return false } // todo: looks dirty, check later // TODO: make a PR to coreos/go-oidc for exposing userinfo endpoint on provider, see https://github.com/coreos/go-oidc/issues/248 - for _, ignoringPath := range []string{"/konnect/v1/userinfo", "/status.php"} { + for _, ignoringPath := range _unauthenticatePaths { if req.URL.Path == ignoringPath { return false } } - return strings.HasPrefix(header, "Bearer ") + header := req.Header.Get(_headerAuthorization) + return strings.HasPrefix(header, _bearerPrefix) } type jwksJSON struct { @@ -234,14 +236,10 @@ func (m *OIDCAuthenticator) getProvider() OIDCProvider { func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { // there is no bearer token on the request, if !m.shouldServe(r) { - // // oidc supported but token not present, add header and handover to the next middleware. - // userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, "bearer") - // next.ServeHTTP(w, r) return nil, false } if m.getProvider() == nil { - // w.WriteHeader(http.StatusInternalServerError) return nil, false } // Force init of jwks keyfunc if needed (contacts the .well-known and jwks endpoints on first call) @@ -249,13 +247,20 @@ func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { return nil, false } - token := strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer ") + token := strings.TrimPrefix(r.Header.Get(_headerAuthorization), _bearerPrefix) - claims, status := m.getClaims(token, r) - if status != 0 { - // w.WriteHeader(status) - // TODO log + claims, err := m.getClaims(token, r) + if err != nil { + m.Logger.Error(). + Err(err). + Str("authenticator", "oidc"). + Str("path", r.URL.Path). + Msg("failed to authenticate the request") return nil, false } + m.Logger.Debug(). + Str("authenticator", "oidc"). + Str("path", r.URL.Path). + Msg("successfully authenticated request") return r.WithContext(oidc.NewContext(r.Context(), claims)), true } diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index 6d6d0fa747d..795063d5d00 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -13,6 +13,9 @@ const ( headerShareToken = "public-token" basicAuthPasswordPrefix = "password|" authenticationType = "publicshares" + + _paramSignature = "signature" + _paramExpiration = "expiration" ) type PublicShareAuthenticator struct { @@ -38,8 +41,8 @@ func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, } var sharePassword string - if signature := query.Get("signature"); signature != "" { - expiration := query.Get("expiration") + if signature := query.Get(_paramSignature); signature != "" { + expiration := query.Get(_paramExpiration) if expiration == "" { a.Logger.Warn().Str("signature", signature).Msg("cannot do signature auth without the expiration") return nil, false @@ -62,11 +65,20 @@ func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, }) if err != nil { - a.Logger.Debug().Err(err).Str("public_share_token", shareToken).Msg("could not authenticate public share") - // try another middleware + a.Logger.Error(). + Err(err). + Str("authenticator", "public_share"). + Str("public_share_token", shareToken). + Str("path", r.URL.Path). + Msg("failed to authenticate request") return nil, false } r.Header.Add(headerRevaAccessToken, authResp.Token) + + a.Logger.Debug(). + Str("authenticator", "public_share"). + Str("path", r.URL.Path). + Msg("successfully authenticated request") return r, false } diff --git a/services/proxy/pkg/middleware/signed_url_auth.go b/services/proxy/pkg/middleware/signed_url_auth.go index 094c279ad49..80a613aace9 100644 --- a/services/proxy/pkg/middleware/signed_url_auth.go +++ b/services/proxy/pkg/middleware/signed_url_auth.go @@ -20,58 +20,36 @@ import ( "golang.org/x/crypto/pbkdf2" ) -// SignedURLAuth provides a middleware to check access secured by a signed URL. -func SignedURLAuth(optionSetters ...Option) func(next http.Handler) http.Handler { - options := newOptions(optionSetters...) +const ( + _paramOCSignature = "OC-Signature" + _paramOCCredential = "OC-Credential" + _paramOCDate = "OC-Date" + _paramOCExpires = "OC-Expires" + _paramOCVerb = "OC-Verb" +) - return func(next http.Handler) http.Handler { - return &SignedURLAuthenticator{ - next: next, - logger: options.Logger, - preSignedURLConfig: options.PreSignedURLConfig, - store: options.Store, - userProvider: options.UserProvider, - } +var ( + _requiredParams = [...]string{ + _paramOCSignature, + _paramOCCredential, + _paramOCDate, + _paramOCExpires, + _paramOCVerb, } -} +) type SignedURLAuthenticator struct { - next http.Handler - logger log.Logger - preSignedURLConfig config.PreSignedURL - userProvider backend.UserBackend - store storesvc.StoreService -} - -func (m SignedURLAuthenticator) ServeHTTP(w http.ResponseWriter, req *http.Request) { - if !m.shouldServe(req) { - m.next.ServeHTTP(w, req) - return - } - - user, _, err := m.userProvider.GetUserByClaims(req.Context(), "username", req.URL.Query().Get("OC-Credential"), true) - if err != nil { - m.logger.Error().Err(err).Msg("Could not get user by claim") - w.WriteHeader(http.StatusInternalServerError) - } - - ctx := revactx.ContextSetUser(req.Context(), user) - - req = req.WithContext(ctx) - - if err := m.validate(req); err != nil { - http.Error(w, "Invalid url signature", http.StatusUnauthorized) - return - } - - m.next.ServeHTTP(w, req) + Logger log.Logger + PreSignedURLConfig config.PreSignedURL + UserProvider backend.UserBackend + Store storesvc.StoreService } func (m SignedURLAuthenticator) shouldServe(req *http.Request) bool { - if !m.preSignedURLConfig.Enabled { + if !m.PreSignedURLConfig.Enabled { return false } - return req.URL.Query().Get("OC-Signature") != "" + return req.URL.Query().Get(_paramOCSignature) != "" } func (m SignedURLAuthenticator) validate(req *http.Request) (err error) { @@ -107,13 +85,7 @@ func (m SignedURLAuthenticator) allRequiredParametersArePresent(query url.Values // OC-Date - defined the date the url was signed (ISO 8601 UTC) REQUIRED // OC-Expires - defines the expiry interval in seconds (between 1 and 604800 = 7 days) REQUIRED // TODO OC-Verb - defines for which http verb the request is valid - defaults to GET OPTIONAL - for _, p := range []string{ - "OC-Signature", - "OC-Credential", - "OC-Date", - "OC-Expires", - "OC-Verb", - } { + for _, p := range _requiredParams { if query.Get(p) == "" { return false, fmt.Errorf("required %s parameter not found", p) } @@ -124,7 +96,7 @@ func (m SignedURLAuthenticator) allRequiredParametersArePresent(query url.Values func (m SignedURLAuthenticator) requestMethodMatches(meth string, query url.Values) (ok bool, err error) { // check if given url query parameter OC-Verb matches given request method - if !strings.EqualFold(meth, query.Get("OC-Verb")) { + if !strings.EqualFold(meth, query.Get(_paramOCVerb)) { return false, errors.New("required OC-Verb parameter did not match request method") } @@ -134,7 +106,7 @@ func (m SignedURLAuthenticator) requestMethodMatches(meth string, query url.Valu func (m SignedURLAuthenticator) requestMethodIsAllowed(meth string) (ok bool, err error) { // check if given request method is allowed methodIsAllowed := false - for _, am := range m.preSignedURLConfig.AllowedHTTPMethods { + for _, am := range m.PreSignedURLConfig.AllowedHTTPMethods { if strings.EqualFold(meth, am) { methodIsAllowed = true break @@ -147,14 +119,15 @@ func (m SignedURLAuthenticator) requestMethodIsAllowed(meth string) (ok bool, er return true, nil } + func (m SignedURLAuthenticator) urlIsExpired(query url.Values, now func() time.Time) (expired bool, err error) { // check if url is expired by checking if given date (OC-Date) + expires in seconds (OC-Expires) is after now - validFrom, err := time.Parse(time.RFC3339, query.Get("OC-Date")) + validFrom, err := time.Parse(time.RFC3339, query.Get(_paramOCDate)) if err != nil { return true, err } - requestExpiry, err := time.ParseDuration(query.Get("OC-Expires") + "s") + requestExpiry, err := time.ParseDuration(query.Get(_paramOCExpires) + "s") if err != nil { return true, err } @@ -168,16 +141,16 @@ func (m SignedURLAuthenticator) signatureIsValid(req *http.Request) (ok bool, er u := revactx.ContextMustGetUser(req.Context()) signingKey, err := m.getSigningKey(req.Context(), u.Id.OpaqueId) if err != nil { - m.logger.Error().Err(err).Msg("could not retrieve signing key") + m.Logger.Error().Err(err).Msg("could not retrieve signing key") return false, err } if len(signingKey) == 0 { - m.logger.Error().Err(err).Msg("signing key empty") + m.Logger.Error().Err(err).Msg("signing key empty") return false, err } q := req.URL.Query() - signature := q.Get("OC-Signature") - q.Del("OC-Signature") + signature := q.Get(_paramOCSignature) + q.Del(_paramOCSignature) req.URL.RawQuery = q.Encode() url := req.URL.String() if !req.URL.IsAbs() { @@ -198,7 +171,7 @@ func (m SignedURLAuthenticator) createSignature(url string, signingKey []byte) s } func (m SignedURLAuthenticator) getSigningKey(ctx context.Context, ocisID string) ([]byte, error) { - res, err := m.store.Read(ctx, &storesvc.ReadRequest{ + res, err := m.Store.Read(ctx, &storesvc.ReadRequest{ Options: &storemsg.ReadOptions{ Database: "proxy", Table: "signing-keys", @@ -206,7 +179,7 @@ func (m SignedURLAuthenticator) getSigningKey(ctx context.Context, ocisID string Key: ocisID, }) if err != nil || len(res.Records) < 1 { - return []byte{}, err + return nil, err } return res.Records[0].Value, nil @@ -217,9 +190,13 @@ func (m SignedURLAuthenticator) Authenticate(r *http.Request) (*http.Request, bo return nil, false } - user, _, err := m.userProvider.GetUserByClaims(r.Context(), "username", r.URL.Query().Get("OC-Credential"), true) + user, _, err := m.UserProvider.GetUserByClaims(r.Context(), "username", r.URL.Query().Get(_paramOCCredential), true) if err != nil { - m.logger.Error().Err(err).Msg("Could not get user by claim") + m.Logger.Error(). + Err(err). + Str("authenticator", "signed_url"). + Str("path", r.URL.Path). + Msg("Could not get user by claim") return nil, false } @@ -228,9 +205,17 @@ func (m SignedURLAuthenticator) Authenticate(r *http.Request) (*http.Request, bo r = r.WithContext(ctx) if err := m.validate(r); err != nil { - // http.Error(w, "Invalid url signature", http.StatusUnauthorized) + m.Logger.Error(). + Err(err). + Str("authenticator", "signed_url"). + Str("path", r.URL.Path). + Msg("Could not get user by claim") return nil, false } + m.Logger.Debug(). + Str("authenticator", "signed_url"). + Str("path", r.URL.Path). + Msg("successfully authenticated request") return r, true } From ddfc01bff9242db5042f751ee91ef41d8cbfb5ad Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 8 Aug 2022 16:59:05 +0200 Subject: [PATCH 03/53] refactor unprotected paths check --- .../proxy/pkg/middleware/authentication.go | 51 ++++++++++++++----- services/proxy/pkg/middleware/oidc_auth.go | 13 ----- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 6c961657d10..887e116be2f 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -23,7 +23,31 @@ var ( "/remote.php/dav/public-files/", "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", "/ocs/v1.php/cloud/capabilities", - "/data", + } + // _unprotectedPaths contains paths which don't need to be authenticated. + _unprotectedPaths = map[string]struct{}{ + "/": {}, + "/login": {}, + "/app/list": {}, + "/config.json": {}, + "/oidc-callback.html": {}, + "/oidc-callback": {}, + "/settings.js": {}, + "/data": {}, + "/konnect/v1/userinfo": {}, + "/status.php": {}, + } + // _unprotectedPathPrefixes contains paths which don't need to be authenticated. + _unprotectedPathPrefixes = [...]string{ + "/files", + "/settings", + "/user-management", + "/.well-known", + "/js", + "/icons", + "/themes", + "/signin", + "/konnect", } ) @@ -46,18 +70,7 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if isOIDCTokenAuth(r) || - r.URL.Path == "/" || - strings.HasPrefix(r.URL.Path, "/.well-known") || - r.URL.Path == "/login" || - strings.HasPrefix(r.URL.Path, "/js") || - strings.HasPrefix(r.URL.Path, "/themes") || - strings.HasPrefix(r.URL.Path, "/signin") || - strings.HasPrefix(r.URL.Path, "/konnect") || - r.URL.Path == "/config.json" || - r.URL.Path == "/oidc-callback.html" || - r.URL.Path == "/oidc-callback" || - r.URL.Path == "/settings.js" { + if isOIDCTokenAuth(r) || isUnprotectedPath(r) { // The authentication for this request is handled by the IdP. next.ServeHTTP(w, r) return @@ -96,6 +109,18 @@ func isOIDCTokenAuth(req *http.Request) bool { return req.URL.Path == "/konnect/v1/token" } +func isUnprotectedPath(r *http.Request) bool { + if _, ok := _unprotectedPaths[r.URL.Path]; ok { + return true + } + for _, p := range _unprotectedPathPrefixes { + if strings.HasPrefix(r.URL.Path, p) { + return true + } + } + return false +} + func isPublicPath(p string) bool { for _, pp := range _publicPaths { if strings.HasPrefix(p, pp) { diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index 5d740843d1c..a6c1b5519d1 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -25,11 +25,6 @@ const ( _bearerPrefix = "Bearer " ) -var ( - // _unauthenticatePaths contains paths which don't need to be authenticated. - _unauthenticatePaths = [...]string{"/konnect/v1/userinfo", "/status.php"} -) - // OIDCProvider used to mock the oidc provider during tests type OIDCProvider interface { UserInfo(ctx context.Context, ts oauth2.TokenSource) (*gOidc.UserInfo, error) @@ -146,14 +141,6 @@ func (m OIDCAuthenticator) shouldServe(req *http.Request) bool { return false } - // todo: looks dirty, check later - // TODO: make a PR to coreos/go-oidc for exposing userinfo endpoint on provider, see https://github.com/coreos/go-oidc/issues/248 - for _, ignoringPath := range _unauthenticatePaths { - if req.URL.Path == ignoringPath { - return false - } - } - header := req.Header.Get(_headerAuthorization) return strings.HasPrefix(header, _bearerPrefix) } From ef020920e8155d442b5c538ab10a296d4c08da74 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 8 Aug 2022 17:23:47 +0200 Subject: [PATCH 04/53] update authentication tests --- .../pkg/middleware/authentication_test.go | 19 ++++++++++ .../proxy/pkg/middleware/basic_auth_test.go | 38 ------------------- .../pkg/middleware/signed_url_auth_test.go | 4 +- 3 files changed, 21 insertions(+), 40 deletions(-) create mode 100644 services/proxy/pkg/middleware/authentication_test.go delete mode 100644 services/proxy/pkg/middleware/basic_auth_test.go diff --git a/services/proxy/pkg/middleware/authentication_test.go b/services/proxy/pkg/middleware/authentication_test.go new file mode 100644 index 00000000000..1188fefa343 --- /dev/null +++ b/services/proxy/pkg/middleware/authentication_test.go @@ -0,0 +1,19 @@ +package middleware + +import ( + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("authentication helpers", func() { + DescribeTable("isPublicPath should recognize public paths", + func(input string, expected bool) { + isPublic := isPublicPath(input) + Expect(isPublic).To(Equal(expected)) + }, + Entry("public files path", "/remote.php/dav/public-files/", true), + Entry("public files path without remote.php", "/remote.php/dav/public-files/", true), + Entry("token info path", "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", true), + Entry("capabilities", "/ocs/v1.php/cloud/capabilities", true), + ) +}) diff --git a/services/proxy/pkg/middleware/basic_auth_test.go b/services/proxy/pkg/middleware/basic_auth_test.go deleted file mode 100644 index 77279d66b4c..00000000000 --- a/services/proxy/pkg/middleware/basic_auth_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package middleware - -import ( - "net/http/httptest" - "testing" -) - -/**/ - -func TestBasicAuth__isPublicLink(t *testing.T) { - tests := []struct { - url string - username string - expected bool - }{ - {url: "/remote.php/dav/public-files/", username: "", expected: false}, - {url: "/remote.php/dav/public-files/", username: "abc", expected: false}, - {url: "/remote.php/dav/public-files/", username: "private", expected: false}, - {url: "/remote.php/dav/public-files/", username: "public", expected: true}, - {url: "/ocs/v1.php/cloud/capabilities", username: "", expected: false}, - {url: "/ocs/v1.php/cloud/capabilities", username: "abc", expected: false}, - {url: "/ocs/v1.php/cloud/capabilities", username: "private", expected: false}, - {url: "/ocs/v1.php/cloud/capabilities", username: "public", expected: true}, - {url: "/ocs/v1.php/cloud/users/admin", username: "public", expected: false}, - } - for _, tt := range tests { - req := httptest.NewRequest("", tt.url, nil) - - if tt.username != "" { - req.SetBasicAuth(tt.username, "") - } - - result := isPublicPath(req.URL.Path) - if result != tt.expected { - t.Errorf("with %s expected %t got %t", tt.url, tt.expected, result) - } - } -} diff --git a/services/proxy/pkg/middleware/signed_url_auth_test.go b/services/proxy/pkg/middleware/signed_url_auth_test.go index 01311b731e8..35f84e66559 100644 --- a/services/proxy/pkg/middleware/signed_url_auth_test.go +++ b/services/proxy/pkg/middleware/signed_url_auth_test.go @@ -20,7 +20,7 @@ func TestSignedURLAuth_shouldServe(t *testing.T) { } for _, tt := range tests { - pua.preSignedURLConfig.Enabled = tt.enabled + pua.PreSignedURLConfig.Enabled = tt.enabled r := httptest.NewRequest("", tt.url, nil) result := pua.shouldServe(r) @@ -89,7 +89,7 @@ func TestSignedURLAuth_requestMethodIsAllowed(t *testing.T) { } for _, tt := range tests { - pua.preSignedURLConfig.AllowedHTTPMethods = tt.allowed + pua.PreSignedURLConfig.AllowedHTTPMethods = tt.allowed ok, _ := pua.requestMethodIsAllowed(tt.method) if ok != tt.expected { From 7bc1305cb4a5f0de769d0c357328174e071a144a Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 9 Aug 2022 15:32:35 +0200 Subject: [PATCH 05/53] add tests for the basic auth middleware --- .../proxy/pkg/middleware/basic_auth_test.go | 68 +++++++++++++++++++ .../pkg/middleware/middleware_suite_test.go | 13 ++++ .../proxy/pkg/middleware/oidc_auth_test.go | 36 ++++------ 3 files changed, 95 insertions(+), 22 deletions(-) create mode 100644 services/proxy/pkg/middleware/basic_auth_test.go create mode 100644 services/proxy/pkg/middleware/middleware_suite_test.go diff --git a/services/proxy/pkg/middleware/basic_auth_test.go b/services/proxy/pkg/middleware/basic_auth_test.go new file mode 100644 index 00000000000..fcc2e6f3ce0 --- /dev/null +++ b/services/proxy/pkg/middleware/basic_auth_test.go @@ -0,0 +1,68 @@ +package middleware + +import ( + "context" + "net/http" + "net/http/httptest" + + userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" + . "github.com/onsi/ginkgo/v2" + + . "github.com/onsi/gomega" + "github.com/owncloud/ocis/v2/ocis-pkg/log" + "github.com/owncloud/ocis/v2/ocis-pkg/oidc" + "github.com/owncloud/ocis/v2/services/proxy/pkg/user/backend" + "github.com/owncloud/ocis/v2/services/proxy/pkg/user/backend/test" +) + +var _ = Describe("Authenticating requests", Label("BasicAuthenticator"), func() { + var authenticator Authenticator + BeforeEach(func() { + authenticator = BasicAuthenticator{ + Logger: log.NewLogger(), + UserProvider: &test.UserBackendMock{ + AuthenticateFunc: func(ctx context.Context, username, password string) (*userv1beta1.User, string, error) { + var user *userv1beta1.User + if username == "testuser" && password == "testpassword" { + user = &userv1beta1.User{ + Id: &userv1beta1.UserId{ + Idp: "IdpId", + OpaqueId: "OpaqueId", + }, + Username: "testuser", + Mail: "testuser@example.com", + } + return user, "", nil + } + return nil, "", backend.ErrAccountNotFound + }, + }, + } + }) + + When("the request contains correct data", func() { + It("should successfully authenticate", func() { + req := httptest.NewRequest(http.MethodGet, "http://example.com/example/path", http.NoBody) + req.SetBasicAuth("testuser", "testpassword") + + req2, valid := authenticator.Authenticate(req) + + Expect(valid).To(Equal(true)) + Expect(req2).ToNot(BeNil()) + }) + It("adds claims to the request context", func() { + req := httptest.NewRequest(http.MethodGet, "http://example.com/example/path", http.NoBody) + req.SetBasicAuth("testuser", "testpassword") + + req2, valid := authenticator.Authenticate(req) + Expect(valid).To(Equal(true)) + + claims := oidc.FromContext(req2.Context()) + Expect(claims).ToNot(BeNil()) + Expect(claims[oidc.Iss]).To(Equal("IdpId")) + Expect(claims[oidc.PreferredUsername]).To(Equal("testuser")) + Expect(claims[oidc.Email]).To(Equal("testuser@example.com")) + Expect(claims[oidc.OwncloudUUID]).To(Equal("OpaqueId")) + }) + }) +}) diff --git a/services/proxy/pkg/middleware/middleware_suite_test.go b/services/proxy/pkg/middleware/middleware_suite_test.go new file mode 100644 index 00000000000..09e4e113609 --- /dev/null +++ b/services/proxy/pkg/middleware/middleware_suite_test.go @@ -0,0 +1,13 @@ +package middleware_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestMiddleware(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Middleware Suite") +} diff --git a/services/proxy/pkg/middleware/oidc_auth_test.go b/services/proxy/pkg/middleware/oidc_auth_test.go index 6b7e97bceb5..93612e3c48e 100644 --- a/services/proxy/pkg/middleware/oidc_auth_test.go +++ b/services/proxy/pkg/middleware/oidc_auth_test.go @@ -5,35 +5,27 @@ import ( "fmt" "net/http" "net/http/httptest" - "testing" "github.com/coreos/go-oidc/v3/oidc" - "github.com/owncloud/ocis/v2/ocis-pkg/log" - "github.com/owncloud/ocis/v2/services/proxy/pkg/config" + . "github.com/onsi/ginkgo/v2" "golang.org/x/oauth2" ) -func TestOIDCAuthMiddleware(t *testing.T) { - next := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}) +var _ = Describe("Test OIDC Authenticator", func() { + It("should authenticate requests", func() { + m := OIDCAuthenticator{ + ProviderFunc: func() (OIDCProvider, error) { return mockOP(false), nil }, + } - m := OIDCAuth( - Logger(log.NewLogger()), - OIDCProviderFunc(func() (OIDCProvider, error) { - return mockOP(false), nil - }), - OIDCIss("https://localhost:9200"), - AccessTokenVerifyMethod(config.AccessTokenVerificationNone), - )(next) + r := httptest.NewRequest(http.MethodGet, "https://idp.example.com", nil) + r.Header.Set("Authorization", "Bearer sometoken") - r := httptest.NewRequest(http.MethodGet, "https://idp.example.com", nil) - r.Header.Set("Authorization", "Bearer sometoken") - w := httptest.NewRecorder() - m.ServeHTTP(w, r) - - if w.Code != http.StatusInternalServerError { - t.Errorf("expected an internal server error") - } -} + _, ok := m.Authenticate(r) + if ok { + Fail("expected an internal server error") + } + }) +}) type mockOIDCProvider struct { UserInfoFunc func(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) From 17a4e65f082601baaf1560722a24f55a42ff7918 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 9 Aug 2022 16:50:05 +0200 Subject: [PATCH 06/53] add tests for the public share auth middleware --- .../proxy/pkg/middleware/public_share_auth.go | 6 +- .../pkg/middleware/public_share_auth_test.go | 78 +++++++++++++++++++ 2 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 services/proxy/pkg/middleware/public_share_auth_test.go diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index 795063d5d00..b32f9ed147f 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -9,7 +9,7 @@ import ( ) const ( - headerRevaAccessToken = "x-access-token" + _headerRevaAccessToken = "x-access-token" headerShareToken = "public-token" basicAuthPasswordPrefix = "password|" authenticationType = "publicshares" @@ -74,11 +74,11 @@ func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, return nil, false } - r.Header.Add(headerRevaAccessToken, authResp.Token) + r.Header.Add(_headerRevaAccessToken, authResp.Token) a.Logger.Debug(). Str("authenticator", "public_share"). Str("path", r.URL.Path). Msg("successfully authenticated request") - return r, false + return r, true } diff --git a/services/proxy/pkg/middleware/public_share_auth_test.go b/services/proxy/pkg/middleware/public_share_auth_test.go new file mode 100644 index 00000000000..98637988bd6 --- /dev/null +++ b/services/proxy/pkg/middleware/public_share_auth_test.go @@ -0,0 +1,78 @@ +package middleware + +import ( + "context" + "net/http" + "net/http/httptest" + + gatewayv1beta1 "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" + rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "github.com/owncloud/ocis/v2/ocis-pkg/log" + "google.golang.org/grpc" +) + +var _ = Describe("Authenticating requests", Label("PublicShareAuthenticator"), func() { + var authenticator Authenticator + BeforeEach(func() { + authenticator = PublicShareAuthenticator{ + Logger: log.NewLogger(), + RevaGatewayClient: mockGatewayClient{ + AuthenticateFunc: func(authType, clientID, clientSecret string) (string, rpcv1beta1.Code) { + if authType != "publicshares" { + return "", rpcv1beta1.Code_CODE_NOT_FOUND + } + + if clientID == "sharetoken" && (clientSecret == "password|examples3cr3t" || clientSecret == "signature|examplesignature|exampleexpiration") { + return "exampletoken", rpcv1beta1.Code_CODE_OK + } + + return "", rpcv1beta1.Code_CODE_NOT_FOUND + }, + }, + } + }) + When("the request contains correct data", func() { + Context("using password authentication", func() { + It("should successfully authenticate", func() { + req := httptest.NewRequest(http.MethodGet, "http://example.com/dav/public-files/?public-token=sharetoken", http.NoBody) + req.SetBasicAuth("public", "examples3cr3t") + + req2, valid := authenticator.Authenticate(req) + + Expect(valid).To(Equal(true)) + Expect(req2).ToNot(BeNil()) + + h := req2.Header + Expect(h.Get(_headerRevaAccessToken)).To(Equal("exampletoken")) + }) + }) + Context("using signature authentication", func() { + It("should successfully authenticate", func() { + req := httptest.NewRequest(http.MethodGet, "http://example.com/dav/public-files/?public-token=sharetoken&signature=examplesignature&expiration=exampleexpiration", http.NoBody) + + req2, valid := authenticator.Authenticate(req) + + Expect(valid).To(Equal(true)) + Expect(req2).ToNot(BeNil()) + + h := req2.Header + Expect(h.Get(_headerRevaAccessToken)).To(Equal("exampletoken")) + }) + }) + }) +}) + +type mockGatewayClient struct { + gatewayv1beta1.GatewayAPIClient + AuthenticateFunc func(authType, clientID, clientSecret string) (string, rpcv1beta1.Code) +} + +func (c mockGatewayClient) Authenticate(ctx context.Context, in *gatewayv1beta1.AuthenticateRequest, opts ...grpc.CallOption) (*gatewayv1beta1.AuthenticateResponse, error) { + token, code := c.AuthenticateFunc(in.GetType(), in.GetClientId(), in.GetClientSecret()) + return &gatewayv1beta1.AuthenticateResponse{ + Status: &rpcv1beta1.Status{Code: code}, + Token: token, + }, nil +} From 9347657370fc3e316949974e8394a998a9e249fe Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 9 Aug 2022 17:17:37 +0200 Subject: [PATCH 07/53] remove the oidc tests since they aren't testing anything at the moment I admit it would be better to implement the tests but I tried and it is a bit tricky since we can't mock everything we would need to mock. I'll wan to get these changes in first and later in the near future we should revisit the auth middleware architecture and refactor it a bit more to be more testable and future proof. --- .../proxy/pkg/middleware/oidc_auth_test.go | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 services/proxy/pkg/middleware/oidc_auth_test.go diff --git a/services/proxy/pkg/middleware/oidc_auth_test.go b/services/proxy/pkg/middleware/oidc_auth_test.go deleted file mode 100644 index 93612e3c48e..00000000000 --- a/services/proxy/pkg/middleware/oidc_auth_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package middleware - -import ( - "context" - "fmt" - "net/http" - "net/http/httptest" - - "github.com/coreos/go-oidc/v3/oidc" - . "github.com/onsi/ginkgo/v2" - "golang.org/x/oauth2" -) - -var _ = Describe("Test OIDC Authenticator", func() { - It("should authenticate requests", func() { - m := OIDCAuthenticator{ - ProviderFunc: func() (OIDCProvider, error) { return mockOP(false), nil }, - } - - r := httptest.NewRequest(http.MethodGet, "https://idp.example.com", nil) - r.Header.Set("Authorization", "Bearer sometoken") - - _, ok := m.Authenticate(r) - if ok { - Fail("expected an internal server error") - } - }) -}) - -type mockOIDCProvider struct { - UserInfoFunc func(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) -} - -// UserInfo will panic if the function has been called, but not mocked -func (m mockOIDCProvider) UserInfo(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) { - if m.UserInfoFunc != nil { - return m.UserInfoFunc(ctx, ts) - } - - panic("UserInfo was called in test but not mocked") -} - -func mockOP(retErr bool) OIDCProvider { - if retErr { - return &mockOIDCProvider{ - UserInfoFunc: func(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) { - return nil, fmt.Errorf("error returned by mockOIDCProvider UserInfo") - }, - } - - } - return &mockOIDCProvider{ - UserInfoFunc: func(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) { - ui := &oidc.UserInfo{ - // claims: private ... - } - return ui, nil - }, - } - -} From 06ffd9cf8a66f3c747a362c90f0db1911da246a2 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 10 Aug 2022 13:39:15 +0200 Subject: [PATCH 08/53] some more cleaning up --- services/proxy/pkg/command/server.go | 21 ++++++-------- .../proxy/pkg/middleware/authentication.go | 2 ++ services/proxy/pkg/middleware/oidc_auth.go | 29 +++++++++++++++---- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 7377d958290..e54538f7165 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -16,7 +16,6 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/log" pkgmiddleware "github.com/owncloud/ocis/v2/ocis-pkg/middleware" "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" settingssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0" storesvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/store/v0" @@ -175,14 +174,12 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) UserProvider: userProvider, }) } - tokenCache := sync.NewCache(cfg.OIDC.UserinfoCache.Size) - authenticators = append(authenticators, middleware.OIDCAuthenticator{ - Logger: logger, - TokenCache: &tokenCache, - TokenCacheTTL: time.Duration(cfg.OIDC.UserinfoCache.TTL), - HTTPClient: oidcHTTPClient, - OIDCIss: cfg.OIDC.Issuer, - ProviderFunc: func() (middleware.OIDCProvider, error) { + authenticators = append(authenticators, middleware.NewOIDCAuthenticator( + logger, + cfg.OIDC.UserinfoCache.TTL, + oidcHTTPClient, + cfg.OIDC.Issuer, + func() (middleware.OIDCProvider, error) { // Initialize a provider by specifying the issuer URL. // it will fetch the keys from the issuer using the .well-known // endpoint @@ -191,9 +188,9 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) cfg.OIDC.Issuer, ) }, - JWKSOptions: cfg.OIDC.JWKS, - AccessTokenVerifyMethod: cfg.OIDC.AccessTokenVerifyMethod, - }) + cfg.OIDC.JWKS, + cfg.OIDC.AccessTokenVerifyMethod, + )) authenticators = append(authenticators, middleware.PublicShareAuthenticator{ Logger: logger, RevaGatewayClient: revaClient, diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 887e116be2f..53dfd414357 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -36,6 +36,7 @@ var ( "/data": {}, "/konnect/v1/userinfo": {}, "/status.php": {}, + "/favicon.ico": {}, } // _unprotectedPathPrefixes contains paths which don't need to be authenticated. _unprotectedPathPrefixes = [...]string{ @@ -44,6 +45,7 @@ var ( "/user-management", "/.well-known", "/js", + "/css", "/icons", "/themes", "/signin", diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index a6c1b5519d1..a59a3b24573 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -30,11 +30,28 @@ type OIDCProvider interface { UserInfo(ctx context.Context, ts oauth2.TokenSource) (*gOidc.UserInfo, error) } +func NewOIDCAuthenticator(logger log.Logger, tokenCacheTTL int, oidcHTTPClient *http.Client, oidcIss string, providerFunc func() (OIDCProvider, error), + jwksOptions config.JWKS, accessTokenVerifyMethod string) OIDCAuthenticator { + tokenCache := osync.NewCache(tokenCacheTTL) + return OIDCAuthenticator{ + Logger: logger, + tokenCache: &tokenCache, + TokenCacheTTL: time.Duration(tokenCacheTTL), + HTTPClient: oidcHTTPClient, + OIDCIss: oidcIss, + ProviderFunc: providerFunc, + JWKSOptions: jwksOptions, + AccessTokenVerifyMethod: accessTokenVerifyMethod, + providerLock: &sync.Mutex{}, + jwksLock: &sync.Mutex{}, + } +} + type OIDCAuthenticator struct { Logger log.Logger HTTPClient *http.Client OIDCIss string - TokenCache *osync.Cache + tokenCache *osync.Cache TokenCacheTTL time.Duration ProviderFunc func() (OIDCProvider, error) AccessTokenVerifyMethod string @@ -49,7 +66,7 @@ type OIDCAuthenticator struct { func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (map[string]interface{}, error) { var claims map[string]interface{} - hit := m.TokenCache.Load(token) + hit := m.tokenCache.Load(token) if hit == nil { aClaims, err := m.verifyAccessToken(token) if err != nil { @@ -72,7 +89,7 @@ func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (map[strin } expiration := m.extractExpiration(aClaims) - m.TokenCache.Store(token, claims, expiration) + m.tokenCache.Store(token, claims, expiration) m.Logger.Debug().Interface("claims", claims).Interface("userInfo", userInfo).Time("expiration", expiration.UTC()).Msg("unmarshalled and cached userinfo") return claims, nil @@ -149,7 +166,7 @@ type jwksJSON struct { JWKSURL string `json:"jwks_uri"` } -func (m *OIDCAuthenticator) getKeyfunc() *keyfunc.JWKS { +func (m OIDCAuthenticator) getKeyfunc() *keyfunc.JWKS { m.jwksLock.Lock() defer m.jwksLock.Unlock() if m.JWKS == nil { @@ -200,7 +217,7 @@ func (m *OIDCAuthenticator) getKeyfunc() *keyfunc.JWKS { return m.JWKS } -func (m *OIDCAuthenticator) getProvider() OIDCProvider { +func (m OIDCAuthenticator) getProvider() OIDCProvider { m.providerLock.Lock() defer m.providerLock.Unlock() if m.provider == nil { @@ -229,11 +246,11 @@ func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { if m.getProvider() == nil { return nil, false } + // Force init of jwks keyfunc if needed (contacts the .well-known and jwks endpoints on first call) if m.AccessTokenVerifyMethod == config.AccessTokenVerificationJWT && m.getKeyfunc() == nil { return nil, false } - token := strings.TrimPrefix(r.Header.Get(_headerAuthorization), _bearerPrefix) claims, err := m.getClaims(token, r) From d271ae2451199ba3ef7f2f252c8a13b41b824b9b Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 10 Aug 2022 16:29:41 +0200 Subject: [PATCH 09/53] fix some authentication cases --- services/proxy/pkg/middleware/authentication.go | 2 ++ services/proxy/pkg/middleware/public_share_auth.go | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 53dfd414357..f5f4d911507 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -41,6 +41,8 @@ var ( // _unprotectedPathPrefixes contains paths which don't need to be authenticated. _unprotectedPathPrefixes = [...]string{ "/files", + "/data", + "/s/", "/settings", "/user-management", "/.well-known", diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index b32f9ed147f..dabaa8a38c8 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -34,10 +34,10 @@ func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, shareToken = query.Get(headerShareToken) } - // Currently we only want to authenticate app open request coming from public shares. if shareToken == "" { - // Don't authenticate - return nil, false + // If the share token is not set then we don't need to inject the user to + // the request context so we can just continue with the request. + return r, true } var sharePassword string From 32f68f91ffdc14ade38373b42ef4880ee185fc5e Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 10 Aug 2022 23:59:33 +0200 Subject: [PATCH 10/53] add missing www-authentication header on failed authentication --- services/proxy/pkg/middleware/authentication.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index f5f4d911507..c90522403fd 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -87,6 +87,7 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle } } if !isPublicPath(r.URL.Path) { + writeSupportedAuthenticateHeader(w, r) for _, s := range SupportedAuthStrategies { userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, s) } @@ -178,6 +179,7 @@ func userAgentAuthenticateLockIn(w http.ResponseWriter, r *http.Request, locks m for _, r := range ProxyWwwAuthenticate { evalRequestURI(u, r) } + fmt.Println(w.Header()) } func evalRequestURI(l userAgentLocker, r regexp.Regexp) { From 036c4664259634243a1ffc9880523a7d64eeb161 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 11 Aug 2022 10:41:18 +0200 Subject: [PATCH 11/53] add missing unprotected paths --- services/proxy/pkg/middleware/authentication.go | 3 ++- vendor-bin/behat/composer.json | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index c90522403fd..728a85a0a48 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -37,6 +37,8 @@ var ( "/konnect/v1/userinfo": {}, "/status.php": {}, "/favicon.ico": {}, + "/ocs/v1.php/config": {}, + "/ocs/v2.php/config": {}, } // _unprotectedPathPrefixes contains paths which don't need to be authenticated. _unprotectedPathPrefixes = [...]string{ @@ -179,7 +181,6 @@ func userAgentAuthenticateLockIn(w http.ResponseWriter, r *http.Request, locks m for _, r := range ProxyWwwAuthenticate { evalRequestURI(u, r) } - fmt.Println(w.Header()) } func evalRequestURI(l userAgentLocker, r regexp.Regexp) { diff --git a/vendor-bin/behat/composer.json b/vendor-bin/behat/composer.json index 00964ecb4b8..999f00df863 100644 --- a/vendor-bin/behat/composer.json +++ b/vendor-bin/behat/composer.json @@ -2,7 +2,10 @@ "config" : { "platform": { "php": "7.4" - } + }, + "allow-plugins": { + "composer/package-versions-deprecated": true + } }, "require": { "behat/behat": "^3.9", From 5d45f0e856201f6cb3afbe6d8a6477b05b10f523 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 11 Aug 2022 12:28:02 +0200 Subject: [PATCH 12/53] fix logic of when to add the www-authenticate headers --- .../proxy/pkg/middleware/authentication.go | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 728a85a0a48..07d5568f7f8 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -89,10 +89,31 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle } } if !isPublicPath(r.URL.Path) { - writeSupportedAuthenticateHeader(w, r) - for _, s := range SupportedAuthStrategies { - userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, s) + // Failed basic authentication attempts receive the Www-Authenticate header in the response + var touch bool + for k, v := range options.CredentialsByUserAgent { + if strings.Contains(k, r.UserAgent()) { + removeSuperfluousAuthenticate(w) + w.Header().Add("Www-Authenticate", fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), r.Host)) + touch = true + break + } } + + // if the request is not bound to any user agent, write all available challenges + if !touch && + // This is a temporary hack... Before the authentication middleware rewrite all + // unauthenticated requests were still handled. The reva http services then did add + // the supported authentication headers to the response. Since we are not allowing the + // requests to continue so far we have to do it here. But we shouldn't do it for the graph service. + // That's the reason for this hard check here. + !strings.HasPrefix(r.URL.Path, "/graph") { + writeSupportedAuthenticateHeader(w, r) + } + } + + for _, s := range SupportedAuthStrategies { + userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, s) } w.WriteHeader(http.StatusUnauthorized) // if the request is a PROPFIND return a WebDAV error code. From 3ebfcbff1e3793bf806c4b11e6cbd9ffd4d0ebb4 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 15 Aug 2022 11:38:04 +0200 Subject: [PATCH 13/53] add missing unprotected path --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 07d5568f7f8..2bdc5fe2cbc 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -30,6 +30,7 @@ var ( "/login": {}, "/app/list": {}, "/config.json": {}, + "/manifest.json": {}, "/oidc-callback.html": {}, "/oidc-callback": {}, "/settings.js": {}, From 864438b2de2744a57a2145cce644b9b2880598d6 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 15 Aug 2022 16:04:14 +0200 Subject: [PATCH 14/53] add missing unprotected path --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 2bdc5fe2cbc..2ee63fe34ba 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -45,6 +45,7 @@ var ( _unprotectedPathPrefixes = [...]string{ "/files", "/data", + "/account", "/s/", "/settings", "/user-management", From 78d85b683da0805c5a04f1738a09de5715534ae4 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 16 Aug 2022 12:47:44 +0200 Subject: [PATCH 15/53] add missing comments --- services/proxy/pkg/middleware/authentication.go | 6 ++++-- services/proxy/pkg/middleware/basic_auth.go | 1 + services/proxy/pkg/middleware/oidc_auth.go | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 2ee63fe34ba..3e851d0adae 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -65,9 +65,11 @@ const ( ) // Authenticator is the common interface implemented by all request authenticators. -// The Authenticator may augment the request with user info or anything related to the -// authentication and return the augmented request. + type Authenticator interface { + // Authenticate is used to authenticate incoming HTTP requests. + // The Authenticator may augment the request with user info or anything related to the + // authentication and return the augmented request. Authenticate(*http.Request) (*http.Request, bool) } diff --git a/services/proxy/pkg/middleware/basic_auth.go b/services/proxy/pkg/middleware/basic_auth.go index eaccd704254..eb8f79847b6 100644 --- a/services/proxy/pkg/middleware/basic_auth.go +++ b/services/proxy/pkg/middleware/basic_auth.go @@ -8,6 +8,7 @@ import ( "github.com/owncloud/ocis/v2/services/proxy/pkg/user/backend" ) +// BasicAuthenticator is the authenticator responsible for HTTP Basic authentication. type BasicAuthenticator struct { Logger log.Logger UserProvider backend.UserBackend diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index a59a3b24573..36adeeb2964 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -30,6 +30,7 @@ type OIDCProvider interface { UserInfo(ctx context.Context, ts oauth2.TokenSource) (*gOidc.UserInfo, error) } +// NewOIDCAuthenticator returns a ready to use authenticator which can handle OIDC authentication. func NewOIDCAuthenticator(logger log.Logger, tokenCacheTTL int, oidcHTTPClient *http.Client, oidcIss string, providerFunc func() (OIDCProvider, error), jwksOptions config.JWKS, accessTokenVerifyMethod string) OIDCAuthenticator { tokenCache := osync.NewCache(tokenCacheTTL) @@ -47,6 +48,7 @@ func NewOIDCAuthenticator(logger log.Logger, tokenCacheTTL int, oidcHTTPClient * } } +// OIDCAuthenticator is an authenticator responsible for OIDC authentication. type OIDCAuthenticator struct { Logger log.Logger HTTPClient *http.Client @@ -239,7 +241,10 @@ func (m OIDCAuthenticator) getProvider() OIDCProvider { func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { // there is no bearer token on the request, - if !m.shouldServe(r) { + if !m.shouldServe(r) || isPublicPath(r.URL.Path) { + // The authentication of public path requests is handled by another authenticator. + // Since we can't guarantee the order of execution of the authenticators, we better + // implement an early return here for paths we can't authenticate in this authenticator. return nil, false } From 905ead629c9143e9f74273276a8b0eb2ad1d56ff Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 16 Aug 2022 15:16:48 +0200 Subject: [PATCH 16/53] add unprotected path prefix for external apps --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 3e851d0adae..84a552463f6 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -47,6 +47,7 @@ var ( "/data", "/account", "/s/", + "/external/spaces", "/settings", "/user-management", "/.well-known", From 3f25ca2059d48a58682d092408b9e47427bfd327 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 16 Aug 2022 15:45:22 +0200 Subject: [PATCH 17/53] add unprotected path prefix for parallel deployment --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 84a552463f6..a218546760b 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -48,6 +48,7 @@ var ( "/account", "/s/", "/external/spaces", + "/apps/openidconnect/redirect", "/settings", "/user-management", "/.well-known", From b5ef10dc2b82fc9a083fad594a00af055068b6e2 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 16 Aug 2022 16:53:27 +0200 Subject: [PATCH 18/53] add missing comments and changelog --- changelog/unreleased/rewrite-authentication.md | 7 +++++++ services/proxy/pkg/middleware/public_share_auth.go | 2 ++ services/proxy/pkg/middleware/signed_url_auth.go | 1 + 3 files changed, 10 insertions(+) create mode 100644 changelog/unreleased/rewrite-authentication.md diff --git a/changelog/unreleased/rewrite-authentication.md b/changelog/unreleased/rewrite-authentication.md new file mode 100644 index 00000000000..c3990743129 --- /dev/null +++ b/changelog/unreleased/rewrite-authentication.md @@ -0,0 +1,7 @@ +Enhancement: Rewrite of the request authentication middleware + +There were some flaws in the authentication middleware which were resolved by this rewrite. +This rewrite also introduced the need to manually mark certain paths as "unprotected" if +requests to these paths must not be authenticated. + +https://github.com/owncloud/ocis/pull/4374 diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index dabaa8a38c8..cab9b6ebf38 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -18,6 +18,8 @@ const ( _paramExpiration = "expiration" ) +// PublicShareAuthenticator is the authenticator which can authenticate public share requests. +// It will add the share owner into the request context. type PublicShareAuthenticator struct { Logger log.Logger RevaGatewayClient gateway.GatewayAPIClient diff --git a/services/proxy/pkg/middleware/signed_url_auth.go b/services/proxy/pkg/middleware/signed_url_auth.go index 80a613aace9..2455e8eecfc 100644 --- a/services/proxy/pkg/middleware/signed_url_auth.go +++ b/services/proxy/pkg/middleware/signed_url_auth.go @@ -38,6 +38,7 @@ var ( } ) +// SignedURLAuthenticator is the authenticator responsible for authenticating signed URL requests. type SignedURLAuthenticator struct { Logger log.Logger PreSignedURLConfig config.PreSignedURL From 6154466bbc9350782be748e5494332232f26ffa6 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 17 Aug 2022 15:36:52 +0200 Subject: [PATCH 19/53] rename extensions to services (leftover occurences) --- ocis-pkg/config/config.go | 8 +- ocis-pkg/config/helpers.go | 6 +- ocis-pkg/config/parser/parse.go | 4 +- ocis-pkg/flags/overrides.go | 10 +-- ocis-pkg/shared/shared_types.go | 2 +- ocis/pkg/command/helper/common.go | 2 +- ocis/pkg/command/version.go | 2 +- ocis/pkg/init/init.go | 90 +++++++++---------- ocis/pkg/runtime/cmd/list.go | 2 +- ocis/pkg/runtime/service/service.go | 12 +-- services/app-provider/pkg/command/server.go | 4 +- services/app-provider/pkg/command/version.go | 2 +- services/app-registry/pkg/command/server.go | 4 +- services/app-registry/pkg/command/version.go | 2 +- services/audit/pkg/command/server.go | 2 +- services/audit/pkg/command/version.go | 2 +- services/auth-basic/pkg/command/server.go | 4 +- services/auth-basic/pkg/command/version.go | 2 +- services/auth-bearer/pkg/command/server.go | 4 +- services/auth-bearer/pkg/command/version.go | 2 +- services/auth-machine/pkg/command/server.go | 4 +- services/auth-machine/pkg/command/version.go | 2 +- services/frontend/pkg/command/server.go | 4 +- services/frontend/pkg/command/version.go | 2 +- services/gateway/pkg/command/server.go | 4 +- services/gateway/pkg/command/version.go | 2 +- services/graph-explorer/pkg/command/server.go | 2 +- .../graph-explorer/pkg/command/version.go | 2 +- .../graph-explorer/pkg/service/v0/service.go | 2 +- services/graph/pkg/command/server.go | 2 +- services/graph/pkg/command/version.go | 2 +- services/graph/pkg/service/v0/service.go | 2 +- services/groups/pkg/command/server.go | 4 +- services/groups/pkg/command/version.go | 2 +- services/idm/pkg/command/server.go | 2 +- services/idm/pkg/command/version.go | 2 +- services/idp/pkg/command/server.go | 2 +- services/idp/pkg/command/version.go | 2 +- services/idp/pkg/service/v0/service.go | 2 +- services/nats/pkg/command/server.go | 2 +- services/nats/pkg/command/version.go | 2 +- services/notifications/pkg/command/server.go | 2 +- services/notifications/pkg/command/version.go | 2 +- services/ocdav/pkg/command/server.go | 4 +- services/ocdav/pkg/command/version.go | 2 +- services/ocs/pkg/command/server.go | 2 +- services/ocs/pkg/command/version.go | 2 +- services/ocs/pkg/service/v0/service.go | 2 +- services/proxy/pkg/command/server.go | 2 +- services/proxy/pkg/command/version.go | 2 +- services/search/pkg/command/server.go | 2 +- services/search/pkg/command/version.go | 2 +- services/settings/pkg/command/server.go | 2 +- services/settings/pkg/command/version.go | 2 +- services/sharing/pkg/command/server.go | 4 +- services/sharing/pkg/command/version.go | 2 +- services/sharing/pkg/config/config.go | 2 +- .../storage-publiclink/pkg/command/server.go | 4 +- .../storage-publiclink/pkg/command/version.go | 2 +- services/storage-shares/pkg/command/server.go | 4 +- .../storage-shares/pkg/command/version.go | 2 +- services/storage-system/pkg/command/server.go | 4 +- .../storage-system/pkg/command/version.go | 2 +- services/storage-users/pkg/command/server.go | 4 +- services/storage-users/pkg/command/version.go | 2 +- services/store/pkg/command/server.go | 2 +- services/store/pkg/command/version.go | 2 +- services/thumbnails/pkg/command/server.go | 2 +- services/thumbnails/pkg/command/version.go | 2 +- .../thumbnails/pkg/service/http/v0/service.go | 2 +- services/users/pkg/command/server.go | 4 +- services/users/pkg/command/version.go | 2 +- services/web/pkg/command/server.go | 2 +- services/web/pkg/command/version.go | 2 +- services/web/pkg/service/v0/service.go | 2 +- services/webdav/pkg/command/server.go | 2 +- services/webdav/pkg/command/version.go | 2 +- 77 files changed, 151 insertions(+), 151 deletions(-) diff --git a/ocis-pkg/config/config.go b/ocis-pkg/config/config.go index 342652caba1..2fd90f9506f 100644 --- a/ocis-pkg/config/config.go +++ b/ocis-pkg/config/config.go @@ -47,10 +47,10 @@ type Mode int // Runtime configures the oCIS runtime when running in supervised mode. type Runtime struct { - Port string `yaml:"port" env:"OCIS_RUNTIME_PORT"` - Host string `yaml:"host" env:"OCIS_RUNTIME_HOST"` - Extensions string `yaml:"services" env:"OCIS_RUN_EXTENSIONS;OCIS_RUN_SERVICES" desc:"Expects a comma separated list of service names. Will start only the listed services."` - Disabled string `yaml:"disabled_services" env:"OCIS_EXCLUDE_RUN_SERVICES" desc:"Expects a comma separated list of service names. Will start all services except of the ones listed. Has no effect when OCIS_RUN_SERVICES is set."` + Port string `yaml:"port" env:"OCIS_RUNTIME_PORT"` + Host string `yaml:"host" env:"OCIS_RUNTIME_HOST"` + Services string `yaml:"services" env:"OCIS_RUN_EXTENSIONS;OCIS_RUN_SERVICES" desc:"Expects a comma separated list of service names. Will start only the listed services."` + Disabled string `yaml:"disabled_services" env:"OCIS_EXCLUDE_RUN_SERVICES" desc:"Expects a comma separated list of service names. Will start all services except of the ones listed. Has no effect when OCIS_RUN_SERVICES is set."` } // Config combines all available configuration parts. diff --git a/ocis-pkg/config/helpers.go b/ocis-pkg/config/helpers.go index df4ec4437f3..7b72333e92b 100644 --- a/ocis-pkg/config/helpers.go +++ b/ocis-pkg/config/helpers.go @@ -17,14 +17,14 @@ var ( // BindSourcesToStructs assigns any config value from a config file / env variable to struct `dst`. Its only purpose // is to solely modify `dst`, not dealing with the config structs; and do so in a thread safe manner. -func BindSourcesToStructs(extension string, dst interface{}) (*gofig.Config, error) { - cnf := gofig.NewWithOptions(extension) +func BindSourcesToStructs(service string, dst interface{}) (*gofig.Config, error) { + cnf := gofig.NewWithOptions(service) cnf.WithOptions(func(options *gofig.Options) { options.DecoderConfig.TagName = decoderConfigTagName }) cnf.AddDriver(gooyaml.Driver) - cfgFile := path.Join(defaults.BaseConfigPath(), extension+".yaml") + cfgFile := path.Join(defaults.BaseConfigPath(), service+".yaml") _ = cnf.LoadFiles([]string{cfgFile}...) err := cnf.BindStruct("", &dst) diff --git a/ocis-pkg/config/parser/parse.go b/ocis-pkg/config/parser/parse.go index 0354b222b0f..81e1ede7b24 100644 --- a/ocis-pkg/config/parser/parse.go +++ b/ocis-pkg/config/parser/parse.go @@ -10,7 +10,7 @@ import ( // ParseConfig loads the ocis configuration and // copies applicable parts into the commons part, from -// where the extensions can copy it into their own config +// where the services can copy it into their own config func ParseConfig(cfg *config.Config, skipValidate bool) error { _, err := config.BindSourcesToStructs("ocis", cfg) if err != nil { @@ -37,7 +37,7 @@ func ParseConfig(cfg *config.Config, skipValidate bool) error { } // EnsureDefaults, ensures that all pointers in the -// oCIS config (not the extensions configs) are initialized +// oCIS config (not the services configs) are initialized func EnsureDefaults(cfg *config.Config) { if cfg.Tracing == nil { cfg.Tracing = &shared.Tracing{} diff --git a/ocis-pkg/flags/overrides.go b/ocis-pkg/flags/overrides.go index f641cf00bed..d65e815d078 100644 --- a/ocis-pkg/flags/overrides.go +++ b/ocis-pkg/flags/overrides.go @@ -2,7 +2,7 @@ package flags // OverrideDefaultString checks whether the default value of v is the zero value, if so, ensure the flag has a correct // value by providing one. A value different than zero would mean that it was read from a config file either from an -// extension or from a higher source (i.e: ocis command). +// service or from a higher source (i.e: ocis command). func OverrideDefaultString(v, def string) string { if v != "" { return v @@ -13,7 +13,7 @@ func OverrideDefaultString(v, def string) string { // OverrideDefaultBool checks whether the default value of v is the zero value, if so, ensure the flag has a correct // value by providing one. A value different than zero would mean that it was read from a config file either from an -// extension or from a higher source (i.e: ocis command). +// service or from a higher source (i.e: ocis command). func OverrideDefaultBool(v, def bool) bool { if v { return v @@ -24,7 +24,7 @@ func OverrideDefaultBool(v, def bool) bool { // OverrideDefaultInt checks whether the default value of v is the zero value, if so, ensure the flag has a correct // value by providing one. A value different than zero would mean that it was read from a config file either from an -// extension or from a higher source (i.e: ocis command). +// service or from a higher source (i.e: ocis command). func OverrideDefaultInt(v, def int) int { if v != 0 { return v @@ -35,7 +35,7 @@ func OverrideDefaultInt(v, def int) int { // OverrideDefaultInt64 checks whether the default value of v is the zero value, if so, ensure the flag has a correct // value by providing one. A value different than zero would mean that it was read from a config file either from an -// extension or from a higher source (i.e: ocis command). +// service or from a higher source (i.e: ocis command). func OverrideDefaultInt64(v, def int64) int64 { if v != 0 { return v @@ -46,7 +46,7 @@ func OverrideDefaultInt64(v, def int64) int64 { // OverrideDefaultUint64 checks whether the default value of v is the zero value, if so, ensure the flag has a correct // value by providing one. A value different than zero would mean that it was read from a config file either from an -// extension or from a higher source (i.e: ocis command). +// service or from a higher source (i.e: ocis command). func OverrideDefaultUint64(v, def uint64) uint64 { if v != 0 { return v diff --git a/ocis-pkg/shared/shared_types.go b/ocis-pkg/shared/shared_types.go index 942ab0a20dc..d633f79bfe6 100644 --- a/ocis-pkg/shared/shared_types.go +++ b/ocis-pkg/shared/shared_types.go @@ -34,7 +34,7 @@ type Reva struct { Address string `yaml:"address" env:"REVA_GATEWAY" desc:"The CS3 gateway endpoint."` } -// Commons holds configuration that are common to all extensions. Each extension can then decide whether +// Commons holds configuration that are common to all services. Each service can then decide whether // to overwrite its values. type Commons struct { Log *Log `yaml:"log"` diff --git a/ocis/pkg/command/helper/common.go b/ocis/pkg/command/helper/common.go index af71e93b098..1c2fdd990bb 100644 --- a/ocis/pkg/command/helper/common.go +++ b/ocis/pkg/command/helper/common.go @@ -5,5 +5,5 @@ import ( ) func SubcommandDescription(serviceName string) string { - return fmt.Sprintf("%s extension commands", serviceName) + return fmt.Sprintf("%s service commands", serviceName) } diff --git a/ocis/pkg/command/version.go b/ocis/pkg/command/version.go index 882e6925eb3..3e251f953e8 100644 --- a/ocis/pkg/command/version.go +++ b/ocis/pkg/command/version.go @@ -17,7 +17,7 @@ import ( func VersionCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and all running extension instances", + Usage: "print the version of this binary and all running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/ocis/pkg/init/init.go b/ocis/pkg/init/init.go index 733092c5c26..a700bcdee63 100644 --- a/ocis/pkg/init/init.go +++ b/ocis/pkg/init/init.go @@ -23,24 +23,24 @@ type TokenManager struct { JWTSecret string `yaml:"jwt_secret"` } -type InsecureExtension struct { +type InsecureService struct { Insecure bool } -type InsecureProxyExtension struct { +type InsecureProxyService struct { InsecureBackends bool `yaml:"insecure_backends"` } type LdapSettings struct { BindPassword string `yaml:"bind_password"` } -type LdapBasedExtension struct { +type LdapBasedService struct { Ldap LdapSettings } -type GraphExtension struct { - Spaces InsecureExtension - Identity LdapBasedExtension +type GraphService struct { + Spaces InsecureService + Identity LdapBasedService } type ServiceUserPasswordsSettings struct { @@ -49,27 +49,27 @@ type ServiceUserPasswordsSettings struct { RevaPassword string `yaml:"reva_password"` IdpPassword string `yaml:"idp_password"` } -type IdmExtension struct { +type IdmService struct { ServiceUserPasswords ServiceUserPasswordsSettings `yaml:"service_user_passwords"` } -type FrontendExtension struct { - Archiver InsecureExtension +type FrontendService struct { + Archiver InsecureService } -type AuthbasicExtension struct { - AuthProviders LdapBasedExtension `yaml:"auth_providers"` +type AuthbasicService struct { + AuthProviders LdapBasedService `yaml:"auth_providers"` } type AuthProviderSettings struct { - Oidc InsecureExtension + Oidc InsecureService } -type AuthbearerExtension struct { +type AuthbearerService struct { AuthProviders AuthProviderSettings `yaml:"auth_providers"` } -type UsersAndGroupsExtension struct { - Drivers LdapBasedExtension +type UsersAndGroupsService struct { + Drivers LdapBasedService } type ThumbnailSettings struct { @@ -78,7 +78,7 @@ type ThumbnailSettings struct { Cs3AllowInsecure bool `yaml:"cs3_allow_insecure"` } -type ThumbnailExtension struct { +type ThumbnailService struct { Thumbnail ThumbnailSettings } @@ -101,17 +101,17 @@ type OcisConfig struct { TransferSecret string `yaml:"transfer_secret"` SystemUserID string `yaml:"system_user_id"` AdminUserID string `yaml:"admin_user_id"` - Graph GraphExtension - Idp LdapBasedExtension - Idm IdmExtension - Proxy InsecureProxyExtension - Frontend FrontendExtension - AuthBasic AuthbasicExtension `yaml:"auth_basic"` - AuthBearer AuthbearerExtension `yaml:"auth_bearer"` - Users UsersAndGroupsExtension - Groups UsersAndGroupsExtension - Ocdav InsecureExtension - Thumbnails ThumbnailExtension + Graph GraphService + Idp LdapBasedService + Idm IdmService + Proxy InsecureProxyService + Frontend FrontendService + AuthBasic AuthbasicService `yaml:"auth_basic"` + AuthBearer AuthbearerService `yaml:"auth_bearer"` + Users UsersAndGroupsService + Groups UsersAndGroupsService + Ocdav InsecureService + Thumbnails ThumbnailService } func checkConfigPath(configPath string) error { @@ -213,7 +213,7 @@ func CreateConfig(insecure, forceOverwrite bool, configPath, adminPassword strin TransferSecret: revaTransferSecret, SystemUserID: systemUserID, AdminUserID: adminUserID, - Idm: IdmExtension{ + Idm: IdmService{ ServiceUserPasswords: ServiceUserPasswordsSettings{ AdminPassword: ocisAdminServicePassword, IdpPassword: idpServicePassword, @@ -221,40 +221,40 @@ func CreateConfig(insecure, forceOverwrite bool, configPath, adminPassword strin IdmPassword: idmServicePassword, }, }, - Idp: LdapBasedExtension{ + Idp: LdapBasedService{ Ldap: LdapSettings{ BindPassword: idpServicePassword, }, }, - AuthBasic: AuthbasicExtension{ - AuthProviders: LdapBasedExtension{ + AuthBasic: AuthbasicService{ + AuthProviders: LdapBasedService{ Ldap: LdapSettings{ BindPassword: revaServicePassword, }, }, }, - Groups: UsersAndGroupsExtension{ - Drivers: LdapBasedExtension{ + Groups: UsersAndGroupsService{ + Drivers: LdapBasedService{ Ldap: LdapSettings{ BindPassword: revaServicePassword, }, }, }, - Users: UsersAndGroupsExtension{ - Drivers: LdapBasedExtension{ + Users: UsersAndGroupsService{ + Drivers: LdapBasedService{ Ldap: LdapSettings{ BindPassword: revaServicePassword, }, }, }, - Graph: GraphExtension{ - Identity: LdapBasedExtension{ + Graph: GraphService{ + Identity: LdapBasedService{ Ldap: LdapSettings{ BindPassword: idmServicePassword, }, }, }, - Thumbnails: ThumbnailExtension{ + Thumbnails: ThumbnailService{ Thumbnail: ThumbnailSettings{ TransferSecret: thumbnailsTransferSecret, }, @@ -262,25 +262,25 @@ func CreateConfig(insecure, forceOverwrite bool, configPath, adminPassword strin } if insecure { - cfg.AuthBearer = AuthbearerExtension{ + cfg.AuthBearer = AuthbearerService{ AuthProviders: AuthProviderSettings{ - Oidc: InsecureExtension{ + Oidc: InsecureService{ Insecure: true, }, }, } - cfg.Frontend = FrontendExtension{ - Archiver: InsecureExtension{ + cfg.Frontend = FrontendService{ + Archiver: InsecureService{ Insecure: true, }, } - cfg.Graph.Spaces = InsecureExtension{ + cfg.Graph.Spaces = InsecureService{ Insecure: true, } - cfg.Ocdav = InsecureExtension{ + cfg.Ocdav = InsecureService{ Insecure: true, } - cfg.Proxy = InsecureProxyExtension{ + cfg.Proxy = InsecureProxyService{ InsecureBackends: true, } diff --git a/ocis/pkg/runtime/cmd/list.go b/ocis/pkg/runtime/cmd/list.go index b4d54dd299a..7f59da14d32 100644 --- a/ocis/pkg/runtime/cmd/list.go +++ b/ocis/pkg/runtime/cmd/list.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" ) -// List running extensions. +// List running service. func List(cfg *config.Config) *cobra.Command { return &cobra.Command{ Use: "list", diff --git a/ocis/pkg/runtime/service/service.go b/ocis/pkg/runtime/service/service.go index ed9fa60e00d..7083ba7838c 100644 --- a/ocis/pkg/runtime/service/service.go +++ b/ocis/pkg/runtime/service/service.go @@ -53,7 +53,7 @@ import ( ) var ( - // runset keeps track of which extensions to start supervised. + // runset keeps track of which services to start supervised. runset map[string]struct{} ) @@ -138,7 +138,7 @@ func NewService(options ...Option) (*Service, error) { return s, nil } -// Start an rpc service. By default the package scope Start will run all default extensions to provide with a working +// Start an rpc service. By default the package scope Start will run all default services to provide with a working // oCIS instance. func Start(o ...Option) error { // Start the runtime. Most likely this was called ONLY by the `ocis server` subcommand, but since we cannot protect @@ -237,12 +237,12 @@ func scheduleServiceTokens(s *Service, funcSet serviceFuncMap) { } } -// generateRunSet interprets the cfg.Runtime.Extensions config option to cherry-pick which services to start using +// generateRunSet interprets the cfg.Runtime.Services config option to cherry-pick which services to start using // the runtime. func (s *Service) generateRunSet(cfg *ociscfg.Config) { runset = make(map[string]struct{}) - if cfg.Runtime.Extensions != "" { - e := strings.Split(strings.ReplaceAll(cfg.Runtime.Extensions, " ", ""), ",") + if cfg.Runtime.Services != "" { + e := strings.Split(strings.ReplaceAll(cfg.Runtime.Services, " ", ""), ",") for _, name := range e { runset[name] = struct{}{} } @@ -269,7 +269,7 @@ func (s *Service) generateRunSet(cfg *ociscfg.Config) { func (s *Service) List(args struct{}, reply *string) error { tableString := &strings.Builder{} table := tablewriter.NewWriter(tableString) - table.SetHeader([]string{"Extension"}) + table.SetHeader([]string{"Service"}) names := []string{} for t := range s.serviceToken { diff --git a/services/app-provider/pkg/command/server.go b/services/app-provider/pkg/command/server.go index 72fe31104e8..a1290ac29bb 100644 --- a/services/app-provider/pkg/command/server.go +++ b/services/app-provider/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/app-provider/pkg/command/version.go b/services/app-provider/pkg/command/version.go index c191fbcfffd..ee143919f57 100644 --- a/services/app-provider/pkg/command/version.go +++ b/services/app-provider/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/app-registry/pkg/command/server.go b/services/app-registry/pkg/command/server.go index f09619d595a..5e22ec453e9 100644 --- a/services/app-registry/pkg/command/server.go +++ b/services/app-registry/pkg/command/server.go @@ -24,7 +24,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -92,7 +92,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/app-registry/pkg/command/version.go b/services/app-registry/pkg/command/version.go index 380a3086267..c4e1adc1f02 100644 --- a/services/app-registry/pkg/command/version.go +++ b/services/app-registry/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/audit/pkg/command/server.go b/services/audit/pkg/command/server.go index fd904a0095d..60e2a997d92 100644 --- a/services/audit/pkg/command/server.go +++ b/services/audit/pkg/command/server.go @@ -20,7 +20,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/audit/pkg/command/version.go b/services/audit/pkg/command/version.go index c3d0eb0b5a8..8b08928c3fe 100644 --- a/services/audit/pkg/command/version.go +++ b/services/audit/pkg/command/version.go @@ -9,7 +9,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { // not implemented diff --git a/services/auth-basic/pkg/command/server.go b/services/auth-basic/pkg/command/server.go index 4e6a3b57421..7041d330ba4 100644 --- a/services/auth-basic/pkg/command/server.go +++ b/services/auth-basic/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -110,7 +110,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/auth-basic/pkg/command/version.go b/services/auth-basic/pkg/command/version.go index 9e2291bf412..f2bbc5eb3ec 100644 --- a/services/auth-basic/pkg/command/version.go +++ b/services/auth-basic/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/auth-bearer/pkg/command/server.go b/services/auth-bearer/pkg/command/server.go index cfa598e5c07..2e26e0482ed 100644 --- a/services/auth-bearer/pkg/command/server.go +++ b/services/auth-bearer/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/auth-bearer/pkg/command/version.go b/services/auth-bearer/pkg/command/version.go index 030171e1692..1f1af58f687 100644 --- a/services/auth-bearer/pkg/command/version.go +++ b/services/auth-bearer/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running services instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/auth-machine/pkg/command/server.go b/services/auth-machine/pkg/command/server.go index 7424c30200f..a2e0418debe 100644 --- a/services/auth-machine/pkg/command/server.go +++ b/services/auth-machine/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/auth-machine/pkg/command/version.go b/services/auth-machine/pkg/command/version.go index 1db2354e441..6912c338241 100644 --- a/services/auth-machine/pkg/command/version.go +++ b/services/auth-machine/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/frontend/pkg/command/server.go b/services/frontend/pkg/command/server.go index 20719e36ccc..dbfa2eb43bf 100644 --- a/services/frontend/pkg/command/server.go +++ b/services/frontend/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/frontend/pkg/command/version.go b/services/frontend/pkg/command/version.go index 77ec32121a8..348b33d6ab9 100644 --- a/services/frontend/pkg/command/version.go +++ b/services/frontend/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/gateway/pkg/command/server.go b/services/gateway/pkg/command/server.go index adb9d6cf5cc..6bf6eac0e2b 100644 --- a/services/gateway/pkg/command/server.go +++ b/services/gateway/pkg/command/server.go @@ -24,7 +24,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -92,7 +92,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/gateway/pkg/command/version.go b/services/gateway/pkg/command/version.go index 6e4fcfc0786..52768b243e6 100644 --- a/services/gateway/pkg/command/version.go +++ b/services/gateway/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/graph-explorer/pkg/command/server.go b/services/graph-explorer/pkg/command/server.go index 60586a267c2..a427e4d33b3 100644 --- a/services/graph-explorer/pkg/command/server.go +++ b/services/graph-explorer/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(ctx *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/graph-explorer/pkg/command/version.go b/services/graph-explorer/pkg/command/version.go index 49b923e9a56..3152b2b4b7f 100644 --- a/services/graph-explorer/pkg/command/version.go +++ b/services/graph-explorer/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/graph-explorer/pkg/service/v0/service.go b/services/graph-explorer/pkg/service/v0/service.go index 055f82388a2..f95b5b806a4 100644 --- a/services/graph-explorer/pkg/service/v0/service.go +++ b/services/graph-explorer/pkg/service/v0/service.go @@ -12,7 +12,7 @@ import ( "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/config" ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) ConfigJs(http.ResponseWriter, *http.Request) diff --git a/services/graph/pkg/command/server.go b/services/graph/pkg/command/server.go index bdcccc2f385..3fead9ea79c 100644 --- a/services/graph/pkg/command/server.go +++ b/services/graph/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/graph/pkg/command/version.go b/services/graph/pkg/command/version.go index ebf93b1436e..fd95546f0f8 100644 --- a/services/graph/pkg/command/version.go +++ b/services/graph/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/graph/pkg/service/v0/service.go b/services/graph/pkg/service/v0/service.go index 4f6799339af..a60e61583a6 100644 --- a/services/graph/pkg/service/v0/service.go +++ b/services/graph/pkg/service/v0/service.go @@ -27,7 +27,7 @@ const ( HeaderPurge = "Purge" ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) GetMe(http.ResponseWriter, *http.Request) diff --git a/services/groups/pkg/command/server.go b/services/groups/pkg/command/server.go index d1e872c4221..f5afcf72c4c 100644 --- a/services/groups/pkg/command/server.go +++ b/services/groups/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -110,7 +110,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/groups/pkg/command/version.go b/services/groups/pkg/command/version.go index 1800ebcf272..270cb99c6ed 100644 --- a/services/groups/pkg/command/version.go +++ b/services/groups/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/idm/pkg/command/server.go b/services/idm/pkg/command/server.go index bd1cca2b10f..cf3670e0217 100644 --- a/services/idm/pkg/command/server.go +++ b/services/idm/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/idm/pkg/command/version.go b/services/idm/pkg/command/version.go index f18727e12fb..b9834afe39f 100644 --- a/services/idm/pkg/command/version.go +++ b/services/idm/pkg/command/version.go @@ -9,7 +9,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { // not implemented diff --git a/services/idp/pkg/command/server.go b/services/idp/pkg/command/server.go index 4991a385e33..de87b03b2c1 100644 --- a/services/idp/pkg/command/server.go +++ b/services/idp/pkg/command/server.go @@ -32,7 +32,7 @@ const _rsaKeySize = 4096 func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/idp/pkg/command/version.go b/services/idp/pkg/command/version.go index 59652acf502..392d9178f69 100644 --- a/services/idp/pkg/command/version.go +++ b/services/idp/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/idp/pkg/service/v0/service.go b/services/idp/pkg/service/v0/service.go index a32a0ecb298..ce47018cca9 100644 --- a/services/idp/pkg/service/v0/service.go +++ b/services/idp/pkg/service/v0/service.go @@ -29,7 +29,7 @@ import ( "stash.kopano.io/kgol/rndm" ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) } diff --git a/services/nats/pkg/command/server.go b/services/nats/pkg/command/server.go index 08ef0b44265..c040d609aca 100644 --- a/services/nats/pkg/command/server.go +++ b/services/nats/pkg/command/server.go @@ -18,7 +18,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/nats/pkg/command/version.go b/services/nats/pkg/command/version.go index cedb412b1e8..7e82763e156 100644 --- a/services/nats/pkg/command/version.go +++ b/services/nats/pkg/command/version.go @@ -9,7 +9,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { // not implemented diff --git a/services/notifications/pkg/command/server.go b/services/notifications/pkg/command/server.go index 91f43b1b93d..9d521795c29 100644 --- a/services/notifications/pkg/command/server.go +++ b/services/notifications/pkg/command/server.go @@ -19,7 +19,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/notifications/pkg/command/version.go b/services/notifications/pkg/command/version.go index 153f65af383..3d288bb7766 100644 --- a/services/notifications/pkg/command/version.go +++ b/services/notifications/pkg/command/version.go @@ -9,7 +9,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { // not implemented diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index d98d9e2f911..3fc7d05a0b4 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -20,7 +20,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -109,7 +109,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/ocdav/pkg/command/version.go b/services/ocdav/pkg/command/version.go index 71ab3f90192..6025ef48245 100644 --- a/services/ocdav/pkg/command/version.go +++ b/services/ocdav/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/ocs/pkg/command/server.go b/services/ocs/pkg/command/server.go index 669fea4f6eb..f3ddc42762c 100644 --- a/services/ocs/pkg/command/server.go +++ b/services/ocs/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/ocs/pkg/command/version.go b/services/ocs/pkg/command/version.go index 4d3bf8bba22..06e48e76efa 100644 --- a/services/ocs/pkg/command/version.go +++ b/services/ocs/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/ocs/pkg/service/v0/service.go b/services/ocs/pkg/service/v0/service.go index 372d0c9c955..6a568ee35f8 100644 --- a/services/ocs/pkg/service/v0/service.go +++ b/services/ocs/pkg/service/v0/service.go @@ -23,7 +23,7 @@ import ( "github.com/owncloud/ocis/v2/services/proxy/pkg/user/backend" ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) GetConfig(http.ResponseWriter, *http.Request) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 81342945f12..37d11e49974 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -38,7 +38,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/proxy/pkg/command/version.go b/services/proxy/pkg/command/version.go index b24caa11bac..0cf3e85b1d0 100644 --- a/services/proxy/pkg/command/version.go +++ b/services/proxy/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "Print the version of this binary and the running extension instances", + Usage: "Print the version of this binary and the running service instances", Category: "Version", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/search/pkg/command/server.go b/services/search/pkg/command/server.go index 967fd96bf2f..013b27bdc8c 100644 --- a/services/search/pkg/command/server.go +++ b/services/search/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/search/pkg/command/version.go b/services/search/pkg/command/version.go index 9aba6033b00..fd176dc9a7d 100644 --- a/services/search/pkg/command/version.go +++ b/services/search/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/settings/pkg/command/server.go b/services/settings/pkg/command/server.go index 9306b00bf9d..2bde2df7600 100644 --- a/services/settings/pkg/command/server.go +++ b/services/settings/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/settings/pkg/command/version.go b/services/settings/pkg/command/version.go index 9ac087f77d7..ac123be776c 100644 --- a/services/settings/pkg/command/version.go +++ b/services/settings/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/sharing/pkg/command/server.go b/services/sharing/pkg/command/server.go index a08cd092669..054663a504d 100644 --- a/services/sharing/pkg/command/server.go +++ b/services/sharing/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -110,7 +110,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/sharing/pkg/command/version.go b/services/sharing/pkg/command/version.go index 368f0710d22..71582ede30b 100644 --- a/services/sharing/pkg/command/version.go +++ b/services/sharing/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/sharing/pkg/config/config.go b/services/sharing/pkg/config/config.go index bada48551bd..a9341bc7659 100644 --- a/services/sharing/pkg/config/config.go +++ b/services/sharing/pkg/config/config.go @@ -124,7 +124,7 @@ type PublicSharingSQLDriver struct { } type PublicSharingCS3Driver struct { - ProviderAddr string `yaml:"provider_addr" env:"SHARING_PUBLIC_CS3_PROVIDER_ADDR" desc:"GRPC address of the STORAGE-SYSTEM extension."` + ProviderAddr string `yaml:"provider_addr" env:"SHARING_PUBLIC_CS3_PROVIDER_ADDR" desc:"GRPC address of the STORAGE-SYSTEM service."` SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;SHARING_PUBLIC_CS3_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."` SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_SYSTEM_USER_IDP;SHARING_PUBLIC_CS3_SYSTEM_USER_IDP" desc:"IDP of the oCIS STORAGE-SYSTEM system user."` SystemUserAPIKey string `yaml:"system_user_api_key" env:"OCIS_SYSTEM_USER_API_KEY;SHARING_USER_CS3_SYSTEM_USER_API_KEY" desc:"API key for the STORAGE-SYSTEM system user."` diff --git a/services/storage-publiclink/pkg/command/server.go b/services/storage-publiclink/pkg/command/server.go index ece1c444d07..9bd9e2456d2 100644 --- a/services/storage-publiclink/pkg/command/server.go +++ b/services/storage-publiclink/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/storage-publiclink/pkg/command/version.go b/services/storage-publiclink/pkg/command/version.go index 31e23c9f386..3a96eba8e99 100644 --- a/services/storage-publiclink/pkg/command/version.go +++ b/services/storage-publiclink/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/storage-shares/pkg/command/server.go b/services/storage-shares/pkg/command/server.go index 243baa43d74..d872b941bba 100644 --- a/services/storage-shares/pkg/command/server.go +++ b/services/storage-shares/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/storage-shares/pkg/command/version.go b/services/storage-shares/pkg/command/version.go index df3e40b2fc6..e88d717d942 100644 --- a/services/storage-shares/pkg/command/version.go +++ b/services/storage-shares/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/storage-system/pkg/command/server.go b/services/storage-system/pkg/command/server.go index 1e5aecd39f4..f86426db0da 100644 --- a/services/storage-system/pkg/command/server.go +++ b/services/storage-system/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -108,7 +108,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/storage-system/pkg/command/version.go b/services/storage-system/pkg/command/version.go index 43898d14907..d1c3b7170a6 100644 --- a/services/storage-system/pkg/command/version.go +++ b/services/storage-system/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/storage-users/pkg/command/server.go b/services/storage-users/pkg/command/server.go index 1b93469990b..9c3435a0b34 100644 --- a/services/storage-users/pkg/command/server.go +++ b/services/storage-users/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/storage-users/pkg/command/version.go b/services/storage-users/pkg/command/version.go index 153d72e5516..b305b0d6151 100644 --- a/services/storage-users/pkg/command/version.go +++ b/services/storage-users/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/store/pkg/command/server.go b/services/store/pkg/command/server.go index ceb0d0c84ef..8ea9a0f9748 100644 --- a/services/store/pkg/command/server.go +++ b/services/store/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/store/pkg/command/version.go b/services/store/pkg/command/version.go index b1cfe574299..81fcb3533ab 100644 --- a/services/store/pkg/command/version.go +++ b/services/store/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/thumbnails/pkg/command/server.go b/services/thumbnails/pkg/command/server.go index a6cfd16e68c..cafd70258b1 100644 --- a/services/thumbnails/pkg/command/server.go +++ b/services/thumbnails/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/thumbnails/pkg/command/version.go b/services/thumbnails/pkg/command/version.go index 5b893a8979e..b52381f04aa 100644 --- a/services/thumbnails/pkg/command/version.go +++ b/services/thumbnails/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/thumbnails/pkg/service/http/v0/service.go b/services/thumbnails/pkg/service/http/v0/service.go index a124ab7e631..8b201658c4c 100644 --- a/services/thumbnails/pkg/service/http/v0/service.go +++ b/services/thumbnails/pkg/service/http/v0/service.go @@ -21,7 +21,7 @@ const ( keyContextKey contextKey = "key" ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) GetThumbnail(http.ResponseWriter, *http.Request) diff --git a/services/users/pkg/command/server.go b/services/users/pkg/command/server.go index 81d849d879e..e06bd8e78dd 100644 --- a/services/users/pkg/command/server.go +++ b/services/users/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -110,7 +110,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/users/pkg/command/version.go b/services/users/pkg/command/version.go index d4f8c4038aa..7fd54b70ae1 100644 --- a/services/users/pkg/command/version.go +++ b/services/users/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/web/pkg/command/server.go b/services/web/pkg/command/server.go index 2a90ff4e8ae..85283bbcf0c 100644 --- a/services/web/pkg/command/server.go +++ b/services/web/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/web/pkg/command/version.go b/services/web/pkg/command/version.go index faef4e15bc9..6b1111fca18 100644 --- a/services/web/pkg/command/version.go +++ b/services/web/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/web/pkg/service/v0/service.go b/services/web/pkg/service/v0/service.go index 342c39e2546..a99c4c2930b 100644 --- a/services/web/pkg/service/v0/service.go +++ b/services/web/pkg/service/v0/service.go @@ -22,7 +22,7 @@ var ( ErrConfigInvalid = `Invalid or missing config` ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) Config(http.ResponseWriter, *http.Request) diff --git a/services/webdav/pkg/command/server.go b/services/webdav/pkg/command/server.go index 43f1744e0d8..c3f0fa1b261 100644 --- a/services/webdav/pkg/command/server.go +++ b/services/webdav/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/webdav/pkg/command/version.go b/services/webdav/pkg/command/version.go index fed75e7920e..b70abaaf7d5 100644 --- a/services/webdav/pkg/command/version.go +++ b/services/webdav/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) From 60689c9c1a9ad4dcdabc52db496af950f6d91429 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 18 Aug 2022 10:59:35 +0200 Subject: [PATCH 20/53] improve unsupervised description --- .../unreleased/bugfix-rename-extensions-to-services.md | 6 ++++++ services/app-provider/pkg/command/server.go | 2 +- services/app-registry/pkg/command/server.go | 2 +- services/audit/pkg/command/server.go | 2 +- services/auth-basic/pkg/command/server.go | 2 +- services/auth-bearer/pkg/command/server.go | 2 +- services/auth-machine/pkg/command/server.go | 2 +- services/frontend/pkg/command/server.go | 2 +- services/gateway/pkg/command/server.go | 2 +- services/graph-explorer/pkg/command/server.go | 2 +- services/graph/pkg/command/server.go | 2 +- services/groups/pkg/command/server.go | 2 +- services/idm/pkg/command/server.go | 2 +- services/idp/pkg/command/server.go | 2 +- services/nats/pkg/command/server.go | 2 +- services/notifications/pkg/command/server.go | 2 +- services/ocdav/pkg/command/server.go | 2 +- services/ocs/pkg/command/server.go | 2 +- services/proxy/pkg/command/server.go | 2 +- services/search/pkg/command/server.go | 2 +- services/settings/pkg/command/server.go | 2 +- services/sharing/pkg/command/server.go | 2 +- services/storage-publiclink/pkg/command/server.go | 2 +- services/storage-shares/pkg/command/server.go | 2 +- services/storage-system/pkg/command/server.go | 2 +- services/storage-users/pkg/command/server.go | 2 +- services/store/pkg/command/server.go | 2 +- services/thumbnails/pkg/command/server.go | 2 +- services/users/pkg/command/server.go | 2 +- services/web/pkg/command/server.go | 2 +- services/webdav/pkg/command/server.go | 2 +- 31 files changed, 36 insertions(+), 30 deletions(-) create mode 100644 changelog/unreleased/bugfix-rename-extensions-to-services.md diff --git a/changelog/unreleased/bugfix-rename-extensions-to-services.md b/changelog/unreleased/bugfix-rename-extensions-to-services.md new file mode 100644 index 00000000000..fb38688caea --- /dev/null +++ b/changelog/unreleased/bugfix-rename-extensions-to-services.md @@ -0,0 +1,6 @@ +Bugfix: Rename extensions to services (leftover occurences) + +We've already renamed extensions to services in previous PRs and this +PR peforms this rename for leftover occurences. + +https://github.com/owncloud/ocis/pull/4407 diff --git a/services/app-provider/pkg/command/server.go b/services/app-provider/pkg/command/server.go index a1290ac29bb..9f4e940f7f9 100644 --- a/services/app-provider/pkg/command/server.go +++ b/services/app-provider/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/app-registry/pkg/command/server.go b/services/app-registry/pkg/command/server.go index 5e22ec453e9..f104d405ab0 100644 --- a/services/app-registry/pkg/command/server.go +++ b/services/app-registry/pkg/command/server.go @@ -24,7 +24,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/audit/pkg/command/server.go b/services/audit/pkg/command/server.go index 60e2a997d92..89423128943 100644 --- a/services/audit/pkg/command/server.go +++ b/services/audit/pkg/command/server.go @@ -20,7 +20,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/auth-basic/pkg/command/server.go b/services/auth-basic/pkg/command/server.go index 7041d330ba4..59fd65cef9b 100644 --- a/services/auth-basic/pkg/command/server.go +++ b/services/auth-basic/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/auth-bearer/pkg/command/server.go b/services/auth-bearer/pkg/command/server.go index 2e26e0482ed..d43f0dc1e9f 100644 --- a/services/auth-bearer/pkg/command/server.go +++ b/services/auth-bearer/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/auth-machine/pkg/command/server.go b/services/auth-machine/pkg/command/server.go index a2e0418debe..1818693728d 100644 --- a/services/auth-machine/pkg/command/server.go +++ b/services/auth-machine/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/frontend/pkg/command/server.go b/services/frontend/pkg/command/server.go index dbfa2eb43bf..872c0b2de51 100644 --- a/services/frontend/pkg/command/server.go +++ b/services/frontend/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/gateway/pkg/command/server.go b/services/gateway/pkg/command/server.go index 6bf6eac0e2b..b24d05b9db5 100644 --- a/services/gateway/pkg/command/server.go +++ b/services/gateway/pkg/command/server.go @@ -24,7 +24,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/graph-explorer/pkg/command/server.go b/services/graph-explorer/pkg/command/server.go index a427e4d33b3..01a7a58e404 100644 --- a/services/graph-explorer/pkg/command/server.go +++ b/services/graph-explorer/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(ctx *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/graph/pkg/command/server.go b/services/graph/pkg/command/server.go index 3fead9ea79c..636ff4544fb 100644 --- a/services/graph/pkg/command/server.go +++ b/services/graph/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/groups/pkg/command/server.go b/services/groups/pkg/command/server.go index f5afcf72c4c..e6883793e7b 100644 --- a/services/groups/pkg/command/server.go +++ b/services/groups/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/idm/pkg/command/server.go b/services/idm/pkg/command/server.go index cf3670e0217..92a30f7baf0 100644 --- a/services/idm/pkg/command/server.go +++ b/services/idm/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/idp/pkg/command/server.go b/services/idp/pkg/command/server.go index de87b03b2c1..70bc123d7d0 100644 --- a/services/idp/pkg/command/server.go +++ b/services/idp/pkg/command/server.go @@ -32,7 +32,7 @@ const _rsaKeySize = 4096 func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/nats/pkg/command/server.go b/services/nats/pkg/command/server.go index c040d609aca..abb3ec7d0cc 100644 --- a/services/nats/pkg/command/server.go +++ b/services/nats/pkg/command/server.go @@ -18,7 +18,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/notifications/pkg/command/server.go b/services/notifications/pkg/command/server.go index 9d521795c29..9071bee1483 100644 --- a/services/notifications/pkg/command/server.go +++ b/services/notifications/pkg/command/server.go @@ -19,7 +19,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index 3fc7d05a0b4..19d4a351c4c 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -20,7 +20,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/ocs/pkg/command/server.go b/services/ocs/pkg/command/server.go index f3ddc42762c..04b3701c4dd 100644 --- a/services/ocs/pkg/command/server.go +++ b/services/ocs/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 37d11e49974..16cb959d432 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -38,7 +38,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/search/pkg/command/server.go b/services/search/pkg/command/server.go index 013b27bdc8c..3faf1e061c3 100644 --- a/services/search/pkg/command/server.go +++ b/services/search/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/settings/pkg/command/server.go b/services/settings/pkg/command/server.go index 2bde2df7600..4dd9b9a40b1 100644 --- a/services/settings/pkg/command/server.go +++ b/services/settings/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/sharing/pkg/command/server.go b/services/sharing/pkg/command/server.go index 054663a504d..a690f6d23b4 100644 --- a/services/sharing/pkg/command/server.go +++ b/services/sharing/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/storage-publiclink/pkg/command/server.go b/services/storage-publiclink/pkg/command/server.go index 9bd9e2456d2..80ebfaff2a1 100644 --- a/services/storage-publiclink/pkg/command/server.go +++ b/services/storage-publiclink/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/storage-shares/pkg/command/server.go b/services/storage-shares/pkg/command/server.go index d872b941bba..7a4c208c66e 100644 --- a/services/storage-shares/pkg/command/server.go +++ b/services/storage-shares/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/storage-system/pkg/command/server.go b/services/storage-system/pkg/command/server.go index f86426db0da..a9257b98587 100644 --- a/services/storage-system/pkg/command/server.go +++ b/services/storage-system/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/storage-users/pkg/command/server.go b/services/storage-users/pkg/command/server.go index 9c3435a0b34..caf1de68f22 100644 --- a/services/storage-users/pkg/command/server.go +++ b/services/storage-users/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/store/pkg/command/server.go b/services/store/pkg/command/server.go index 8ea9a0f9748..c548b786da1 100644 --- a/services/store/pkg/command/server.go +++ b/services/store/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/thumbnails/pkg/command/server.go b/services/thumbnails/pkg/command/server.go index cafd70258b1..404a9815c90 100644 --- a/services/thumbnails/pkg/command/server.go +++ b/services/thumbnails/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/users/pkg/command/server.go b/services/users/pkg/command/server.go index e06bd8e78dd..2fc836d3646 100644 --- a/services/users/pkg/command/server.go +++ b/services/users/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/web/pkg/command/server.go b/services/web/pkg/command/server.go index 85283bbcf0c..247e249631f 100644 --- a/services/web/pkg/command/server.go +++ b/services/web/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/webdav/pkg/command/server.go b/services/webdav/pkg/command/server.go index c3f0fa1b261..4b2290ae162 100644 --- a/services/webdav/pkg/command/server.go +++ b/services/webdav/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) From d93fd7ab4d7fe9188c787dbf65e77c1648608cee Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 18 Aug 2022 11:55:19 +0200 Subject: [PATCH 21/53] fix configuration of mimetypes for the app registry --- .../unreleased/bugfix-app-registry-default-mimetypes.md | 8 ++++++++ ...pty-file => bugfix-idp-init-certificate-empty-file.md} | 0 .../app-registry/pkg/config/defaults/defaultconfig.go | 8 ++++---- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/bugfix-app-registry-default-mimetypes.md rename changelog/unreleased/{bugfix-idp-init-certificate-empty-file => bugfix-idp-init-certificate-empty-file.md} (100%) diff --git a/changelog/unreleased/bugfix-app-registry-default-mimetypes.md b/changelog/unreleased/bugfix-app-registry-default-mimetypes.md new file mode 100644 index 00000000000..4d51f871332 --- /dev/null +++ b/changelog/unreleased/bugfix-app-registry-default-mimetypes.md @@ -0,0 +1,8 @@ +Bugfix: Fix configuration of mimetypes for the app registry + +We've fixed the configuration option for mimetypes in the app registry. +Previously the default config would always be merged over the user provided +configuration. Now the default mimetype configuration is only used if the user does not +providy any mimetype configuration (like it is already done in the proxy with the routes configuration). + +https://github.com/owncloud/ocis/pull/4411 diff --git a/changelog/unreleased/bugfix-idp-init-certificate-empty-file b/changelog/unreleased/bugfix-idp-init-certificate-empty-file.md similarity index 100% rename from changelog/unreleased/bugfix-idp-init-certificate-empty-file rename to changelog/unreleased/bugfix-idp-init-certificate-empty-file.md diff --git a/services/app-registry/pkg/config/defaults/defaultconfig.go b/services/app-registry/pkg/config/defaults/defaultconfig.go index 4846146f98c..c754f4e5064 100644 --- a/services/app-registry/pkg/config/defaults/defaultconfig.go +++ b/services/app-registry/pkg/config/defaults/defaultconfig.go @@ -30,9 +30,6 @@ func DefaultConfig() *config.Config { Reva: &config.Reva{ Address: "127.0.0.1:9142", }, - AppRegistry: config.AppRegistry{ - MimeTypeConfig: defaultMimeTypeConfig(), - }, } } @@ -150,6 +147,9 @@ func EnsureDefaults(cfg *config.Config) { } +// Sanitize the config func Sanitize(cfg *config.Config) { - // nothing to sanitize here atm + if cfg.AppRegistry.MimeTypeConfig == nil { + cfg.AppRegistry.MimeTypeConfig = defaultMimeTypeConfig() + } } From a1ea39f645dc11d013ebc89390c5271ddc7e64a4 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Thu, 18 Aug 2022 13:26:03 +0200 Subject: [PATCH 22/53] bump reva version Signed-off-by: jkoberg --- changelog/unreleased/bump-reva.md | 5 +++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 changelog/unreleased/bump-reva.md diff --git a/changelog/unreleased/bump-reva.md b/changelog/unreleased/bump-reva.md new file mode 100644 index 00000000000..dc839ad3abd --- /dev/null +++ b/changelog/unreleased/bump-reva.md @@ -0,0 +1,5 @@ +Enhancement: Bump reva version + +Bumps reva version + +https://github.com/owncloud/ocis/pull/4412 diff --git a/go.mod b/go.mod index 6d2350d953c..170a342815e 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.2 github.com/coreos/go-oidc/v3 v3.2.0 github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 - github.com/cs3org/reva/v2 v2.7.5-0.20220817100552-b0f72d755620 + github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index 61ac75368f2..814b0b3bd2b 100644 --- a/go.sum +++ b/go.sum @@ -291,8 +291,8 @@ github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4= github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A= github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 h1:cFnankJOCWndnOns4sKRG7yzH61ammK2Am6rEGWCK40= github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.7.5-0.20220817100552-b0f72d755620 h1:OZc0njRbjujMofFuhF3DYpZ+0k29jZJ0S7Ft8A/0xQM= -github.com/cs3org/reva/v2 v2.7.5-0.20220817100552-b0f72d755620/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= +github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa h1:v7dsI1tidpyQ0oiElSc30NO9rNcgpvJuzLileslTN1s= +github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= From d1f0dbc4c928539fe0a97af8aeb224f5fafb8d22 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Thu, 18 Aug 2022 12:03:48 +0000 Subject: [PATCH 23/53] Automated changelog update [skip ci] --- CHANGELOG.md | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10f35bcc85a..890f2b57432 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The following sections list the changes for unreleased. ## Summary * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) +* Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) @@ -22,6 +23,13 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4394 +* Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) + + We've already renamed extensions to services in previous PRs and this PR peforms this rename + for leftover occurences. + + https://github.com/owncloud/ocis/pull/4407 + * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) We've renamed the storage-users service's "uploads purge" command to "upload clean". @@ -1440,7 +1448,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 ## Summary @@ -1608,28 +1616,11 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 ## Summary @@ -1798,6 +1789,23 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 5a51a24bbd36ad5b998130752106e52953aba54e Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 18 Aug 2022 14:08:47 +0200 Subject: [PATCH 24/53] fix url in open-with-web documentation --- docs/services/app-registry/apps.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/services/app-registry/apps.md b/docs/services/app-registry/apps.md index 457e2294fb1..a6185c67145 100644 --- a/docs/services/app-registry/apps.md +++ b/docs/services/app-registry/apps.md @@ -200,9 +200,9 @@ HTTP status code: 200 **Request examples**: ```bash -curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=' +curl -X POST 'https://ocis.test/app/open-with-web?file_id=ZmlsZTppZAo=' -curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=&app_name=Collabora' +curl -X POST 'https://ocis.test/app/open-with-web?file_id=ZmlsZTppZAo=&app_name=Collabora' ``` **Response examples**: From e58eaabdeb1bb89575efe2a65c0bdb00b0cc9f8f Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Thu, 18 Aug 2022 08:57:27 +0000 Subject: [PATCH 25/53] move config parse error logging into function to ensure new lines and don't parse config for help --- .../unreleased/bugfix-help-config-newline.md | 6 +++ ocis-pkg/config/configlog/log.go | 30 +++++++++++++++ ocis/pkg/command/app-provider.go | 7 +--- ocis/pkg/command/app-registry.go | 7 +--- ocis/pkg/command/audit.go | 7 +--- ocis/pkg/command/auth-basic.go | 7 +--- ocis/pkg/command/auth-bearer.go | 7 +--- ocis/pkg/command/auth-machine.go | 7 +--- ocis/pkg/command/frontend.go | 7 +--- ocis/pkg/command/gateway.go | 7 +--- ocis/pkg/command/graph-explorer.go | 7 +--- ocis/pkg/command/graph.go | 7 +--- ocis/pkg/command/groups.go | 7 +--- ocis/pkg/command/idm.go | 7 +--- ocis/pkg/command/idp.go | 7 +--- ocis/pkg/command/migrate.go | 37 +++++++++++-------- ocis/pkg/command/nats.go | 7 +--- ocis/pkg/command/notifications.go | 7 +--- ocis/pkg/command/ocdav.go | 7 +--- ocis/pkg/command/ocs.go | 7 +--- ocis/pkg/command/proxy.go | 7 +--- ocis/pkg/command/search.go | 7 +--- ocis/pkg/command/server.go | 9 +---- ocis/pkg/command/settings.go | 7 +--- ocis/pkg/command/sharing.go | 7 +--- ocis/pkg/command/storage-publiclink.go | 7 +--- ocis/pkg/command/storage-shares.go | 7 +--- ocis/pkg/command/storage-system.go | 7 +--- ocis/pkg/command/storage-users.go | 7 +--- ocis/pkg/command/store.go | 7 +--- ocis/pkg/command/thumbnails.go | 7 +--- ocis/pkg/command/users.go | 7 +--- ocis/pkg/command/web.go | 7 +--- ocis/pkg/command/webdav.go | 7 +--- services/app-provider/pkg/command/health.go | 7 +--- services/app-provider/pkg/command/server.go | 8 +--- services/app-registry/pkg/command/health.go | 7 +--- services/app-registry/pkg/command/server.go | 8 +--- services/audit/pkg/command/server.go | 9 +---- services/auth-basic/pkg/command/health.go | 7 +--- services/auth-basic/pkg/command/server.go | 8 +--- services/auth-bearer/pkg/command/health.go | 7 +--- services/auth-bearer/pkg/command/server.go | 8 +--- services/auth-machine/pkg/command/health.go | 7 +--- services/auth-machine/pkg/command/server.go | 8 +--- services/frontend/pkg/command/health.go | 7 +--- services/frontend/pkg/command/server.go | 8 +--- services/gateway/pkg/command/health.go | 7 +--- services/gateway/pkg/command/server.go | 8 +--- services/graph-explorer/pkg/command/health.go | 7 +--- services/graph-explorer/pkg/command/server.go | 9 +---- services/graph/pkg/command/health.go | 7 +--- services/graph/pkg/command/server.go | 9 +---- services/groups/pkg/command/health.go | 7 +--- services/groups/pkg/command/server.go | 8 +--- services/idm/pkg/command/health.go | 7 +--- services/idm/pkg/command/resetpw.go | 10 ++--- services/idm/pkg/command/server.go | 8 +--- services/idp/pkg/command/health.go | 7 +--- services/idp/pkg/command/server.go | 9 ++--- services/nats/pkg/command/server.go | 9 +---- services/notifications/pkg/command/server.go | 9 +---- services/ocdav/pkg/command/health.go | 7 +--- services/ocdav/pkg/command/server.go | 9 +---- services/ocs/pkg/command/health.go | 7 +--- services/ocs/pkg/command/server.go | 9 +---- services/proxy/pkg/command/health.go | 7 +--- services/proxy/pkg/command/server.go | 9 +---- services/search/pkg/command/server.go | 9 +---- services/settings/pkg/command/health.go | 7 +--- services/settings/pkg/command/server.go | 9 +---- services/sharing/pkg/command/health.go | 7 +--- services/sharing/pkg/command/server.go | 8 +--- .../storage-publiclink/pkg/command/health.go | 7 +--- .../storage-publiclink/pkg/command/server.go | 8 +--- services/storage-shares/pkg/command/health.go | 7 +--- services/storage-shares/pkg/command/server.go | 8 +--- services/storage-system/pkg/command/health.go | 7 +--- services/storage-system/pkg/command/server.go | 8 +--- services/storage-users/pkg/command/health.go | 7 +--- services/storage-users/pkg/command/server.go | 8 +--- services/storage-users/pkg/command/uploads.go | 28 +++----------- services/store/pkg/command/health.go | 7 +--- services/store/pkg/command/server.go | 9 +---- services/thumbnails/pkg/command/health.go | 7 +--- services/thumbnails/pkg/command/server.go | 9 +---- services/users/pkg/command/health.go | 7 +--- services/users/pkg/command/server.go | 8 +--- services/web/pkg/command/health.go | 7 +--- services/web/pkg/command/server.go | 9 +---- services/webdav/pkg/command/health.go | 7 +--- services/webdav/pkg/command/server.go | 9 +---- 92 files changed, 241 insertions(+), 526 deletions(-) create mode 100644 changelog/unreleased/bugfix-help-config-newline.md create mode 100644 ocis-pkg/config/configlog/log.go diff --git a/changelog/unreleased/bugfix-help-config-newline.md b/changelog/unreleased/bugfix-help-config-newline.md new file mode 100644 index 00000000000..1470de3e56d --- /dev/null +++ b/changelog/unreleased/bugfix-help-config-newline.md @@ -0,0 +1,6 @@ +Bugfix: Show help for some commands when unconfigured + +We've fixed some commands to show the help also when oCIS is not yet configured. +Previously the help was not displayed to the user but instead a configuration validation error. + +https://github.com/owncloud/ocis/pull/4405 diff --git a/ocis-pkg/config/configlog/log.go b/ocis-pkg/config/configlog/log.go new file mode 100644 index 00000000000..c5ff40d04e2 --- /dev/null +++ b/ocis-pkg/config/configlog/log.go @@ -0,0 +1,30 @@ +package configlog + +import ( + "fmt" + "os" +) + +// LogError logs the error +func LogError(err error) { + if err != nil { + fmt.Printf("%v\n", err) + } +} + +// LogError logs the error and returns it unchanged +func LogReturnError(err error) error { + if err != nil { + fmt.Printf("%v\n", err) + } + return err +} + +// LogReturnFatal logs the error and calls os.Exit(1) and returns nil if no error is passed +func LogReturnFatal(err error) error { + if err != nil { + fmt.Printf("%v\n", err) + os.Exit(1) + } + return nil +} diff --git a/ocis/pkg/command/app-provider.go b/ocis/pkg/command/app-provider.go index 89120bd57f3..74cdbecd483 100644 --- a/ocis/pkg/command/app-provider.go +++ b/ocis/pkg/command/app-provider.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AppProviderCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AppProvider.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.AppProvider.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/app-registry.go b/ocis/pkg/command/app-registry.go index b16df293a80..d39e08201d2 100644 --- a/ocis/pkg/command/app-registry.go +++ b/ocis/pkg/command/app-registry.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AppRegistryCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AppRegistry.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.AppRegistry.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/audit.go b/ocis/pkg/command/audit.go index 58b4d4e0a67..ffc8b335ebf 100644 --- a/ocis/pkg/command/audit.go +++ b/ocis/pkg/command/audit.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AuditCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Audit.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Audit.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-basic.go b/ocis/pkg/command/auth-basic.go index 3a850faa67a..8503851d3b1 100644 --- a/ocis/pkg/command/auth-basic.go +++ b/ocis/pkg/command/auth-basic.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AuthBasicCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthBasic.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.AuthBasic.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-bearer.go b/ocis/pkg/command/auth-bearer.go index be1e3605039..213146f212a 100644 --- a/ocis/pkg/command/auth-bearer.go +++ b/ocis/pkg/command/auth-bearer.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AuthBearerCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthBearer.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.AuthBearer.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-machine.go b/ocis/pkg/command/auth-machine.go index 336823efab2..4561203c085 100644 --- a/ocis/pkg/command/auth-machine.go +++ b/ocis/pkg/command/auth-machine.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AuthMachineCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthMachine.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.AuthMachine.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/frontend.go b/ocis/pkg/command/frontend.go index 741e96cdce7..0ca6a4c6be8 100644 --- a/ocis/pkg/command/frontend.go +++ b/ocis/pkg/command/frontend.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func FrontendCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Frontend.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Frontend.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/gateway.go b/ocis/pkg/command/gateway.go index b771d3c9e9d..1107587c373 100644 --- a/ocis/pkg/command/gateway.go +++ b/ocis/pkg/command/gateway.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func GatewayCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Gateway.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Gateway.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/graph-explorer.go b/ocis/pkg/command/graph-explorer.go index 4c54deec1ea..4d295fd8256 100644 --- a/ocis/pkg/command/graph-explorer.go +++ b/ocis/pkg/command/graph-explorer.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func GraphExplorerCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.GraphExplorer.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.GraphExplorer.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/graph.go b/ocis/pkg/command/graph.go index ce0acc33e6b..6efc8179d22 100644 --- a/ocis/pkg/command/graph.go +++ b/ocis/pkg/command/graph.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func GraphCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Graph.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Graph.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/groups.go b/ocis/pkg/command/groups.go index 50394348946..edaffd9824e 100644 --- a/ocis/pkg/command/groups.go +++ b/ocis/pkg/command/groups.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func GroupsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Groups.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Groups.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/idm.go b/ocis/pkg/command/idm.go index 21862ade96a..d1e100a0567 100644 --- a/ocis/pkg/command/idm.go +++ b/ocis/pkg/command/idm.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func IDMCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.IDM.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.IDM.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/idp.go b/ocis/pkg/command/idp.go index 6b798bf4380..b932f2465d1 100644 --- a/ocis/pkg/command/idp.go +++ b/ocis/pkg/command/idp.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func IDPCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.IDP.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.IDP.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/migrate.go b/ocis/pkg/command/migrate.go index 3f18b96ece1..fa020a1afb6 100644 --- a/ocis/pkg/command/migrate.go +++ b/ocis/pkg/command/migrate.go @@ -2,7 +2,6 @@ package command import ( "context" - "fmt" "os" "sync" @@ -13,6 +12,7 @@ import ( "github.com/cs3org/reva/v2/pkg/share/manager/registry" "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/register" sharing "github.com/owncloud/ocis/v2/services/sharing/pkg/config" @@ -27,21 +27,6 @@ func Migrate(cfg *config.Config) *cli.Command { Name: "migrate", Usage: "migrate data from an existing to another instance", Category: "migration", - Before: func(c *cli.Context) error { - // Parse base config - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - return err - } - - // Parse sharing config - cfg.Sharing.Commons = cfg.Commons - if err := sharingparser.ParseConfig(cfg.Sharing); err != nil { - fmt.Printf("%v", err) - return err - } - return nil - }, Subcommands: []*cli.Command{ MigrateShares(cfg), MigratePublicShares(cfg), @@ -69,6 +54,16 @@ func MigrateShares(cfg *config.Config) *cli.Command { Usage: "Share manager to import the data into", }, }, + Before: func(c *cli.Context) error { + // Parse base config + if err := parser.ParseConfig(cfg, true); err != nil { + return configlog.LogReturnError(err) + } + + // Parse sharing config + cfg.Sharing.Commons = cfg.Commons + return configlog.LogReturnError(sharingparser.ParseConfig(cfg.Sharing)) + }, Action: func(c *cli.Context) error { log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger() ctx := log.WithContext(context.Background()) @@ -154,6 +149,16 @@ func MigratePublicShares(cfg *config.Config) *cli.Command { Usage: "Public share manager to import the data into", }, }, + Before: func(c *cli.Context) error { + // Parse base config + if err := parser.ParseConfig(cfg, true); err != nil { + return configlog.LogReturnError(err) + } + + // Parse sharing config + cfg.Sharing.Commons = cfg.Commons + return configlog.LogReturnError(sharingparser.ParseConfig(cfg.Sharing)) + }, Action: func(c *cli.Context) error { log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger() ctx := log.WithContext(context.Background()) diff --git a/ocis/pkg/command/nats.go b/ocis/pkg/command/nats.go index e8c60061ed0..a7ec22ad64e 100644 --- a/ocis/pkg/command/nats.go +++ b/ocis/pkg/command/nats.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func NatsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Nats.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Nats.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/notifications.go b/ocis/pkg/command/notifications.go index 0599dc86e88..1bdea39f23b 100644 --- a/ocis/pkg/command/notifications.go +++ b/ocis/pkg/command/notifications.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func NotificationsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Notifications.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Notifications.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/ocdav.go b/ocis/pkg/command/ocdav.go index cc04d648847..f48683a44e0 100644 --- a/ocis/pkg/command/ocdav.go +++ b/ocis/pkg/command/ocdav.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func OCDavCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.OCDav.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.OCDav.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/ocs.go b/ocis/pkg/command/ocs.go index abeb8310bd0..1c27e1cddc2 100644 --- a/ocis/pkg/command/ocs.go +++ b/ocis/pkg/command/ocs.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func OCSCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.OCS.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.OCS.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/proxy.go b/ocis/pkg/command/proxy.go index 127957bc693..7e1204248bb 100644 --- a/ocis/pkg/command/proxy.go +++ b/ocis/pkg/command/proxy.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func ProxyCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Proxy.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Proxy.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/search.go b/ocis/pkg/command/search.go index c649fbce414..050b8b4300d 100644 --- a/ocis/pkg/command/search.go +++ b/ocis/pkg/command/search.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func SearchCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Search.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Search.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/server.go b/ocis/pkg/command/server.go index c935aba9f14..685d55ebf55 100644 --- a/ocis/pkg/command/server.go +++ b/ocis/pkg/command/server.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/runtime" @@ -17,11 +16,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: "start a fullstack server (runtime and all services in supervised mode)", Category: "fullstack", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, false); err != nil { - fmt.Printf("%v", err) - return err - } - return nil + return configlog.LogReturnError(parser.ParseConfig(cfg, false)) }, Action: func(c *cli.Context) error { r := runtime.New(cfg) diff --git a/ocis/pkg/command/settings.go b/ocis/pkg/command/settings.go index ec95cf3a17a..c9609b10ef7 100644 --- a/ocis/pkg/command/settings.go +++ b/ocis/pkg/command/settings.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func SettingsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Settings.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Settings.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/sharing.go b/ocis/pkg/command/sharing.go index 9145f532c52..1df0e153030 100644 --- a/ocis/pkg/command/sharing.go +++ b/ocis/pkg/command/sharing.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func SharingCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Sharing.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Sharing.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-publiclink.go b/ocis/pkg/command/storage-publiclink.go index 04780870c5c..4d91368c643 100644 --- a/ocis/pkg/command/storage-publiclink.go +++ b/ocis/pkg/command/storage-publiclink.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func StoragePublicLinkCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StoragePublicLink.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.StoragePublicLink.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-shares.go b/ocis/pkg/command/storage-shares.go index e499e008f66..744b20c12d1 100644 --- a/ocis/pkg/command/storage-shares.go +++ b/ocis/pkg/command/storage-shares.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func StorageSharesCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageShares.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.StorageShares.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-system.go b/ocis/pkg/command/storage-system.go index e90af469073..ed790b6c435 100644 --- a/ocis/pkg/command/storage-system.go +++ b/ocis/pkg/command/storage-system.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func StorageSystemCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageSystem.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.StorageSystem.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-users.go b/ocis/pkg/command/storage-users.go index f1598332bb7..c3745a8429d 100644 --- a/ocis/pkg/command/storage-users.go +++ b/ocis/pkg/command/storage-users.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func StorageUsersCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageUsers.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.StorageUsers.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/store.go b/ocis/pkg/command/store.go index 617af037cd8..8dcc455f498 100644 --- a/ocis/pkg/command/store.go +++ b/ocis/pkg/command/store.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -19,9 +18,7 @@ func StoreCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Store.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Store.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/thumbnails.go b/ocis/pkg/command/thumbnails.go index da60a12a189..682020c7b97 100644 --- a/ocis/pkg/command/thumbnails.go +++ b/ocis/pkg/command/thumbnails.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func ThumbnailsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Thumbnails.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Thumbnails.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/users.go b/ocis/pkg/command/users.go index 992a0492858..97b7e30be3a 100644 --- a/ocis/pkg/command/users.go +++ b/ocis/pkg/command/users.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func UsersCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Users.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Users.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/web.go b/ocis/pkg/command/web.go index dd826d6b998..983134f1f72 100644 --- a/ocis/pkg/command/web.go +++ b/ocis/pkg/command/web.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func WebCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Web.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Web.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/webdav.go b/ocis/pkg/command/webdav.go index 20be56b5b0e..ea9e42531b9 100644 --- a/ocis/pkg/command/webdav.go +++ b/ocis/pkg/command/webdav.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -19,9 +18,7 @@ func WebDAVCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.WebDAV.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.WebDAV.Commons = cfg.Commons return nil }, diff --git a/services/app-provider/pkg/command/health.go b/services/app-provider/pkg/command/health.go index 9344b8a9acb..684c2ce42bc 100644 --- a/services/app-provider/pkg/command/health.go +++ b/services/app-provider/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/app-provider/pkg/config" "github.com/owncloud/ocis/v2/services/app-provider/pkg/config/parser" "github.com/owncloud/ocis/v2/services/app-provider/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-provider/pkg/command/server.go b/services/app-provider/pkg/command/server.go index 9f4e940f7f9..eb399c5782d 100644 --- a/services/app-provider/pkg/command/server.go +++ b/services/app-provider/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-registry/pkg/command/health.go b/services/app-registry/pkg/command/health.go index d1227a0544c..f9b6737f188 100644 --- a/services/app-registry/pkg/command/health.go +++ b/services/app-registry/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/app-registry/pkg/config" "github.com/owncloud/ocis/v2/services/app-registry/pkg/config/parser" "github.com/owncloud/ocis/v2/services/app-registry/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-registry/pkg/command/server.go b/services/app-registry/pkg/command/server.go index f104d405ab0..7339ebd3eb9 100644 --- a/services/app-registry/pkg/command/server.go +++ b/services/app-registry/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/app-registry/pkg/config" @@ -27,12 +28,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/audit/pkg/command/server.go b/services/audit/pkg/command/server.go index 89423128943..a3f0121d314 100644 --- a/services/audit/pkg/command/server.go +++ b/services/audit/pkg/command/server.go @@ -3,11 +3,11 @@ package command import ( "context" "fmt" - "os" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/events/server" "github.com/go-micro/plugins/v4/events/natsjs" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/audit/pkg/config" "github.com/owncloud/ocis/v2/services/audit/pkg/config/parser" "github.com/owncloud/ocis/v2/services/audit/pkg/logging" @@ -23,12 +23,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-basic/pkg/command/health.go b/services/auth-basic/pkg/command/health.go index 48f07427d8c..357139e6030 100644 --- a/services/auth-basic/pkg/command/health.go +++ b/services/auth-basic/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/auth-basic/pkg/config" "github.com/owncloud/ocis/v2/services/auth-basic/pkg/config/parser" "github.com/owncloud/ocis/v2/services/auth-basic/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-basic/pkg/command/server.go b/services/auth-basic/pkg/command/server.go index 59fd65cef9b..908883fca42 100644 --- a/services/auth-basic/pkg/command/server.go +++ b/services/auth-basic/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/ldap" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" @@ -29,12 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-bearer/pkg/command/health.go b/services/auth-bearer/pkg/command/health.go index 040e695b26a..59c619b49e6 100644 --- a/services/auth-bearer/pkg/command/health.go +++ b/services/auth-bearer/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/auth-bearer/pkg/config" "github.com/owncloud/ocis/v2/services/auth-bearer/pkg/config/parser" "github.com/owncloud/ocis/v2/services/auth-bearer/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-bearer/pkg/command/server.go b/services/auth-bearer/pkg/command/server.go index d43f0dc1e9f..d923a0e4ce7 100644 --- a/services/auth-bearer/pkg/command/server.go +++ b/services/auth-bearer/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-machine/pkg/command/health.go b/services/auth-machine/pkg/command/health.go index cc26ea7f29e..252bca77ca4 100644 --- a/services/auth-machine/pkg/command/health.go +++ b/services/auth-machine/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/auth-machine/pkg/config" "github.com/owncloud/ocis/v2/services/auth-machine/pkg/config/parser" "github.com/owncloud/ocis/v2/services/auth-machine/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-machine/pkg/command/server.go b/services/auth-machine/pkg/command/server.go index 1818693728d..31e3572af96 100644 --- a/services/auth-machine/pkg/command/server.go +++ b/services/auth-machine/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/frontend/pkg/command/health.go b/services/frontend/pkg/command/health.go index 15858682615..4feeb3d6d23 100644 --- a/services/frontend/pkg/command/health.go +++ b/services/frontend/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/frontend/pkg/config" "github.com/owncloud/ocis/v2/services/frontend/pkg/config/parser" "github.com/owncloud/ocis/v2/services/frontend/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/frontend/pkg/command/server.go b/services/frontend/pkg/command/server.go index b5309344e1a..8ac24922123 100644 --- a/services/frontend/pkg/command/server.go +++ b/services/frontend/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/gateway/pkg/command/health.go b/services/gateway/pkg/command/health.go index 1dd8229b695..54ca2717aca 100644 --- a/services/gateway/pkg/command/health.go +++ b/services/gateway/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/gateway/pkg/config" "github.com/owncloud/ocis/v2/services/gateway/pkg/config/parser" "github.com/owncloud/ocis/v2/services/gateway/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/gateway/pkg/command/server.go b/services/gateway/pkg/command/server.go index b24d05b9db5..18202cf136b 100644 --- a/services/gateway/pkg/command/server.go +++ b/services/gateway/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/gateway/pkg/config" @@ -27,12 +28,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph-explorer/pkg/command/health.go b/services/graph-explorer/pkg/command/health.go index b83a33c820b..07547d98b25 100644 --- a/services/graph-explorer/pkg/command/health.go +++ b/services/graph-explorer/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/config" "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/config/parser" "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph-explorer/pkg/command/server.go b/services/graph-explorer/pkg/command/server.go index 01a7a58e404..564739a539a 100644 --- a/services/graph-explorer/pkg/command/server.go +++ b/services/graph-explorer/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/config" "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/config/parser" @@ -24,12 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(ctx *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph/pkg/command/health.go b/services/graph/pkg/command/health.go index e1cbbbd641c..788ef9feb71 100644 --- a/services/graph/pkg/command/health.go +++ b/services/graph/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/graph/pkg/config" "github.com/owncloud/ocis/v2/services/graph/pkg/config/parser" "github.com/owncloud/ocis/v2/services/graph/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph/pkg/command/server.go b/services/graph/pkg/command/server.go index 636ff4544fb..4ad0faa3bf4 100644 --- a/services/graph/pkg/command/server.go +++ b/services/graph/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/graph/pkg/config" "github.com/owncloud/ocis/v2/services/graph/pkg/config/parser" @@ -24,12 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/groups/pkg/command/health.go b/services/groups/pkg/command/health.go index 9925b7ce688..e0a87a0806c 100644 --- a/services/groups/pkg/command/health.go +++ b/services/groups/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/groups/pkg/config" "github.com/owncloud/ocis/v2/services/groups/pkg/config/parser" "github.com/owncloud/ocis/v2/services/groups/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/groups/pkg/command/server.go b/services/groups/pkg/command/server.go index e6883793e7b..7652d2213fa 100644 --- a/services/groups/pkg/command/server.go +++ b/services/groups/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/ldap" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" @@ -29,12 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/health.go b/services/idm/pkg/command/health.go index 1b7d5a48410..1abac500cf5 100644 --- a/services/idm/pkg/command/health.go +++ b/services/idm/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/idm/pkg/config" "github.com/owncloud/ocis/v2/services/idm/pkg/config/parser" "github.com/owncloud/ocis/v2/services/idm/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/resetpw.go b/services/idm/pkg/command/resetpw.go index 7fd5c52eba4..a98b39946f1 100644 --- a/services/idm/pkg/command/resetpw.go +++ b/services/idm/pkg/command/resetpw.go @@ -11,6 +11,7 @@ import ( "github.com/go-ldap/ldap/v3" "github.com/libregraph/idm/pkg/ldbbolt" "github.com/libregraph/idm/server" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/services/idm/pkg/config" "github.com/owncloud/ocis/v2/services/idm/pkg/config/parser" @@ -24,15 +25,10 @@ import ( func ResetPassword(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "resetpassword", - Usage: fmt.Sprintf("Reset admin password"), + Usage: "Reset admin password", Category: "password reset", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/server.go b/services/idm/pkg/command/server.go index 92a30f7baf0..2e0e96d2d88 100644 --- a/services/idm/pkg/command/server.go +++ b/services/idm/pkg/command/server.go @@ -13,6 +13,7 @@ import ( "github.com/libregraph/idm/pkg/ldappassword" "github.com/libregraph/idm/pkg/ldbbolt" "github.com/libregraph/idm/server" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" pkgcrypto "github.com/owncloud/ocis/v2/ocis-pkg/crypto" "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/services/idm" @@ -29,12 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idp/pkg/command/health.go b/services/idp/pkg/command/health.go index 687d806fe5f..108af9d2899 100644 --- a/services/idp/pkg/command/health.go +++ b/services/idp/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/idp/pkg/config" "github.com/owncloud/ocis/v2/services/idp/pkg/config/parser" "github.com/owncloud/ocis/v2/services/idp/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idp/pkg/command/server.go b/services/idp/pkg/command/server.go index 70bc123d7d0..c6a265868c1 100644 --- a/services/idp/pkg/command/server.go +++ b/services/idp/pkg/command/server.go @@ -15,6 +15,7 @@ import ( "path/filepath" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/idp/pkg/config" "github.com/owncloud/ocis/v2/services/idp/pkg/config/parser" @@ -35,11 +36,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } + configlog.LogReturnFatal(parser.ParseConfig(cfg)) if cfg.IDP.EncryptionSecretFile != "" { if err := ensureEncryptionSecretExists(cfg.IDP.EncryptionSecretFile); err != nil { @@ -49,7 +46,7 @@ func Server(cfg *config.Config) *cli.Command { return err } } - return err + return nil }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/nats/pkg/command/server.go b/services/nats/pkg/command/server.go index abb3ec7d0cc..1cee11ebbd5 100644 --- a/services/nats/pkg/command/server.go +++ b/services/nats/pkg/command/server.go @@ -3,10 +3,10 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/nats/pkg/config" "github.com/owncloud/ocis/v2/services/nats/pkg/config/parser" "github.com/owncloud/ocis/v2/services/nats/pkg/logging" @@ -21,12 +21,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/notifications/pkg/command/server.go b/services/notifications/pkg/command/server.go index 9071bee1483..12f5ee5431e 100644 --- a/services/notifications/pkg/command/server.go +++ b/services/notifications/pkg/command/server.go @@ -2,11 +2,11 @@ package command import ( "fmt" - "os" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/events/server" "github.com/go-micro/plugins/v4/events/natsjs" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/notifications/pkg/channels" "github.com/owncloud/ocis/v2/services/notifications/pkg/config" "github.com/owncloud/ocis/v2/services/notifications/pkg/config/parser" @@ -22,12 +22,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocdav/pkg/command/health.go b/services/ocdav/pkg/command/health.go index 8724a43adbe..5bee1653e20 100644 --- a/services/ocdav/pkg/command/health.go +++ b/services/ocdav/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/ocdav/pkg/config" "github.com/owncloud/ocis/v2/services/ocdav/pkg/config/parser" "github.com/owncloud/ocis/v2/services/ocdav/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index 19d4a351c4c..1474cd9bc6b 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -3,10 +3,10 @@ package command import ( "context" "fmt" - "os" "github.com/cs3org/reva/v2/pkg/micro/ocdav" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/ocdav/pkg/config" "github.com/owncloud/ocis/v2/services/ocdav/pkg/config/parser" @@ -23,12 +23,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocs/pkg/command/health.go b/services/ocs/pkg/command/health.go index 197c2e1ca82..dfa9f077797 100644 --- a/services/ocs/pkg/command/health.go +++ b/services/ocs/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/ocs/pkg/config" "github.com/owncloud/ocis/v2/services/ocs/pkg/config/parser" "github.com/owncloud/ocis/v2/services/ocs/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocs/pkg/command/server.go b/services/ocs/pkg/command/server.go index 04b3701c4dd..507951fb5ca 100644 --- a/services/ocs/pkg/command/server.go +++ b/services/ocs/pkg/command/server.go @@ -3,8 +3,8 @@ package command import ( "context" "fmt" - "os" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/ocs/pkg/config/parser" "github.com/owncloud/ocis/v2/services/ocs/pkg/logging" @@ -25,12 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/proxy/pkg/command/health.go b/services/proxy/pkg/command/health.go index cb9ee814bf4..2646f53c6a5 100644 --- a/services/proxy/pkg/command/health.go +++ b/services/proxy/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/proxy/pkg/config" "github.com/owncloud/ocis/v2/services/proxy/pkg/config/parser" "github.com/owncloud/ocis/v2/services/proxy/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 16cb959d432..e5ebcaac84d 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -5,7 +5,6 @@ import ( "crypto/tls" "fmt" "net/http" - "os" "time" "github.com/coreos/go-oidc/v3/oidc" @@ -13,6 +12,7 @@ import ( chimiddleware "github.com/go-chi/chi/v5/middleware" "github.com/justinas/alice" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/log" pkgmiddleware "github.com/owncloud/ocis/v2/ocis-pkg/middleware" "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" @@ -41,12 +41,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/search/pkg/command/server.go b/services/search/pkg/command/server.go index 3faf1e061c3..0e0dcd0570c 100644 --- a/services/search/pkg/command/server.go +++ b/services/search/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/search/pkg/config" "github.com/owncloud/ocis/v2/services/search/pkg/config/parser" @@ -24,12 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/settings/pkg/command/health.go b/services/settings/pkg/command/health.go index 68dee3672a7..fc126cad14c 100644 --- a/services/settings/pkg/command/health.go +++ b/services/settings/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/settings/pkg/config" "github.com/owncloud/ocis/v2/services/settings/pkg/config/parser" "github.com/owncloud/ocis/v2/services/settings/pkg/logging" @@ -16,11 +17,7 @@ func Health(cfg *config.Config) *cli.Command { Name: "health", Usage: "Check health status", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/settings/pkg/command/server.go b/services/settings/pkg/command/server.go index 4dd9b9a40b1..101f070ee70 100644 --- a/services/settings/pkg/command/server.go +++ b/services/settings/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/settings/pkg/config" "github.com/owncloud/ocis/v2/services/settings/pkg/config/parser" @@ -25,12 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/sharing/pkg/command/health.go b/services/sharing/pkg/command/health.go index 1c2bb37ed45..00a34e5fcbd 100644 --- a/services/sharing/pkg/command/health.go +++ b/services/sharing/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/sharing/pkg/config" "github.com/owncloud/ocis/v2/services/sharing/pkg/config/parser" "github.com/owncloud/ocis/v2/services/sharing/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/sharing/pkg/command/server.go b/services/sharing/pkg/command/server.go index a690f6d23b4..00c675fa1dd 100644 --- a/services/sharing/pkg/command/server.go +++ b/services/sharing/pkg/command/server.go @@ -10,6 +10,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -29,12 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-publiclink/pkg/command/health.go b/services/storage-publiclink/pkg/command/health.go index b2f3889f507..70a392baf83 100644 --- a/services/storage-publiclink/pkg/command/health.go +++ b/services/storage-publiclink/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/storage-publiclink/pkg/config" "github.com/owncloud/ocis/v2/services/storage-publiclink/pkg/config/parser" "github.com/owncloud/ocis/v2/services/storage-publiclink/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-publiclink/pkg/command/server.go b/services/storage-publiclink/pkg/command/server.go index 80ebfaff2a1..257c78d8b5e 100644 --- a/services/storage-publiclink/pkg/command/server.go +++ b/services/storage-publiclink/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-shares/pkg/command/health.go b/services/storage-shares/pkg/command/health.go index 90e68c8ba17..f607aae7b62 100644 --- a/services/storage-shares/pkg/command/health.go +++ b/services/storage-shares/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/storage-shares/pkg/config" "github.com/owncloud/ocis/v2/services/storage-shares/pkg/config/parser" "github.com/owncloud/ocis/v2/services/storage-shares/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-shares/pkg/command/server.go b/services/storage-shares/pkg/command/server.go index 7a4c208c66e..8cd42e99c69 100644 --- a/services/storage-shares/pkg/command/server.go +++ b/services/storage-shares/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-system/pkg/command/health.go b/services/storage-system/pkg/command/health.go index 8b5d5e116a9..dcef0c624c8 100644 --- a/services/storage-system/pkg/command/health.go +++ b/services/storage-system/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/storage-system/pkg/config" "github.com/owncloud/ocis/v2/services/storage-system/pkg/config/parser" "github.com/owncloud/ocis/v2/services/storage-system/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-system/pkg/command/server.go b/services/storage-system/pkg/command/server.go index a9257b98587..aba0df8e68b 100644 --- a/services/storage-system/pkg/command/server.go +++ b/services/storage-system/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/health.go b/services/storage-users/pkg/command/health.go index 9dcb45556a8..3c92b63bd50 100644 --- a/services/storage-users/pkg/command/health.go +++ b/services/storage-users/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/storage-users/pkg/config" "github.com/owncloud/ocis/v2/services/storage-users/pkg/config/parser" "github.com/owncloud/ocis/v2/services/storage-users/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/server.go b/services/storage-users/pkg/command/server.go index caf1de68f22..f7b3f68501e 100644 --- a/services/storage-users/pkg/command/server.go +++ b/services/storage-users/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index ea553de0137..90568c97b04 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -12,6 +12,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage" "github.com/cs3org/reva/v2/pkg/storage/fs/registry" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/storage-users/pkg/config" "github.com/owncloud/ocis/v2/services/storage-users/pkg/config/parser" "github.com/owncloud/ocis/v2/services/storage-users/pkg/revaconfig" @@ -19,16 +20,9 @@ import ( func Uploads(cfg *config.Config) *cli.Command { return &cli.Command{ - Name: "uploads", - Usage: "manage unfinished uploads", - Category: "maintenance", - Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg); err != nil { - fmt.Printf("%v", err) - return err - } - return nil - }, + + Name: "uploads", + Usage: "manage unfinished uploads", Subcommands: []*cli.Command{ ListUploads(cfg), PurgeExpiredUploads(cfg), @@ -42,12 +36,7 @@ func ListUploads(cfg *config.Config) *cli.Command { Name: "list", Usage: "Print a list of all incomplete uploads", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { f, ok := registry.NewFuncs[cfg.Driver] @@ -88,12 +77,7 @@ func PurgeExpiredUploads(cfg *config.Config) *cli.Command { Name: "clean", Usage: "Clean up leftovers from expired uploads", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { f, ok := registry.NewFuncs[cfg.Driver] diff --git a/services/store/pkg/command/health.go b/services/store/pkg/command/health.go index e08ec2c782a..7ec9a7b1fef 100644 --- a/services/store/pkg/command/health.go +++ b/services/store/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/store/pkg/config" "github.com/owncloud/ocis/v2/services/store/pkg/config/parser" "github.com/owncloud/ocis/v2/services/store/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/store/pkg/command/server.go b/services/store/pkg/command/server.go index c548b786da1..e472e5d8159 100644 --- a/services/store/pkg/command/server.go +++ b/services/store/pkg/command/server.go @@ -3,10 +3,10 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/store/pkg/config" "github.com/owncloud/ocis/v2/services/store/pkg/config/parser" @@ -25,12 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/thumbnails/pkg/command/health.go b/services/thumbnails/pkg/command/health.go index d8e1210b01c..341b156f662 100644 --- a/services/thumbnails/pkg/command/health.go +++ b/services/thumbnails/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/config" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/config/parser" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/thumbnails/pkg/command/server.go b/services/thumbnails/pkg/command/server.go index 404a9815c90..ebe72e8e876 100644 --- a/services/thumbnails/pkg/command/server.go +++ b/services/thumbnails/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/config" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/config/parser" @@ -25,12 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/users/pkg/command/health.go b/services/users/pkg/command/health.go index 729dcf4d095..13841bde099 100644 --- a/services/users/pkg/command/health.go +++ b/services/users/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/users/pkg/config" "github.com/owncloud/ocis/v2/services/users/pkg/config/parser" "github.com/owncloud/ocis/v2/services/users/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/users/pkg/command/server.go b/services/users/pkg/command/server.go index 2fc836d3646..008200215a3 100644 --- a/services/users/pkg/command/server.go +++ b/services/users/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/ldap" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" @@ -29,12 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/web/pkg/command/health.go b/services/web/pkg/command/health.go index 633067f8567..157e8b434b3 100644 --- a/services/web/pkg/command/health.go +++ b/services/web/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/web/pkg/config" "github.com/owncloud/ocis/v2/services/web/pkg/config/parser" "github.com/owncloud/ocis/v2/services/web/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/web/pkg/command/server.go b/services/web/pkg/command/server.go index 247e249631f..083074bcc2c 100644 --- a/services/web/pkg/command/server.go +++ b/services/web/pkg/command/server.go @@ -5,9 +5,9 @@ import ( "encoding/json" "fmt" "io/ioutil" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/web/pkg/config" "github.com/owncloud/ocis/v2/services/web/pkg/config/parser" "github.com/owncloud/ocis/v2/services/web/pkg/logging" @@ -25,12 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/webdav/pkg/command/health.go b/services/webdav/pkg/command/health.go index e0bc1d5d28d..edfec5d6d81 100644 --- a/services/webdav/pkg/command/health.go +++ b/services/webdav/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/webdav/pkg/config" "github.com/owncloud/ocis/v2/services/webdav/pkg/config/parser" "github.com/owncloud/ocis/v2/services/webdav/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/webdav/pkg/command/server.go b/services/webdav/pkg/command/server.go index 4b2290ae162..4c505c5c445 100644 --- a/services/webdav/pkg/command/server.go +++ b/services/webdav/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/webdav/pkg/config" "github.com/owncloud/ocis/v2/services/webdav/pkg/config/parser" @@ -24,12 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) From 3df8218067f2016bc00f66e39b967f2bba949d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 19 Aug 2022 07:51:02 +0000 Subject: [PATCH 26/53] bump reva to b272f45c35aa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 170a342815e..96e95bcda06 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.2 github.com/coreos/go-oidc/v3 v3.2.0 github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 - github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa + github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index 814b0b3bd2b..86599db2d39 100644 --- a/go.sum +++ b/go.sum @@ -293,6 +293,8 @@ github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 h1:cFnankJOCWndn github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa h1:v7dsI1tidpyQ0oiElSc30NO9rNcgpvJuzLileslTN1s= github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= +github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8 h1:+VZ5D5rIfT7DHVntyQfr4MNV+vqBixbI/dOAG6MQSaQ= +github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= From ba9f5e42b0eb44fd28384a0d0f8e3c8fdf55ac81 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Fri, 19 Aug 2022 16:17:08 +0545 Subject: [PATCH 27/53] ping selenium to 104.0-20220812 --- .drone.star | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.star b/.drone.star index 1ac30b73526..95fe42377fe 100644 --- a/.drone.star +++ b/.drone.star @@ -33,7 +33,7 @@ PLUGINS_S3 = "plugins/s3:latest" PLUGINS_S3_CACHE = "plugins/s3-cache:1" PLUGINS_SLACK = "plugins/slack:1" REDIS = "redis:6-alpine" -SELENIUM_STANDALONE_CHROME_DEBUG = "selenium/standalone-chrome-debug:3.141.59" +SELENIUM_STANDALONE_CHROME = "selenium/standalone-chrome:104.0-20220812" SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:latest" THEGEEKLAB_DRONE_GITHUB_COMMENT = "thegeeklab/drone-github-comment:1" @@ -333,7 +333,7 @@ def testPipelines(ctx): pipelines += litmus(ctx, "ocis") if "skip" not in config["cs3ApiTests"] or not config["cs3ApiTests"]["skip"]: - pipelines += [cs3ApiTests(ctx, "ocis", "default")] + pipelines.append(cs3ApiTests(ctx, "ocis", "default")) if "skip" not in config["localApiTests"] or not config["localApiTests"]["skip"]: pipelines += [ localApiTests(ctx, "ocis", "apiAccountsHashDifficulty"), @@ -1955,7 +1955,7 @@ def selenium(): return [ { "name": "selenium", - "image": SELENIUM_STANDALONE_CHROME_DEBUG, + "image": SELENIUM_STANDALONE_CHROME, "volumes": [{ "name": "uploads", "path": "/uploads", From 145561729105f4c54eee157c94915ad42b20c2d7 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 20 Aug 2022 08:01:11 +0000 Subject: [PATCH 28/53] Automated changelog update [skip ci] --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 890f2b57432..f42de2b8ba5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The following sections list the changes for unreleased. ## Summary +* Bugfix - Fix configuration of mimetypes for the app registry: [#4411](https://github.com/owncloud/ocis/pull/4411) * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) * Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) @@ -16,6 +17,15 @@ The following sections list the changes for unreleased. ## Details +* Bugfix - Fix configuration of mimetypes for the app registry: [#4411](https://github.com/owncloud/ocis/pull/4411) + + We've fixed the configuration option for mimetypes in the app registry. Previously the + default config would always be merged over the user provided configuration. Now the default + mimetype configuration is only used if the user does not providy any mimetype configuration + (like it is already done in the proxy with the routes configuration). + + https://github.com/owncloud/ocis/pull/4411 + * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) We've fixed the behavior for the IDP private key generation so that a private key is also From e17d43a940bd091db7b003b86f4898ca6023f3d9 Mon Sep 17 00:00:00 2001 From: "sagargurung1001@gmail.com" Date: Tue, 16 Aug 2022 11:20:46 +0545 Subject: [PATCH 29/53] Add etag propagation for delete files folder for spaces --- .../apiSpaces/etagPropagation.feature | 123 ++++++++++++++++-- .../features/bootstrap/SpacesContext.php | 4 +- 2 files changed, 117 insertions(+), 10 deletions(-) diff --git a/tests/acceptance/features/apiSpaces/etagPropagation.feature b/tests/acceptance/features/apiSpaces/etagPropagation.feature index c861a894812..34a89dda54c 100644 --- a/tests/acceptance/features/apiSpaces/etagPropagation.feature +++ b/tests/acceptance/features/apiSpaces/etagPropagation.feature @@ -81,7 +81,7 @@ Feature: check etag propagation after different file alterations | Alice | / | Personal | | Alice | /upload | Personal | | Brian | / | Shares Jail | - | Brian | /upload | Shares Jail | + | Brian | /upload | Shares Jail | And these etags should not have changed | user | path | space | | Alice | /upload/renamed.txt | Personal | @@ -105,7 +105,7 @@ Feature: check etag propagation after different file alterations | Alice | / | Personal | | Alice | /upload | Personal | | Brian | / | Shares Jail | - | Brian | /upload | Shares Jail | + | Brian | /upload | Shares Jail | And these etags should not have changed | user | path | space | | Alice | /upload/renamed.txt | Personal | @@ -186,7 +186,7 @@ Feature: check etag propagation after different file alterations | Brian | / | Shares Jail | | Brian | /upload | Shares Jail | | Brian | /dst | Shares Jail | - + Scenario: as share reciever moving a folder from one folder to an other changes the etags of both folders for all collaborators Given user "Alice" has created folder "/dst" @@ -229,7 +229,7 @@ Feature: check etag propagation after different file alterations | Brian | / | Shares Jail | | Brian | /upload | Shares Jail | - + Scenario: as sharer creating a folder inside a shared folder changes etag for all collaborators Given user "Alice" has shared folder "/upload" with user "Brian" And user "Brian" has accepted share "/upload" offered by user "Alice" @@ -261,10 +261,10 @@ Feature: check etag propagation after different file alterations | Alice | / | Personal | | Alice | /upload | Personal | | Brian | / | Shares Jail | - | Brian | /upload | Shares Jail | + | Brian | /upload | Shares Jail | - Scenario: as sharer uploading a file inside a shared folder should update etags for all collaborators + Scenario: as sharer uploading a file inside a shared folder should update etags for all collaborators Given user "Alice" has shared folder "/upload" with user "Brian" And user "Brian" has accepted share "/upload" offered by user "Alice" And user "Alice" has stored etag of element "/" inside space "Personal" @@ -298,8 +298,8 @@ Feature: check etag propagation after different file alterations | Brian | / | Shares Jail | | Brian | /upload | Shares Jail | - - Scenario: as sharer overwriting a file inside a shared folder should update etags for all collaborators + + Scenario: as sharer overwriting a file inside a shared folder should update etags for all collaborators Given user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt" And user "Alice" has shared folder "/upload" with user "Brian" And user "Brian" has accepted share "/upload" offered by user "Alice" @@ -315,3 +315,110 @@ Feature: check etag propagation after different file alterations | Alice | /upload | Personal | | Brian | / | Shares Jail | | Brian | /upload | Shares Jail | + + + Scenario: As share receiver deleting (removing) a file changes the etags of all parents for all collaborators + Given user "Alice" has created folder "/upload/sub" + And user "Alice" has uploaded file with content "uploaded content" to "/upload/sub/file.txt" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" inside space "Personal" + And user "Alice" has stored etag of element "/upload" inside space "Personal" + And user "Alice" has stored etag of element "/upload/sub" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload/sub" inside space "Shares Jail" + When user "Brian" removes the file "upload/sub/file.txt" from space "Shares Jail" + Then the HTTP status code should be "204" + And these etags should have changed + | user | path | space | + | Alice | / | Personal | + | Alice | /upload | Personal | + | Alice | /upload/sub | Personal | + | Brian | / | Shares Jail | + | Brian | /upload | Shares Jail | + | Brian | /upload/sub | Shares Jail | + And these etags should not have changed + | user | path | space | + | Brian | / | Personal | + + + Scenario: As sharer deleting (removing) a file changes the etags of all parents for all collaborators + Given user "Alice" has created folder "/upload/sub" + And user "Alice" has uploaded file with content "uploaded content" to "/upload/sub/file.txt" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" inside space "Personal" + And user "Alice" has stored etag of element "/upload" inside space "Personal" + And user "Alice" has stored etag of element "/upload/sub" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload/sub" inside space "Shares Jail" + When user "Alice" removes the file "upload/sub/file.txt" from space "Personal" + Then the HTTP status code should be "204" + And these etags should have changed + | user | path | space | + | Alice | / | Personal | + | Alice | /upload | Personal | + | Alice | /upload/sub | Personal | + | Brian | / | Shares Jail | + | Brian | /upload | Shares Jail | + | Brian | /upload/sub | Shares Jail | + And these etags should not have changed + | user | path | space | + | Brian | / | Personal | + + + Scenario: As share receiver deleting (removing) a folder changes the etags of all parents for all collaborators + Given user "Alice" has created folder "/upload/sub" + And user "Alice" has created folder "/upload/sub/toDelete" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" inside space "Personal" + And user "Alice" has stored etag of element "/upload" inside space "Personal" + And user "Alice" has stored etag of element "/upload/sub" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload/sub" inside space "Shares Jail" + When user "Brian" removes the file "upload/sub/toDelete" from space "Shares Jail" + Then the HTTP status code should be "204" + And these etags should have changed + | user | path | space | + | Alice | / | Personal | + | Alice | /upload | Personal | + | Alice | /upload/sub | Personal | + | Brian | / | Shares Jail | + | Brian | /upload | Shares Jail | + | Brian | /upload/sub | Shares Jail | + And these etags should not have changed + | user | path | space | + | Brian | / | Personal | + + Scenario: As sharer deleting (removing) a folder changes the etags of all parents for all collaborators + Given user "Alice" has created folder "/upload/sub" + And user "Alice" has created folder "/upload/sub/toDelete" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" inside space "Personal" + And user "Alice" has stored etag of element "/upload" inside space "Personal" + And user "Alice" has stored etag of element "/upload/sub" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload/sub" inside space "Shares Jail" + When user "Alice" removes the file "upload/sub/toDelete" from space "Personal" + Then the HTTP status code should be "204" + And these etags should have changed + | user | path | space | + | Alice | / | Personal | + | Alice | /upload | Personal | + | Alice | /upload/sub | Personal | + | Brian | / | Shares Jail | + | Brian | /upload | Shares Jail | + | Brian | /upload/sub | Shares Jail | + And these etags should not have changed + | user | path | space | + | Brian | / | Personal | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 470a9d0fd9b..43c96caeeac 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -2215,7 +2215,7 @@ class SpacesContext implements Context { string $spaceName ): void { $space = $this->getSpaceByName($user, $spaceName); - $spaceWebDavUrl = $space["root"]["webDavUrl"] . '/' . $object; + $spaceWebDavUrl = $space["root"]["webDavUrl"] . '/' . ltrim($object, "/"); $this->featureContext->setResponse( HttpRequestHelper::delete( $spaceWebDavUrl, @@ -3035,7 +3035,7 @@ class SpacesContext implements Context { Assert::assertEmpty($responseArray, __METHOD__ . ' Response should be empty'); } } - + /** * @When /^user "([^"]*)" gets the following properties of (?:file|folder|entry|resource) "([^"]*)" inside space "([^"]*)" using the WebDAV API$/ * From 23344fd08eb4a312c57b69cb1f95c22e25ff6a30 Mon Sep 17 00:00:00 2001 From: "sagargurung1001@gmail.com" Date: Tue, 16 Aug 2022 11:49:06 +0545 Subject: [PATCH 30/53] Update expected to failure for etag --- .drone.env | 2 +- tests/acceptance/expected-failures-API-on-OCIS-storage.md | 8 ++++---- .../acceptance/features/apiSpaces/etagPropagation.feature | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.drone.env b/.drone.env index 4cc690e0985..bf41b89dff6 100644 --- a/.drone.env +++ b/.drone.env @@ -1,5 +1,5 @@ # The test runner source for API tests -CORE_COMMITID=76048f490ac50af03594d181c5baf49f87c18b6e +CORE_COMMITID=f79fbff0a0d129df7b6ec20bc202665c4fda5fad CORE_BRANCH=master # The test runner source for UI tests diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index 7da96c76e19..e39067d0abb 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -954,10 +954,6 @@ And other missing implementation of favorites - [apiWebdavUploadTUS/uploadToShare.feature:254](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L254) - [apiWebdavUploadTUS/uploadToShare.feature:301](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L301) - [apiWebdavUploadTUS/uploadToShare.feature:326](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L326) -- [apiWebdavEtagPropagation1/deleteFileFolder.feature:120](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation1/deleteFileFolder.feature#L120) -- [apiWebdavEtagPropagation1/deleteFileFolder.feature:156](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation1/deleteFileFolder.feature#L156) -- [apiWebdavEtagPropagation1/deleteFileFolder.feature:194](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation1/deleteFileFolder.feature#L194) -- [apiWebdavEtagPropagation1/deleteFileFolder.feature:232](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation1/deleteFileFolder.feature#L232) - [apiWebdavLocks2/resharedSharesToShares.feature:117](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L117) - [apiWebdavLocks2/resharedSharesToShares.feature:118](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L118) - [apiWebdavLocks2/resharedSharesToShares.feature:144](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L144) @@ -1397,5 +1393,9 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiTrashbin/trashbinFilesFolders.feature:438](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L438) - [apiTrashbin/trashbinFilesFolders.feature:475](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L475) +#### [valid WebDAV (DELETE, COPY or MOVE) requests with body must exit with 415](https://github.com/owncloud/ocis/issues/4332) +- [apiAuthWebDav/webDavDELETEAuth.feature:188](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiAuthWebDav/webDavDELETEAuth.feature#L188) +- [apiAuthWebDav/webDavDELETEAuth.feature:199](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiAuthWebDav/webDavDELETEAuth.feature#L199) + Note: always have an empty line at the end of this file. The bash script that processes this file requires that the last line has a newline on the end. diff --git a/tests/acceptance/features/apiSpaces/etagPropagation.feature b/tests/acceptance/features/apiSpaces/etagPropagation.feature index 34a89dda54c..bd93c6598a0 100644 --- a/tests/acceptance/features/apiSpaces/etagPropagation.feature +++ b/tests/acceptance/features/apiSpaces/etagPropagation.feature @@ -397,6 +397,7 @@ Feature: check etag propagation after different file alterations | user | path | space | | Brian | / | Personal | + Scenario: As sharer deleting (removing) a folder changes the etags of all parents for all collaborators Given user "Alice" has created folder "/upload/sub" And user "Alice" has created folder "/upload/sub/toDelete" From 9f2be9f4f95dd27553a98576ecc73c72eaf65db7 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Mon, 22 Aug 2022 08:08:18 +0200 Subject: [PATCH 31/53] remove Log prefix from configlog functions --- ocis-pkg/config/configlog/log.go | 12 ++++++------ ocis/pkg/command/app-provider.go | 2 +- ocis/pkg/command/app-registry.go | 2 +- ocis/pkg/command/audit.go | 2 +- ocis/pkg/command/auth-basic.go | 2 +- ocis/pkg/command/auth-bearer.go | 2 +- ocis/pkg/command/auth-machine.go | 2 +- ocis/pkg/command/frontend.go | 2 +- ocis/pkg/command/gateway.go | 2 +- ocis/pkg/command/graph-explorer.go | 2 +- ocis/pkg/command/graph.go | 2 +- ocis/pkg/command/groups.go | 2 +- ocis/pkg/command/idm.go | 2 +- ocis/pkg/command/idp.go | 2 +- ocis/pkg/command/migrate.go | 8 ++++---- ocis/pkg/command/nats.go | 2 +- ocis/pkg/command/notifications.go | 2 +- ocis/pkg/command/ocdav.go | 2 +- ocis/pkg/command/ocs.go | 2 +- ocis/pkg/command/proxy.go | 2 +- ocis/pkg/command/search.go | 2 +- ocis/pkg/command/server.go | 2 +- ocis/pkg/command/settings.go | 2 +- ocis/pkg/command/sharing.go | 2 +- ocis/pkg/command/storage-publiclink.go | 2 +- ocis/pkg/command/storage-shares.go | 2 +- ocis/pkg/command/storage-system.go | 2 +- ocis/pkg/command/storage-users.go | 2 +- ocis/pkg/command/store.go | 2 +- ocis/pkg/command/thumbnails.go | 2 +- ocis/pkg/command/users.go | 2 +- ocis/pkg/command/web.go | 2 +- ocis/pkg/command/webdav.go | 2 +- services/app-provider/pkg/command/health.go | 2 +- services/app-provider/pkg/command/server.go | 2 +- services/app-registry/pkg/command/health.go | 2 +- services/app-registry/pkg/command/server.go | 2 +- services/audit/pkg/command/server.go | 2 +- services/auth-basic/pkg/command/health.go | 2 +- services/auth-basic/pkg/command/server.go | 2 +- services/auth-bearer/pkg/command/health.go | 2 +- services/auth-bearer/pkg/command/server.go | 2 +- services/auth-machine/pkg/command/health.go | 2 +- services/auth-machine/pkg/command/server.go | 2 +- services/frontend/pkg/command/health.go | 2 +- services/frontend/pkg/command/server.go | 2 +- services/gateway/pkg/command/health.go | 2 +- services/gateway/pkg/command/server.go | 2 +- services/graph-explorer/pkg/command/health.go | 2 +- services/graph-explorer/pkg/command/server.go | 2 +- services/graph/pkg/command/health.go | 2 +- services/graph/pkg/command/server.go | 2 +- services/groups/pkg/command/health.go | 2 +- services/groups/pkg/command/server.go | 2 +- services/idm/pkg/command/health.go | 2 +- services/idm/pkg/command/resetpw.go | 2 +- services/idm/pkg/command/server.go | 2 +- services/idp/pkg/command/health.go | 2 +- services/idp/pkg/command/server.go | 2 +- services/nats/pkg/command/server.go | 2 +- services/notifications/pkg/command/server.go | 2 +- services/ocdav/pkg/command/health.go | 2 +- services/ocdav/pkg/command/server.go | 2 +- services/ocs/pkg/command/health.go | 2 +- services/ocs/pkg/command/server.go | 2 +- services/proxy/pkg/command/health.go | 2 +- services/proxy/pkg/command/server.go | 2 +- services/search/pkg/command/server.go | 2 +- services/settings/pkg/command/health.go | 2 +- services/settings/pkg/command/server.go | 2 +- services/sharing/pkg/command/health.go | 2 +- services/sharing/pkg/command/server.go | 2 +- services/storage-publiclink/pkg/command/health.go | 2 +- services/storage-publiclink/pkg/command/server.go | 2 +- services/storage-shares/pkg/command/health.go | 2 +- services/storage-shares/pkg/command/server.go | 2 +- services/storage-system/pkg/command/health.go | 2 +- services/storage-system/pkg/command/server.go | 2 +- services/storage-users/pkg/command/health.go | 2 +- services/storage-users/pkg/command/server.go | 2 +- services/storage-users/pkg/command/uploads.go | 4 ++-- services/store/pkg/command/health.go | 2 +- services/store/pkg/command/server.go | 2 +- services/thumbnails/pkg/command/health.go | 2 +- services/thumbnails/pkg/command/server.go | 2 +- services/users/pkg/command/health.go | 2 +- services/users/pkg/command/server.go | 2 +- services/web/pkg/command/health.go | 2 +- services/web/pkg/command/server.go | 2 +- services/webdav/pkg/command/health.go | 2 +- services/webdav/pkg/command/server.go | 2 +- 91 files changed, 100 insertions(+), 100 deletions(-) diff --git a/ocis-pkg/config/configlog/log.go b/ocis-pkg/config/configlog/log.go index c5ff40d04e2..33079e846db 100644 --- a/ocis-pkg/config/configlog/log.go +++ b/ocis-pkg/config/configlog/log.go @@ -5,23 +5,23 @@ import ( "os" ) -// LogError logs the error -func LogError(err error) { +// Error logs the error +func Error(err error) { if err != nil { fmt.Printf("%v\n", err) } } -// LogError logs the error and returns it unchanged -func LogReturnError(err error) error { +// ReturnError logs the error and returns it unchanged +func ReturnError(err error) error { if err != nil { fmt.Printf("%v\n", err) } return err } -// LogReturnFatal logs the error and calls os.Exit(1) and returns nil if no error is passed -func LogReturnFatal(err error) error { +// ReturnFatal logs the error and calls os.Exit(1) and returns nil if no error is passed +func ReturnFatal(err error) error { if err != nil { fmt.Printf("%v\n", err) os.Exit(1) diff --git a/ocis/pkg/command/app-provider.go b/ocis/pkg/command/app-provider.go index 74cdbecd483..50f20ce7665 100644 --- a/ocis/pkg/command/app-provider.go +++ b/ocis/pkg/command/app-provider.go @@ -17,7 +17,7 @@ func AppProviderCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AppProvider.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.AppProvider.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/app-registry.go b/ocis/pkg/command/app-registry.go index d39e08201d2..d35fcabb424 100644 --- a/ocis/pkg/command/app-registry.go +++ b/ocis/pkg/command/app-registry.go @@ -17,7 +17,7 @@ func AppRegistryCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AppRegistry.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.AppRegistry.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/audit.go b/ocis/pkg/command/audit.go index ffc8b335ebf..7299a71a847 100644 --- a/ocis/pkg/command/audit.go +++ b/ocis/pkg/command/audit.go @@ -17,7 +17,7 @@ func AuditCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Audit.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Audit.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-basic.go b/ocis/pkg/command/auth-basic.go index 8503851d3b1..48a026647c1 100644 --- a/ocis/pkg/command/auth-basic.go +++ b/ocis/pkg/command/auth-basic.go @@ -17,7 +17,7 @@ func AuthBasicCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthBasic.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.AuthBasic.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-bearer.go b/ocis/pkg/command/auth-bearer.go index 213146f212a..413e15e9efb 100644 --- a/ocis/pkg/command/auth-bearer.go +++ b/ocis/pkg/command/auth-bearer.go @@ -17,7 +17,7 @@ func AuthBearerCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthBearer.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.AuthBearer.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-machine.go b/ocis/pkg/command/auth-machine.go index 4561203c085..17c23b632f6 100644 --- a/ocis/pkg/command/auth-machine.go +++ b/ocis/pkg/command/auth-machine.go @@ -17,7 +17,7 @@ func AuthMachineCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthMachine.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.AuthMachine.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/frontend.go b/ocis/pkg/command/frontend.go index 0ca6a4c6be8..ae28f410593 100644 --- a/ocis/pkg/command/frontend.go +++ b/ocis/pkg/command/frontend.go @@ -17,7 +17,7 @@ func FrontendCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Frontend.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Frontend.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/gateway.go b/ocis/pkg/command/gateway.go index 1107587c373..3562ffade54 100644 --- a/ocis/pkg/command/gateway.go +++ b/ocis/pkg/command/gateway.go @@ -17,7 +17,7 @@ func GatewayCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Gateway.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Gateway.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/graph-explorer.go b/ocis/pkg/command/graph-explorer.go index 4d295fd8256..87e6fe71f68 100644 --- a/ocis/pkg/command/graph-explorer.go +++ b/ocis/pkg/command/graph-explorer.go @@ -17,7 +17,7 @@ func GraphExplorerCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.GraphExplorer.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.GraphExplorer.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/graph.go b/ocis/pkg/command/graph.go index 6efc8179d22..4ff45e23138 100644 --- a/ocis/pkg/command/graph.go +++ b/ocis/pkg/command/graph.go @@ -17,7 +17,7 @@ func GraphCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Graph.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Graph.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/groups.go b/ocis/pkg/command/groups.go index edaffd9824e..630f1060ee6 100644 --- a/ocis/pkg/command/groups.go +++ b/ocis/pkg/command/groups.go @@ -17,7 +17,7 @@ func GroupsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Groups.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Groups.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/idm.go b/ocis/pkg/command/idm.go index d1e100a0567..3adc8373889 100644 --- a/ocis/pkg/command/idm.go +++ b/ocis/pkg/command/idm.go @@ -17,7 +17,7 @@ func IDMCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.IDM.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.IDM.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/idp.go b/ocis/pkg/command/idp.go index b932f2465d1..b8f0449c785 100644 --- a/ocis/pkg/command/idp.go +++ b/ocis/pkg/command/idp.go @@ -17,7 +17,7 @@ func IDPCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.IDP.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.IDP.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/migrate.go b/ocis/pkg/command/migrate.go index fa020a1afb6..985c44ba976 100644 --- a/ocis/pkg/command/migrate.go +++ b/ocis/pkg/command/migrate.go @@ -57,12 +57,12 @@ func MigrateShares(cfg *config.Config) *cli.Command { Before: func(c *cli.Context) error { // Parse base config if err := parser.ParseConfig(cfg, true); err != nil { - return configlog.LogReturnError(err) + return configlog.ReturnError(err) } // Parse sharing config cfg.Sharing.Commons = cfg.Commons - return configlog.LogReturnError(sharingparser.ParseConfig(cfg.Sharing)) + return configlog.ReturnError(sharingparser.ParseConfig(cfg.Sharing)) }, Action: func(c *cli.Context) error { log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger() @@ -152,12 +152,12 @@ func MigratePublicShares(cfg *config.Config) *cli.Command { Before: func(c *cli.Context) error { // Parse base config if err := parser.ParseConfig(cfg, true); err != nil { - return configlog.LogReturnError(err) + return configlog.ReturnError(err) } // Parse sharing config cfg.Sharing.Commons = cfg.Commons - return configlog.LogReturnError(sharingparser.ParseConfig(cfg.Sharing)) + return configlog.ReturnError(sharingparser.ParseConfig(cfg.Sharing)) }, Action: func(c *cli.Context) error { log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger() diff --git a/ocis/pkg/command/nats.go b/ocis/pkg/command/nats.go index a7ec22ad64e..989286c0aea 100644 --- a/ocis/pkg/command/nats.go +++ b/ocis/pkg/command/nats.go @@ -17,7 +17,7 @@ func NatsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Nats.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Nats.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/notifications.go b/ocis/pkg/command/notifications.go index 1bdea39f23b..0fc591f1460 100644 --- a/ocis/pkg/command/notifications.go +++ b/ocis/pkg/command/notifications.go @@ -17,7 +17,7 @@ func NotificationsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Notifications.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Notifications.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/ocdav.go b/ocis/pkg/command/ocdav.go index f48683a44e0..a46cd3ecf56 100644 --- a/ocis/pkg/command/ocdav.go +++ b/ocis/pkg/command/ocdav.go @@ -17,7 +17,7 @@ func OCDavCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.OCDav.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.OCDav.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/ocs.go b/ocis/pkg/command/ocs.go index 1c27e1cddc2..89091138c4e 100644 --- a/ocis/pkg/command/ocs.go +++ b/ocis/pkg/command/ocs.go @@ -17,7 +17,7 @@ func OCSCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.OCS.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.OCS.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/proxy.go b/ocis/pkg/command/proxy.go index 7e1204248bb..0bdbf71e250 100644 --- a/ocis/pkg/command/proxy.go +++ b/ocis/pkg/command/proxy.go @@ -17,7 +17,7 @@ func ProxyCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Proxy.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Proxy.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/search.go b/ocis/pkg/command/search.go index 050b8b4300d..59cb691e9e6 100644 --- a/ocis/pkg/command/search.go +++ b/ocis/pkg/command/search.go @@ -17,7 +17,7 @@ func SearchCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Search.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Search.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/server.go b/ocis/pkg/command/server.go index 685d55ebf55..a83ffd585f1 100644 --- a/ocis/pkg/command/server.go +++ b/ocis/pkg/command/server.go @@ -16,7 +16,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: "start a fullstack server (runtime and all services in supervised mode)", Category: "fullstack", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg, false)) + return configlog.ReturnError(parser.ParseConfig(cfg, false)) }, Action: func(c *cli.Context) error { r := runtime.New(cfg) diff --git a/ocis/pkg/command/settings.go b/ocis/pkg/command/settings.go index c9609b10ef7..d5950b2096d 100644 --- a/ocis/pkg/command/settings.go +++ b/ocis/pkg/command/settings.go @@ -17,7 +17,7 @@ func SettingsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Settings.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Settings.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/sharing.go b/ocis/pkg/command/sharing.go index 1df0e153030..31ccc40ca2e 100644 --- a/ocis/pkg/command/sharing.go +++ b/ocis/pkg/command/sharing.go @@ -17,7 +17,7 @@ func SharingCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Sharing.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Sharing.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-publiclink.go b/ocis/pkg/command/storage-publiclink.go index 4d91368c643..1819089247d 100644 --- a/ocis/pkg/command/storage-publiclink.go +++ b/ocis/pkg/command/storage-publiclink.go @@ -17,7 +17,7 @@ func StoragePublicLinkCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StoragePublicLink.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.StoragePublicLink.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-shares.go b/ocis/pkg/command/storage-shares.go index 744b20c12d1..6def8926965 100644 --- a/ocis/pkg/command/storage-shares.go +++ b/ocis/pkg/command/storage-shares.go @@ -17,7 +17,7 @@ func StorageSharesCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageShares.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.StorageShares.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-system.go b/ocis/pkg/command/storage-system.go index ed790b6c435..cd933eeeaa3 100644 --- a/ocis/pkg/command/storage-system.go +++ b/ocis/pkg/command/storage-system.go @@ -17,7 +17,7 @@ func StorageSystemCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageSystem.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.StorageSystem.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-users.go b/ocis/pkg/command/storage-users.go index c3745a8429d..980cc953d6f 100644 --- a/ocis/pkg/command/storage-users.go +++ b/ocis/pkg/command/storage-users.go @@ -17,7 +17,7 @@ func StorageUsersCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageUsers.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.StorageUsers.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/store.go b/ocis/pkg/command/store.go index 8dcc455f498..947779d71e1 100644 --- a/ocis/pkg/command/store.go +++ b/ocis/pkg/command/store.go @@ -18,7 +18,7 @@ func StoreCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Store.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Store.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/thumbnails.go b/ocis/pkg/command/thumbnails.go index 682020c7b97..235edfafb37 100644 --- a/ocis/pkg/command/thumbnails.go +++ b/ocis/pkg/command/thumbnails.go @@ -17,7 +17,7 @@ func ThumbnailsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Thumbnails.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Thumbnails.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/users.go b/ocis/pkg/command/users.go index 97b7e30be3a..905c7571875 100644 --- a/ocis/pkg/command/users.go +++ b/ocis/pkg/command/users.go @@ -17,7 +17,7 @@ func UsersCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Users.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Users.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/web.go b/ocis/pkg/command/web.go index 983134f1f72..e7b1f001df6 100644 --- a/ocis/pkg/command/web.go +++ b/ocis/pkg/command/web.go @@ -17,7 +17,7 @@ func WebCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Web.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Web.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/webdav.go b/ocis/pkg/command/webdav.go index ea9e42531b9..6acd8ec5960 100644 --- a/ocis/pkg/command/webdav.go +++ b/ocis/pkg/command/webdav.go @@ -18,7 +18,7 @@ func WebDAVCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.WebDAV.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.WebDAV.Commons = cfg.Commons return nil }, diff --git a/services/app-provider/pkg/command/health.go b/services/app-provider/pkg/command/health.go index 684c2ce42bc..23db3c5011f 100644 --- a/services/app-provider/pkg/command/health.go +++ b/services/app-provider/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-provider/pkg/command/server.go b/services/app-provider/pkg/command/server.go index eb399c5782d..a7fc216d07e 100644 --- a/services/app-provider/pkg/command/server.go +++ b/services/app-provider/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-registry/pkg/command/health.go b/services/app-registry/pkg/command/health.go index f9b6737f188..f8331072cc5 100644 --- a/services/app-registry/pkg/command/health.go +++ b/services/app-registry/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-registry/pkg/command/server.go b/services/app-registry/pkg/command/server.go index 7339ebd3eb9..aa230570fbe 100644 --- a/services/app-registry/pkg/command/server.go +++ b/services/app-registry/pkg/command/server.go @@ -28,7 +28,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/audit/pkg/command/server.go b/services/audit/pkg/command/server.go index a3f0121d314..2537adfdd57 100644 --- a/services/audit/pkg/command/server.go +++ b/services/audit/pkg/command/server.go @@ -23,7 +23,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-basic/pkg/command/health.go b/services/auth-basic/pkg/command/health.go index 357139e6030..269847ebb80 100644 --- a/services/auth-basic/pkg/command/health.go +++ b/services/auth-basic/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-basic/pkg/command/server.go b/services/auth-basic/pkg/command/server.go index 908883fca42..4dc4ffba2a0 100644 --- a/services/auth-basic/pkg/command/server.go +++ b/services/auth-basic/pkg/command/server.go @@ -30,7 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-bearer/pkg/command/health.go b/services/auth-bearer/pkg/command/health.go index 59c619b49e6..b562eaa4a30 100644 --- a/services/auth-bearer/pkg/command/health.go +++ b/services/auth-bearer/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-bearer/pkg/command/server.go b/services/auth-bearer/pkg/command/server.go index d923a0e4ce7..4c181bfab9c 100644 --- a/services/auth-bearer/pkg/command/server.go +++ b/services/auth-bearer/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-machine/pkg/command/health.go b/services/auth-machine/pkg/command/health.go index 252bca77ca4..2e04d3a5b5f 100644 --- a/services/auth-machine/pkg/command/health.go +++ b/services/auth-machine/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-machine/pkg/command/server.go b/services/auth-machine/pkg/command/server.go index 31e3572af96..bf2ad19cca0 100644 --- a/services/auth-machine/pkg/command/server.go +++ b/services/auth-machine/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/frontend/pkg/command/health.go b/services/frontend/pkg/command/health.go index 4feeb3d6d23..041dea70a3b 100644 --- a/services/frontend/pkg/command/health.go +++ b/services/frontend/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/frontend/pkg/command/server.go b/services/frontend/pkg/command/server.go index 8ac24922123..6508799699a 100644 --- a/services/frontend/pkg/command/server.go +++ b/services/frontend/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/gateway/pkg/command/health.go b/services/gateway/pkg/command/health.go index 54ca2717aca..e2b5231ce9c 100644 --- a/services/gateway/pkg/command/health.go +++ b/services/gateway/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/gateway/pkg/command/server.go b/services/gateway/pkg/command/server.go index 18202cf136b..f2ddf03afab 100644 --- a/services/gateway/pkg/command/server.go +++ b/services/gateway/pkg/command/server.go @@ -28,7 +28,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph-explorer/pkg/command/health.go b/services/graph-explorer/pkg/command/health.go index 07547d98b25..96a43029633 100644 --- a/services/graph-explorer/pkg/command/health.go +++ b/services/graph-explorer/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph-explorer/pkg/command/server.go b/services/graph-explorer/pkg/command/server.go index 564739a539a..aa2e5be077a 100644 --- a/services/graph-explorer/pkg/command/server.go +++ b/services/graph-explorer/pkg/command/server.go @@ -24,7 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(ctx *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph/pkg/command/health.go b/services/graph/pkg/command/health.go index 788ef9feb71..b3cf03e9be3 100644 --- a/services/graph/pkg/command/health.go +++ b/services/graph/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph/pkg/command/server.go b/services/graph/pkg/command/server.go index 4ad0faa3bf4..36a8a5cf946 100644 --- a/services/graph/pkg/command/server.go +++ b/services/graph/pkg/command/server.go @@ -24,7 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/groups/pkg/command/health.go b/services/groups/pkg/command/health.go index e0a87a0806c..8a48fe36c87 100644 --- a/services/groups/pkg/command/health.go +++ b/services/groups/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/groups/pkg/command/server.go b/services/groups/pkg/command/server.go index 7652d2213fa..6605c3dfd3a 100644 --- a/services/groups/pkg/command/server.go +++ b/services/groups/pkg/command/server.go @@ -30,7 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/health.go b/services/idm/pkg/command/health.go index 1abac500cf5..328ac396901 100644 --- a/services/idm/pkg/command/health.go +++ b/services/idm/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/resetpw.go b/services/idm/pkg/command/resetpw.go index a98b39946f1..415b0479220 100644 --- a/services/idm/pkg/command/resetpw.go +++ b/services/idm/pkg/command/resetpw.go @@ -28,7 +28,7 @@ func ResetPassword(cfg *config.Config) *cli.Command { Usage: "Reset admin password", Category: "password reset", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/server.go b/services/idm/pkg/command/server.go index 2e0e96d2d88..f8e8561dc1d 100644 --- a/services/idm/pkg/command/server.go +++ b/services/idm/pkg/command/server.go @@ -30,7 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idp/pkg/command/health.go b/services/idp/pkg/command/health.go index 108af9d2899..461bd5cbef6 100644 --- a/services/idp/pkg/command/health.go +++ b/services/idp/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idp/pkg/command/server.go b/services/idp/pkg/command/server.go index c6a265868c1..a17d0c42d43 100644 --- a/services/idp/pkg/command/server.go +++ b/services/idp/pkg/command/server.go @@ -36,7 +36,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - configlog.LogReturnFatal(parser.ParseConfig(cfg)) + configlog.ReturnFatal(parser.ParseConfig(cfg)) if cfg.IDP.EncryptionSecretFile != "" { if err := ensureEncryptionSecretExists(cfg.IDP.EncryptionSecretFile); err != nil { diff --git a/services/nats/pkg/command/server.go b/services/nats/pkg/command/server.go index 1cee11ebbd5..d2817590790 100644 --- a/services/nats/pkg/command/server.go +++ b/services/nats/pkg/command/server.go @@ -21,7 +21,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/notifications/pkg/command/server.go b/services/notifications/pkg/command/server.go index 12f5ee5431e..8685b4e4291 100644 --- a/services/notifications/pkg/command/server.go +++ b/services/notifications/pkg/command/server.go @@ -22,7 +22,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocdav/pkg/command/health.go b/services/ocdav/pkg/command/health.go index 5bee1653e20..c207e17f2d0 100644 --- a/services/ocdav/pkg/command/health.go +++ b/services/ocdav/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index 1474cd9bc6b..f7bc2a91ada 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -23,7 +23,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocs/pkg/command/health.go b/services/ocs/pkg/command/health.go index dfa9f077797..e4939db9e1f 100644 --- a/services/ocs/pkg/command/health.go +++ b/services/ocs/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocs/pkg/command/server.go b/services/ocs/pkg/command/server.go index 507951fb5ca..7c3b6c989b4 100644 --- a/services/ocs/pkg/command/server.go +++ b/services/ocs/pkg/command/server.go @@ -25,7 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/proxy/pkg/command/health.go b/services/proxy/pkg/command/health.go index 2646f53c6a5..824d626e51d 100644 --- a/services/proxy/pkg/command/health.go +++ b/services/proxy/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index e5ebcaac84d..b59b6eefb15 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -41,7 +41,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/search/pkg/command/server.go b/services/search/pkg/command/server.go index 0e0dcd0570c..e1bfac3a3e9 100644 --- a/services/search/pkg/command/server.go +++ b/services/search/pkg/command/server.go @@ -24,7 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/settings/pkg/command/health.go b/services/settings/pkg/command/health.go index fc126cad14c..59519140fd8 100644 --- a/services/settings/pkg/command/health.go +++ b/services/settings/pkg/command/health.go @@ -17,7 +17,7 @@ func Health(cfg *config.Config) *cli.Command { Name: "health", Usage: "Check health status", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/settings/pkg/command/server.go b/services/settings/pkg/command/server.go index 101f070ee70..6e9571495ca 100644 --- a/services/settings/pkg/command/server.go +++ b/services/settings/pkg/command/server.go @@ -25,7 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/sharing/pkg/command/health.go b/services/sharing/pkg/command/health.go index 00a34e5fcbd..3e15bcd1cf3 100644 --- a/services/sharing/pkg/command/health.go +++ b/services/sharing/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/sharing/pkg/command/server.go b/services/sharing/pkg/command/server.go index 00c675fa1dd..6154ff20b96 100644 --- a/services/sharing/pkg/command/server.go +++ b/services/sharing/pkg/command/server.go @@ -30,7 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-publiclink/pkg/command/health.go b/services/storage-publiclink/pkg/command/health.go index 70a392baf83..f60117b4fa3 100644 --- a/services/storage-publiclink/pkg/command/health.go +++ b/services/storage-publiclink/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-publiclink/pkg/command/server.go b/services/storage-publiclink/pkg/command/server.go index 257c78d8b5e..1c731ee52d7 100644 --- a/services/storage-publiclink/pkg/command/server.go +++ b/services/storage-publiclink/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-shares/pkg/command/health.go b/services/storage-shares/pkg/command/health.go index f607aae7b62..4ed8a72cfad 100644 --- a/services/storage-shares/pkg/command/health.go +++ b/services/storage-shares/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-shares/pkg/command/server.go b/services/storage-shares/pkg/command/server.go index 8cd42e99c69..d3e507e2bb5 100644 --- a/services/storage-shares/pkg/command/server.go +++ b/services/storage-shares/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-system/pkg/command/health.go b/services/storage-system/pkg/command/health.go index dcef0c624c8..c5e80577da1 100644 --- a/services/storage-system/pkg/command/health.go +++ b/services/storage-system/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-system/pkg/command/server.go b/services/storage-system/pkg/command/server.go index aba0df8e68b..de6095a66da 100644 --- a/services/storage-system/pkg/command/server.go +++ b/services/storage-system/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/health.go b/services/storage-users/pkg/command/health.go index 3c92b63bd50..717df82eb4a 100644 --- a/services/storage-users/pkg/command/health.go +++ b/services/storage-users/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/server.go b/services/storage-users/pkg/command/server.go index f7b3f68501e..8c976eb376b 100644 --- a/services/storage-users/pkg/command/server.go +++ b/services/storage-users/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index 90568c97b04..506dee2dab8 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -36,7 +36,7 @@ func ListUploads(cfg *config.Config) *cli.Command { Name: "list", Usage: "Print a list of all incomplete uploads", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { f, ok := registry.NewFuncs[cfg.Driver] @@ -77,7 +77,7 @@ func PurgeExpiredUploads(cfg *config.Config) *cli.Command { Name: "clean", Usage: "Clean up leftovers from expired uploads", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { f, ok := registry.NewFuncs[cfg.Driver] diff --git a/services/store/pkg/command/health.go b/services/store/pkg/command/health.go index 7ec9a7b1fef..6d2abc564f8 100644 --- a/services/store/pkg/command/health.go +++ b/services/store/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/store/pkg/command/server.go b/services/store/pkg/command/server.go index e472e5d8159..76534809bb3 100644 --- a/services/store/pkg/command/server.go +++ b/services/store/pkg/command/server.go @@ -25,7 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/thumbnails/pkg/command/health.go b/services/thumbnails/pkg/command/health.go index 341b156f662..a730037c366 100644 --- a/services/thumbnails/pkg/command/health.go +++ b/services/thumbnails/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/thumbnails/pkg/command/server.go b/services/thumbnails/pkg/command/server.go index ebe72e8e876..c79b882ddcb 100644 --- a/services/thumbnails/pkg/command/server.go +++ b/services/thumbnails/pkg/command/server.go @@ -25,7 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/users/pkg/command/health.go b/services/users/pkg/command/health.go index 13841bde099..7884cdc4137 100644 --- a/services/users/pkg/command/health.go +++ b/services/users/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/users/pkg/command/server.go b/services/users/pkg/command/server.go index 008200215a3..b0419b305a0 100644 --- a/services/users/pkg/command/server.go +++ b/services/users/pkg/command/server.go @@ -30,7 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/web/pkg/command/health.go b/services/web/pkg/command/health.go index 157e8b434b3..db6a6924084 100644 --- a/services/web/pkg/command/health.go +++ b/services/web/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/web/pkg/command/server.go b/services/web/pkg/command/server.go index 083074bcc2c..3c430369db8 100644 --- a/services/web/pkg/command/server.go +++ b/services/web/pkg/command/server.go @@ -25,7 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/webdav/pkg/command/health.go b/services/webdav/pkg/command/health.go index edfec5d6d81..f7c16c6c552 100644 --- a/services/webdav/pkg/command/health.go +++ b/services/webdav/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/webdav/pkg/command/server.go b/services/webdav/pkg/command/server.go index 4c505c5c445..5393a453f9a 100644 --- a/services/webdav/pkg/command/server.go +++ b/services/webdav/pkg/command/server.go @@ -24,7 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) From 9aabcecc1fe250d3f53361cae0f43b56c3e88512 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 06:29:25 +0000 Subject: [PATCH 32/53] Bump github.com/MicahParks/keyfunc from 1.2.0 to 1.2.2 Bumps [github.com/MicahParks/keyfunc](https://github.com/MicahParks/keyfunc) from 1.2.0 to 1.2.2. - [Release notes](https://github.com/MicahParks/keyfunc/releases) - [Commits](https://github.com/MicahParks/keyfunc/compare/v1.2.0...v1.2.2) --- updated-dependencies: - dependency-name: github.com/MicahParks/keyfunc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6d2350d953c..0e69239debb 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/CiscoM31/godata v1.0.5 github.com/Masterminds/semver v1.5.0 - github.com/MicahParks/keyfunc v1.2.0 + github.com/MicahParks/keyfunc v1.2.2 github.com/ReneKroon/ttlcache/v2 v2.11.0 github.com/blevesearch/bleve/v2 v2.3.3 github.com/blevesearch/bleve_index_api v1.0.2 diff --git a/go.sum b/go.sum index 61ac75368f2..122cfd86084 100644 --- a/go.sum +++ b/go.sum @@ -99,8 +99,8 @@ github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3Q github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/MicahParks/keyfunc v1.2.0 h1:qiUfvtvvcoS0JXcHtoqglT29WyvuL0l3tkBlzp0QmsU= -github.com/MicahParks/keyfunc v1.2.0/go.mod h1:a4yfunv77gZ0RgTNw7tOYS+bjtHk5565e+1dPz+YJI8= +github.com/MicahParks/keyfunc v1.2.2 h1:MtA/6bnmhcyDMarVF9QRQmfKg1ssKxH1C+k3Gw8DY1g= +github.com/MicahParks/keyfunc v1.2.2/go.mod h1:GWZYIBflWXRPShQPMFRrUg+8buvyD0IWeg3Fi2rcrME= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= From fd1a9bf6c2ac885249028e599b4ad89e9139f149 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Mon, 22 Aug 2022 09:12:52 +0000 Subject: [PATCH 33/53] Automated changelog update [skip ci] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f42de2b8ba5..45f9475404a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The following sections list the changes for unreleased. ## Summary * Bugfix - Fix configuration of mimetypes for the app registry: [#4411](https://github.com/owncloud/ocis/pull/4411) +* Bugfix - Show help for some commands when unconfigured: [#4405](https://github.com/owncloud/ocis/pull/4405) * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) * Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) @@ -26,6 +27,13 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4411 +* Bugfix - Show help for some commands when unconfigured: [#4405](https://github.com/owncloud/ocis/pull/4405) + + We've fixed some commands to show the help also when oCIS is not yet configured. Previously the + help was not displayed to the user but instead a configuration validation error. + + https://github.com/owncloud/ocis/pull/4405 + * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) We've fixed the behavior for the IDP private key generation so that a private key is also From 99a22a37602c8c5738b66aebc64feb0792f7505f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 10:00:15 +0000 Subject: [PATCH 34/53] Bump go-micro.dev/v4 from 4.8.0 to 4.8.1 Bumps [go-micro.dev/v4](https://github.com/asim/go-micro) from 4.8.0 to 4.8.1. - [Release notes](https://github.com/asim/go-micro/releases) - [Changelog](https://github.com/asim/go-micro/blob/master/CHANGELOG.md) - [Commits](https://github.com/asim/go-micro/compare/v4.8.0...v4.8.1) --- updated-dependencies: - dependency-name: go-micro.dev/v4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 6d2350d953c..e0eae8a2cce 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/CiscoM31/godata v1.0.5 github.com/Masterminds/semver v1.5.0 - github.com/MicahParks/keyfunc v1.2.0 + github.com/MicahParks/keyfunc v1.2.2 github.com/ReneKroon/ttlcache/v2 v2.11.0 github.com/blevesearch/bleve/v2 v2.3.3 github.com/blevesearch/bleve_index_api v1.0.2 @@ -63,7 +63,7 @@ require ( github.com/tus/tusd v1.9.0 github.com/urfave/cli/v2 v2.11.1 github.com/xhit/go-simple-mail/v2 v2.11.0 - go-micro.dev/v4 v4.8.0 + go-micro.dev/v4 v4.8.1 go.etcd.io/bbolt v1.3.6 go.opencensus.io v0.23.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 diff --git a/go.sum b/go.sum index 61ac75368f2..3b2bb56fc99 100644 --- a/go.sum +++ b/go.sum @@ -99,8 +99,8 @@ github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3Q github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/MicahParks/keyfunc v1.2.0 h1:qiUfvtvvcoS0JXcHtoqglT29WyvuL0l3tkBlzp0QmsU= -github.com/MicahParks/keyfunc v1.2.0/go.mod h1:a4yfunv77gZ0RgTNw7tOYS+bjtHk5565e+1dPz+YJI8= +github.com/MicahParks/keyfunc v1.2.2 h1:MtA/6bnmhcyDMarVF9QRQmfKg1ssKxH1C+k3Gw8DY1g= +github.com/MicahParks/keyfunc v1.2.2/go.mod h1:GWZYIBflWXRPShQPMFRrUg+8buvyD0IWeg3Fi2rcrME= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= @@ -1226,8 +1226,8 @@ github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zenazn/goji v1.0.1/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -go-micro.dev/v4 v4.8.0 h1:4rrKpGHUTnrD2k2eVUVayJgWDoFlDcB/Ijkga8dZMNc= -go-micro.dev/v4 v4.8.0/go.mod h1:Ju8HrZ5hQSF+QguZ2QUs9Kbe42MHP1tJa/fpP5g07Cs= +go-micro.dev/v4 v4.8.1 h1:6/3YtUQ+ofkMJh98lC8TkpuMGoFS8kVcj0cnkQhzwDY= +go-micro.dev/v4 v4.8.1/go.mod h1:Ju8HrZ5hQSF+QguZ2QUs9Kbe42MHP1tJa/fpP5g07Cs= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= From 349f171f17b6b8001d06304bf5ddeb6836389880 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Mon, 22 Aug 2022 12:11:37 +0200 Subject: [PATCH 35/53] bump reva --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 96e95bcda06..5184c8fcf52 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.2 github.com/coreos/go-oidc/v3 v3.2.0 github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 - github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8 + github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index 86599db2d39..c3ae47cecdc 100644 --- a/go.sum +++ b/go.sum @@ -295,6 +295,8 @@ github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa h1:v7dsI1tidpyQ0o github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8 h1:+VZ5D5rIfT7DHVntyQfr4MNV+vqBixbI/dOAG6MQSaQ= github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= +github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614 h1:gvsRe7JW8WE9IxTxFAwhOa3kbB7dkeTRP2mq3XxRXEA= +github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= From f297e833af2b289277d6bf7b4ea26d47767fb9d6 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Mon, 22 Aug 2022 11:07:19 +0000 Subject: [PATCH 36/53] Automated changelog update [skip ci] --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45f9475404a..23e5eca4504 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The following sections list the changes for unreleased. * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) * Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) +* Enhancement - Bump reva version: [#4412](https://github.com/owncloud/ocis/pull/4412) * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) @@ -54,6 +55,12 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4403 +* Enhancement - Bump reva version: [#4412](https://github.com/owncloud/ocis/pull/4412) + + Bumps reva version + + https://github.com/owncloud/ocis/pull/4412 + * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) We've added an /app/open-with-web endpoint to the app provider, so that clients that are no From 976a91c6413540c5df89dbe8368ebbf3e5a2ff8a Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Mon, 22 Aug 2022 11:07:58 +0000 Subject: [PATCH 37/53] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23e5eca4504..f62a5fcc7c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1473,7 +1473,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 ## Summary @@ -1641,11 +1641,28 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 ## Summary @@ -1814,23 +1831,6 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 12d42e00746fb6f4050f645bb864403549ce4de5 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 22 Aug 2022 14:15:13 +0200 Subject: [PATCH 38/53] add missing comments --- services/proxy/pkg/middleware/authentication.go | 1 - services/proxy/pkg/middleware/basic_auth.go | 1 + services/proxy/pkg/middleware/oidc_auth.go | 1 + services/proxy/pkg/middleware/public_share_auth.go | 1 + services/proxy/pkg/middleware/signed_url_auth.go | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index a218546760b..93a023038fd 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -67,7 +67,6 @@ const ( ) // Authenticator is the common interface implemented by all request authenticators. - type Authenticator interface { // Authenticate is used to authenticate incoming HTTP requests. // The Authenticator may augment the request with user info or anything related to the diff --git a/services/proxy/pkg/middleware/basic_auth.go b/services/proxy/pkg/middleware/basic_auth.go index eb8f79847b6..913e7404865 100644 --- a/services/proxy/pkg/middleware/basic_auth.go +++ b/services/proxy/pkg/middleware/basic_auth.go @@ -16,6 +16,7 @@ type BasicAuthenticator struct { UserOIDCClaim string } +// Authenticate implements the authenticator interface to authenticate requests via basic auth. func (m BasicAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { if isPublicPath(r.URL.Path) { // The authentication of public path requests is handled by another authenticator. diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index 36adeeb2964..c89f83d5ccd 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -239,6 +239,7 @@ func (m OIDCAuthenticator) getProvider() OIDCProvider { return m.provider } +// Authenticate implements the authenticator interface to authenticate requests via oidc auth. func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { // there is no bearer token on the request, if !m.shouldServe(r) || isPublicPath(r.URL.Path) { diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index cab9b6ebf38..8f82bf72031 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -25,6 +25,7 @@ type PublicShareAuthenticator struct { RevaGatewayClient gateway.GatewayAPIClient } +// Authenticate implements the authenticator interface to authenticate requests via public share auth. func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { if !isPublicPath(r.URL.Path) { return nil, false diff --git a/services/proxy/pkg/middleware/signed_url_auth.go b/services/proxy/pkg/middleware/signed_url_auth.go index 2455e8eecfc..793f6d8adca 100644 --- a/services/proxy/pkg/middleware/signed_url_auth.go +++ b/services/proxy/pkg/middleware/signed_url_auth.go @@ -186,6 +186,7 @@ func (m SignedURLAuthenticator) getSigningKey(ctx context.Context, ocisID string return res.Records[0].Value, nil } +// Authenticate implements the authenticator interface to authenticate requests via signed URL auth. func (m SignedURLAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { if !m.shouldServe(r) { return nil, false From dfe703291f09243b2aab2e931da08d33225f5ebe Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 22 Aug 2022 15:08:01 +0200 Subject: [PATCH 39/53] replace strings.Title with cases.Title --- services/proxy/pkg/middleware/authentication.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 93a023038fd..6d430c0038b 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -7,6 +7,8 @@ import ( "strings" "github.com/owncloud/ocis/v2/services/proxy/pkg/webdav" + "golang.org/x/text/cases" + "golang.org/x/text/language" ) var ( @@ -96,10 +98,11 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle if !isPublicPath(r.URL.Path) { // Failed basic authentication attempts receive the Www-Authenticate header in the response var touch bool + caser := cases.Title(language.Und) for k, v := range options.CredentialsByUserAgent { if strings.Contains(k, r.UserAgent()) { removeSuperfluousAuthenticate(w) - w.Header().Add("Www-Authenticate", fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), r.Host)) + w.Header().Add("Www-Authenticate", fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", caser.String(v), r.Host)) touch = true break } @@ -175,8 +178,9 @@ func configureSupportedChallenges(options Options) { } func writeSupportedAuthenticateHeader(w http.ResponseWriter, r *http.Request) { + caser := cases.Title(language.Und) for _, s := range SupportedAuthStrategies { - w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(s), r.Host)) + w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", caser.String(s), r.Host)) } } @@ -213,12 +217,13 @@ func evalRequestURI(l userAgentLocker, r regexp.Regexp) { if !r.MatchString(l.r.RequestURI) { return } + caser := cases.Title(language.Und) for k, v := range l.locks { if strings.Contains(k, l.r.UserAgent()) { removeSuperfluousAuthenticate(l.w) - l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), l.r.Host)) + l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", caser.String(v), l.r.Host)) return } } - l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(l.fallback), l.r.Host)) + l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", caser.String(l.fallback), l.r.Host)) } From 9506bfc8db492044b4ccaa8d3c56f9ed6363eb7b Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 22 Aug 2022 14:39:31 +0000 Subject: [PATCH 40/53] Automated changelog update [skip ci] --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f62a5fcc7c5..ae1332d58ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The following sections list the changes for unreleased. * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) +* Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) * Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) ## Details @@ -86,6 +87,14 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/issues/4084 https://github.com/owncloud/ocis/pull/4365 +* Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) + + There were some flaws in the authentication middleware which were resolved by this rewrite. + This rewrite also introduced the need to manually mark certain paths as "unprotected" if + requests to these paths must not be authenticated. + + https://github.com/owncloud/ocis/pull/4374 + * Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) Updated reva to version x.x.x. This update includes: From cb2822b8b741a67a1ac33500f7b98bb4f4b7afd2 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Tue, 23 Aug 2022 10:42:27 +0200 Subject: [PATCH 41/53] [tests-only] [full-ci] ApiTest. after each test users delete their personal space (#4433) * after each test users delete their personal space * Simplify deleteAllPersonalSpaces * Simplify deleteAllPersonalSpaces() Co-authored-by: Phil Davis --- ...ected-failures-localAPI-on-OCIS-storage.md | 4 -- .../features/bootstrap/SpacesContext.php | 42 ++++++++++++++----- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 0170f03fe79..a636c8ba43b 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -21,7 +21,3 @@ The expected failures in this file are from features in the owncloud/ocis repo. ### [Search by shares jail works incorrect](https://github.com/owncloud/ocis/issues/4014) - [apiSpaces/search.feature:43](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/search.feature#L43) - -### [Changing personal drive quota on another user as admin is not possible](https://github.com/owncloud/ocis/issues/4325) -- [apiSpaces/changeSpaces.feature:221](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/changeSpaces.feature#L221) - diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 43c96caeeac..590b085a7c2 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -126,14 +126,8 @@ class SpacesContext implements Context { $this->createdSpaces[$spaceName] = $spaceCreator; } - /** - * @var array - */ - private array $availableSpaces; + private array $availableSpaces = []; - /** - * @var array - */ private array $lastPublicLinkData = []; /** @@ -378,7 +372,7 @@ class SpacesContext implements Context { /** * using method from core to set share data - * + * * @return void */ public function setLastShareData(): void { @@ -428,11 +422,11 @@ class SpacesContext implements Context { public function cleanDataAfterTests(): void { // TODO enable when admin can disable and delete spaces // $this->deleteAllSpacesOfTheType('project'); - // $this->deleteAllSpacesOfTheType('personal'); + $this->deleteAllPersonalSpaces(); } /** - * The method first disables and then deletes spaces + * Admin first disables and then deletes spaces * * @param string $driveType * @@ -463,6 +457,32 @@ class SpacesContext implements Context { } } + /** + * users delete their personal space at the end of the test + * + * @return void + * + * @throws Exception|GuzzleException + */ + public function deleteAllPersonalSpaces(): void { + $query = "\$filter=driveType eq personal"; + $createdUsers= $this->featureContext->getCreatedUsers(); + + foreach($createdUsers as $user) { + $this->theUserListsAllHisAvailableSpacesUsingTheGraphApi( + $user["actualUsername"], + $query + ); + $drives = $this->getAvailableSpaces(); + foreach ($drives as $value) { + if (!\array_key_exists("deleted", $value["root"])) { + $this->sendDisableSpaceRequest($user["actualUsername"], $value["name"]); + } + $this->sendDeleteSpaceRequest($user["actualUsername"], $value["name"]); + } + } + } + /** * Send Graph List My Spaces Request * @@ -3013,7 +3033,7 @@ class SpacesContext implements Context { $space = $this->getSpaceByName($user, $spaceName); $body = $space['id']; } - + $url = "/apps/files_sharing/api/v1/shares?reshares=true&space_ref=" . $body; $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody( From 4e8da994e589b5887f269dd693a4e464229fc752 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Tue, 23 Aug 2022 09:26:06 +0545 Subject: [PATCH 42/53] Bump commit id for tests and update expected to faile file --- .drone.env | 2 +- .../expected-failures-API-on-OCIS-storage.md | 202 +++++------------- 2 files changed, 54 insertions(+), 150 deletions(-) diff --git a/.drone.env b/.drone.env index bf41b89dff6..8811cf1a157 100644 --- a/.drone.env +++ b/.drone.env @@ -1,5 +1,5 @@ # The test runner source for API tests -CORE_COMMITID=f79fbff0a0d129df7b6ec20bc202665c4fda5fad +CORE_COMMITID=db3913cd9ba67b2d603f8917017734903dfd432a CORE_BRANCH=master # The test runner source for UI tests diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index e39067d0abb..c1e25a26f38 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -195,22 +195,22 @@ Synchronization features like etag propagation, setting mtime and locking files - [apiWebdavLocks2/resharedSharesToShares.feature:32](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L32) - [apiWebdavLocks2/resharedSharesToShares.feature:33](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L33) - [apiWebdavLocks2/resharedSharesToShares.feature:34](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L34) -- [apiWebdavLocks2/resharedSharesToShares.feature:61](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L61) -- [apiWebdavLocks2/resharedSharesToShares.feature:62](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L62) -- [apiWebdavLocks2/resharedSharesToShares.feature:63](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L63) -- [apiWebdavLocks2/resharedSharesToShares.feature:64](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L64) -- [apiWebdavLocks2/resharedSharesToShares.feature:87](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L87) -- [apiWebdavLocks2/resharedSharesToShares.feature:88](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L88) -- [apiWebdavLocks2/resharedSharesToShares.feature:89](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L89) -- [apiWebdavLocks2/resharedSharesToShares.feature:90](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L90) -- [apiWebdavLocks2/resharedSharesToShares.feature:109](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L109) -- [apiWebdavLocks2/resharedSharesToShares.feature:110](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L110) -- [apiWebdavLocks2/resharedSharesToShares.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L111) -- [apiWebdavLocks2/resharedSharesToShares.feature:112](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L112) -- [apiWebdavLocks2/resharedSharesToShares.feature:136](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L136) -- [apiWebdavLocks2/resharedSharesToShares.feature:137](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L137) -- [apiWebdavLocks2/resharedSharesToShares.feature:138](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L138) -- [apiWebdavLocks2/resharedSharesToShares.feature:139](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L139) +- [apiWebdavLocks2/resharedSharesToShares.feature:55](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L55) +- [apiWebdavLocks2/resharedSharesToShares.feature:56](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L56) +- [apiWebdavLocks2/resharedSharesToShares.feature:57](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L57) +- [apiWebdavLocks2/resharedSharesToShares.feature:58](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L58) +- [apiWebdavLocks2/resharedSharesToShares.feature:75](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L75) +- [apiWebdavLocks2/resharedSharesToShares.feature:76](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L76) +- [apiWebdavLocks2/resharedSharesToShares.feature:77](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L77) +- [apiWebdavLocks2/resharedSharesToShares.feature:78](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L78) +- [apiWebdavLocks2/resharedSharesToShares.feature:97](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L97) +- [apiWebdavLocks2/resharedSharesToShares.feature:98](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L98) +- [apiWebdavLocks2/resharedSharesToShares.feature:99](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L99) +- [apiWebdavLocks2/resharedSharesToShares.feature:100](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L100) +- [apiWebdavLocks2/resharedSharesToShares.feature:118](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L118) +- [apiWebdavLocks2/resharedSharesToShares.feature:119](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L119) +- [apiWebdavLocks2/resharedSharesToShares.feature:120](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L120) +- [apiWebdavLocks2/resharedSharesToShares.feature:121](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L121) - [apiWebdavLocks2/setTimeout.feature:24](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeout.feature#L24) - [apiWebdavLocks2/setTimeout.feature:25](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeout.feature#L25) - [apiWebdavLocks2/setTimeout.feature:26](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeout.feature#L26) @@ -270,16 +270,16 @@ Synchronization features like etag propagation, setting mtime and locking files - [apiWebdavLocks2/setTimeoutSharesToShares.feature:39](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L39) - [apiWebdavLocks2/setTimeoutSharesToShares.feature:40](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L40) - [apiWebdavLocks2/setTimeoutSharesToShares.feature:41](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L41) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:57](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L57) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:58](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L58) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:59](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L59) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:60](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L60) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:61](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L61) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:62](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L62) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:63](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L63) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:64](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L64) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:65](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L65) - [apiWebdavLocks2/setTimeoutSharesToShares.feature:66](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L66) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:67](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L67) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:68](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L68) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:69](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L69) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:70](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L70) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:71](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L71) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:72](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L72) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:73](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L73) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:74](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L74) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:75](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L75) - [apiWebdavLocks3/independentLocks.feature:25](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks3/independentLocks.feature#L25) - [apiWebdavLocks3/independentLocks.feature:26](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks3/independentLocks.feature#L26) - [apiWebdavLocks3/independentLocks.feature:27](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks3/independentLocks.feature#L27) @@ -447,10 +447,6 @@ File and sync features in a shared scenario - [apiShareManagementToShares/mergeShare.feature:105](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature#L105) -#### [not possible to move file into a received folder](https://github.com/owncloud/ocis/issues/764) - -- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:500](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L500) - #### [File deletion using dav gives unique string in filename in the trashbin](https://github.com/owncloud/product/issues/178) - [apiShareManagementBasicToShares/deleteShareFromShares.feature:67](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/deleteShareFromShares.feature#L67) @@ -588,13 +584,11 @@ cannot share a folder with create permission - [apiShareOperationsToShares1/changingFilesShare.feature:25](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L25) - [apiShareOperationsToShares1/changingFilesShare.feature:26](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L26) -- [apiShareOperationsToShares1/changingFilesShare.feature:31](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L31) -- [apiShareOperationsToShares1/changingFilesShare.feature:119](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L119) -- [apiShareOperationsToShares1/changingFilesShare.feature:120](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L120) -- [apiShareOperationsToShares1/changingFilesShare.feature:125](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L125) -- [apiShareOperationsToShares1/changingFilesShare.feature:146](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L146) -- [apiShareOperationsToShares1/changingFilesShare.feature:147](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L147) -- [apiShareOperationsToShares1/changingFilesShare.feature:152](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L152) +- [apiShareOperationsToShares1/changingFilesShare.feature:110](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L110) +- [apiShareOperationsToShares1/changingFilesShare.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L111) +- [apiShareOperationsToShares1/changingFilesShare.feature:131](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L131) +- [apiShareOperationsToShares1/changingFilesShare.feature:132](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L132) +- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:500](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L500) - [apiVersions/fileVersionsSharingToShares.feature:220](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiVersions/fileVersionsSharingToShares.feature#L220) - [apiVersions/fileVersionsSharingToShares.feature:221](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiVersions/fileVersionsSharingToShares.feature#L221) @@ -602,18 +596,12 @@ Scenario Outline: Moving a file into a shared folder as the sharee and as the sh - [apiWebdavMove2/moveShareOnOcis.feature:30](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L30) - [apiWebdavMove2/moveShareOnOcis.feature:32](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L32) - Scenario Outline: Moving a file out of a shared folder as the sharee and as the sharer -- [apiWebdavMove2/moveShareOnOcis.feature:60](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L60) -- [apiWebdavMove2/moveShareOnOcis.feature:62](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L62) Scenario Outline: Moving a folder into a shared folder as the sharee and as the sharer -- [apiWebdavMove2/moveShareOnOcis.feature:91](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L91) -- [apiWebdavMove2/moveShareOnOcis.feature:93](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L93) - Scenario Outline: Moving a folder out of a shared folder as the sharee and as the sharer -- [apiWebdavMove2/moveShareOnOcis.feature:124](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L124) -- [apiWebdavMove2/moveShareOnOcis.feature:126](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L126) +- [apiWebdavMove2/moveShareOnOcis.feature:98](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L98) +- [apiWebdavMove2/moveShareOnOcis.feature:100](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L100) Scenario Outline: Moving a file to a shared folder with no permissions -- [apiWebdavMove2/moveShareOnOcis.feature:152](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L152) -- [apiWebdavMove2/moveShareOnOcis.feature:153](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L153) +- [apiWebdavMove2/moveShareOnOcis.feature:169](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L169) +- [apiWebdavMove2/moveShareOnOcis.feature:170](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L170) #### [restoring an older version of a shared file deletes the share](https://github.com/owncloud/ocis/issues/765) @@ -742,17 +730,6 @@ Scenario Outline: Moving a file into a shared folder as the sharee and as the sh - [apiShareReshareToShares3/reShareWithExpiryDate.feature:234](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareReshareToShares3/reShareWithExpiryDate.feature#L234) - [apiShareReshareToShares3/reShareWithExpiryDate.feature:235](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareReshareToShares3/reShareWithExpiryDate.feature#L235) -#### [incorrect ocs(v2) status value when sharing to group that does not exist should be 404, gives 998](https://github.com/owncloud/product/issues/250) - -_ocs: api compatibility, return correct status code_ - -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:85](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L85) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:86](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L86) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:87](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L87) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:88](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L88) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:89](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L89) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:90](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L90) - #### [Cannot move folder/file from one received share to another](https://github.com/owncloud/ocis/issues/2442) - [apiShareUpdateToShares/updateShare.feature:242](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L242) @@ -918,67 +895,20 @@ _ocdav: api compatibility, return correct status code_ - [apiFavorites/favorites.feature:116](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L116) - [apiFavorites/favorites.feature:141](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L141) - [apiFavorites/favorites.feature:142](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L142) -- [apiFavorites/favorites.feature:267](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L267) -- [apiFavorites/favorites.feature:268](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L268) +- [apiFavorites/favorites.feature:262](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L262) +- [apiFavorites/favorites.feature:263](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L263) And other missing implementation of favorites -- [apiFavorites/favorites.feature:162](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L162) -- [apiFavorites/favorites.feature:163](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L163) -- [apiFavorites/favorites.feature:187](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L187) +- [apiFavorites/favorites.feature:182](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L182) +- [apiFavorites/favorites.feature:183](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L183) - [apiFavorites/favorites.feature:188](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L188) -- [apiFavorites/favorites.feature:193](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L193) -- [apiFavorites/favorites.feature:220](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L220) +- [apiFavorites/favorites.feature:215](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L215) +- [apiFavorites/favorites.feature:216](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L216) - [apiFavorites/favorites.feature:221](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L221) -- [apiFavorites/favorites.feature:226](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L226) -- [apiFavorites/favoritesSharingToShares.feature:82](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L82) -- [apiFavorites/favoritesSharingToShares.feature:88](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L88) - -#### [resource inside Shares dir is not found using the spaces WebDAV API](https://github.com/owncloud/ocis/issues/2968) - -- [apiFavorites/favorites.feature:168](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L168) -- [apiFavorites/favoritesSharingToShares.feature:28](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L28) -- [apiFavorites/favoritesSharingToShares.feature:48](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L48) - [apiFavorites/favoritesSharingToShares.feature:67](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L67) -- [apiFavorites/favoritesSharingToShares.feature:83](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L83) -- [apiFavorites/favoritesSharingToShares.feature:108](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L108) -- [apiWebdavUploadTUS/uploadToShare.feature:31](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L31) -- [apiWebdavUploadTUS/uploadToShare.feature:50](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L50) -- [apiWebdavUploadTUS/uploadToShare.feature:72](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L72) -- [apiWebdavUploadTUS/uploadToShare.feature:93](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L93) -- [apiWebdavUploadTUS/uploadToShare.feature:135](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L135) -- [apiWebdavUploadTUS/uploadToShare.feature:159](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L159) -- [apiWebdavUploadTUS/uploadToShare.feature:182](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L182) -- [apiWebdavUploadTUS/uploadToShare.feature:205](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L205) -- [apiWebdavUploadTUS/uploadToShare.feature:230](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L230) -- [apiWebdavUploadTUS/uploadToShare.feature:254](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L254) -- [apiWebdavUploadTUS/uploadToShare.feature:301](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L301) -- [apiWebdavUploadTUS/uploadToShare.feature:326](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L326) -- [apiWebdavLocks2/resharedSharesToShares.feature:117](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L117) -- [apiWebdavLocks2/resharedSharesToShares.feature:118](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L118) -- [apiWebdavLocks2/resharedSharesToShares.feature:144](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L144) -- [apiWebdavLocks2/resharedSharesToShares.feature:145](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L145) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:46](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L46) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:47](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L47) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:48](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L48) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:49](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L49) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:50](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L50) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:80](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L80) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:81](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L81) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:82](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L82) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:83](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L83) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:84](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L84) -- [apiShareOperationsToShares1/changingFilesShare.feature:98](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L98) -- [apiShareOperationsToShares1/changingFilesShare.feature:173](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L173) -- [apiWebdavMove2/moveShareOnOcis.feature:38](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L38) -- [apiWebdavMove2/moveShareOnOcis.feature:39](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L39) -- [apiWebdavMove2/moveShareOnOcis.feature:68](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L68) -- [apiWebdavMove2/moveShareOnOcis.feature:99](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L99) -- [apiWebdavMove2/moveShareOnOcis.feature:100](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L100) -- [apiWebdavMove2/moveShareOnOcis.feature:132](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L132) -- [apiWebdavMove2/moveShareOnOcis.feature:158](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L158) -- [apiWebdavMove2/moveShareOnOcis.feature:185](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L185) -- [apiWebdavMove2/moveShareOnOcis.feature:220](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L220) +- [apiFavorites/favoritesSharingToShares.feature:68](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L68) + #### [WWW-Authenticate header for unauthenticated requests is not clear](https://github.com/owncloud/ocis/issues/2285) @@ -1095,18 +1025,16 @@ And other missing implementation of favorites - [apiWebdavUploadTUS/optionsRequest.feature:21](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/optionsRequest.feature#L21) - [apiWebdavUploadTUS/optionsRequest.feature:33](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/optionsRequest.feature#L33) - [apiWebdavUploadTUS/optionsRequest.feature:47](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/optionsRequest.feature#L47) -- [apiWebdavUploadTUS/uploadToShare.feature:224](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L224) -- [apiWebdavUploadTUS/uploadToShare.feature:225](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L225) -- [apiWebdavUploadTUS/uploadToShare.feature:248](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L248) -- [apiWebdavUploadTUS/uploadToShare.feature:249](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L249) -- [apiWebdavUploadTUS/uploadToShare.feature:272](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L272) -- [apiWebdavUploadTUS/uploadToShare.feature:273](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L273) -- [apiWebdavUploadTUS/uploadToShare.feature:278](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L278) -- [apiWebdavUploadTUS/uploadToShare.feature:320](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L320) -- [apiWebdavUploadTUS/uploadToShare.feature:321](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L321) -- [apiWebdavUploadTUS/uploadToShare.feature:372](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L372) -- [apiWebdavUploadTUS/uploadToShare.feature:373](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L373) -- [apiWebdavUploadTUS/uploadToShare.feature:378](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L378) +- [apiWebdavUploadTUS/uploadToShare.feature:181](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L181) +- [apiWebdavUploadTUS/uploadToShare.feature:182](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L182) +- [apiWebdavUploadTUS/uploadToShare.feature:200](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L200) +- [apiWebdavUploadTUS/uploadToShare.feature:201](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L201) +- [apiWebdavUploadTUS/uploadToShare.feature:219](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L219) +- [apiWebdavUploadTUS/uploadToShare.feature:220](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L220) +- [apiWebdavUploadTUS/uploadToShare.feature:258](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L258) +- [apiWebdavUploadTUS/uploadToShare.feature:259](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L259) +- [apiWebdavUploadTUS/uploadToShare.feature:300](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L300) +- [apiWebdavUploadTUS/uploadToShare.feature:301](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L301) #### [TUS OPTIONS requests do not reply with TUS headers when invalid password](https://github.com/owncloud/ocis/issues/1012) @@ -1275,14 +1203,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiShareManagementToShares/moveShareInsideAnotherShare.feature:86](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/moveShareInsideAnotherShare.feature#L86) - [apiShareManagementToShares/moveShareInsideAnotherShare.feature:100](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/moveShareInsideAnotherShare.feature#L100) -#### [unable to create resource using TUS inside Shares dir](https://github.com/owncloud/ocis/issues/3048) - -- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:33](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L33) -- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:52](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L52) -- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:73](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L73) -- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:94](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L94) -- [apiWebdavUploadTUS/uploadToShare.feature:352](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L352) - #### [Renaming resource to banned name is allowed in spaces webdav](https://github.com/owncloud/ocis/issues/3099) - [apiWebdavMove1/moveFolder.feature:27](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove1/moveFolder.feature#L27) @@ -1297,7 +1217,7 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiFavorites/favorites.feature:121](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L121) - [apiFavorites/favorites.feature:147](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L147) -- [apiFavorites/favorites.feature:273](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L273) +- [apiFavorites/favorites.feature:268](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L268) #### [could not create system tag](https://github.com/owncloud/ocis/issues/3092) @@ -1315,13 +1235,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiWebdavOperations/listFiles.feature:442](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/listFiles.feature#L442) - [apiWebdavOperations/listFiles.feature:448](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/listFiles.feature#L448) -### [[spaces webdav] upload to a share that was locked by owner ends with status code 409](https://github.com/owncloud/ocis/issues/3128) - -- [apiWebdavLocks2/resharedSharesToShares.feature:39](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L39) -- [apiWebdavLocks2/resharedSharesToShares.feature:40](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L40) -- [apiWebdavLocks2/resharedSharesToShares.feature:69](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L69) -- [apiWebdavLocks2/resharedSharesToShares.feature:70](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L70) - #### [Renaming resource to excluded directory name is allowed in spaces webdav](https://github.com/owncloud/ocis/issues/3102) - [apiWebdavMove2/moveFileToExcludedDirectory.feature:26](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveFileToExcludedDirectory.feature#L26) @@ -1340,15 +1253,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiWebdavOperations/refuseAccess.feature:36](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/refuseAccess.feature#L36) - [apiWebdavOperations/refuseAccess.feature:41](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/refuseAccess.feature#L41) -### [GraphAPI groups are case in-sensitive](https://github.com/owncloud/ocis/issues/4291) - -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:49](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L49) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:50](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L50) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:51](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L51) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:52](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L52) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:53](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L53) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:54](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L54) - #### [OCS status code zero](https://github.com/owncloud/ocis/issues/3621) - [apiShareManagementToShares/moveReceivedShare.feature:32](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature#L32) From faa7d3b6474a271469d6519cc00c63c1f2dc448b Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 23 Aug 2022 14:29:04 +0200 Subject: [PATCH 43/53] add config options for mail encryption and authentication --- ...mail-authentication-encryption-settings.md | 10 +++ .../examples/ocis_traefik/docker-compose.yml | 3 +- .../notifications/pkg/channels/channels.go | 65 ++++++++++++++++--- services/notifications/pkg/config/config.go | 13 ++-- .../pkg/config/defaults/defaultconfig.go | 8 ++- 5 files changed, 80 insertions(+), 19 deletions(-) create mode 100644 changelog/unreleased/enhancement-mail-authentication-encryption-settings.md diff --git a/changelog/unreleased/enhancement-mail-authentication-encryption-settings.md b/changelog/unreleased/enhancement-mail-authentication-encryption-settings.md new file mode 100644 index 00000000000..1148c126aa8 --- /dev/null +++ b/changelog/unreleased/enhancement-mail-authentication-encryption-settings.md @@ -0,0 +1,10 @@ +Enhancement: Add configuration options for mail authentication and encryption + +We've added configuration options to configure the authentication and encryption +for sending mails in the notifications service. + +Furthermore there is now a distinguished configuration option for the username to use +for authentication against the mail server. This allows you to customize the sender address +to your liking. For example sender addresses like `my oCIS instance ` are now possible, too. + +https://github.com/owncloud/ocis/pull/4443 diff --git a/deployments/examples/ocis_traefik/docker-compose.yml b/deployments/examples/ocis_traefik/docker-compose.yml index 38e14059471..1b37ca17aa2 100644 --- a/deployments/examples/ocis_traefik/docker-compose.yml +++ b/deployments/examples/ocis_traefik/docker-compose.yml @@ -68,7 +68,8 @@ services: # email server (in this case inbucket acts as mail catcher) NOTIFICATIONS_SMTP_HOST: inbucket NOTIFICATIONS_SMTP_PORT: 2500 - NOTIFICATIONS_SMTP_SENDER: notifications@${OCIS_DOMAIN:-ocis.owncloud.test} + NOTIFICATIONS_SMTP_SENDER: oCIS notifications + NOTIFICATIONS_SMTP_USERNAME: notifications@${OCIS_DOMAIN:-ocis.owncloud.test} NOTIFICATIONS_SMTP_INSECURE: true # the mail catcher uses self signed certificates volumes: - ocis-config:/etc/ocis diff --git a/services/notifications/pkg/channels/channels.go b/services/notifications/pkg/channels/channels.go index 896dc8afcff..06129399800 100644 --- a/services/notifications/pkg/channels/channels.go +++ b/services/notifications/pkg/channels/channels.go @@ -4,6 +4,7 @@ package channels import ( "context" "crypto/tls" + "strings" gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" groups "github.com/cs3org/go-cs3apis/cs3/identity/group/v1beta1" @@ -45,6 +46,59 @@ type Mail struct { logger log.Logger } +func (m Mail) getMailClient() (*mail.SMTPClient, error) { + server := mail.NewSMTPClient() + server.Host = m.conf.Notifications.SMTP.Host + server.Port = m.conf.Notifications.SMTP.Port + server.Username = m.conf.Notifications.SMTP.Username + if server.Username == "" { + // compatibility fallback + server.Username = m.conf.Notifications.SMTP.Sender + } + server.Password = m.conf.Notifications.SMTP.Password + if server.TLSConfig == nil { + server.TLSConfig = &tls.Config{} + } + server.TLSConfig.InsecureSkipVerify = m.conf.Notifications.SMTP.Insecure + + switch strings.ToLower(m.conf.Notifications.SMTP.Authentication) { + case "login": + server.Authentication = mail.AuthLogin + case "plain": + server.Authentication = mail.AuthPlain + case "crammd5": + server.Authentication = mail.AuthCRAMMD5 + case "none": + server.Authentication = mail.AuthNone + default: + return nil, errors.New("unknown mail authentication method") + } + + switch strings.ToLower(m.conf.Notifications.SMTP.Encryption) { + case "tls": + server.Encryption = mail.EncryptionTLS + server.TLSConfig.ServerName = m.conf.Notifications.SMTP.Host + case "starttls": + server.Encryption = mail.EncryptionSTARTTLS + server.TLSConfig.ServerName = m.conf.Notifications.SMTP.Host + case "ssl": + server.Encryption = mail.EncryptionSSL + case "ssltls": + server.Encryption = mail.EncryptionSSLTLS + case "none": + server.Encryption = mail.EncryptionNone + default: + return nil, errors.New("unknown mail encryption method") + } + + smtpClient, err := server.Connect() + if err != nil { + return nil, err + } + + return smtpClient, nil +} + // SendMessage sends a message to all given users. func (m Mail) SendMessage(userIDs []string, msg string) error { if m.conf.Notifications.SMTP.Host == "" { @@ -56,22 +110,13 @@ func (m Mail) SendMessage(userIDs []string, msg string) error { return err } - server := mail.NewSMTPClient() - server.Host = m.conf.Notifications.SMTP.Host - server.Port = m.conf.Notifications.SMTP.Port - server.Username = m.conf.Notifications.SMTP.Sender - server.Password = m.conf.Notifications.SMTP.Password - server.TLSConfig = &tls.Config{InsecureSkipVerify: m.conf.Notifications.SMTP.Insecure} - - smtpClient, err := server.Connect() + smtpClient, err := m.getMailClient() if err != nil { return err } email := mail.NewMSG() - email.SetFrom(m.conf.Notifications.SMTP.Sender).AddTo(to...) - email.SetBody(mail.TextPlain, msg) return email.Send(smtpClient) diff --git a/services/notifications/pkg/config/config.go b/services/notifications/pkg/config/config.go index ba23d12c616..849f1ac1ff6 100644 --- a/services/notifications/pkg/config/config.go +++ b/services/notifications/pkg/config/config.go @@ -30,11 +30,14 @@ type Notifications struct { // SMTP combines the smtp configuration options. type SMTP struct { - Host string `yaml:"smtp_host" env:"NOTIFICATIONS_SMTP_HOST" desc:"SMTP host to connect to."` - Port int `yaml:"smtp_port" env:"NOTIFICATIONS_SMTP_PORT" desc:"Port of the SMTP host to connect to."` - Sender string `yaml:"smtp_sender" env:"NOTIFICATIONS_SMTP_SENDER" desc:"Sender of emails that will be sent."` - Password string `yaml:"smtp_password" env:"NOTIFICATIONS_SMTP_PASSWORD" desc:"Password of the SMTP host to connect to."` - Insecure bool `yaml:"insecure" env:"NOTIFICATIONS_SMTP_INSECURE" desc:"Allow insecure connections to the SMTP server."` + Host string `yaml:"smtp_host" env:"NOTIFICATIONS_SMTP_HOST" desc:"SMTP host to connect to."` + Port int `yaml:"smtp_port" env:"NOTIFICATIONS_SMTP_PORT" desc:"Port of the SMTP host to connect to."` + Sender string `yaml:"smtp_sender" env:"NOTIFICATIONS_SMTP_SENDER" desc:"Sender address of emails that will be sent."` + Username string `yaml:"smtp_username" env:"NOTIFICATIONS_SMTP_USERNAME" desc:"Username for the SMTP host to connect to."` + Password string `yaml:"smtp_password" env:"NOTIFICATIONS_SMTP_PASSWORD" desc:"Password for the SMTP host to connect to."` + Insecure bool `yaml:"insecure" env:"NOTIFICATIONS_SMTP_INSECURE" desc:"Allow insecure connections to the SMTP server."` + Authentication string `yaml:"smtp_authentication" env:"NOTIFICATIONS_SMTP_AUTHENTICATION" desc:"Authentication method for the SMTP communication. Possible values are 'login', 'plain', 'crammd5', 'none'"` + Encryption string `yaml:"smtp_encryption" env:"NOTIFICATIONS_SMTP_ENCRYPTION" desc:"Encryption method for the SMTP communication. Possible values are 'starttls', 'ssl', 'ssltls', 'tls' and 'none'."` } // Events combines the configuration options for the event bus. diff --git a/services/notifications/pkg/config/defaults/defaultconfig.go b/services/notifications/pkg/config/defaults/defaultconfig.go index acd443345b2..849592926c1 100644 --- a/services/notifications/pkg/config/defaults/defaultconfig.go +++ b/services/notifications/pkg/config/defaults/defaultconfig.go @@ -24,9 +24,11 @@ func DefaultConfig() *config.Config { }, Notifications: config.Notifications{ SMTP: config.SMTP{ - Host: "", - Port: 1025, - Sender: "noreply@example.com", + Host: "", + Port: 1025, + Sender: "ownCloud ", + Authentication: "none", + Encryption: "none", }, Events: config.Events{ Endpoint: "127.0.0.1:9233", From d10f52197297258ec144f7d97a37695035ca01e7 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 23 Aug 2022 16:16:23 +0200 Subject: [PATCH 44/53] chore: update reva to v2.8.0 --- changelog/unreleased/bump-reva.md | 5 ----- changelog/unreleased/update-reva-beta.7.md | 15 +++++++++++---- go.mod | 6 +++--- go.sum | 12 ++++-------- 4 files changed, 18 insertions(+), 20 deletions(-) delete mode 100644 changelog/unreleased/bump-reva.md diff --git a/changelog/unreleased/bump-reva.md b/changelog/unreleased/bump-reva.md deleted file mode 100644 index dc839ad3abd..00000000000 --- a/changelog/unreleased/bump-reva.md +++ /dev/null @@ -1,5 +0,0 @@ -Enhancement: Bump reva version - -Bumps reva version - -https://github.com/owncloud/ocis/pull/4412 diff --git a/changelog/unreleased/update-reva-beta.7.md b/changelog/unreleased/update-reva-beta.7.md index b81c362c0e4..2f7039eca3b 100644 --- a/changelog/unreleased/update-reva-beta.7.md +++ b/changelog/unreleased/update-reva-beta.7.md @@ -1,7 +1,14 @@ -Enhancement: update reva to vx.x.x +Enhancement: update reva to v2.8.0 -Updated reva to version x.x.x. This update includes: +Updated reva to version 2.8.0. This update includes: -* TODO: +* Bugfix [cs3org/reva#3158](https://github.com/cs3org/reva/pull/3158): Add name to the propfind response +* Bugfix [cs3org/reva#3157](https://github.com/cs3org/reva/pull/3157): Fix locking response codes +* Bugfix [cs3org/reva#3152](https://github.com/cs3org/reva/pull/3152): Disable caching of not found stat responses +* Bugfix [cs3org/reva#4251](https://github.com/cs3org/reva/pull/4251): Disable caching +* Enhancement [cs3org/reva#3154](https://github.com/cs3org/reva/pull/3154): Dataproviders now return file metadata +* Enhancement [cs3org/reva#3143](https://github.com/cs3org/reva/pull/3143): Add /app/open-with-web endpoint +* Enhancement [cs3org/reva#3156](https://github.com/cs3org/reva/pull/3156): Added language option to the app provider +* Enhancement [cs3org/reva#3148](https://github.com/cs3org/reva/pull/3148): Add new jsoncs3 share manager -https://github.com/owncloud/ocis/pull/4376 +https://github.com/owncloud/ocis/pull/4444 diff --git a/go.mod b/go.mod index 3007aa09002..df5865fa016 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/blevesearch/bleve/v2 v2.3.3 github.com/blevesearch/bleve_index_api v1.0.2 github.com/coreos/go-oidc/v3 v3.2.0 - github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 - github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614 + github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d + github.com/cs3org/reva/v2 v2.8.0 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 @@ -77,6 +77,7 @@ require ( golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 + golang.org/x/text v0.3.7 google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 @@ -268,7 +269,6 @@ require ( golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect - golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect golang.org/x/tools v0.1.10 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect diff --git a/go.sum b/go.sum index f03cb5998cf..b6c3b9e86bc 100644 --- a/go.sum +++ b/go.sum @@ -289,14 +289,10 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4= github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4= github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A= -github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 h1:cFnankJOCWndnOns4sKRG7yzH61ammK2Am6rEGWCK40= -github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa h1:v7dsI1tidpyQ0oiElSc30NO9rNcgpvJuzLileslTN1s= -github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= -github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8 h1:+VZ5D5rIfT7DHVntyQfr4MNV+vqBixbI/dOAG6MQSaQ= -github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= -github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614 h1:gvsRe7JW8WE9IxTxFAwhOa3kbB7dkeTRP2mq3XxRXEA= -github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= +github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d h1:toyZ7IsXlUdEPZ/IG8fg7hbM8HcLPY0bkX4FKBmgLVI= +github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= +github.com/cs3org/reva/v2 v2.8.0 h1:8QtZ3oQB/96yY6GjvjFF73vbM+YAiSmdje41yHrdFms= +github.com/cs3org/reva/v2 v2.8.0/go.mod h1:+BYVpRV8g1hL8wF3+3BunL9BKPsXVyJYmH8COxq/V7Y= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= From bf97c626754304f93a8a3f4e3462bc494281c062 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 19:45:45 +0000 Subject: [PATCH 45/53] Bump github.com/urfave/cli/v2 from 2.11.1 to 2.11.2 Bumps [github.com/urfave/cli/v2](https://github.com/urfave/cli) from 2.11.1 to 2.11.2. - [Release notes](https://github.com/urfave/cli/releases) - [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md) - [Commits](https://github.com/urfave/cli/compare/v2.11.1...v2.11.2) --- updated-dependencies: - dependency-name: github.com/urfave/cli/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index df5865fa016..42d2a3cc7ad 100644 --- a/go.mod +++ b/go.mod @@ -61,7 +61,7 @@ require ( github.com/test-go/testify v1.1.4 github.com/thejerf/suture/v4 v4.0.2 github.com/tus/tusd v1.9.0 - github.com/urfave/cli/v2 v2.11.1 + github.com/urfave/cli/v2 v2.11.2 github.com/xhit/go-simple-mail/v2 v2.11.0 go-micro.dev/v4 v4.8.1 go.etcd.io/bbolt v1.3.6 diff --git a/go.sum b/go.sum index b6c3b9e86bc..712e09f4a52 100644 --- a/go.sum +++ b/go.sum @@ -1183,8 +1183,8 @@ github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/urfave/cli/v2 v2.11.1 h1:UKK6SP7fV3eKOefbS87iT9YHefv7iB/53ih6e+GNAsE= -github.com/urfave/cli/v2 v2.11.1/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= +github.com/urfave/cli/v2 v2.11.2 h1:FVfNg4m3vbjbBpLYxW//WjxUoHvJ9TlppXcqY9Q9ZfA= +github.com/urfave/cli/v2 v2.11.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= From f3e623779600ca955556b7d810cc03ea16c884e9 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 23 Aug 2022 19:45:58 +0000 Subject: [PATCH 46/53] Automated changelog update [skip ci] --- CHANGELOG.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae1332d58ac..bd0f104c7aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,12 +11,11 @@ The following sections list the changes for unreleased. * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) * Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) -* Enhancement - Bump reva version: [#4412](https://github.com/owncloud/ocis/pull/4412) * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) * Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) -* Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) +* Enhancement - Update reva to v2.8.0: [#4444](https://github.com/owncloud/ocis/pull/4444) ## Details @@ -56,12 +55,6 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4403 -* Enhancement - Bump reva version: [#4412](https://github.com/owncloud/ocis/pull/4412) - - Bumps reva version - - https://github.com/owncloud/ocis/pull/4412 - * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) We've added an /app/open-with-web endpoint to the app provider, so that clients that are no @@ -95,13 +88,20 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4374 -* Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) +* Enhancement - Update reva to v2.8.0: [#4444](https://github.com/owncloud/ocis/pull/4444) - Updated reva to version x.x.x. This update includes: + Updated reva to version 2.8.0. This update includes: - * TODO: + * Bugfix [cs3org/reva#3158](https://github.com/cs3org/reva/pull/3158): Add name to the propfind response + * Bugfix [cs3org/reva#3157](https://github.com/cs3org/reva/pull/3157): Fix locking response codes + * Bugfix [cs3org/reva#3152](https://github.com/cs3org/reva/pull/3152): Disable caching of not found stat responses + * Bugfix [cs3org/reva#4251](https://github.com/cs3org/reva/pull/4251): Disable caching + * Enhancement [cs3org/reva#3154](https://github.com/cs3org/reva/pull/3154): Dataproviders now return file metadata + * Enhancement [cs3org/reva#3143](https://github.com/cs3org/reva/pull/3143): Add /app/open-with-web endpoint + * Enhancement [cs3org/reva#3156](https://github.com/cs3org/reva/pull/3156): Added language option to the app provider + * Enhancement [cs3org/reva#3148](https://github.com/cs3org/reva/pull/3148): Add new jsoncs3 share manager - https://github.com/owncloud/ocis/pull/4376 + https://github.com/owncloud/ocis/pull/4444 # Changelog for [2.0.0-beta.6] (2022-08-11) The following sections list the changes for 2.0.0-beta.6. From 992c19d26a62b74f479c90f40f310c0b958b27cd Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 23 Aug 2022 13:07:47 +0200 Subject: [PATCH 47/53] chore: update web to v5.7.0-rc.10 --- .drone.env | 2 +- changelog/unreleased/update-web-beta.7.md | 31 +++++++++++++++++++++++ services/web/Makefile | 2 +- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/update-web-beta.7.md diff --git a/.drone.env b/.drone.env index 8811cf1a157..a8f36753cf8 100644 --- a/.drone.env +++ b/.drone.env @@ -3,5 +3,5 @@ CORE_COMMITID=db3913cd9ba67b2d603f8917017734903dfd432a CORE_BRANCH=master # The test runner source for UI tests -WEB_COMMITID=52c0a3e8d0c0a2a8a342ed2656254afe03725260 +WEB_COMMITID=4828c892d292dbccd382104c11486bc5d21340b0 WEB_BRANCH=master diff --git a/changelog/unreleased/update-web-beta.7.md b/changelog/unreleased/update-web-beta.7.md new file mode 100644 index 00000000000..47f3991c1c9 --- /dev/null +++ b/changelog/unreleased/update-web-beta.7.md @@ -0,0 +1,31 @@ +Enhancement: Update ownCloud Web to v5.7.0-rc.10 + +Tags: web + +We updated ownCloud Web to v5.7.0-rc.10. Please refer to the changelog (linked) for details on the web release. + +* Bugfix [owncloud/web#7443](https://github.com/owncloud/web/pull/7443): Datetime formatting +* Bugfix [owncloud/web#7437](https://github.com/owncloud/web/pull/7437): Default to user context +* Bugfix [owncloud/web#7473](https://github.com/owncloud/web/pull/7473): Dragging a file causes no selection +* Bugfix [owncloud/web#7469](https://github.com/owncloud/web/pull/7469): File size not updated while restoring file version +* Bugfix [owncloud/web#7443](https://github.com/owncloud/web/pull/7443): File size formatting +* Bugfix [owncloud/web#7474](https://github.com/owncloud/web/pull/7474): Load only supported thumbnails (configurable) +* Bugfix [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): SidebarNavItem icon flickering +* Bugfix [owncloud/web#7425](https://github.com/owncloud/web/pull/7425): Open Folder in project space context menu +* Bugfix [owncloud/web#7486](https://github.com/owncloud/web/issues/7486): Prevent unnecessary PROPFIND request during upload +* Bugfix [owncloud/web#7415](https://github.com/owncloud/web/pull/7415): Re-fetch quota +* Bugfix [owncloud/web#7478](https://github.com/owncloud/web/issues/7478): "Shared via"-indicator for links +* Bugfix [owncloud/web#7480](https://github.com/owncloud/web/issues/7480): Missing space image in sidebar +* Bugfix [owncloud/web#7436](https://github.com/owncloud/web/issues/7436): Hide share actions for space viewers/editors +* Bugfix [owncloud/web#7445](https://github.com/owncloud/web/pull/7445): User management app close side bar throws error +* Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Keyboard shortcut indicators in ContextMenu +* Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Lowlight cut resources +* Enhancement [owncloud/web#7133](https://github.com/owncloud/web/pull/7133): Permissionless (internal) link shares +* Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Replace locationpicker with clipboard actions +* Enhancement [owncloud/web#7363](https://github.com/owncloud/web/pull/7363): Streamline UI sizings +* Enhancement [owncloud/web#7355](https://github.com/owncloud/web/pull/7355): Update ODS to v14.0.0-alpha.16 +* Enhancement [owncloud/web#7476](https://github.com/owncloud/web/pull/7476): Users table on small screen +* Enhancement [owncloud/web#7182](https://github.com/owncloud/web/pull/7182): User management app edit quota + +https://github.com/owncloud/ocis/pull/4439 +https://github.com/owncloud/web/releases/tag/v5.7.0-rc.10 diff --git a/services/web/Makefile b/services/web/Makefile index 662c784822e..331ef4ab296 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -1,6 +1,6 @@ SHELL := bash NAME := web -WEB_ASSETS_VERSION = v5.7.0-rc.9 +WEB_ASSETS_VERSION = v5.7.0-rc.10 include ../../.make/recursion.mk From 6043e019f478557f184b8b1f387de712fca6849f Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 23 Aug 2022 13:32:32 +0200 Subject: [PATCH 48/53] add the fonts path to the unprotected path prefixes --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 6d430c0038b..c61207149b7 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -56,6 +56,7 @@ var ( "/.well-known", "/js", "/css", + "/fonts", "/icons", "/themes", "/signin", From 28a9bf357e49401ce82625925dbbc110fa0fb0ed Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 23 Aug 2022 13:41:05 +0200 Subject: [PATCH 49/53] end unprotected path prefixes with a slash --- .../proxy/pkg/middleware/authentication.go | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index c61207149b7..4f77f36b099 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -45,22 +45,22 @@ var ( } // _unprotectedPathPrefixes contains paths which don't need to be authenticated. _unprotectedPathPrefixes = [...]string{ - "/files", - "/data", - "/account", + "/files/", + "/data/", + "/account/", "/s/", "/external/spaces", "/apps/openidconnect/redirect", - "/settings", - "/user-management", - "/.well-known", - "/js", - "/css", - "/fonts", - "/icons", - "/themes", - "/signin", - "/konnect", + "/settings/", + "/user-management/", + "/.well-known/", + "/js/", + "/css/", + "/fonts/", + "/icons/", + "/themes/", + "/signin/", + "/konnect/", } ) From dd49462bace95c8e3d81e847fae85e428928ffa5 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 24 Aug 2022 09:09:53 +0200 Subject: [PATCH 50/53] ci: delete accounts frontend app from ci config.json --- tests/config/drone/ocis-config.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/config/drone/ocis-config.json b/tests/config/drone/ocis-config.json index d8ee1513fb8..5c181dedd07 100644 --- a/tests/config/drone/ocis-config.json +++ b/tests/config/drone/ocis-config.json @@ -31,10 +31,6 @@ { "id": "settings", "path": "https://ocis-server:9200/settings.js" - }, - { - "id": "accounts", - "path": "https://ocis-server:9200/accounts.js" } ] } From add2364c6dda5b4e6e723b815a93d1271bd5cb24 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Wed, 24 Aug 2022 08:50:47 +0000 Subject: [PATCH 51/53] Automated changelog update [skip ci] --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd0f104c7aa..9ad87afddbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The following sections list the changes for unreleased. * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) +* Enhancement - Add configuration options for mail authentication and encryption: [#4443](https://github.com/owncloud/ocis/pull/4443) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) * Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) * Enhancement - Update reva to v2.8.0: [#4444](https://github.com/owncloud/ocis/pull/4444) @@ -72,6 +73,18 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4399 https://github.com/cs3org/reva/pull/3156 +* Enhancement - Add configuration options for mail authentication and encryption: [#4443](https://github.com/owncloud/ocis/pull/4443) + + We've added configuration options to configure the authentication and encryption for + sending mails in the notifications service. + + Furthermore there is now a distinguished configuration option for the username to use for + authentication against the mail server. This allows you to customize the sender address to + your liking. For example sender addresses like `my oCIS instance ` are + now possible, too. + + https://github.com/owncloud/ocis/pull/4443 + * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) The new command `ocis idm resetpassword` allows to reset the administrator password when ocis From e65eb15f2c3305e068dd5059ffee48cc16cf0460 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 24 Aug 2022 11:04:18 +0200 Subject: [PATCH 52/53] add the settings path to the unprotected paths --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 4f77f36b099..99dced8d681 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -30,6 +30,7 @@ var ( _unprotectedPaths = map[string]struct{}{ "/": {}, "/login": {}, + "/settings": {}, "/app/list": {}, "/config.json": {}, "/manifest.json": {}, From 1565fe6f1eac3aff35de5ccb22e0b24ee14e2791 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 24 Aug 2022 10:08:52 +0000 Subject: [PATCH 53/53] Automated changelog update [skip ci] --- CHANGELOG.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ad87afddbc..6d713b52766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The following sections list the changes for unreleased. * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) * Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) * Enhancement - Update reva to v2.8.0: [#4444](https://github.com/owncloud/ocis/pull/4444) +* Enhancement - Update ownCloud Web to v5.7.0-rc.10: [#4439](https://github.com/owncloud/ocis/pull/4439) ## Details @@ -115,6 +116,39 @@ The following sections list the changes for unreleased. * Enhancement [cs3org/reva#3148](https://github.com/cs3org/reva/pull/3148): Add new jsoncs3 share manager https://github.com/owncloud/ocis/pull/4444 + +* Enhancement - Update ownCloud Web to v5.7.0-rc.10: [#4439](https://github.com/owncloud/ocis/pull/4439) + + Tags: web + + We updated ownCloud Web to v5.7.0-rc.10. Please refer to the changelog (linked) for details on + the web release. + + * Bugfix [owncloud/web#7443](https://github.com/owncloud/web/pull/7443): Datetime formatting + * Bugfix [owncloud/web#7437](https://github.com/owncloud/web/pull/7437): Default to user context + * Bugfix [owncloud/web#7473](https://github.com/owncloud/web/pull/7473): Dragging a file causes no selection + * Bugfix [owncloud/web#7469](https://github.com/owncloud/web/pull/7469): File size not updated while restoring file version + * Bugfix [owncloud/web#7443](https://github.com/owncloud/web/pull/7443): File size formatting + * Bugfix [owncloud/web#7474](https://github.com/owncloud/web/pull/7474): Load only supported thumbnails (configurable) + * Bugfix [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): SidebarNavItem icon flickering + * Bugfix [owncloud/web#7425](https://github.com/owncloud/web/pull/7425): Open Folder in project space context menu + * Bugfix [owncloud/web#7486](https://github.com/owncloud/web/issues/7486): Prevent unnecessary PROPFIND request during upload + * Bugfix [owncloud/web#7415](https://github.com/owncloud/web/pull/7415): Re-fetch quota + * Bugfix [owncloud/web#7478](https://github.com/owncloud/web/issues/7478): "Shared via"-indicator for links + * Bugfix [owncloud/web#7480](https://github.com/owncloud/web/issues/7480): Missing space image in sidebar + * Bugfix [owncloud/web#7436](https://github.com/owncloud/web/issues/7436): Hide share actions for space viewers/editors + * Bugfix [owncloud/web#7445](https://github.com/owncloud/web/pull/7445): User management app close side bar throws error + * Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Keyboard shortcut indicators in ContextMenu + * Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Lowlight cut resources + * Enhancement [owncloud/web#7133](https://github.com/owncloud/web/pull/7133): Permissionless (internal) link shares + * Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Replace locationpicker with clipboard actions + * Enhancement [owncloud/web#7363](https://github.com/owncloud/web/pull/7363): Streamline UI sizings + * Enhancement [owncloud/web#7355](https://github.com/owncloud/web/pull/7355): Update ODS to v14.0.0-alpha.16 + * Enhancement [owncloud/web#7476](https://github.com/owncloud/web/pull/7476): Users table on small screen + * Enhancement [owncloud/web#7182](https://github.com/owncloud/web/pull/7182): User management app edit quota + + https://github.com/owncloud/ocis/pull/4439 + https://github.com/owncloud/web/releases/tag/v5.7.0-rc.10 # Changelog for [2.0.0-beta.6] (2022-08-11) The following sections list the changes for 2.0.0-beta.6.