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

self-host enhancements for Word/PDF handling

This commit is contained in:
Harvey Kandola 2017-06-06 19:00:35 -04:00
parent 99b9427b8e
commit bbcba8eb18
23 changed files with 728 additions and 705 deletions

View file

@ -13,6 +13,7 @@ package endpoint
import (
"bytes"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
@ -27,10 +28,8 @@ import (
"github.com/documize/community/core/api/util"
api "github.com/documize/community/core/convapi"
"github.com/documize/community/core/log"
uuid "github.com/nu7hatch/gouuid"
"github.com/gorilla/mux"
uuid "github.com/nu7hatch/gouuid"
)
// UploadConvertDocument is an endpoint to both upload and convert a document
@ -96,10 +95,24 @@ func convertDocument(w http.ResponseWriter, r *http.Request, job, folderID strin
method := "convertDocument"
p := request.GetPersister(r)
licenseKey := request.ConfigString("EDITION-LICENSE", "key")
licenseSignature := request.ConfigString("EDITION-LICENSE", "signature")
k, _ := hex.DecodeString(licenseKey)
s, _ := hex.DecodeString(licenseSignature)
conversion.LicenseKey = k
conversion.LicenseSignature = s
org, err := p.GetOrganization(p.Context.OrgID)
if err != nil {
writePayloadError(w, method, err)
return
}
conversion.ServiceEndpoint = org.ConversionEndpoint
var fileResult *api.DocumentConversionResponse
var filename string
var err error
filename, fileResult, err = storageProvider.Convert(conversion)
if err != nil {
writePayloadError(w, method, err)

View file

@ -48,6 +48,7 @@ func GetMeta(w http.ResponseWriter, r *http.Request) {
data.Version = Product.Version
data.Edition = Product.License.Edition
data.Valid = Product.License.Valid
data.ConversionEndpoint = org.ConversionEndpoint
// Strip secrets
data.AuthConfig = StripAuthSecrets(org.AuthProvider, org.AuthConfig)

View file

@ -34,13 +34,16 @@ var Product core.ProdInfo
func init() {
Product.Major = "1"
Product.Minor = "47"
Product.Patch = "2"
Product.Minor = "48"
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.Seats = 1
Product.License.Valid = true
Product.License.Trial = false
Product.License.Edition = "Community"
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)