From 23acf40dd22345a31c02c277b14381aef1314d82 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 16 May 2022 13:43:21 +0200 Subject: [PATCH] fix version for legacy clients --- changelog/unreleased/fix-version.md | 6 ++++++ extensions/frontend/pkg/revaconfig/config.go | 5 +++-- extensions/ocdav/pkg/command/server.go | 1 + extensions/ocdav/pkg/config/config.go | 11 ++++++----- extensions/ocdav/pkg/config/defaults/defaultconfig.go | 11 ++++++----- extensions/proxy/pkg/config/defaults/defaultconfig.go | 4 ++++ go.mod | 2 +- go.sum | 6 ++++-- ocis-pkg/version/version.go | 6 ++++++ 9 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 changelog/unreleased/fix-version.md diff --git a/changelog/unreleased/fix-version.md b/changelog/unreleased/fix-version.md new file mode 100644 index 00000000000..36c5eb0a595 --- /dev/null +++ b/changelog/unreleased/fix-version.md @@ -0,0 +1,6 @@ +Bugfix: Fix version number in status page + +We needed to undo the version number changes on the status page to keep compatibility for legacy clients. We added a new field `productversion` for the actual version of the product. + +https://github.com/owncloud/ocis/issues/3788 +https://github.com/owncloud/ocis/pull/3805 diff --git a/extensions/frontend/pkg/revaconfig/config.go b/extensions/frontend/pkg/revaconfig/config.go index a7f30597c3a..d54a88d147d 100644 --- a/extensions/frontend/pkg/revaconfig/config.go +++ b/extensions/frontend/pkg/revaconfig/config.go @@ -139,11 +139,12 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { "installed": true, "maintenance": false, "needsDbUpgrade": false, - "version": version.Long(), - "versionstring": version.GetString(), + "version": version.Legacy, + "versionstring": version.LegacyString, "edition": "Community", "productname": "Infinite Scale", "product": "Infinite Scale", + "productversion": version.GetString(), "hostname": "", }, "support_url_signing": true, diff --git a/extensions/ocdav/pkg/command/server.go b/extensions/ocdav/pkg/command/server.go index 75fa0a471d0..a544c7906c8 100644 --- a/extensions/ocdav/pkg/command/server.go +++ b/extensions/ocdav/pkg/command/server.go @@ -58,6 +58,7 @@ func Server(cfg *config.Config) *cli.Command { ocdav.GatewaySvc(cfg.Reva.Address), ocdav.JWTSecret(cfg.TokenManager.JWTSecret), ocdav.ProductName(cfg.Status.ProductName), + ocdav.ProductVersion(cfg.Status.ProductVersion), ocdav.Product(cfg.Status.Product), ocdav.Version(cfg.Status.Version), ocdav.VersionString(cfg.Status.VersionString), diff --git a/extensions/ocdav/pkg/config/config.go b/extensions/ocdav/pkg/config/config.go index 72d60a06d3e..f5a5c634971 100644 --- a/extensions/ocdav/pkg/config/config.go +++ b/extensions/ocdav/pkg/config/config.go @@ -79,9 +79,10 @@ type Auth struct { // Status holds the configurable values for the status.php type Status struct { - Version string - VersionString string - Product string - ProductName string - Edition string + Version string + VersionString string + Product string + ProductName string + ProductVersion string + Edition string } diff --git a/extensions/ocdav/pkg/config/defaults/defaultconfig.go b/extensions/ocdav/pkg/config/defaults/defaultconfig.go index dcf990ab425..e41d021b8e3 100644 --- a/extensions/ocdav/pkg/config/defaults/defaultconfig.go +++ b/extensions/ocdav/pkg/config/defaults/defaultconfig.go @@ -44,11 +44,12 @@ func DefaultConfig() *config.Config { }, }, Status: config.Status{ - Version: version.Long(), - VersionString: version.GetString(), - Product: "Infinite Scale", - ProductName: "Infinite Scale", - Edition: "Community", + Version: version.Legacy, + VersionString: version.LegacyString, + ProductVersion: version.GetString(), + Product: "Infinite Scale", + ProductName: "Infinite Scale", + Edition: "Community", }, } } diff --git a/extensions/proxy/pkg/config/defaults/defaultconfig.go b/extensions/proxy/pkg/config/defaults/defaultconfig.go index 87e803d7068..ca9ca55bd45 100644 --- a/extensions/proxy/pkg/config/defaults/defaultconfig.go +++ b/extensions/proxy/pkg/config/defaults/defaultconfig.go @@ -128,6 +128,10 @@ func DefaultPolicies() []config.Policy { Endpoint: "/webdav/", Service: "com.owncloud.web.ocdav", }, + { + Endpoint: "/status", + Service: "com.owncloud.web.ocdav", + }, { Endpoint: "/status.php", Service: "com.owncloud.web.ocdav", diff --git a/go.mod b/go.mod index 52f6bed48a6..d8d12b09231 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.1 github.com/coreos/go-oidc/v3 v3.2.0 github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde - github.com/cs3org/reva/v2 v2.3.2-0.20220513093820-4f179b727de6 + github.com/cs3org/reva/v2 v2.3.2-0.20220517104818-690fb7f13ef4 github.com/disintegration/imaging v1.6.2 github.com/go-chi/chi/v5 v5.0.7 github.com/go-chi/cors v1.2.1 diff --git a/go.sum b/go.sum index 577328e1e96..f5952c35155 100644 --- a/go.sum +++ b/go.sum @@ -296,8 +296,8 @@ github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD9 github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e/go.mod h1:XJEZ3/EQuI3BXTp/6DUzFr850vlxq11I6satRtz0YQ4= github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde h1:WrD9O8ZaWvsm0eBzpzVBIuczDhqVq50Nmjc7PGHHA9Y= github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.3.2-0.20220513093820-4f179b727de6 h1:SsL8/Uu/h8fYxi44iEg8MbziujeyVMZdwZECeaoMBww= -github.com/cs3org/reva/v2 v2.3.2-0.20220513093820-4f179b727de6/go.mod h1:uGeTncJa3FISh8AERkbZYVNXFV40PjYyRht5L09i+LQ= +github.com/cs3org/reva/v2 v2.3.2-0.20220517104818-690fb7f13ef4 h1:QPJPgsJtLcceFZn1GXZiotyp/fNxuf74gijwDJ/jU+o= +github.com/cs3org/reva/v2 v2.3.2-0.20220517104818-690fb7f13ef4/go.mod h1:uGeTncJa3FISh8AERkbZYVNXFV40PjYyRht5L09i+LQ= 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= @@ -883,6 +883,8 @@ github.com/maxymania/go-system v0.0.0-20170110133659-647cc364bf0b h1:Q53idHrTuQD github.com/maxymania/go-system v0.0.0-20170110133659-647cc364bf0b/go.mod h1:KirJrATYGbTyUwVR26xIkaipRqRcMRXBf8N5dacvGus= github.com/mendsley/gojwk v0.0.0-20141217222730-4d5ec6e58103 h1:Z/i1e+gTZrmcGeZyWckaLfucYG6KYOXLWo4co8pZYNY= github.com/mendsley/gojwk v0.0.0-20141217222730-4d5ec6e58103/go.mod h1:o9YPB5aGP8ob35Vy6+vyq3P3bWe7NQWzf+JLiXCiMaE= +github.com/micbar/reva/v2 v2.0.0-20220516113840-e3aec07a0336 h1:/N3Hw1x/28snGTVNV/eoU3gyfcp4ZHCjSxQj8fAa7Ls= +github.com/micbar/reva/v2 v2.0.0-20220516113840-e3aec07a0336/go.mod h1:uGeTncJa3FISh8AERkbZYVNXFV40PjYyRht5L09i+LQ= github.com/micbar/xattr v0.4.6-0.20220215112335-88e74d648fb7 h1:M0R40eUlyqxMuZn3Knx4DJTwHE3TiPFzcWUA/BKtDMM= github.com/micbar/xattr v0.4.6-0.20220215112335-88e74d648fb7/go.mod h1:sBD3RAqlr8Q+RC3FutZcikpT8nyDrIEEBw2J744gVWs= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= diff --git a/ocis-pkg/version/version.go b/ocis-pkg/version/version.go index 1cfabd6f2ff..759b4a21d22 100644 --- a/ocis-pkg/version/version.go +++ b/ocis-pkg/version/version.go @@ -13,6 +13,12 @@ var ( // Date indicates the build date. Date = time.Now().Format("20060102") + + // Legacy defines the old long 4 number ownCloud version needed for some clients + Legacy = "10.11.0.0" + + // LegacyString defines the old ownCloud version needed for some clients + LegacyString = "10.11.0" ) // Compiled returns the compile time of this service.