1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 07:39:43 +02:00

license code refactoring

This commit is contained in:
Harvey Kandola 2017-02-23 10:29:51 -08:00
parent 3f87401d49
commit edccb39019
5 changed files with 22 additions and 40 deletions

View file

@ -18,7 +18,6 @@ import (
"net/http"
"text/template"
"github.com/documize/community/core"
"github.com/documize/community/core/api/entity"
"github.com/documize/community/core/api/request"
"github.com/documize/community/core/log"
@ -41,13 +40,11 @@ func GetMeta(w http.ResponseWriter, r *http.Request) {
return
}
product := core.Product()
data.OrgID = org.RefID
data.Title = org.Title
data.Message = org.Message
data.AllowAnonymousAccess = org.AllowAnonymousAccess
data.Version = product.Version
data.Version = Product.Version
json, err := json.Marshal(data)

View file

@ -33,14 +33,21 @@ var port, certFile, keyFile, forcePort2SSL string
var Product core.ProdInfo
func init() {
Product = core.Product()
Product.Major = "0"
Product.Minor = "42"
Product.Patch = "0"
Product.Version = fmt.Sprintf("%s.%s.%s", Product.Major, Product.Minor, Product.Patch)
Product.Edition = "Community"
Product.Title = fmt.Sprintf("%s Edition", Product.Edition)
Product.License = core.License{}
Product.License.Valid = true
environment.GetString(&certFile, "cert", false, "the cert.pem file used for https", nil)
environment.GetString(&keyFile, "key", false, "the key.pem file used for https", nil)
environment.GetString(&port, "port", false, "http/https port number", nil)
environment.GetString(&forcePort2SSL, "forcesslport", false, "redirect given http port number to TLS", nil)
// license state
log.Info(Product.License.Status())
log.Info("Server.Init complete")
}
var testHost string // used during automated testing