diff --git a/.drone.env b/.drone.env index 52b4541d11..e81955aed1 100644 --- a/.drone.env +++ b/.drone.env @@ -1,5 +1,5 @@ # The test runner source for API tests -CORE_COMMITID=a11dbcf8ae3903c550bffea6bbfc7f587bede995 +CORE_COMMITID=5699b6e0adf79ec3241a918ac28c8eb20c70f8bd CORE_BRANCH=master # The test runner source for UI tests diff --git a/CHANGELOG.md b/CHANGELOG.md index 567047c3c5..54140f89d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The following sections list the changes for unreleased. ## Summary +* Bugfix - Check permissions when deleting Space: [#3709](https://github.com/owncloud/ocis/pull/3709) * Bugfix - Thumbnails for `/dav/xxx?preview=1` requests: [#3567](https://github.com/owncloud/ocis/pull/3567) * Bugfix - Idp: Check if CA certificate if present: [#3623](https://github.com/owncloud/ocis/issues/3623) * Bugfix - Return proper errors when ocs/cloud/users is using the cs3 backend: [#3483](https://github.com/owncloud/ocis/issues/3483) @@ -22,15 +23,23 @@ The following sections list the changes for unreleased. * Change - Split MachineAuth from SystemUser: [#3672](https://github.com/owncloud/ocis/pull/3672) * Enhancement - Align service naming: [#3606](https://github.com/owncloud/ocis/pull/3606) * Enhancement - Wrap metadata storage with dedicated reva gateway: [#3602](https://github.com/owncloud/ocis/pull/3602) +* Enhancement - Product field in OCS version: [#2918](https://github.com/owncloud/ocis/pull/2918) * Enhancement - Add initial version of the search extensions: [#3635](https://github.com/owncloud/ocis/pull/3635) * Enhancement - Add capability for public link single file edit: [#6787](https://github.com/owncloud/web/pull/6787) * Enhancement - Added `share_jail` and `projects` feature flags in spaces capability: [#3626](https://github.com/owncloud/ocis/pull/3626) * Enhancement - Update linkshare capabilities: [#3579](https://github.com/owncloud/ocis/pull/3579) -* Enhancement - Update reva to v2.3.0: [#3552](https://github.com/owncloud/ocis/pull/3552) +* Enhancement - Update reva to v2.3.1: [#3552](https://github.com/owncloud/ocis/pull/3552) * Enhancement - Update ownCloud Web to v5.5.0-rc.4: [#6854](https://github.com/owncloud/web/pull/6854) ## Details +* Bugfix - Check permissions when deleting Space: [#3709](https://github.com/owncloud/ocis/pull/3709) + + Check for manager permissions when deleting spaces. Do not allow deleting spaces via dav + service + + https://github.com/owncloud/ocis/pull/3709 + * Bugfix - Thumbnails for `/dav/xxx?preview=1` requests: [#3567](https://github.com/owncloud/ocis/pull/3567) We've added the thumbnail rendering for `/dav/xxx?preview=1`, @@ -164,6 +173,14 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/3602 https://github.com/owncloud/ocis/pull/3647 +* Enhancement - Product field in OCS version: [#2918](https://github.com/owncloud/ocis/pull/2918) + + We've added a new field to the OCS Version, which is supposed to announce the product name. The + web ui as a client will make use of it to make the backend product and version available (e.g. for + easier bug reports). + + https://github.com/owncloud/ocis/pull/2918 + * Enhancement - Add initial version of the search extensions: [#3635](https://github.com/owncloud/ocis/pull/3635) It is now possible to search for files and directories by their name using the web UI. Therefor @@ -195,7 +212,15 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/3579 -* Enhancement - Update reva to v2.3.0: [#3552](https://github.com/owncloud/ocis/pull/3552) +* Enhancement - Update reva to v2.3.1: [#3552](https://github.com/owncloud/ocis/pull/3552) + + Updated reva to version 2.3.1. This update includes + + * Bugfix [cs3org/reva#2827](https://github.com/cs3org/reva/pull/2827): Check permissions when deleting spaces + * Bugfix [cs3org/reva#2830](https://github.com/cs3org/reva/pull/2830): Correctly render response when accepting merged shares + * Bugfix [cs3org/reva#2831](https://github.com/cs3org/reva/pull/2831): Fix uploads to owncloudsql storage when no mtime is provided + * Enhancement [cs3org/reva#2833](https://github.com/cs3org/reva/pull/2833): Make status.php values configurable + * Enhancement [cs3org/reva#2832](https://github.com/cs3org/reva/pull/2832): Add version option for ocdav go-micro service Updated reva to version 2.3.0. This update includes: diff --git a/changelog/unreleased/deleteSpacePermissions.md b/changelog/unreleased/deleteSpacePermissions.md new file mode 100644 index 0000000000..2f6418d26d --- /dev/null +++ b/changelog/unreleased/deleteSpacePermissions.md @@ -0,0 +1,6 @@ +Bugfix: Check permissions when deleting Space + +Check for manager permissions when deleting spaces. +Do not allow deleting spaces via dav service + +https://github.com/owncloud/ocis/pull/3709 diff --git a/changelog/unreleased/ocs-version-product-field.md b/changelog/unreleased/ocs-version-product-field.md new file mode 100644 index 0000000000..6714300c1b --- /dev/null +++ b/changelog/unreleased/ocs-version-product-field.md @@ -0,0 +1,5 @@ +Enhancement: Product field in OCS version + +We've added a new field to the OCS Version, which is supposed to announce the product name. The web ui as a client will make use of it to make the backend product and version available (e.g. for easier bug reports). + +https://github.com/owncloud/ocis/pull/2918 diff --git a/changelog/unreleased/update-reva.md b/changelog/unreleased/update-reva.md index 57b8c179ce..3f5f66790c 100644 --- a/changelog/unreleased/update-reva.md +++ b/changelog/unreleased/update-reva.md @@ -1,4 +1,12 @@ -Enhancement: update reva to v2.3.0 +Enhancement: update reva to v2.3.1 + +Updated reva to version 2.3.1. This update includes + +* Bugfix [cs3org/reva#2827](https://github.com/cs3org/reva/pull/2827): Check permissions when deleting spaces +* Bugfix [cs3org/reva#2830](https://github.com/cs3org/reva/pull/2830): Correctly render response when accepting merged shares +* Bugfix [cs3org/reva#2831](https://github.com/cs3org/reva/pull/2831): Fix uploads to owncloudsql storage when no mtime is provided +* Enhancement [cs3org/reva#2833](https://github.com/cs3org/reva/pull/2833): Make status.php values configurable +* Enhancement [cs3org/reva#2832](https://github.com/cs3org/reva/pull/2832): Add version option for ocdav go-micro service Updated reva to version 2.3.0. This update includes: diff --git a/deployments/examples/ocis_ldap/config/ocis/entrypoint-override.sh b/deployments/examples/ocis_ldap/config/ocis/entrypoint-override.sh deleted file mode 100644 index 2fd09563b2..0000000000 --- a/deployments/examples/ocis_ldap/config/ocis/entrypoint-override.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -set -e - -mkdir -p /var/tmp/ocis/.config/ -cp /config/web-config.dist.json /var/tmp/ocis/.config/web-config.json -sed -i 's/ocis.owncloud.test/'${OCIS_DOMAIN:-ocis.owncloud.test}'/g' /var/tmp/ocis/.config/web-config.json - -ocis server& -sleep 10 - -# stop builtin accounts since we use LDAP only -ocis kill accounts -# stop builtin LDAP server since we use external LDAP only -ocis kill glauth - -wait # wait for oCIS to exit diff --git a/deployments/examples/ocis_ldap/config/ocis/proxy.yaml b/deployments/examples/ocis_ldap/config/ocis/proxy.yaml deleted file mode 100644 index b303cd63d9..0000000000 --- a/deployments/examples/ocis_ldap/config/ocis/proxy.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -policy_selector: - static: - policy: ocis -policies: - - name: ocis - routes: - - endpoint: "/" - backend: http://localhost:9100 - - endpoint: "/.well-known/" - backend: http://localhost:9130 - - endpoint: "/konnect/" - backend: http://localhost:9130 - - endpoint: "/signin/" - backend: http://localhost:9130 - - type: regex - endpoint: "/ocs/v[12].php/cloud/user/signing-key" - backend: http://localhost:9110 - - endpoint: "/ocs/" - backend: http://localhost:9140 - - type: query - endpoint: "/remote.php/?preview=1" - backend: http://localhost:9115 - - endpoint: "/remote.php/" - backend: http://localhost:9140 - - endpoint: "/dav/" - backend: http://localhost:9140 - - endpoint: "/webdav/" - backend: http://localhost:9140 - - endpoint: "/status.php" - backend: http://localhost:9140 - - endpoint: "/index.php/" - backend: http://localhost:9140 - - endpoint: "/app/" - backend: http://localhost:9140 - - endpoint: "/archiver" - backend: http://localhost:9140 - - endpoint: "/data" - backend: http://localhost:9140 - - endpoint: "/graph/" - backend: http://localhost:9120 - - endpoint: "/graph-explorer/" - backend: http://localhost:9135 - - endpoint: "/api/v0/settings" - backend: http://localhost:9190 - - endpoint: "/settings.js" - backend: http://localhost:9190 diff --git a/deployments/examples/ocis_ldap/config/ocis/web-config.dist.json b/deployments/examples/ocis_ldap/config/ocis/web-config.dist.json deleted file mode 100644 index b4bd58fc16..0000000000 --- a/deployments/examples/ocis_ldap/config/ocis/web-config.dist.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "server": "https://ocis.owncloud.test", - "theme": "owncloud", - "version": "0.1.0", - "openIdConnect": { - "metadata_url": "https://ocis.owncloud.test/.well-known/openid-configuration", - "authority": "https://ocis.owncloud.test", - "client_id": "web", - "response_type": "code", - "scope": "openid profile email" - }, - "apps": ["files"], - "external_apps": [ - { - "id": "settings", - "path": "/settings.js" - } - ], - "options": { - "hideSearchBar": true - } -} diff --git a/deployments/examples/ocis_ldap/docker-compose.yml b/deployments/examples/ocis_ldap/docker-compose.yml index b5547a8b20..e82a3eb912 100644 --- a/deployments/examples/ocis_ldap/docker-compose.yml +++ b/deployments/examples/ocis_ldap/docker-compose.yml @@ -50,9 +50,13 @@ services: - ldap-server entrypoint: - /bin/sh - - /entrypoint-override.sh + # run ocis init to initialize a configuration file with random secrets + # it will fail on subsequent runs, because the config file already exists + # therefore we ignore the error and then start the ocis server + command: ["-c", "ocis init || true; ocis server"] environment: - # CS3 users from ldap specific configuration + + # users/gropups from ldap LDAP_URI: ldaps://ldap-server LDAP_INSECURE: "true" LDAP_BIND_DN: "cn=admin,dc=owncloud,dc=com" @@ -64,32 +68,24 @@ services: LDAP_USERFILTER: "(objectclass=owncloud)" LDAP_USER_OBEJECTCLASS: "inetOrgPerson" LDAP_LOGIN_ATTRIBUTES: "uid,mail" + IDP_LDAP_URI: ldap://ldap-server IDP_LDAP_LOGIN_ATTRIBUTE: "uid" IDP_LDAP_UUID_ATTRIBUTE: "ownclouduuid" IDP_LDAP_UUID_ATTRIBUTE_TYPE: binary - PROXY_ACCOUNT_BACKEND_TYPE: cs3 - # web ui - WEB_UI_CONFIG: "/var/tmp/ocis/.config/web-config.json" + GRAPH_LDAP_SERVER_WRITE_ENABLED: "false" # assuming the external ldap is readonly + # OCIS_RUN_EXTENSIONS specifies to start all extensions except glauth, idm and accounts. These are replaced by external services + OCIS_RUN_EXTENSIONS: app-registry,app-provider,audit,auth-basic,auth-bearer,auth-machine,frontend,gateway,graph,graph-explorer,groups,idp,nats,notifications,ocdav,ocs,proxy,search,settings,sharing,storage-system,storage-publiclink,storage-shares,storage-users,store,thumbnails,users,web,webdav # General oCIS config OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test} - OCIS_DOMAIN: ${OCIS_DOMAIN:-ocis.owncloud.test} OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-error} # make oCIS less verbose PROXY_TLS: "false" # do not use SSL between Traefik and oCIS - # change default secrets - OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4} - STORAGE_TRANSFER_SECRET: ${STORAGE_TRANSFER_SECRET:-replace-me-with-a-transfer-secret} - OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please} # INSECURE: needed if oCIS / Traefik is using self generated certificates OCIS_INSECURE: "${INSECURE:-false}" # basic auth (not recommended, but needed for eg. WebDav clients that do not support OpenID Connect) PROXY_ENABLE_BASIC_AUTH: "${PROXY_ENABLE_BASIC_AUTH:-false}" - # demo users - ACCOUNTS_DEMO_USERS_AND_GROUPS: "${DEMO_USERS:-false}" # deprecated, remove after switching to LibreIDM - IDM_CREATE_DEMO_USERS: "${DEMO_USERS:-false}" + # admin user password volumes: - - ./config/ocis/entrypoint-override.sh:/entrypoint-override.sh - - ./config/ocis/web-config.dist.json:/config/web-config.dist.json - - ./config/ocis/proxy.yaml:/etc/ocis/proxy.yaml + - ocis-config:/etc/ocis - ocis-data:/var/lib/ocis labels: - "traefik.enable=true" @@ -124,7 +120,7 @@ services: restart: always ldap-manager: - image: osixia/phpldapadmin:0.9.0 + image: osixia/phpldapadmin:latest networks: ocis-net: environment: @@ -143,6 +139,7 @@ services: volumes: certs: + ocis-config: ocis-data: networks: diff --git a/extensions/frontend/pkg/revaconfig/config.go b/extensions/frontend/pkg/revaconfig/config.go index 9cd3c95d8f..a7f30597c3 100644 --- a/extensions/frontend/pkg/revaconfig/config.go +++ b/extensions/frontend/pkg/revaconfig/config.go @@ -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(), }, }, }, diff --git a/extensions/graph/pkg/service/v0/drives.go b/extensions/graph/pkg/service/v0/drives.go index 5482fea406..6fde3c5a00 100644 --- a/extensions/graph/pkg/service/v0/drives.go +++ b/extensions/graph/pkg/service/v0/drives.go @@ -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: - errorcode.GeneralException.Render(w, r, http.StatusBadRequest, dRes.Status.Message) - w.WriteHeader(http.StatusBadRequest) - return - case err != nil || dRes.Status.Code != cs3rpc.Code_CODE_OK: + 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 + // 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) { diff --git a/extensions/ocdav/pkg/command/server.go b/extensions/ocdav/pkg/command/server.go index f55c641003..b9a109d275 100644 --- a/extensions/ocdav/pkg/command/server.go +++ b/extensions/ocdav/pkg/command/server.go @@ -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 diff --git a/extensions/ocdav/pkg/config/config.go b/extensions/ocdav/pkg/config/config.go index 92395e3a43..8c7e2407dc 100644 --- a/extensions/ocdav/pkg/config/config.go +++ b/extensions/ocdav/pkg/config/config.go @@ -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 +} diff --git a/extensions/ocdav/pkg/config/defaults/defaultconfig.go b/extensions/ocdav/pkg/config/defaults/defaultconfig.go index d151762cc5..dcf990ab42 100644 --- a/extensions/ocdav/pkg/config/defaults/defaultconfig.go +++ b/extensions/ocdav/pkg/config/defaults/defaultconfig.go @@ -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", + }, } } diff --git a/go.mod b/go.mod index f5778bd59c..66b83300bb 100644 --- a/go.mod +++ b/go.mod @@ -5,12 +5,13 @@ go 1.17 require ( github.com/CiscoM31/godata v1.0.5 github.com/GeertJohan/yubigo v0.0.0-20190917122436-175bc097e60e + github.com/Masterminds/semver v1.5.0 github.com/ReneKroon/ttlcache/v2 v2.11.0 github.com/blevesearch/bleve/v2 v2.3.2 github.com/blevesearch/bleve_index_api v1.0.1 github.com/coreos/go-oidc/v3 v3.1.0 github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde - github.com/cs3org/reva/v2 v2.3.1-0.20220506133959-1ad146903c6f + github.com/cs3org/reva/v2 v2.3.1 github.com/disintegration/imaging v1.6.2 github.com/glauth/glauth/v2 v2.0.0-20211021011345-ef3151c28733 github.com/go-chi/chi/v5 v5.0.7 @@ -68,10 +69,10 @@ require ( go-micro.dev/v4 v4.6.0 go.opencensus.io v0.23.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.31.0 - go.opentelemetry.io/otel v1.6.3 - go.opentelemetry.io/otel/exporters/jaeger v1.6.3 - go.opentelemetry.io/otel/sdk v1.6.3 - go.opentelemetry.io/otel/trace v1.6.3 + go.opentelemetry.io/otel v1.7.0 + go.opentelemetry.io/otel/exporters/jaeger v1.7.0 + go.opentelemetry.io/otel/sdk v1.7.0 + go.opentelemetry.io/otel/trace v1.7.0 golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 golang.org/x/image v0.0.0-20220321031419-a8550c1d254a golang.org/x/net v0.0.0-20220225172249-27dd8689420f @@ -89,7 +90,6 @@ require ( github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e // indirect github.com/BurntSushi/toml v1.1.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver v1.5.0 // indirect github.com/Masterminds/sprig v2.22.0+incompatible // indirect github.com/Microsoft/go-winio v0.5.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20211112122917-428f8eabeeb3 // indirect diff --git a/go.sum b/go.sum index b806db1717..dddfbd5e56 100644 --- a/go.sum +++ b/go.sum @@ -318,10 +318,8 @@ github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde h1:WrD9O8ZaWvsm0 github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cs3org/reva v1.18.0 h1:MbPS5ZAa8RzKcTxAVeSDdISB3XXqLIxqB03BTN5ReBY= github.com/cs3org/reva v1.18.0/go.mod h1:e5VDUDu4vVWIeVkZcW//n6UZzhGGMa+Tz/whCiX3N6o= -github.com/cs3org/reva/v2 v2.3.0 h1:AwDwqqzAKTrkBz1ifOy3U92C12zk92uBw6LyhLAjCBc= -github.com/cs3org/reva/v2 v2.3.0/go.mod h1:2e/4HcIy54Mic3V7Ow0bz4n5dkZU0dHIZSWomFe5vng= -github.com/cs3org/reva/v2 v2.3.1-0.20220506133959-1ad146903c6f h1:1vv8pODAoBgFGCP7UGoQCxvY6hK3vb6KirlqUNRcRys= -github.com/cs3org/reva/v2 v2.3.1-0.20220506133959-1ad146903c6f/go.mod h1:2e/4HcIy54Mic3V7Ow0bz4n5dkZU0dHIZSWomFe5vng= +github.com/cs3org/reva/v2 v2.3.1 h1:15RrT1Jz5VEuPobtfG4Nm2TcTb5O6jj1djEmIYA3yQk= +github.com/cs3org/reva/v2 v2.3.1/go.mod h1:2e/4HcIy54Mic3V7Ow0bz4n5dkZU0dHIZSWomFe5vng= 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= @@ -1481,18 +1479,22 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.31.0/go.mod h1:SY9qHHUES6W3oZnO1H2W8NvsSovIoXRg/A1AH9px8+I= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel v1.6.1/go.mod h1:blzUabWHkX6LJewxvadmzafgh/wnvBSDBdOuwkAtrWQ= -go.opentelemetry.io/otel v1.6.3 h1:FLOfo8f9JzFVFVyU+MSRJc2HdEAXQgm7pIv2uFKRSZE= go.opentelemetry.io/otel v1.6.3/go.mod h1:7BgNga5fNlF/iZjG06hM3yofffp0ofKCDwSXx1GC4dI= +go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM= +go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= go.opentelemetry.io/otel/exporters/jaeger v1.3.0/go.mod h1:KoYHi1BtkUPncGSRtCe/eh1ijsnePhSkxwzz07vU0Fc= -go.opentelemetry.io/otel/exporters/jaeger v1.6.3 h1:7tvBU1Ydbzq080efuepYYqC1Pv3/vOFBgCSrxLb24d0= go.opentelemetry.io/otel/exporters/jaeger v1.6.3/go.mod h1:YgX3eZWbJzgrNyNHCK0otGreAMBTIAcObtZS2VRi6sU= +go.opentelemetry.io/otel/exporters/jaeger v1.7.0 h1:wXgjiRldljksZkZrldGVe6XrG9u3kYDyQmkZwmm5dI0= +go.opentelemetry.io/otel/exporters/jaeger v1.7.0/go.mod h1:PwQAOqBgqbLQRKlj466DuD2qyMjbtcPpfPfj+AqbSBs= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= -go.opentelemetry.io/otel/sdk v1.6.3 h1:prSHYdwCQOX5DrsEzxowH3nLhoAzEBdZhvrR79scfLs= go.opentelemetry.io/otel/sdk v1.6.3/go.mod h1:A4iWF7HTXa+GWL/AaqESz28VuSBIcZ+0CV+IzJ5NMiQ= +go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= +go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/otel/trace v1.6.1/go.mod h1:RkFRM1m0puWIq10oxImnGEduNBzxiN7TXluRBtE+5j0= -go.opentelemetry.io/otel/trace v1.6.3 h1:IqN4L+5b0mPNjdXIiZ90Ni4Bl5BRkDQywePLWemd9bc= go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs= +go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= +go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/ocis-pkg/version/version.go b/ocis-pkg/version/version.go index 81e81815f4..1cfabd6f2f 100644 --- a/ocis-pkg/version/version.go +++ b/ocis-pkg/version/version.go @@ -1,15 +1,18 @@ package version import ( + "strconv" "time" + + "github.com/Masterminds/semver" ) var ( // String gets defined by the build system. - String = "0.0.0" + String = "dev" // Date indicates the build date. - Date = "00000000" + Date = time.Now().Format("20060102") ) // Compiled returns the compile time of this service. @@ -17,3 +20,33 @@ func Compiled() time.Time { t, _ := time.Parse("20060102", Date) return t } + +// GetString returns a version string with pre-releases and metadata +func GetString() string { + return Parsed().String() +} + +// Parsed returns a semver Version +func Parsed() *semver.Version { + versionToParse := String + if String == "dev" { + versionToParse = "0.0.0+dev" + } + parsedVersion, err := semver.NewVersion(versionToParse) + // We have no semver version but a commitid + if err != nil { + parsedVersion, err = semver.NewVersion("0.0.0+" + String) + // this should never happen + if err != nil { + return &semver.Version{} + } + } + return parsedVersion +} + +// Long returns the legacy version with 4 number parts like 10.9.8.0 +func Long() string { + return strconv.FormatInt(Parsed().Major(), 10) + "." + + strconv.FormatInt(Parsed().Minor(), 10) + "." + + strconv.FormatInt(Parsed().Patch(), 10) + "." + "0" +} diff --git a/ocis/pkg/command/init.go b/ocis/pkg/command/init.go index 5b08786978..62f2f26c50 100644 --- a/ocis/pkg/command/init.go +++ b/ocis/pkg/command/init.go @@ -50,7 +50,7 @@ func InitCommand(cfg *config.Config) *cli.Command { insecureFlag := c.String("insecure") insecure := false if insecureFlag == "ask" { - answer := strings.ToLower(stringPrompt("Do you want to configure oCIS with certificate checking disabled?\n This is not recommended for public instances! [yes | no = default]")) + answer := strings.ToLower(stringPrompt("Do you want to configure Infinite Scale with certificate checking disabled?\n This is not recommended for public instances! [yes | no = default]")) if answer == "yes" || answer == "y" { insecure = true } diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index ab30ab9795..086d3b93a4 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -1613,10 +1613,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiMain/checksums.feature:233](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L233) -#### [status does not have new product data item](https://github.com/owncloud/ocis/issues/3317) - -- [apiCapabilities/capabilities.feature:959](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiCapabilities/capabilities.feature#L959) - #### public links without permission are allowed now - [apiShareUpdateToShares/updateShare.feature:113](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L113) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index ae26ed68e5..eae806c58a 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -22,7 +22,3 @@ The expected failures in this file are from features in the owncloud/ocis repo. #### [Overwriting a file in the space within the allowed quota does not work](https://github.com/owncloud/ocis/issues/2829) - [apiSpaces/quota.feature:56](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/quota.feature#L56) -#### [Viewer and editor has the possibility to disable the space](https://github.com/owncloud/ocis/issues/3031) -- [apiSpaces/removeSpaceObjects.feature:74](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/removeSpaceObjects.feature#L74) -- [apiSpaces/deleteSpaces.feature:73](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/deleteSpaces.feature#L73) -- [apiSpaces/deleteSpaces.feature:84](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/deleteSpaces.feature#L84) diff --git a/tests/acceptance/features/apiSpaces/removeSpaceObjects.feature b/tests/acceptance/features/apiSpaces/removeSpaceObjects.feature index 95112c0619..6e22ec10c0 100644 --- a/tests/acceptance/features/apiSpaces/removeSpaceObjects.feature +++ b/tests/acceptance/features/apiSpaces/removeSpaceObjects.feature @@ -74,7 +74,7 @@ Feature: Remove files, folder Scenario: An user is unable to delete a Space via the webDav API Given user "Alice" has created a space "user deletes a space" of type "project" with quota "20" When user "Alice" removes the folder "" from space "user deletes a space" - Then the HTTP status code should be "405" + Then the HTTP status code should be "400" When user "Alice" lists all available spaces via the GraphApi Then the json responded should contain a space "user deletes a space" with these key and value pairs: | key | value |