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

ZBUG-3263: Upgrading onlyoffice to v7.2.2.56 (7.2.1) #3

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
142 changes: 142 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
version: 2.1

orbs:
aws-s3: circleci/aws-s3@3.0.0
############################################################################

references:
checkout_job_steps: &checkout_job_steps
steps:
- checkout
- run:
name: Checking out dependencies
command: |
git clone -b develop --single-branch https://github.com/Zimbra/zm-pkg-tool.git ~/zm-pkg-tool
echo "BUILD_NO=$CIRCLE_BUILD_NUM" > config.build
- persist_to_workspace:
root: ..
paths:
- zm-onlyoffice
- zm-pkg-tool

build_job_steps: &build_job_steps
steps:
- attach_workspace:
at: ..
- run:
name: Creating build
command: make -f Makefile.build
no_output_timeout: 30m
- store_artifacts:
path: build/dist
- persist_to_workspace:
root: ..
paths: zm-onlyoffice/build/dist/*

deploy_s3_job_steps: &deploy_s3_job_steps
docker:
- image: 'cimg/python:3.10'
resource_class: small
steps:
- attach_workspace:
at: ..
- aws-s3/sync:
from: 'build/dist/'
to: 's3://files.zimbra.com/dev-releases/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/$CIRCLE_BRANCH-$CIRCLE_BUILD_NUM/archives/zimbra-onlyoffice/'
aws-access-key-id: RELEASE_AWS_ACCESS_KEY_ID
aws-secret-access-key: RELEASE_AWS_SECRET_ACCESS_KEY
aws-region: RELEASE_AWS_DEFAULT_REGION
arguments: --acl public-read

std_filters: &std_filters
filters:
branches:
only:
- master
- develop

############################################################################

jobs:
checkout:
working_directory: ~/zm-onlyoffice
shell: /bin/bash -eo pipefail
docker:
- image: zimbra/zm-base-os:core-ubuntu
resource_class: small
<<: *checkout_job_steps

build_u20:
working_directory: ~/zm-onlyoffice
shell: /bin/bash -eo pipefail
docker:
- image: zimbra/zm-base-os:devcore-ubuntu-20.04
resource_class: small
<<: *build_job_steps

build_u18:
working_directory: ~/zm-onlyoffice
shell: /bin/bash -eo pipefail
docker:
- image: zimbra/zm-base-os:devcore-ubuntu-18.04
resource_class: small
<<: *build_job_steps


build_c8:
working_directory: ~/zm-onlyoffice
shell: /bin/bash -eo pipefail
docker:
- image: zimbra/zm-base-os:devcore-centos-8
resource_class: small
<<: *build_job_steps

build_c7:
working_directory: ~/zm-onlyoffice
shell: /bin/bash -eo pipefail
docker:
- image: zimbra/zm-base-os:devcore-centos-7
resource_class: small
<<: *build_job_steps

deploy_s3:
working_directory: ~/zm-onlyoffice
shell: /bin/bash -eo pipefail
<<: *deploy_s3_job_steps

############################################################################

workflows:
version: 2
main:
jobs:
- build:
type: approval
- checkout:
requires:
- build
- build_u20:
requires:
- checkout
- build_u18:
requires:
- checkout
- build_c8:
requires:
- checkout
- build_c7:
requires:
- checkout
- deploy_s3_hold:
type: approval
requires:
- build_u20
- build_u18
- build_c8
- build_c7

- deploy_s3:
context:
- aws
requires:
- deploy_s3_hold
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ node_modules
/Gruntfile.js.out
local-development-*.json
*.pyc
.DS_Store
28 changes: 24 additions & 4 deletions Common/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@
},
"services": {
"CoAuthoring": {
"ssl" :{
"key" : "",
"cert" : ""
},
"server": {
"port": 8000,
"port": 7084,
"workerpercpu": 1,
"mode": "development",
"limits_tempfile_upload": 104857600,
Expand Down Expand Up @@ -158,11 +162,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 @@ -327,5 +331,21 @@
}
]
}
},
"FileStorage": {
"host": "",
"port": 4567,
"directory": "",
"silent": true
},
"SpellChecker": {
"ssl" :{
"key" : "",
"cert" : ""
},
"server": {
"port": 7085,
"mode": "development"
}
}
}
}
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": "/opt/zimbra/log/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": "/opt/zimbra/onlyoffice/documentserver/server/Common/config/log4js/logconfig.json"
},
"storage": {
"fs": {
"folderPath": "/opt/zimbra/onlyoffice/documentserver/App_Data/cache/files"
}
},
"services": {
"CoAuthoring": {
"server": {
"static_content": {
"/fonts": {
"path": "/opt/zimbra/onlyoffice/documentserver/fonts",
"options": {"maxAge": "7d"}
},
"/sdkjs": {
"path": "/opt/zimbra/onlyoffice/documentserver/sdkjs",
"options": {"maxAge": "7d"}
},
"/web-apps": {
"path": "/opt/zimbra/onlyoffice/documentserver/web-apps",
"options": {"maxAge": "7d"}
},
"/sdkjs-plugins": {
"path": "/opt/zimbra/onlyoffice/documentserver/sdkjs-plugins",
"options": {"maxAge": "7d"}
},
"/App_Data": {
"path": "/opt/zimbra/onlyoffice/documentserver/App_Data",
"options": {"maxAge": "7d"}
}
}
},
"utils": {
"utils_common_fontdir": "/usr/share/fonts"
},
"request-filtering-agent" : {
"allowPrivateIPAddress": true,
"allowMetaIPAddress": true
},
"sockjs": {
"sockjs_url": "/opt/zimbra/onlyoffice/documentserver/web-apps/vendor/sockjs/sockjs.min.js"
}
}
},
"license": {
"license_file": "/opt/zimbra/onlyoffice/documentserver/license.lic",
"warning_limit_percents": 70,
"packageType": 0
},
"FileConverter": {
"converter": {
"fontDir": "/usr/share/fonts",
"presentationThemesDir": "/opt/zimbra/onlyoffice/documentserver/sdkjs/slide/themes",
"x2tPath": "/opt/zimbra/onlyoffice/documentserver/server/FileConverter/bin/x2t",
"docbuilderPath": "/opt/zimbra/onlyoffice/documentserver/server/FileConverter/bin/docbuilder",
"docbuilderAllFontsPath": "/opt/zimbra/onlyoffice/documentserver/App_Data/docbuilder/AllFonts.js"
}
},
"FileStorage": {
"directory": "/opt/zimbra/onlyoffice/documentserver/App_Data"
},
"SpellChecker": {
"server": {
"dictDir": "/opt/zimbra/onlyoffice/documentserver/dictionaries"
}
}
}
2 changes: 1 addition & 1 deletion Common/sources/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ exports.LICENSE_RESULT = {
UsersViewCountOS: 15
};

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
22 changes: 15 additions & 7 deletions 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 @@ -59,7 +60,6 @@ const commonDefines = require('./../../Common/sources/commondefines');
const operationContext = require('./../../Common/sources/operationContext');
const tenantManager = require('./../../Common/sources/tenantManager');
const configStorage = configCommon.get('storage');

const cfgWopiEnable = configCommon.get('wopi.enable');
const cfgHtmlTemplate = configCommon.get('wopi.htmlTemplate');
const cfgTokenEnableBrowser = configCommon.get('services.CoAuthoring.token.enable.browser');
Expand All @@ -68,11 +68,19 @@ const cfgTokenEnableRequestOutbox = configCommon.get('services.CoAuthoring.token
const cfgLicenseFile = configCommon.get('license.license_file');

const app = express();
app.disable('x-powered-by');
//path.resolve uses __dirname by default(unexpected path in pkg)
app.set("views", path.resolve(process.cwd(), cfgHtmlTemplate));
app.set("view engine", "ejs");
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, licenseOriginal, updatePluginsTime, userPlugins, pluginsLoaded;

Expand Down Expand Up @@ -360,4 +368,4 @@ process.on('uncaughtException', (err) => {
logger.shutdown(() => {
process.exit(1);
});
});
});
53 changes: 53 additions & 0 deletions Makefile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
########################################################################################################

SHELL = bash

SHA512 = sha512sum

OS = $(shell cat /etc/os-release | grep '^NAME' | cut -d'=' -f2 | cut -d'"' -f2)

.PHONY: clean all

########################################################################################################


all: clean zimbra-onlyoffice-pkg

########################################################################################################

ONLY_OFFICE_VERSION = 1.0
ONLY_OFFICE_URL="https://files.zimbra.com/downloads/onlyoffice/u14/zimbra-onlyoffice-v7.2.2.56.tar.gz"

stage-zimbra-onlyoffice-pkg: downloads
mkdir -p build/stage/zimbra-onlyoffice/opt/zimbra
cp -r downloads/onlyoffice build/stage/zimbra-onlyoffice/opt/zimbra/
chmod +x build/stage/zimbra-onlyoffice/opt/zimbra/onlyoffice/bin/jq
rm -rf build/stage/zimbra-onlyoffice/opt/zimbra/onlyoffice/.DS_Store
rm -rf build/stage/zimbra-onlyoffice/opt/zimbra/onlyoffice/._.DS_Store

zimbra-onlyoffice-pkg: stage-zimbra-onlyoffice-pkg
./pkg-build.pl \
--pkg-version=$(ONLY_OFFICE_VERSION).$(shell git log --format=%at -1) \
--pkg-release=1 \
--pkg-name=zimbra-onlyoffice \
--out-type=binary \
--pkg-summary="Zimbra onlyoffice package" \
--pkg-post-install-script='scripts/postinst.sh' \
--pkg-installs='/opt/zimbra/onlyoffice/*'


downloads:
mkdir -p downloads
wget -O downloads/zimbra-onlyoffice.tar.gz $(ONLY_OFFICE_URL)
cd downloads/; tar -xf zimbra-onlyoffice.tar.gz
mv downloads/zimbra-onlyoffice downloads/onlyoffice

########################################################################################################

########################################################################################################

clean:
rm -rf build
rm -rf downloads

########################################################################################################
Loading