Merge branch 'master' into reenable-parallel-deployment-in-ci
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"strconv"
|
||||
|
||||
"github.com/owncloud/ocis/v2/extensions/frontend/pkg/config"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/version"
|
||||
)
|
||||
|
||||
// FrontendConfigFromStruct will adapt an oCIS config struct into a reva mapstructure to start a reva service.
|
||||
@@ -138,10 +139,11 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} {
|
||||
"installed": true,
|
||||
"maintenance": false,
|
||||
"needsDbUpgrade": false,
|
||||
"version": "10.0.11.5",
|
||||
"versionstring": "10.0.11",
|
||||
"edition": "community",
|
||||
"productname": "reva",
|
||||
"version": version.Long(),
|
||||
"versionstring": version.GetString(),
|
||||
"edition": "Community",
|
||||
"productname": "Infinite Scale",
|
||||
"product": "Infinite Scale",
|
||||
"hostname": "",
|
||||
},
|
||||
"support_url_signing": true,
|
||||
@@ -210,11 +212,12 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} {
|
||||
},
|
||||
},
|
||||
"version": map[string]interface{}{
|
||||
"edition": "reva",
|
||||
"major": 10,
|
||||
"minor": 0,
|
||||
"micro": 11,
|
||||
"string": "10.0.11",
|
||||
"product": "Infinite Scale",
|
||||
"edition": "Community",
|
||||
"major": version.Parsed().Major(),
|
||||
"minor": version.Parsed().Minor(),
|
||||
"micro": version.Parsed().Patch(),
|
||||
"string": version.GetString(),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -793,18 +793,30 @@ func (g Graph) DeleteDrive(w http.ResponseWriter, r *http.Request) {
|
||||
OpaqueId: root.StorageId,
|
||||
},
|
||||
})
|
||||
switch {
|
||||
case dRes.Status.Code == cs3rpc.Code_CODE_INVALID_ARGUMENT:
|
||||
if err != nil {
|
||||
g.logger.Error().Err(err).Msg("error deleting storage space")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
switch dRes.GetStatus().GetCode() {
|
||||
case cs3rpc.Code_CODE_OK:
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
return
|
||||
case cs3rpc.Code_CODE_INVALID_ARGUMENT:
|
||||
errorcode.GeneralException.Render(w, r, http.StatusBadRequest, dRes.Status.Message)
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
case cs3rpc.Code_CODE_PERMISSION_DENIED:
|
||||
w.WriteHeader(http.StatusForbidden)
|
||||
return
|
||||
case err != nil || dRes.Status.Code != cs3rpc.Code_CODE_OK:
|
||||
// don't expose internal error codes to the outside world
|
||||
default:
|
||||
g.logger.Error().Err(err).Msg("error deleting storage space")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
}
|
||||
|
||||
func sortSpaces(req *godata.GoDataRequest, spaces []*libregraph.Drive) ([]*libregraph.Drive, error) {
|
||||
|
||||
@@ -55,6 +55,11 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
ocdav.Prefix(cfg.HTTP.Prefix),
|
||||
ocdav.GatewaySvc(cfg.Reva.Address),
|
||||
ocdav.JWTSecret(cfg.TokenManager.JWTSecret),
|
||||
ocdav.ProductName(cfg.Status.ProductName),
|
||||
ocdav.Product(cfg.Status.Product),
|
||||
ocdav.Version(cfg.Status.Version),
|
||||
ocdav.VersionString(cfg.Status.VersionString),
|
||||
ocdav.Edition(cfg.Status.Edition),
|
||||
// ocdav.FavoriteManager() // FIXME needs a proper persistence implementation
|
||||
// ocdav.LockSystem(), // will default to the CS3 lock system
|
||||
// ocdav.TLSConfig() // tls config for the http server
|
||||
|
||||
@@ -33,6 +33,7 @@ type Config struct {
|
||||
Middleware Middleware `yaml:"middleware"`
|
||||
|
||||
Context context.Context `yaml:"-"`
|
||||
Status Status `yaml:"-"`
|
||||
}
|
||||
type Tracing struct {
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;OCDAV_TRACING_ENABLED" desc:"Activates tracing."`
|
||||
@@ -75,3 +76,12 @@ type Middleware struct {
|
||||
type Auth struct {
|
||||
CredentialsByUserAgent map[string]string `yaml:"credentials_by_user_agent"`
|
||||
}
|
||||
|
||||
// Status holds the configurable values for the status.php
|
||||
type Status struct {
|
||||
Version string
|
||||
VersionString string
|
||||
Product string
|
||||
ProductName string
|
||||
Edition string
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package defaults
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis/v2/extensions/ocdav/pkg/config"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/version"
|
||||
)
|
||||
|
||||
func FullDefaultConfig() *config.Config {
|
||||
@@ -42,6 +43,13 @@ func DefaultConfig() *config.Config {
|
||||
CredentialsByUserAgent: map[string]string{},
|
||||
},
|
||||
},
|
||||
Status: config.Status{
|
||||
Version: version.Long(),
|
||||
VersionString: version.GetString(),
|
||||
Product: "Infinite Scale",
|
||||
ProductName: "Infinite Scale",
|
||||
Edition: "Community",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user