Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ZCS 10534 #1

Open
wants to merge 3 commits into
base: zimbra9/onlyoffice
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions Common/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@
},
"services": {
"CoAuthoring": {
"ssl" :{
"key" : "",
"cert" : ""
},
"server": {
"port": 8000,
"port": 7084,
"workerpercpu": 1,
"mode": "development",
"limits_tempfile_upload": 104857600,
Expand Down Expand Up @@ -119,11 +123,11 @@
"limits_image_types_upload": "jpg;jpeg;jpe;png;gif;bmp"
},
"sql": {
"type": "postgres",
"type": "mysql",
"tableChanges": "doc_changes",
"tableResult": "task_result",
"dbHost": "localhost",
"dbPort": 5432,
"dbPort": 7306,
"dbName": "onlyoffice",
"dbUser": "onlyoffice",
"dbPass": "onlyoffice",
Expand Down Expand Up @@ -215,7 +219,7 @@
"autostart": []
},
"editor":{
"spellcheckerUrl": "",
"spellcheckerUrl": "/spellchecker",
"reconnection":{
"attempts": 50,
"delay": "2s"
Expand Down Expand Up @@ -296,8 +300,12 @@
"silent": true
},
"SpellChecker": {
"ssl" :{
"key" : "",
"cert" : ""
},
"server": {
"port": 8080,
"port": 7085,
"mode": "development"
}
}
Expand Down
15 changes: 15 additions & 0 deletions Common/config/log4js/logconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"appenders": {
"default": {
"type": "file",
"filename": "../onlyoffice.log",
"layout": {
"type": "pattern",
"pattern": "[%d] [%p] %c - %.10000m"
}
}
},
"categories": {
"default": { "appenders": [ "default" ], "level": "WARN" }
}
}
70 changes: 70 additions & 0 deletions Common/config/onlyofficeconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"log": {
"filePath": "../documentserver/server/Common/config/log4js/logconfig.json"
},
"storage": {
"fs": {
"folderPath": "../documentserver/App_Data/cache/files"
}
},
"services": {
"CoAuthoring": {
"server": {
"static_content": {
"/fonts": {
"path": "../documentserver/fonts",
"options": {"maxAge": "7d"}
},
"/sdkjs": {
"path": "../documentserver/sdkjs",
"options": {"maxAge": "7d"}
},
"/web-apps": {
"path": "../documentserver/web-apps",
"options": {"maxAge": "7d"}
},
"/sdkjs-plugins": {
"path": "../documentserver/sdkjs-plugins",
"options": {"maxAge": "7d"}
},
"/App_Data": {
"path": "../documentserver/App_Data",
"options": {"maxAge": "7d"}
}
}
},
"utils": {
"utils_common_fontdir": "/usr/share/fonts"
},
"request-filtering-agent" : {
"allowPrivateIPAddress": true,
"allowMetaIPAddress": true
},
"sockjs": {
"sockjs_url": "../documentserver/web-apps/vendor/sockjs/sockjs.min.js"
}
}
},
"license": {
"license_file": "./../documentserver/license.lic",
"warning_limit_percents": 70,
"packageType": 0
},
"FileConverter": {
"converter": {
"fontDir": "/usr/share/fonts",
"presentationThemesDir": "../documentserver/sdkjs/slide/themes",
"x2tPath": "../documentserver/server/FileConverter/bin/x2t",
"docbuilderPath": "../documentserver/server/FileConverter/bin/docbuilder",
"docbuilderAllFontsPath": "../documentserver/App_Data/docbuilder/AllFonts.js"
}
},
"FileStorage": {
"directory": "../documentserver/App_Data"
},
"SpellChecker": {
"server": {
"dictDir": "../documentserver/server/SpellChecker/dictionaries"
}
}
}
2 changes: 1 addition & 1 deletion Common/sources/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ exports.LICENSE_RESULT = {
ExpiredLimited: 11
};

exports.LICENSE_CONNECTIONS = 20;
exports.LICENSE_CONNECTIONS = 99999;
exports.LICENSE_EXPIRE_USERS_ONE_DAY = 24 * 60 * 60; // day in seconds

exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000;
Expand Down
15 changes: 14 additions & 1 deletion DocService/sources/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const fs = require('fs');

const express = require('express');
const http = require('http');
const https = require('https');
const urlModule = require('url');
const path = require('path');
const bodyParser = require("body-parser");
Expand All @@ -55,7 +56,19 @@ const utils = require('./../../Common/sources/utils');
const commonDefines = require('./../../Common/sources/commondefines');
const configStorage = configCommon.get('storage');
const app = express();
const server = http.createServer(app);

let server = null;

if (config.has('ssl')) {
const privateKey = fs.readFileSync(config.get('ssl.key')).toString();
const certificateKey = fs.readFileSync(config.get('ssl.cert')).toString();
//See detailed options format here: http://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener
const options = {key: privateKey, cert: certificateKey};

server = https.createServer(options, app);
} else {
server = http.createServer(app);
}

let licenseInfo, updatePluginsTime, userPlugins, pluginsLoaded;

Expand Down
4 changes: 2 additions & 2 deletions SpellChecker/sources/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ if (cluster.isMaster) {
if (config.has('ssl')) {
const privateKey = fs.readFileSync(config.get('ssl.key')).toString();
const certificateKey = fs.readFileSync(config.get('ssl.cert')).toString();
const trustedCertificate = fs.readFileSync(config.get('ssl.ca')).toString();

//See detailed options format here: http://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener
const options = {key: privateKey, cert: certificateKey, ca: [trustedCertificate]};
const options = {key: privateKey, cert: certificateKey};

server = https.createServer(options, app);
} else {
Expand Down
77 changes: 77 additions & 0 deletions bin/createdb.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

--
-- Create schema onlyoffice
--
CREATE DATABASE IF NOT EXISTS onlyoffice DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
--CREATE USER IF NOT EXISTS 'onlyoffice' IDENTIFIED BY 'onlyoffice';
--grant all on onlyoffice.* to 'onlyoffice' identified by 'onlyoffice';
GRANT ALL PRIVILEGES ON onlyoffice.* TO 'zimbra';
FLUSH PRIVILEGES;


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;



USE onlyoffice;

--
-- Definition of table `doc_changes`
--

CREATE TABLE IF NOT EXISTS `doc_changes` (
`id` varchar(255) NOT NULL,
`change_id` int(10) unsigned NOT NULL,
`user_id` varchar(255) NOT NULL,
`user_id_original` varchar(255) NOT NULL,
`user_name` varchar(255) NOT NULL,
`change_data` longtext NOT NULL,
`change_date` datetime NOT NULL,
PRIMARY KEY (`id`,`change_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `doc_changes`
--

/*!40000 ALTER TABLE `doc_changes` DISABLE KEYS */;
/*!40000 ALTER TABLE `doc_changes` ENABLE KEYS */;

--
-- Definition of table `task_result`
--

CREATE TABLE IF NOT EXISTS `task_result` (
`id` varchar(255) NOT NULL,
`status` tinyint(3) NOT NULL,
`status_info` int(10) NOT NULL,
`last_open_date` datetime NOT NULL,
`user_index` int(10) unsigned NOT NULL DEFAULT 1,
`change_id` int(10) unsigned NOT NULL DEFAULT 0,
`callback` longtext NOT NULL,
`baseurl` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `task_result`
--

/*!40000 ALTER TABLE `task_result` DISABLE KEYS */;
/*!40000 ALTER TABLE `task_result` ENABLE KEYS */;


/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
Binary file added bin/jq
Binary file not shown.
5 changes: 5 additions & 0 deletions bin/process_id.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"docservice": -1,
"spellchecker": -1,
"converter" : -1
}
Loading