diff --git a/extensions/ocdav/pkg/command/server.go b/extensions/ocdav/pkg/command/server.go index f55c641003c..b9a109d2750 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 92395e3a43e..8c7e2407dcd 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 d151762cc57..3255f0ea0fd 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.String + ".0", + VersionString: version.String, + Product: "ocis", + ProductName: "Infinite Scale", + Edition: "Community", + }, } } diff --git a/go.sum b/go.sum index b806db17177..04f78d6b97a 100644 --- a/go.sum +++ b/go.sum @@ -318,8 +318,6 @@ 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/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= diff --git a/ocis-pkg/version/version.go b/ocis-pkg/version/version.go index 81e81815f46..d85c0bd0ae6 100644 --- a/ocis-pkg/version/version.go +++ b/ocis-pkg/version/version.go @@ -6,10 +6,10 @@ import ( var ( // String gets defined by the build system. - String = "0.0.0" + String = "2.0.0-dev" // Date indicates the build date. - Date = "00000000" + Date = time.Now().Format("20060102") ) // Compiled returns the compile time of this service.