Commit 587e4db8 authored by tangwei's avatar tangwei

init

parent 50d89b14
ARG product_version=7.1.1
ARG build_number=23
ARG oo_root='/var/www/onlyoffice/documentserver'
## Setup
FROM onlyoffice/documentserver:${product_version}.${build_number} as setup-stage
ARG product_version
ARG build_number
ARG oo_root
ENV PRODUCT_VERSION=${product_version}
ENV BUILD_NUMBER=${build_number}
ARG build_deps="git make g++ nodejs npm"
RUN apt-get update && apt-get install -y ${build_deps}
RUN npm install -g pkg grunt grunt-cli
WORKDIR /build
## Clone
FROM setup-stage as clone-stage
ARG tag=v${PRODUCT_VERSION}.${BUILD_NUMBER}
RUN git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/build_tools.git /build/build_tools
RUN git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/server.git /build/server
COPY server /build/
## Build
FROM clone-stage as build-stage
# build server with license checks patched
WORKDIR /build/server
RUN make
RUN pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter --targets=node10-linux -o /build/converter
RUN pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/DocService --targets=node10-linux --options max_old_space_size=4096 -o /build/docservice
## Final image
FROM onlyoffice/documentserver:${product_version}.${build_number}
ARG oo_root
# server
COPY --from=build-stage /build/converter ${oo_root}/server/FileConverter/converter
COPY --from=build-stage /build/docservice ${oo_root}/server/DocService/docservice
# doc-editor # doc-editor
view/edit/save word,excel,ppt files online view/edit/save word,excel,ppt files online
## backgrounds
this project is based on onlyoffice V7.1.1.23
base images is:
onlyoffice/documentserver:7.1.1.23
version dependency:
| onlyoffice component | version | repo |
| -------------------- | -------- | ----------------------------------------------------- |
| server | 7.1.1.23 | https://github.com/ONLYOFFICE/server/tree/v7.1.1.76 |
| web-app | 7.1.1.23 | https://github.com/ONLYOFFICE/web-apps/tree/v7.1.1.76 |
| build_tools | 7.1.1.23 | https://github.com/ONLYOFFICE/sdkjs/tree/v7.1.1.76 |
what's more, it removes the concurrency limit, enable mobile editing and adds chinese fonts
this project is heavily inspired by the works of
[GitHub - aleho/onlyoffice-ce-docker-license: Onlyoffice with mobile editing enabled](https://github.com/aleho/onlyoffice-ce-docker-license)
and
[Docker Hub](https://hub.docker.com/r/gmsjy/onlyoffice)
btw:
```
docker pull gmsjy/onlyoffice
```
this image is really awesome but it used an early version of onlyoffice which is 6.2.0. The perpose of this project is to change the version to 7.1.1.
## Usage
```
docker build -t [imageName] .
```
\ No newline at end of file
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
'use strict';
const constants = require('./constants');
function InputCommand(data, copyExplicit) {
//must be set explicitly to prevent vulnerability(downloadAs(with url) creates request to integrator with authorization)
this['withAuthorization'] = undefined;//bool
this['isbuilder'] = undefined;//bool
this['externalChangeInfo'] = undefined;//zero DB changes case: set password, undo all changes
this['wopiParams'] = undefined;
if (data) {
this['c'] = data['c'];
this['id'] = data['id'];
this['userid'] = data['userid'];
this['userindex'] = data['userindex'];
this['username'] = data['username'];
this['tokenSession'] = data['tokenSession'];
this['tokenDownload'] = data['tokenDownload'];
this['tokenHistory'] = data['tokenHistory'];
this['data'] = data['data'];
this['editorid'] = data['editorid'];
this['format'] = data['format'];
this['url'] = data['url'];
this['title'] = data['title'];
this['outputformat'] = data['outputformat'];
this['outputpath'] = data['outputpath'];
this['savetype'] = data['savetype'];
this['saveindex'] = data['saveindex'];
this['codepage'] = data['codepage'];
this['delimiter'] = data['delimiter'];
this['delimiterChar'] = data['delimiterChar'];
this['embeddedfonts'] = data['embeddedfonts'];
if (data['mailmergesend']) {
this['mailmergesend'] = new CMailMergeSendData(data['mailmergesend']);
} else {
this['mailmergesend'] = undefined;
}
if (data['thumbnail']) {
this['thumbnail'] = new CThumbnailData(data['thumbnail']);
} else {
this['thumbnail'] = undefined;
}
if (data['textParams']) {
this['textParams'] = new CTextParams(data['textParams']);
} else {
this['textParams'] = undefined;
}
this['status'] = data['status'];
this['status_info'] = data['status_info'];
this['savekey'] = data['savekey'];
this['userconnectionid'] = data['userconnectionid'];
this['responsekey'] = data['responsekey'];
this['docconnectionid'] = data['docconnectionid'];
this['jsonparams'] = data['jsonparams'];
this['lcid'] = data['lcid'];
this['useractionid'] = data['useractionid'];
this['useractionindex'] = data['useractionindex'];
if (data['forcesave']) {
this['forcesave'] = new CForceSaveData(data['forcesave']);
} else {
this['forcesave'] = undefined;
}
this['userdata'] = data['userdata'];
this['inline'] = data['inline'];
this['password'] = data['password'];
this['savepassword'] = data['savepassword'];
this['withoutPassword'] = data['withoutPassword'];
this['outputurls'] = data['outputurls'];
this['closeonerror'] = data['closeonerror'];
this['serverVersion'] = data['serverVersion'];
this['rediskey'] = data['rediskey'];
this['nobase64'] = data['nobase64'];
this['forgotten'] = data['forgotten'];
this['status_info_in'] = data['status_info_in'];
this['attempt'] = data['attempt'];
this['convertToOrigin'] = data['convertToOrigin'];
if (copyExplicit) {
this['withAuthorization'] = data['withAuthorization'];
this['isbuilder'] = data['isbuilder'];
this['externalChangeInfo'] = data['externalChangeInfo'];
this['wopiParams'] = data['wopiParams'];
}
} else {
this['c'] = undefined;//string command
this['id'] = undefined;//string document id
this['userid'] = undefined;//string
this['userindex'] = undefined;
this['username'] = undefined;
this['tokenSession'] = undefined;//string validate
this['tokenDownload'] = undefined;//string validate
this['tokenHistory'] = undefined;//string validate
this['data'] = undefined;//string
//to open
this['editorid'] = undefined;//int
this['format'] = undefined;//string extention
this['url'] = undefined;//string
this['title'] = undefined;//string filename
// to save
this['outputformat'] = undefined;//int
this['outputpath'] = undefined;//int internal
this['savetype'] = undefined;//int part type
this['saveindex'] = undefined;//int part index
//nullable
this['codepage'] = undefined;
this['delimiter'] = undefined;
this['delimiterChar'] = undefined;
this['embeddedfonts'] = undefined;//bool
this['mailmergesend'] = undefined;
this['thumbnail'] = undefined;
//private
this['status'] = undefined;//int
this['status_info'] = undefined;//int
this['savekey'] = undefined;//int document id to save
this['userconnectionid'] = undefined;//string internal
this['responsekey'] = undefined;
this['docconnectionid'] = undefined;//string internal
this['jsonparams'] = undefined;//string
this['lcid'] = undefined;
this['useractionid'] = undefined;
this['useractionindex'] = undefined;
this['forcesave'] = undefined;
this['userdata'] = undefined;
this['inline'] = undefined;//content disposition
this['password'] = undefined;
this['savepassword'] = undefined;
this['withoutPassword'] = undefined;
this['outputurls'] = undefined;
this['closeonerror'] = undefined;
this['serverVersion'] = undefined;
this['rediskey'] = undefined;
this['nobase64'] = true;
this['forgotten'] = undefined;
this['status_info_in'] = undefined;
this['attempt'] = undefined;
this['convertToOrigin'] = undefined;
}
}
InputCommand.prototype = {
fillFromConnection: function(conn) {
this['id'] = conn.docId;
},
getCommand: function() {
return this['c'];
},
setCommand: function(data) {
this['c'] = data;
},
getDocId: function() {
return this['id'];
},
setDocId: function(data) {
this['id'] = data;
},
getUserId: function() {
return this['userid'];
},
setUserId: function(data) {
this['userid'] = data;
},
getUserIndex: function() {
return this['userindex'];
},
setUserIndex: function(data) {
this['userindex'] = data;
},
getUserName: function() {
return this['username'];
},
setUserName: function(data) {
this['username'] = data;
},
getTokenSession: function() {
return this['tokenSession'];
},
getTokenDownload: function() {
return this['tokenDownload'];
},
getTokenHistory: function() {
return this['tokenHistory'];
},
getData: function() {
return this['data'];
},
setData: function(data) {
this['data'] = data;
},
getFormat: function() {
return this['format'];
},
setFormat: function(data) {
this['format'] = data;
},
getUrl: function() {
return this['url'];
},
setUrl: function(data) {
this['url'] = data;
},
getTitle: function() {
return this['title'];
},
setTitle: function(data) {
this['title'] = data;
},
getOutputFormat: function() {
return this['outputformat'];
},
setOutputFormat: function(data) {
this['outputformat'] = data;
},
getOutputPath: function() {
return this['outputpath'];
},
setOutputPath: function(data) {
this['outputpath'] = data;
},
getSaveType: function() {
return this['savetype'];
},
setSaveType: function(data) {
this['savetype'] = data;
},
getSaveIndex: function() {
return this['saveindex'];
},
setSaveIndex: function(data) {
this['saveindex'] = data;
},
getCodepage: function() {
return this['codepage'];
},
setCodepage: function(data) {
this['codepage'] = data;
},
getDelimiter: function() {
return this['delimiter'];
},
setDelimiter: function(data) {
this['delimiter'] = data;
},
getDelimiterChar: function() {
return this['delimiterChar'];
},
setDelimiterChar: function(data) {
this['delimiterChar'] = data;
},
getEmbeddedFonts: function() {
return this['embeddedfonts'];
},
setEmbeddedFonts: function(data) {
this['embeddedfonts'] = data;
},
getMailMergeSend: function() {
return this['mailmergesend'];
},
setMailMergeSend: function(data) {
this['mailmergesend'] = data;
},
getThumbnail: function() {
return this['thumbnail'];
},
setThumbnail: function(data) {
this['thumbnail'] = data;
},
getTextParams: function() {
return this['textParams'];
},
setTextParams: function(data) {
this['textParams'] = data;
},
getStatus: function() {
return this['status'];
},
setStatus: function(data) {
this['status'] = data;
},
getStatusInfo: function() {
return this['status_info'];
},
setStatusInfo: function(data) {
this['status_info'] = data;
},
getSaveKey: function() {
return this['savekey'];
},
setSaveKey: function(data) {
this['savekey'] = data;
},
getForgotten: function() {
return this['forgotten'];
},
setForgotten: function(data) {
this['forgotten'] = data;
},
getUserConnectionId: function() {
return this['userconnectionid'];
},
setUserConnectionId: function(data) {
this['userconnectionid'] = data;
},
getResponseKey: function() {
return this['responsekey'];
},
setResponseKey: function(data) {
this['responsekey'] = data;
},
getDocConnectionId: function() {
return this['docconnectionid'];
},
setDocConnectionId: function(data) {
this['docconnectionid'] = data;
},
getJsonParams: function() {
return this['jsonparams'];
},
setJsonParams: function(data) {
this['jsonparams'] = data;
},
getLCID: function() {
return this['lcid'];
},
setLCID: function(data) {
this['lcid'] = data;
},
getUserActionId: function() {
return this['useractionid'];
},
setUserActionId: function(data) {
this['useractionid'] = data;
},
getUserActionIndex: function() {
return this['useractionindex'];
},
setUserActionIndex: function(data) {
this['useractionindex'] = data;
},
getForceSave: function() {
return this['forcesave'];
},
setForceSave: function(data) {
this['forcesave'] = data;
},
getUserData: function() {
return this['userdata'];
},
setUserData: function(data) {
this['userdata'] = data;
},
getInline: function() {
return this['inline'];
},
setInline: function(data) {
this['inline'] = data;
},
getPassword: function() {
return this['password'];
},
setPassword: function(data) {
this['password'] = data;
},
getSavePassword: function() {
return this['savepassword'];
},
setSavePassword: function(data) {
this['savepassword'] = data;
},
getWithoutPassword: function() {
return this['withoutPassword'];
},
setWithoutPassword: function(data) {
this['withoutPassword'] = data;
},
setOutputUrls: function(data) {
this['outputurls'] = data;
},
getOutputUrls: function() {
return this['outputurls'];
},
getCloseOnError: function() {
return this['closeonerror'];
},
setCloseOnError: function(data) {
this['closeonerror'] = data;
},
getServerVersion: function() {
return this['serverVersion'];
},
setServerVersion: function(data) {
this['serverVersion'] = data;
},
getRedisKey: function() {
return this['rediskey'];
},
setRedisKey: function(data) {
this['rediskey'] = data;
},
getNoBase64: function() {
return this['nobase64'];
},
setNoBase64: function(data) {
this['nobase64'] = data;
},
getIsBuilder: function() {
return this['isbuilder'];
},
setIsBuilder: function(data) {
this['isbuilder'] = data;
},
getStatusInfoIn: function() {
return this['status_info_in'];
},
setStatusInfoIn: function(data) {
this['status_info_in'] = data;
},
getAttempt: function() {
return this['attempt'];
},
setAttempt: function(data) {
this['attempt'] = data;
},
getWithAuthorization: function() {
return this['withAuthorization'];
},
setWithAuthorization: function(data) {
this['withAuthorization'] = data;
},
getExternalChangeInfo: function() {
return this['externalChangeInfo'];
},
setExternalChangeInfo: function(data) {
this['externalChangeInfo'] = data;
},
getWopiParams: function() {
return this['wopiParams'];
},
setWopiParams: function(data) {
this['wopiParams'] = data;
},
getConvertToOrigin: function() {
return this['convertToOrigin'];
},
setConvertToOrigin: function(data) {
this['convertToOrigin'] = data;
}
};
function CForceSaveData(obj) {
if (obj) {
this['type'] = obj['type'];
this['time'] = obj['time'];
this['index'] = obj['index'];
this['authoruserid'] = obj['authoruserid'];
this['authoruserindex'] = obj['authoruserindex'];
} else {
this['type'] = null;
this['time'] = null;
this['index'] = null;
this['authoruserid'] = null;
this['authoruserindex'] = null;
}
}
CForceSaveData.prototype.getType = function() {
return this['type']
};
CForceSaveData.prototype.setType = function(v) {
this['type'] = v;
};
CForceSaveData.prototype.getTime = function() {
return this['time']
};
CForceSaveData.prototype.setTime = function(v) {
this['time'] = v;
};
CForceSaveData.prototype.getIndex = function() {
return this['index']
};
CForceSaveData.prototype.setIndex = function(v) {
this['index'] = v;
};
CForceSaveData.prototype.getAuthorUserId = function() {
return this['authoruserid'];
};
CForceSaveData.prototype.setAuthorUserId = function(v) {
this['authoruserid'] = v;
};
CForceSaveData.prototype.getAuthorUserIndex = function() {
return this['authoruserindex'];
};
CForceSaveData.prototype.setAuthorUserIndex = function(v) {
this['authoruserindex'] = v;
};
function CThumbnailData(obj) {
if (obj) {
this['format'] = obj['format'];
this['aspect'] = obj['aspect'];
this['first'] = obj['first'];
this['width'] = obj['width'];
this['height'] = obj['height'];
} else {
this['format'] = null;
this['aspect'] = null;
this['first'] = null;
this['width'] = null;
this['height'] = null;
}
}
CThumbnailData.prototype.getFormat = function() {
return this['format']
};
CThumbnailData.prototype.setFormat = function(v) {
this['format'] = v;
};
CThumbnailData.prototype.getAspect = function() {
return this['aspect']
};
CThumbnailData.prototype.setAspect = function(v) {
this['aspect'] = v;
};
CThumbnailData.prototype.getFirst = function() {
return this['first']
};
CThumbnailData.prototype.setFirst = function(v) {
this['first'] = v;
};
CThumbnailData.prototype.getWidth = function() {
return this['width']
};
CThumbnailData.prototype.setWidth = function(v) {
this['width'] = v;
};
CThumbnailData.prototype.getHeight = function() {
return this['height']
};
CThumbnailData.prototype.setHeight = function(v) {
this['height'] = v;
};
function CTextParams(obj) {
if (obj) {
this['association'] = obj['association'];
} else {
this['association'] = null;
}
}
CTextParams.prototype.getAssociation = function() {
return this['association']
};
CTextParams.prototype.setAssociation = function(v) {
this['association'] = v;
};
function CMailMergeSendData(obj) {
if (obj) {
this['from'] = obj['from'];
this['to'] = obj['to'];
this['subject'] = obj['subject'];
this['mailFormat'] = obj['mailFormat'];
this['fileName'] = obj['fileName'];
this['message'] = obj['message'];
this['recordFrom'] = obj['recordFrom'];
this['recordTo'] = obj['recordTo'];
this['recordCount'] = obj['recordCount'];
this['recordErrorCount'] = obj['recordErrorCount'];
this['userId'] = obj['userId'];
this['url'] = obj['url'];
this['baseUrl'] = obj['baseUrl'];
this['jsonkey'] = obj['jsonkey'];
this['isJson'] = obj['isJson'];
} else {
this['from'] = null;
this['to'] = null;
this['subject'] = null;
this['mailFormat'] = null;
this['fileName'] = null;
this['message'] = null;
this['recordFrom'] = null;
this['recordTo'] = null;
this['recordCount'] = null;
this['recordErrorCount'] = null;
this['userId'] = null;
this['url'] = null;
this['baseUrl'] = null;
this['jsonkey'] = null;
this['isJson'] = null;
}
}
CMailMergeSendData.prototype.getFrom = function() {
return this['from']
};
CMailMergeSendData.prototype.setFrom = function(v) {
this['from'] = v;
};
CMailMergeSendData.prototype.getTo = function() {
return this['to']
};
CMailMergeSendData.prototype.setTo = function(v) {
this['to'] = v;
};
CMailMergeSendData.prototype.getSubject = function() {
return this['subject']
};
CMailMergeSendData.prototype.setSubject = function(v) {
this['subject'] = v;
};
CMailMergeSendData.prototype.getMailFormat = function() {
return this['mailFormat']
};
CMailMergeSendData.prototype.setMailFormat = function(v) {
this['mailFormat'] = v;
};
CMailMergeSendData.prototype.getFileName = function() {
return this['fileName']
};
CMailMergeSendData.prototype.setFileName = function(v) {
this['fileName'] = v;
};
CMailMergeSendData.prototype.getMessage = function() {
return this['message']
};
CMailMergeSendData.prototype.setMessage = function(v) {
this['message'] = v;
};
CMailMergeSendData.prototype.getRecordFrom = function() {
return this['recordFrom']
};
CMailMergeSendData.prototype.setRecordFrom = function(v) {
this['recordFrom'] = v;
};
CMailMergeSendData.prototype.getRecordTo = function() {
return this['recordTo']
};
CMailMergeSendData.prototype.setRecordTo = function(v) {
this['recordTo'] = v;
};
CMailMergeSendData.prototype.getRecordCount = function() {
return this['recordCount']
};
CMailMergeSendData.prototype.setRecordCount = function(v) {
this['recordCount'] = v;
};
CMailMergeSendData.prototype.getRecordErrorCount = function() {
return this['recordErrorCount']
};
CMailMergeSendData.prototype.setRecordErrorCount = function(v) {
this['recordErrorCount'] = v;
};
CMailMergeSendData.prototype.getUserId = function() {
return this['userId']
};
CMailMergeSendData.prototype.setUserId = function(v) {
this['userId'] = v;
};
CMailMergeSendData.prototype.getUrl = function() {
return this['url']
};
CMailMergeSendData.prototype.setUrl = function(v) {
this['url'] = v;
};
CMailMergeSendData.prototype.getBaseUrl = function() {
return this['baseUrl']
};
CMailMergeSendData.prototype.setBaseUrl = function(v) {
this['baseUrl'] = v;
};
CMailMergeSendData.prototype.getJsonKey = function() {
return this['jsonkey']
};
CMailMergeSendData.prototype.setJsonKey = function(v) {
this['jsonkey'] = v;
};
CMailMergeSendData.prototype.getIsJsonKey = function() {
return this['isJson']
};
CMailMergeSendData.prototype.setIsJsonKey = function(v) {
this['isJson'] = v;
};
function TaskQueueData(data) {
if (data) {
this['cmd'] = new InputCommand(data['cmd'], true);
this['toFile'] = data['toFile'];
this['fromOrigin'] = data['fromOrigin'];
this['fromSettings'] = data['fromSettings'];
this['fromChanges'] = data['fromChanges'];
this['paid'] = data['paid'];
this['dataKey'] = data['dataKey'];
this['visibilityTimeout'] = data['visibilityTimeout'];
} else {
this['cmd'] = undefined;
this['toFile'] = undefined;
this['fromOrigin'] = undefined;
this['fromSettings'] = undefined;
this['fromChanges'] = undefined;
this['paid'] = undefined;
this['dataKey'] = undefined;
this['visibilityTimeout'] = undefined;
}
}
TaskQueueData.prototype = {
getCmd : function() {
return this['cmd'];
},
setCmd : function(data) {
return this['cmd'] = data;
},
getToFile : function() {
return this['toFile'];
},
setToFile : function(data) {
return this['toFile'] = data;
},
getFromOrigin : function() {
return this['fromOrigin'];
},
setFromOrigin : function(data) {
return this['fromOrigin'] = data;
},
getFromSettings : function() {
return this['fromSettings'];
},
setFromSettings : function(data) {
return this['fromSettings'] = data;
},
getFromChanges : function() {
return this['fromChanges'];
},
setFromChanges : function(data) {
return this['fromChanges'] = data;
},
getPaid : function() {
return this['paid'];
},
setPaid : function(data) {
return this['paid'] = data;
},
getDataKey : function() {
return this['dataKey'];
},
setDataKey : function(data) {
return this['dataKey'] = data;
},
getVisibilityTimeout : function() {
return this['visibilityTimeout'];
},
setVisibilityTimeout : function(data) {
return this['visibilityTimeout'] = data;
}
};
function OutputSfcData(key) {
this['key'] = key;
this['status'] = undefined;
this['url'] = undefined;
this['changesurl'] = undefined;
this['history'] = undefined;
this['users'] = undefined;
this['actions'] = undefined;
this['mailMerge'] = undefined;
this['userdata'] = undefined;
this['lastsave'] = undefined;
this['notmodified'] = undefined;
this['forcesavetype'] = undefined;
this['encrypted'] = undefined;
this['token'] = undefined;
}
OutputSfcData.prototype.getKey = function() {
return this['key'];
};
OutputSfcData.prototype.setKey = function(data) {
return this['key'] = data;
};
OutputSfcData.prototype.getStatus = function() {
return this['status'];
};
OutputSfcData.prototype.setStatus = function(data) {
return this['status'] = data;
};
OutputSfcData.prototype.getUrl = function() {
return this['url'];
};
OutputSfcData.prototype.setUrl = function(data) {
return this['url'] = data;
};
OutputSfcData.prototype.getExtName = function() {
return this['filetype'];
};
OutputSfcData.prototype.setExtName = function(data) {
return this['filetype'] = data.substring(1);
};
OutputSfcData.prototype.getChangeUrl = function() {
return this['changesurl'];
};
OutputSfcData.prototype.setChangeUrl = function(data) {
return this['changesurl'] = data;
};
OutputSfcData.prototype.getChangeHistory = function() {
return this['history'];
};
OutputSfcData.prototype.setChangeHistory = function(data) {
return this['history'] = data;
};
OutputSfcData.prototype.getUsers = function() {
return this['users'];
};
OutputSfcData.prototype.setUsers = function(data) {
return this['users'] = data;
};
OutputSfcData.prototype.getMailMerge = function() {
return this['mailMerge'];
};
OutputSfcData.prototype.setMailMerge = function(data) {
return this['mailMerge'] = data;
};
OutputSfcData.prototype.getActions = function() {
return this['actions'];
};
OutputSfcData.prototype.setActions = function(data) {
return this['actions'] = data;
};
OutputSfcData.prototype.getUserData= function() {
return this['userdata'];
};
OutputSfcData.prototype.setUserData = function(data) {
return this['userdata'] = data;
};
OutputSfcData.prototype.getLastSave = function() {
return this['lastsave']
};
OutputSfcData.prototype.setLastSave = function(v) {
this['lastsave'] = v;
};
OutputSfcData.prototype.getNotModified = function() {
return this['notmodified']
};
OutputSfcData.prototype.setNotModified = function(v) {
this['notmodified'] = v;
};
OutputSfcData.prototype.getForceSaveType = function() {
return this['forcesavetype']
};
OutputSfcData.prototype.setForceSaveType = function(v) {
this['forcesavetype'] = v;
};
OutputSfcData.prototype.getEncrypted = function() {
return this['encrypted']
};
OutputSfcData.prototype.setEncrypted = function(v) {
this['encrypted'] = v;
};
OutputSfcData.prototype.getToken = function() {
return this['token']
};
OutputSfcData.prototype.setToken = function(v) {
this['token'] = v;
};
function OutputMailMerge(mailMergeSendData) {
if (mailMergeSendData) {
this['from'] = mailMergeSendData.getFrom();
this['message'] = mailMergeSendData.getMessage();
this['subject'] = mailMergeSendData.getSubject();
this['title'] = mailMergeSendData.getFileName();
const mailFormat = mailMergeSendData.getMailFormat();
switch (mailFormat) {
case constants.AVS_OFFICESTUDIO_FILE_OTHER_HTMLZIP :
this['type'] = 0;
break;
case constants.AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX :
this['type'] = 1;
break;
case constants.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF :
this['type'] = 2;
break;
default :
this['type'] = 0;
break;
}
this['recordCount'] = mailMergeSendData.getRecordCount();
this['recordErrorCount'] = mailMergeSendData.getRecordErrorCount();
this['to'] = null;
this['recordIndex'] = null;
} else {
this['from'] = null;
this['message'] = null;
this['subject'] = null;
this['title'] = null;
this['to'] = null;
this['type'] = null;
this['recordCount'] = null;
this['recordIndex'] = null;
this['recordErrorCount'] = null;
}
}
OutputMailMerge.prototype.getRecordIndex = function() {
return this['recordIndex'];
};
OutputMailMerge.prototype.setRecordIndex = function(data) {
return this['recordIndex'] = data;
};
OutputMailMerge.prototype.getRecordErrorCount = function() {
return this['recordErrorCount'];
};
OutputMailMerge.prototype.setRecordErrorCount = function(data) {
return this['recordErrorCount'] = data;
};
OutputMailMerge.prototype.getTo = function() {
return this['to'];
};
OutputMailMerge.prototype.setTo = function(data) {
return this['to'] = data;
};
function OutputAction(type, userid) {
this['type'] = type;
this['userid'] = userid;
}
function ConvertStatus(err, url, filetype) {
this.err = err;
this.url = url;
this.filetype = filetype;
this.end = !!url;
}
ConvertStatus.prototype.setExtName = function(extname) {
this.filetype = extname.substring(1);
};
ConvertStatus.prototype.setUrl = function(url) {
this.url = url;
this.end = true;
};
const c_oPublishType = {
drop : 0,
releaseLock : 1,
participantsState : 2,
message : 3,
getLock : 4,
changes : 5,
auth : 6,
receiveTask : 7,
warning: 8,
cursor: 9,
shutdown: 10,
meta: 11,
forceSave: 12,
closeConnection: 13,
changesNotify: 14,
changeConnecitonInfo: 15,
rpc: 16
};
const c_oAscCsvDelimiter = {
None: 0,
Tab: 1,
Semicolon: 2,
Colon: 3,
Comma: 4,
Space: 5
};
const c_oAscEncodings = [
[ 0, 28596, "ISO-8859-6", "Arabic (ISO 8859-6)" ],
[ 1, 720, "DOS-720", "Arabic (OEM 720)" ],
[ 2, 1256, "windows-1256", "Arabic (Windows)" ],
[ 3, 28594, "ISO-8859-4", "Baltic (ISO 8859-4)" ],
[ 4, 28603, "ISO-8859-13", "Baltic (ISO 8859-13)" ],
[ 5, 775, "IBM775", "Baltic (OEM 775)" ],
[ 6, 1257, "windows-1257", "Baltic (Windows)" ],
[ 7, 28604, "ISO-8859-14", "Celtic (ISO 8859-14)" ],
[ 8, 28595, "ISO-8859-5", "Cyrillic (ISO 8859-5)" ],
[ 9, 20866, "KOI8-R", "Cyrillic (KOI8-R)" ],
[ 10, 21866, "KOI8-U", "Cyrillic (KOI8-U)" ],
[ 11, 10007, "x-mac-cyrillic", "Cyrillic (Mac)" ],
[ 12, 855, "IBM855", "Cyrillic (OEM 855)" ],
[ 13, 866, "cp866", "Cyrillic (OEM 866)" ],
[ 14, 1251, "windows-1251", "Cyrillic (Windows)" ],
[ 15, 852, "IBM852", "Central European (OEM 852)" ],
[ 16, 1250, "windows-1250", "Central European (Windows)" ],
[ 17, 950, "Big5", "Chinese (Big5 Traditional)" ],
[ 18, 936, "GB2312", "Central (GB2312 Simplified)" ],
[ 19, 28592, "ISO-8859-2", "Eastern European (ISO 8859-2)" ],
[ 20, 28597, "ISO-8859-7", "Greek (ISO 8859-7)" ],
[ 21, 737, "IBM737", "Greek (OEM 737)" ],
[ 22, 869, "IBM869", "Greek (OEM 869)" ],
[ 23, 1253, "windows-1253", "Greek (Windows)" ],
[ 24, 28598, "ISO-8859-8", "Hebrew (ISO 8859-8)" ],
[ 25, 862, "DOS-862", "Hebrew (OEM 862)" ],
[ 26, 1255, "windows-1255", "Hebrew (Windows)" ],
[ 27, 932, "Shift_JIS", "Japanese (Shift-JIS)" ],
[ 28, 949, "KS_C_5601-1987", "Korean (Windows)" ],
[ 29, 51949, "EUC-KR", "Korean (EUC)" ],
[ 30, 861, "IBM861", "North European (Icelandic OEM 861)" ],
[ 31, 865, "IBM865", "North European (Nordic OEM 865)" ],
[ 32, 874, "windows-874", "Thai (TIS-620)" ],
[ 33, 28593, "ISO-8859-3", "Turkish (ISO 8859-3)" ],
[ 34, 28599, "ISO-8859-9", "Turkish (ISO 8859-9)" ],
[ 35, 857, "IBM857", "Turkish (OEM 857)" ],
[ 36, 1254, "windows-1254", "Turkish (Windows)" ],
[ 37, 28591, "ISO-8859-1", "Western European (ISO-8859-1)" ],
[ 38, 28605, "ISO-8859-15", "Western European (ISO-8859-15)" ],
[ 39, 850, "IBM850", "Western European (OEM 850)" ],
[ 40, 858, "IBM858", "Western European (OEM 858)" ],
[ 41, 860, "IBM860", "Western European (OEM 860 : Portuguese)" ],
[ 42, 863, "IBM863", "Western European (OEM 863 : French)" ],
[ 43, 437, "IBM437", "Western European (OEM-US)" ],
[ 44, 1252, "windows-1252", "Western European (Windows)" ],
[ 45, 1258, "windows-1258", "Vietnamese (Windows)" ],
[ 46, 65001, "UTF-8", "Unicode (UTF-8)" ],
[ 47, 65000, "UTF-7", "Unicode (UTF-7)" ],
[ 48, 1200, "UTF-16", "Unicode (UTF-16)" ],
[ 49, 1201, "UTF-16BE", "Unicode (UTF-16 Big Endian)" ],
[ 50, 12000, "UTF-32", "Unicode (UTF-32)" ],
[ 51, 12001, "UTF-32BE", "Unicode (UTF-32 Big Endian)" ]
];
const c_oAscEncodingsMap = {"437": 43, "720": 1, "737": 21, "775": 5, "850": 39, "852": 15, "855": 12, "857": 35, "858": 40, "860": 41, "861": 30, "862": 25, "863": 42, "865": 31, "866": 13, "869": 22, "874": 32, "932": 27, "936": 18, "949": 28, "950": 17, "1200": 48, "1201": 49, "1250": 16, "1251": 14, "1252": 44, "1253": 23, "1254": 36, "1255": 26, "1256": 2, "1257": 6, "1258": 45, "10007": 11, "12000": 50, "12001": 51, "20866": 9, "21866": 10, "28591": 37, "28592": 19, "28593": 33, "28594": 3, "28595": 8, "28596": 0, "28597": 20, "28598": 24, "28599": 34, "28603": 4, "28604": 7, "28605": 38, "51949": 29, "65000": 47, "65001": 46}
const c_oAscCodePageUtf8 = 46;//65001
const c_oAscUserAction = {
Out: 0,
In: 1,
ForceSaveButton: 2
};
const c_oAscServerCommandErrors = {
NoError: 0,
DocumentIdError: 1,
ParseError: 2,
UnknownError: 3,
NotModified: 4,
UnknownCommand: 5,
Token: 6,
TokenExpire: 7
};
const c_oAscForceSaveTypes = {
Command: 0,
Button: 1,
Timeout: 2,
Form: 3
};
const c_oAscUrlTypes = {
Session: 0,
Temporary: 1
};
const c_oAscSecretType = {
Browser: 0,
Inbox: 1,
Outbox: 2,
Session: 3
};
const c_oAscQueueType = {
rabbitmq: 'rabbitmq',
activemq: 'activemq'
};
const c_oAscUnlockRes = {
Locked: 0,
Unlocked: 1,
Empty: 2
};
const buildVersion = '7.1.1';
const buildNumber = 23;
exports.TaskQueueData = TaskQueueData;
exports.CMailMergeSendData = CMailMergeSendData;
exports.CThumbnailData = CThumbnailData;
exports.CTextParams = CTextParams;
exports.CForceSaveData = CForceSaveData;
exports.InputCommand = InputCommand;
exports.OutputSfcData = OutputSfcData;
exports.OutputMailMerge = OutputMailMerge;
exports.OutputAction = OutputAction;
exports.ConvertStatus = ConvertStatus;
exports.c_oPublishType = c_oPublishType;
exports.c_oAscCsvDelimiter = c_oAscCsvDelimiter;
exports.c_oAscEncodings = c_oAscEncodings;
exports.c_oAscEncodingsMap = c_oAscEncodingsMap;
exports.c_oAscCodePageUtf8 = c_oAscCodePageUtf8;
exports.c_oAscUserAction = c_oAscUserAction;
exports.c_oAscServerCommandErrors = c_oAscServerCommandErrors;
exports.c_oAscForceSaveTypes = c_oAscForceSaveTypes;
exports.c_oAscUrlTypes = c_oAscUrlTypes;
exports.c_oAscSecretType = c_oAscSecretType;
exports.c_oAscQueueType = c_oAscQueueType;
exports.c_oAscUnlockRes = c_oAscUnlockRes;
exports.buildVersion = buildVersion;
exports.buildNumber = buildNumber;
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
'use strict';
exports.DOC_ID_PATTERN = '0-9-.a-zA-Z_=';
exports.DOC_ID_REGEX = new RegExp("^[" + exports.DOC_ID_PATTERN + "]*$", 'i');
exports.DOC_ID_REPLACE_REGEX = new RegExp("[^" + exports.DOC_ID_PATTERN + "]", 'g');
exports.DOC_ID_MAX_LENGTH = 240;
exports.USER_ID_MAX_LENGTH = 240;//255-240=15 symbols to make user id unique
exports.USER_NAME_MAX_LENGTH = 255;
exports.PASSWORD_MAX_LENGTH = 255;//set password limit for DoS protection with long password
exports.EXTENTION_REGEX = /^[a-zA-Z0-9]*$/;
exports.CHAR_DELIMITER = String.fromCharCode(5);
exports.OUTPUT_NAME = 'output';
exports.ONLY_OFFICE_URL_PARAM = 'ooname';
exports.DISPLAY_PREFIX = 'display';
exports.CHANGES_NAME = 'changes';
exports.RIGHTS = {
None : 0,
Edit : 1,
Review : 2,
Comment : 3,
View : 4
};
exports.LICENSE_MODE = {
None: 0,
Trial: 1,
Developer: 2,
Limited: 4
};
exports.LICENSE_RESULT = {
Error : 1,
Expired : 2,
Success : 3,
UnknownUser : 4,
Connections : 5,
ExpiredTrial : 6,
SuccessLimit : 7,
UsersCount : 8,
ConnectionsOS : 9,
UsersCountOS : 10,
ExpiredLimited: 11
};
exports.LICENSE_CONNECTIONS = 99999;
exports.LICENSE_EXPIRE_USERS_ONE_DAY = 24 * 60 * 60; // day in seconds
exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT = 0x0040;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0001;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0002;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0003;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_RTF = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0004;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0005;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0006;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_MHT = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0007;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_EPUB = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0008;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_FB2 = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0009;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_MOBI = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000a;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000b;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000c;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000d;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT_FLAT = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000e;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_OTT = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000f;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC_FLAT = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0010;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX_FLAT = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0011;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML_IN_CONTAINER = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0012;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX_PACKAGE = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0014;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_OFORM = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0015;
exports.AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCXF = exports.AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0016;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION = 0x0080;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX = exports.AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0001;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT = exports.AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0002;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP = exports.AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0003;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX = exports.AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0004;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTM = exports.AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0005;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSM = exports.AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0006;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX = exports.AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0007;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION_POTM = exports.AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0008;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP_FLAT = exports.AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0009;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION_OTP = exports.AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x000a;
exports.AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX_PACKAGE = exports.AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x000b;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET = 0x0100;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0001;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0002;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0003;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0004;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0005;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0006;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0007;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSB = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0008;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS_FLAT = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0009;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_OTS = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000a;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX_FLAT = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000b;
exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX_PACKAGE = exports.AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000c;
exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM = 0x0200;
exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF = exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0001;
exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_SWF = exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0002;
exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_DJVU = exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0003;
exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_XPS = exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0004;
exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_SVG = exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0005;
exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLR = exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0006;
exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLR_MENU = exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0007;
exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLR_CANVAS = exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0008;
exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDFA = exports.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0009;
exports.AVS_OFFICESTUDIO_FILE_IMAGE = 0x0400;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_JPG = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x0001;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_TIFF = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x0002;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_TGA = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x0003;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_GIF = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x0004;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_PNG = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x0005;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_EMF = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x0006;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_WMF = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x0007;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_BMP = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x0008;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_CR2 = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x0009;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_PCX = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x000a;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_RAS = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x000b;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_PSD = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x000c;
exports.AVS_OFFICESTUDIO_FILE_IMAGE_ICO = exports.AVS_OFFICESTUDIO_FILE_IMAGE + 0x000d;
exports.AVS_OFFICESTUDIO_FILE_OTHER = 0x0800;
exports.AVS_OFFICESTUDIO_FILE_OTHER_EXTRACT_IMAGE = exports.AVS_OFFICESTUDIO_FILE_OTHER + 0x0001;
exports.AVS_OFFICESTUDIO_FILE_OTHER_MS_OFFCRYPTO = exports.AVS_OFFICESTUDIO_FILE_OTHER + 0x0002;
exports.AVS_OFFICESTUDIO_FILE_OTHER_HTMLZIP = exports.AVS_OFFICESTUDIO_FILE_OTHER + 0x0003;
exports.AVS_OFFICESTUDIO_FILE_OTHER_OLD_DOCUMENT = exports.AVS_OFFICESTUDIO_FILE_OTHER + 0x0004;
exports.AVS_OFFICESTUDIO_FILE_OTHER_OLD_PRESENTATION = exports.AVS_OFFICESTUDIO_FILE_OTHER + 0x0005;
exports.AVS_OFFICESTUDIO_FILE_OTHER_OLD_DRAWING = exports.AVS_OFFICESTUDIO_FILE_OTHER + 0x0006;
exports.AVS_OFFICESTUDIO_FILE_OTHER_OOXML = exports.AVS_OFFICESTUDIO_FILE_OTHER + 0x0007;
exports.AVS_OFFICESTUDIO_FILE_OTHER_JSON = exports.AVS_OFFICESTUDIO_FILE_OTHER + 0x0008; // Для mail-merge
exports.AVS_OFFICESTUDIO_FILE_OTHER_ODF = exports.AVS_OFFICESTUDIO_FILE_OTHER + 0x000a;
exports.AVS_OFFICESTUDIO_FILE_OTHER_MS_MITCRYPTO = exports.AVS_OFFICESTUDIO_FILE_OTHER + 0x000b;
exports.AVS_OFFICESTUDIO_FILE_TEAMLAB = 0x1000;
exports.AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY = exports.AVS_OFFICESTUDIO_FILE_TEAMLAB + 0x0001;
exports.AVS_OFFICESTUDIO_FILE_TEAMLAB_XLSY = exports.AVS_OFFICESTUDIO_FILE_TEAMLAB + 0x0002;
exports.AVS_OFFICESTUDIO_FILE_TEAMLAB_PPTY = exports.AVS_OFFICESTUDIO_FILE_TEAMLAB + 0x0003;
exports.AVS_OFFICESTUDIO_FILE_CANVAS = 0x2000;
exports.AVS_OFFICESTUDIO_FILE_CANVAS_WORD = exports.AVS_OFFICESTUDIO_FILE_CANVAS + 0x0001;
exports.AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET = exports.AVS_OFFICESTUDIO_FILE_CANVAS + 0x0002;
exports.AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION = exports.AVS_OFFICESTUDIO_FILE_CANVAS + 0x0003;
exports.NO_ERROR = 0;
exports.UNKNOWN = -1;
exports.READ_REQUEST_STREAM = -3;
exports.WEB_REQUEST = -4;
exports.CHANGE_DOC_INFO = -5;
exports.TASK_QUEUE = -20;
exports.TASK_RESULT = -40;
exports.STORAGE = -60;
exports.STORAGE_FILE_NO_FOUND = -61;
exports.STORAGE_READ = -62;
exports.STORAGE_WRITE = -63;
exports.STORAGE_REMOVE_DIR = -64;
exports.STORAGE_CREATE_DIR = -65;
exports.STORAGE_GET_INFO = -66;
exports.CONVERT = -80;
exports.CONVERT_DOWNLOAD = -81;
exports.CONVERT_UNKNOWN_FORMAT = -82;
exports.CONVERT_TIMEOUT = -83;
exports.CONVERT_READ_FILE = -84;
exports.CONVERT_DRM_UNSUPPORTED = -85;
exports.CONVERT_CORRUPTED = -86;
exports.CONVERT_LIBREOFFICE = -87;
exports.CONVERT_PARAMS = -88;
exports.CONVERT_NEED_PARAMS = -89;
exports.CONVERT_DRM = -90;
exports.CONVERT_PASSWORD = -91;
exports.CONVERT_ICU = -92;
exports.CONVERT_LIMITS = -93;
exports.CONVERT_DEAD_LETTER = -99;
exports.UPLOAD = -100;
exports.UPLOAD_CONTENT_LENGTH = -101;
exports.UPLOAD_EXTENSION = -102;
exports.UPLOAD_COUNT_FILES = -103;
exports.UPLOAD_URL = -104;
exports.VKEY = -120;
exports.VKEY_ENCRYPT = -121;
exports.VKEY_KEY_EXPIRE = -122;
exports.VKEY_USER_COUNT_EXCEED = -123;
exports.VKEY_TIME_EXPIRE = -124;
exports.VKEY_TIME_INCORRECT = -125;
exports.EDITOR_CHANGES = -160;
exports.PASSWORD = -180;
exports.QUEUE_PRIORITY_VERY_LOW = 0;
exports.QUEUE_PRIORITY_LOW = 1;
exports.QUEUE_PRIORITY_NORMAL = 2;
exports.QUEUE_PRIORITY_HIGH = 3;
exports.QUEUE_PRIORITY_VERY_HIGH = 4;
exports.EDITOR_TYPE_WORD = 0;
exports.EDITOR_TYPE_SPREADSHEET = 1;
exports.EDITOR_TYPE_PRESENTATION = 2;
exports.EDITOR_TYPE_CONVERTATION = 3;
exports.PACKAGE_TYPE_OS = 0;
exports.PACKAGE_TYPE_I = 1;
exports.PACKAGE_TYPE_D = 2;
exports.REDIS_KEY_PUBSUB = 'pubsub';
exports.REDIS_KEY_SAVE_LOCK = 'savelock:';
exports.REDIS_KEY_PRESENCE_HASH = 'presence:hash:';
exports.REDIS_KEY_PRESENCE_SET = 'presence:set:';
exports.REDIS_KEY_PRESENCE_UNIQUE_USERS = 'presence:unique:users';
exports.REDIS_KEY_PRESENCE_UNIQUE_USERS_HASH = 'presence:unique:users:hash';
exports.REDIS_KEY_PRESENCE_MONTH_UNIQUE_USERS_HASH = 'presence:unique:users:month';
exports.REDIS_KEY_LOCKS = 'locks:';
exports.REDIS_KEY_LOCK_DOCUMENT = 'lockdocument:';
exports.REDIS_KEY_MESSAGE = 'message:';
exports.REDIS_KEY_DOCUMENTS = 'documents';
exports.REDIS_KEY_LAST_SAVE = 'lastsave:';
exports.REDIS_KEY_FORCE_SAVE = 'forcesave:';
exports.REDIS_KEY_FORCE_SAVE_TIMER = 'forcesavetimer';
exports.REDIS_KEY_FORCE_SAVE_TIMER_LOCK = 'forcesavetimerlock:';
exports.REDIS_KEY_SAVED = 'saved:';
exports.REDIS_KEY_SHUTDOWN = 'shutdown';
exports.REDIS_KEY_COLLECT_LOST = 'collectlost';
exports.REDIS_KEY_LICENSE = 'license';
exports.REDIS_KEY_LICENSE_T = 'licenseT';
exports.REDIS_KEY_EDITOR_CONNECTIONS = 'editorconnections';
exports.REDIS_KEY_SHARD_CONNECTIONS_EDIT_ZSET = 'shardconnections:edit:zset';
exports.REDIS_KEY_SHARD_CONNECTIONS_EDIT_HASH = 'shardconnections:edit:hash';
exports.REDIS_KEY_SHARD_CONNECTIONS_VIEW_ZSET = 'shardconnections:view:zset';
exports.REDIS_KEY_SHARD_CONNECTIONS_VIEW_HASH = 'shardconnections:view:hash';
exports.SHUTDOWN_CODE = 4001;
exports.SHUTDOWN_REASON = 'server shutdown';
exports.SESSION_IDLE_CODE = 4002;
exports.SESSION_IDLE_REASON = 'idle session expires';
exports.SESSION_ABSOLUTE_CODE = 4003;
exports.SESSION_ABSOLUTE_REASON = 'absolute session expires';
exports.ACCESS_DENIED_CODE = 4004;
exports.ACCESS_DENIED_REASON = 'access deny';
exports.JWT_EXPIRED_CODE = 4005;
exports.JWT_EXPIRED_REASON = 'token:';
exports.JWT_ERROR_CODE = 4006;
exports.JWT_ERROR_REASON = 'token:';
exports.DROP_CODE = 4007;
exports.DROP_REASON = 'drop';
exports.UPDATE_VERSION_CODE = 4008;
exports.UPDATE_VERSION = 'update version';
exports.NO_CACHE_CODE = 4009;
exports.NO_CACHE = 'no cache';
exports.CONTENT_DISPOSITION_INLINE = 'inline';
exports.CONTENT_DISPOSITION_ATTACHMENT = 'attachment';
exports.CONN_CLOSED = 3;
exports.FILE_STATUS_OK = 'ok';
exports.FILE_STATUS_UPDATE_VERSION = 'updateversion';
exports.ACTIVEMQ_QUEUE_PREFIX = 'queue://';
exports.ACTIVEMQ_TOPIC_PREFIX = 'topic://';
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
'use strict';
const constants = require('./constants');
const buildDate = '9/8/2022';
const oBuildDate = new Date(buildDate);
exports.readLicense = function*() {
const c_LR = constants.LICENSE_RESULT;
var now = new Date();
var startDate = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1));//first day of current month
return [{
count: 1,
type: c_LR.Success,
light: false,
packageType: constants.PACKAGE_TYPE_I,
mode: constants.LICENSE_MODE.None,
branding: false,
connections: constants.LICENSE_CONNECTIONS,
customization: true,
usersCount: 0,
usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY,
hasLicense: true,
plugins: true,
buildDate: oBuildDate,
startDate: startDate,
endDate: "2999-01-01T23:59:59.000Z",
customerId: ""
}, null];
};
exports.packageType = constants.PACKAGE_TYPE_OS;
GRUNT = grunt
GRUNT_FLAGS = --no-color -v
GRUNT_FILES = Gruntfile.js.out
PRODUCT_VERSION ?= 0.0.0
BUILD_NUMBER ?= 0
PUBLISHER_NAME ?= Ascensio System SIA
PUBLISHER_URL ?= https://www.onlyoffice.com/
GRUNT_ENV += PRODUCT_VERSION=$(PRODUCT_VERSION)
GRUNT_ENV += BUILD_NUMBER=$(BUILD_NUMBER)
GRUNT_ENV += PUBLISHER_NAME="$(PUBLISHER_NAME)"
GRUNT_ENV += PUBLISHER_URL="$(PUBLISHER_URL)"
BRANDING_DIR ?= ./branding
DOCUMENT_ROOT ?= /var/www/onlyoffice/documentserver
ifeq ($(OS),Windows_NT)
PLATFORM := win
EXEC_EXT := .exe
SHARED_EXT := .dll
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
ARCHITECTURE := 64
endif
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
ARCHITECTURE := 32
endif
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
PLATFORM := linux
SHARED_EXT := .so*
LIB_PREFIX := lib
endif
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_M),x86_64)
ARCHITECTURE := 64
endif
ifneq ($(filter %86,$(UNAME_M)),)
ARCHITECTURE := 32
endif
endif
TARGET := $(PLATFORM)_$(ARCHITECTURE)
OUTPUT = ../build_tools/out/$(TARGET)/onlyoffice/documentserver/server
SPELLCHECKER_DICTIONARIES := $(OUTPUT)/../dictionaries
SPELLCHECKER_DICTIONARY_FILES += ../dictionaries/*_*
SCHEMA_DIR = schema
SCHEMA_FILES = $(SCHEMA_DIR)/**
SCHEMA = $(OUTPUT)/$(SCHEMA_DIR)/
TOOLS_DIR = tools
TOOLS_FILES += ../core/build/bin/$(TARGET)/allfontsgen$(EXEC_EXT)
TOOLS_FILES += ../core/build/bin/$(TARGET)/allthemesgen$(EXEC_EXT)
TOOLS = $(OUTPUT)/$(TOOLS_DIR)
LICENSE_FILES = LICENSE.txt 3rd-Party.txt license/
LICENSE = $(addsuffix $(OUTPUT)/, LICENSE_FILES)
LICENSE_JS := $(OUTPUT)/Common/sources/license.js
COMMON_DEFINES_JS := $(OUTPUT)/Common/sources/commondefines.js
WELCOME_DIR = welcome
WELCOME_FILES = $(BRANDING_DIR)/$(WELCOME_DIR)/**
WELCOME = $(OUTPUT)/$(WELCOME_DIR)/
INFO_DIR = info
INFO_FILES = $(BRANDING_DIR)/$(INFO_DIR)/**
INFO = $(OUTPUT)/$(INFO_DIR)/
CORE_FONTS_DIR = core-fonts
CORE_FONTS_FILES = ../$(CORE_FONTS_DIR)/**
CORE_FONTS = $(OUTPUT)/../$(CORE_FONTS_DIR)/
DOCUMENT_TEMPLATES_DIR = document-templates
DOCUMENT_TEMPLATES_FILES = ../$(DOCUMENT_TEMPLATES_DIR)/**
DOCUMENT_TEMPLATES = $(OUTPUT)/../$(DOCUMENT_TEMPLATES_DIR)/
DEBUG = $(BRANDING_DIR)/debug.js
.PHONY: all clean install uninstall build-date
.NOTPARALLEL:
all: $(SCHEMA) $(LICENSE) $(WELCOME) $(INFO) build-date
build-date: $(GRUNT_FILES)
sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS)
sed "s|\(const buildNumber = \).*|\1${BUILD_NUMBER};|" -i $(COMMON_DEFINES_JS)
sed "s|\(const buildDate = \).*|\1'$$(date +%F)';|" -i $(LICENSE_JS)
test -e $(DEBUG) && \
cp $(DEBUG) $(OUTPUT)/Common/sources || true
$(SPELLCHECKER_DICTIONARIES): $(GRUNT_FILES)
mkdir -p $(SPELLCHECKER_DICTIONARIES) && \
cp -r -t $(SPELLCHECKER_DICTIONARIES) $(SPELLCHECKER_DICTIONARY_FILES)
$(SCHEMA):
mkdir -p $(SCHEMA) && \
cp -r -t $(SCHEMA) $(SCHEMA_FILES)
$(TOOLS):
mkdir -p $(TOOLS) && \
cp -r -t $(TOOLS) $(TOOLS_FILES)
$(LICENSE):
mkdir -p $(OUTPUT) && \
cp -r -t $(OUTPUT) $(LICENSE_FILES)
$(GRUNT_FILES):
cd $(@D) && \
npm install && \
$(GRUNT_ENV) $(GRUNT) $(GRUNT_FLAGS)
mkdir -p $(OUTPUT)
cp -r -t $(OUTPUT) ./build/server/*
echo "Done" > $@
$(WELCOME):
mkdir -p $(WELCOME) && \
cp -r -t $(WELCOME) $(WELCOME_FILES)
$(INFO):
mkdir -p $(INFO) && \
cp -r -t $(INFO) $(INFO_FILES)
$(CORE_FONTS):
mkdir -p $(CORE_FONTS) && \
cp -r -t $(CORE_FONTS) $(CORE_FONTS_FILES)
$(DOCUMENT_TEMPLATES):
mkdir -p $(DOCUMENT_TEMPLATES) && \
cp -r -t $(DOCUMENT_TEMPLATES) $(DOCUMENT_TEMPLATES_FILES)
clean:
rm -rf $(GRUNT_FILES)
install:
mkdir -pv ${DESTDIR}/var/www/onlyoffice
if ! id -u onlyoffice > /dev/null 2>&1; then useradd -m -d /var/www/onlyoffice -r -U onlyoffice; fi
mkdir -p ${DESTDIR}${DOCUMENT_ROOT}/fonts
mkdir -p ${DESTDIR}/var/log/onlyoffice/documentserver
mkdir -p ${DESTDIR}/var/lib/onlyoffice/documentserver/App_Data
cp -fr -t ${DESTDIR}${DOCUMENT_ROOT} build/* ../web-apps/deploy/*
mkdir -p ${DESTDIR}/etc/onlyoffice/documentserver
mv ${DESTDIR}${DOCUMENT_ROOT}/server/Common/config/* ${DESTDIR}/etc/onlyoffice/documentserver
chown onlyoffice:onlyoffice -R ${DESTDIR}/var/www/onlyoffice
chown onlyoffice:onlyoffice -R ${DESTDIR}/var/log/onlyoffice
chown onlyoffice:onlyoffice -R ${DESTDIR}/var/lib/onlyoffice
# Make symlinks for shared libs
find \
${DESTDIR}${DOCUMENT_ROOT}/server/FileConverter/bin \
-maxdepth 1 \
-name *$(SHARED_EXT) \
-exec sh -c 'ln -sf {} ${DESTDIR}/lib/$$(basename {})' \;
sudo -u onlyoffice "${DESTDIR}${DOCUMENT_ROOT}/server/tools/allfontsgen"\
--input="${DESTDIR}${DOCUMENT_ROOT}/core-fonts"\
--allfonts-web="${DESTDIR}${DOCUMENT_ROOT}/sdkjs/common/AllFonts.js"\
--allfonts="${DESTDIR}${DOCUMENT_ROOT}/server/FileConverter/bin/AllFonts.js"\
--images="${DESTDIR}${DOCUMENT_ROOT}/sdkjs/common/Images"\
--selection="${DESTDIR}${DOCUMENT_ROOT}/server/FileConverter/bin/font_selection.bin"\
--output-web="${DESTDIR}${DOCUMENT_ROOT}/fonts"\
--use-system="true"
sudo -u onlyoffice "${DESTDIR}${DOCUMENT_ROOT}/server/tools/allthemesgen"\
--converter-dir="${DESTDIR}${DOCUMENT_ROOT}/server/FileConverter/bin"\
--src="${DESTDIR}${DOCUMENT_ROOT}/sdkjs/slide/themes"\
--output="${DESTDIR}${DOCUMENT_ROOT}/sdkjs/common/Images"
uninstall:
userdel onlyoffice
# Unlink installed shared libs
find /lib -type l | while IFS= read -r lnk; do if (readlink "$$lnk" | grep -q '^${DOCUMENT_ROOT}/server/FileConverter/bin/'); then rm "$$lnk"; fi; done
rm -rf /var/www/onlyoffice/documentserver
rm -rf /var/log/onlyoffice/documentserver
rm -rf /var/lib/onlyoffice/documentserver
rm -rf /etc/onlyoffice/documentserver
const EditorUIController = () => {
return null
};
EditorUIController.isSupportEditFeature = () => {
return true
};
EditorUIController.getToolbarOptions = () => {
return null
};
EditorUIController.initFonts = () => null;
EditorUIController.initEditorStyles = () => null;
EditorUIController.initFocusObjects = () => null;
EditorUIController.initTableTemplates = () => null;
EditorUIController.ContextMenu = {
mapMenuItems: () => [],
handleMenuItemClick: () => true,
};
export default EditorUIController;
const EditorUIController = () => null;
EditorUIController.isSupportEditFeature = () => true;
export default EditorUIController;
const EditorUIController = () => null;
EditorUIController.isSupportEditFeature = () => true;
export default EditorUIController;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment