Skip to content

Commit

Permalink
ZBUG-3263: Upgrading onlyoffice to v7.2.2.56 (7.2.1) (#3)
Browse files Browse the repository at this point in the history
* ZBUG-3263: Updating the connection limit to 99999.

* adding jq binary, onlyoffice config script, https servers, create onlyoffice db

* fixing shellcheck issues, changing log path, changing to absolute path

* Package creation changes

* Changing Permission

* Merge branch 'feature/910-build' into zimbra9/onlyoffice

* ZBUG-3263: Removing the repeated code block.

* ZBUG-3263: Removed the spellchecker endpoint.

* ZBUG-3263: Updated the spellchecker dictionaries path.

* ZBUG-3263:Updated createdb.sql for v7.2.2.56

* ZBUG-3263:updated circle-ci config to create rpm/debian packages

* ZBUG-3263: Removed the default spellchecker PID. Not required.

* ZBUG-3263:Updated tar file for logo related changes

* ZCS-13864:Onlyoffice logo reset it back to show (#4)

* Added U22 and Rocky9 support in circle-ci config.

* ZCS-14838:Replace AWS S3 with OCI S3 for Circle CI Job Upload Packages (#7)

* ZCS-15301 : Check for commercial certificates (#6)

* ZCS-15301:Check for commercial certificates

* ZCS-15301:Check for commercial certificates

---------

Co-authored-by: sreejan <[email protected]>
Co-authored-by: UmaShankar Avagadda <[email protected]>
  • Loading branch information
3 people committed Jan 9, 2025
1 parent d206d4b commit 127b1d5
Show file tree
Hide file tree
Showing 15 changed files with 1,449 additions and 12 deletions.
174 changes: 174 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
version: 2.1

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

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: ..
- run:
name: Create a zip file for artifacts and upload them to the OCI bucket
command: |
cd build/dist/
zip -r $CIRCLE_PROJECT_REPONAME.zip .
ZIP_FILE_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/$CIRCLE_BRANCH-$CIRCLE_BUILD_NUM/archives/$CIRCLE_PROJECT_REPONAME.zip"
curl -X PUT "$OCI_PAR_URL$ZIP_FILE_PATH" -T $CIRCLE_PROJECT_REPONAME.zip
echo "artifacts uploaded to $ZIP_FILE_PATH"
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_u22:
working_directory: ~/zm-onlyoffice
shell: /bin/bash -eo pipefail
docker:
- image: $DOCKER_REGISTRY/zm-base-os:devcore-ubuntu-22.04
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
resource_class: small
<<: *build_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_c9:
working_directory: ~/zm-onlyoffice
shell: /bin/bash -eo pipefail
docker:
- image: $DOCKER_REGISTRY/zm-base-os:devcore-centos-9
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
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_u22:
requires:
- checkout
context:
- docker-dev-registry
- build_u20:
requires:
- checkout
- build_u18:
requires:
- checkout
- build_c9:
requires:
- checkout
context:
- docker-dev-registry
- build_c8:
requires:
- checkout
- build_c7:
requires:
- checkout
- deploy_s3_hold:
type: approval
requires:
- build_u22
- build_u20
- build_u18
- build_c9
- build_c8
- build_c7

- deploy_s3:
context:
- oracle
requires:
- deploy_s3_hold
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ node_modules
/Gruntfile.js.out
local-development-*.json
*.pyc
run-develop-local.py
run-develop-local.py
.DS_Store
28 changes: 24 additions & 4 deletions Common/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,12 @@
},
"services": {
"CoAuthoring": {
"ssl" :{
"key" : "",
"cert" : ""
},
"server": {
"port": 8000,
"port": 7084,
"workerpercpu": 1,
"mode": "development",
"limits_tempfile_upload": 104857600,
Expand Down Expand Up @@ -278,11 +282,11 @@
"limits_image_types_upload": "jpg;jpeg;jpe;png;gif;bmp;svg;tiff;tif"
},
"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 @@ -504,5 +508,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"
}
}
}
27 changes: 22 additions & 5 deletions DocService/sources/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,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 Down Expand Up @@ -87,13 +88,29 @@ if (false) {
return;
}
}
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');
const cfgTokenEnableRequestInbox = configCommon.get('services.CoAuthoring.token.enable.request.inbox');
const cfgTokenEnableRequestOutbox = configCommon.get('services.CoAuthoring.token.enable.request.outbox');
const cfgLicenseFile = configCommon.get('license.license_file');
const cfgDownloadMaxBytes = configCommon.get('FileConverter.converter.maxDownloadBytes');

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;
const updatePluginsCacheExpire = ms("5m");
Expand Down
Loading

0 comments on commit 127b1d5

Please sign in to comment.