mirror of
https://github.com/aleho/onlyoffice-ce-docker-license.git
synced 2026-01-01 13:44:04 +01:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b876e7729 | ||
|
|
4dbf466ea4 | ||
|
|
42d32196fa | ||
|
|
6f4181f51a | ||
|
|
4a19854542 | ||
|
|
a17ec8bbf7 | ||
|
|
fe1a3d4391 | ||
|
|
a1431337a4 | ||
|
|
86721ea9db |
38
Dockerfile
38
Dockerfile
@@ -1,5 +1,6 @@
|
|||||||
ARG oo_version=5.5.0.165
|
ARG oo_version=5.6.3.2
|
||||||
FROM onlyoffice/documentserver:$oo_version
|
FROM onlyoffice/documentserver:$oo_version
|
||||||
|
ARG oo_version=5.6.3.2
|
||||||
|
|
||||||
|
|
||||||
RUN sed -is \
|
RUN sed -is \
|
||||||
@@ -15,23 +16,30 @@ RUN sed -is \
|
|||||||
/var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/mobile/app.js
|
/var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/mobile/app.js
|
||||||
|
|
||||||
|
|
||||||
|
# source patching and compilation
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
python3-pip \
|
git \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
curl \
|
||||||
&& pip3 install pycryptodome
|
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
|
||||||
|
&& apt install -y nodejs \
|
||||||
|
|
||||||
COPY license.py /tmp/
|
|
||||||
RUN python3 /tmp/license.py
|
|
||||||
|
|
||||||
RUN pip3 uninstall -y pycryptodome \
|
|
||||||
&& apt-get purge -y python3-pip \
|
|
||||||
&& apt-get purge -y --autoremove \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
COPY run-oo.sh /usr/local/bin/run-oo.sh
|
RUN mkdir /build
|
||||||
RUN chmod a+x /usr/local/bin/run-oo.sh
|
WORKDIR /build
|
||||||
|
|
||||||
|
RUN git clone --branch v$oo_version --depth 1 https://github.com/ONLYOFFICE/server.git .
|
||||||
|
|
||||||
|
COPY license.patch /build/
|
||||||
|
RUN git apply license.patch
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT [ "/usr/local/bin/run-oo.sh" ]
|
RUN npm install pkg grunt-cli \
|
||||||
|
&& make \
|
||||||
|
&& node_modules/.bin/pkg --targets=linux build/server/FileConverter \
|
||||||
|
&& node_modules/.bin/pkg --targets=linux build/server/DocService \
|
||||||
|
&& cp fileconverter /var/www/onlyoffice/documentserver/server/FileConverter/converter \
|
||||||
|
&& cp coauthoring /var/www/onlyoffice/documentserver/server/DocService/docservice
|
||||||
|
|
||||||
|
WORKDIR /
|
||||||
|
RUN rm -rf /build
|
||||||
|
|||||||
25
README.md
25
README.md
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
### CLI
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker build \
|
docker build \
|
||||||
--tag=onlyoffice-patched \
|
--tag=onlyoffice-patched \
|
||||||
@@ -12,10 +14,27 @@ docker build \
|
|||||||
docker run \
|
docker run \
|
||||||
--name=onlyoffice \
|
--name=onlyoffice \
|
||||||
--detach \
|
--detach \
|
||||||
--volume=$(pwd)/ooData:/var/www/onlyoffice/Data onlyoffice-patched \
|
|
||||||
onlyoffice-patched
|
onlyoffice-patched
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### docker-compose.yml
|
||||||
|
|
||||||
|
```yml
|
||||||
|
services:
|
||||||
|
onlyoffice:
|
||||||
|
container_name: onlyoffice
|
||||||
|
image: onlyoffice-patched
|
||||||
|
build:
|
||||||
|
context: https://github.com/aleho/onlyoffice-ce-docker-license.git
|
||||||
|
```
|
||||||
|
|
||||||
|
### Verify
|
||||||
|
|
||||||
|
To verify that the container is running successfully open
|
||||||
|
`[server-url]/healthcheck` (has to return `true`) and for the version number open
|
||||||
|
`[server-url]/web-apps/apps/api/documents/api.js` and check the header comment.
|
||||||
|
|
||||||
|
|
||||||
## Background
|
## Background
|
||||||
Recently, just about a month after Nextcloud announced their partnership with
|
Recently, just about a month after Nextcloud announced their partnership with
|
||||||
Ascensio and featuring a community version of OnlyOffice, the latter decided
|
Ascensio and featuring a community version of OnlyOffice, the latter decided
|
||||||
@@ -27,10 +46,10 @@ feature. Only after some outcries Ascensio deigned to release a statement and
|
|||||||
a new, albeit "limited", offer of €90 for home servers.
|
a new, albeit "limited", offer of €90 for home servers.
|
||||||
|
|
||||||
In my opinion these deceptive practices are unacceptable for a company
|
In my opinion these deceptive practices are unacceptable for a company
|
||||||
advertising itself and their product as open source .
|
advertising itself and their product as open source.
|
||||||
|
|
||||||
|
|
||||||
## Thanks
|
## Thanks
|
||||||
|
|
||||||
This repo is heavily inspired by the works of
|
This repo was heavily inspired by the works of
|
||||||
[Zegorax/OnlyOffice-Unlimited](https://github.com/Zegorax/OnlyOffice-Unlimited).
|
[Zegorax/OnlyOffice-Unlimited](https://github.com/Zegorax/OnlyOffice-Unlimited).
|
||||||
|
|||||||
128
license.patch
Normal file
128
license.patch
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
From 49041ccf02617c5a9b92693b3bf65870e6b79006 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Alexander Hofbauer <alex@derhofbauer.at>
|
||||||
|
Date: Mon, 3 Aug 2020 11:44:57 +0200
|
||||||
|
Subject: [PATCH] Enable rebuild with fake license
|
||||||
|
|
||||||
|
---
|
||||||
|
Common/sources/commondefines.js | 5 ++--
|
||||||
|
Common/sources/license.js | 52 ++++++++-------------------------
|
||||||
|
Makefile | 6 ++--
|
||||||
|
3 files changed, 18 insertions(+), 45 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js
|
||||||
|
index 694a13a..eb85e04 100644
|
||||||
|
--- a/Common/sources/commondefines.js
|
||||||
|
+++ b/Common/sources/commondefines.js
|
||||||
|
@@ -975,8 +975,9 @@ const c_oAscUnlockRes = {
|
||||||
|
Empty: 2
|
||||||
|
};
|
||||||
|
|
||||||
|
-const buildVersion = '4.1.2';
|
||||||
|
-const buildNumber = 37;
|
||||||
|
+const buildVersion = '5.6.3';
|
||||||
|
+const buildNumber = 2
|
||||||
|
+exports.buildDate = '2020-08-17T10:18:00.000+02:00'
|
||||||
|
|
||||||
|
exports.TaskQueueData = TaskQueueData;
|
||||||
|
exports.CMailMergeSendData = CMailMergeSendData;
|
||||||
|
diff --git a/Common/sources/license.js b/Common/sources/license.js
|
||||||
|
index 290d85d..5a1ab21 100644
|
||||||
|
--- a/Common/sources/license.js
|
||||||
|
+++ b/Common/sources/license.js
|
||||||
|
@@ -32,53 +32,25 @@
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
-const config = require('config');
|
||||||
|
-const configL = config.get('license');
|
||||||
|
const constants = require('./constants');
|
||||||
|
-const logger = require('./logger');
|
||||||
|
-const editorDataStorage = require('./../../DocService/sources/' + config.get('services.CoAuthoring.server.editorDataStorage'));
|
||||||
|
-
|
||||||
|
-const buildDate = '6/29/2016';
|
||||||
|
-const oBuildDate = new Date(buildDate);
|
||||||
|
-const oPackageType = configL.get('packageType');
|
||||||
|
-
|
||||||
|
-const cfgRedisPrefix = config.get('services.CoAuthoring.redis.prefix');
|
||||||
|
-const redisKeyLicense = cfgRedisPrefix + constants.REDIS_KEY_LICENSE;
|
||||||
|
-
|
||||||
|
-let editorData = new editorDataStorage();
|
||||||
|
+const commonDefines = require('./commondefines');
|
||||||
|
|
||||||
|
exports.readLicense = function*() {
|
||||||
|
- const c_LR = constants.LICENSE_RESULT;
|
||||||
|
- const res = {
|
||||||
|
+ return {
|
||||||
|
count: 1,
|
||||||
|
- type: c_LR.Error,
|
||||||
|
+ type: constants.LICENSE_RESULT.Success,
|
||||||
|
light: false,
|
||||||
|
- packageType: oPackageType,
|
||||||
|
+ packageType: constants.PACKAGE_TYPE_I,
|
||||||
|
mode: constants.LICENSE_MODE.None,
|
||||||
|
branding: false,
|
||||||
|
- connections: constants.LICENSE_CONNECTIONS,
|
||||||
|
+ connections: 9999,
|
||||||
|
customization: false,
|
||||||
|
- usersCount: 0,
|
||||||
|
- usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY,
|
||||||
|
- hasLicense: false,
|
||||||
|
- plugins: false,
|
||||||
|
- buildDate: oBuildDate,
|
||||||
|
- endDate: null
|
||||||
|
+ usersCount: 9999,
|
||||||
|
+ usersExpire: 99999,
|
||||||
|
+ hasLicense: true,
|
||||||
|
+ plugins: true,
|
||||||
|
+ buildDate: commonDefines.buildDate,
|
||||||
|
+ endDate: "2099-01-01T23:59:59.000Z"
|
||||||
|
};
|
||||||
|
-
|
||||||
|
- if (yield* _getFileState()) {
|
||||||
|
- res.type = c_LR.ExpiredTrial;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (res.type === c_LR.Expired || res.type === c_LR.ExpiredTrial) {
|
||||||
|
- res.count = 1;
|
||||||
|
- logger.error('License: License Expired!!!');
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- return res;
|
||||||
|
};
|
||||||
|
-exports.packageType = oPackageType;
|
||||||
|
-
|
||||||
|
-function* _getFileState() {
|
||||||
|
- return yield editorData.getLicense(redisKeyLicense);
|
||||||
|
-}
|
||||||
|
+exports.packageType = constants.PACKAGE_TYPE_I;
|
||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 40bf93e..7109dbd 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-GRUNT = grunt
|
||||||
|
+GRUNT = ./node_modules/.bin/grunt
|
||||||
|
GRUNT_FLAGS = --no-color -v
|
||||||
|
|
||||||
|
GRUNT_FILES = Gruntfile.js.out
|
||||||
|
@@ -46,7 +46,7 @@ endif
|
||||||
|
|
||||||
|
TARGET := $(PLATFORM)_$(ARCHITECTURE)
|
||||||
|
|
||||||
|
-OUTPUT = ../build_tools/out/$(TARGET)/onlyoffice/documentserver/server
|
||||||
|
+OUTPUT = build/out/$(TARGET)/onlyoffice/documentserver/server
|
||||||
|
|
||||||
|
SPELLCHECKER_DICTIONARIES := $(OUTPUT)/SpellChecker/dictionaries
|
||||||
|
SPELLCHECKER_DICTIONARY_FILES += ../dictionaries/*_*
|
||||||
|
@@ -83,7 +83,7 @@ DEBUG = $(BRANDING_DIR)/debug.js
|
||||||
|
.PHONY: all clean install uninstall build-date
|
||||||
|
|
||||||
|
.NOTPARALLEL:
|
||||||
|
-all: $(SPELLCHECKER_DICTIONARIES) $(TOOLS) $(SCHEMA) $(CORE_FONTS) $(LICENSE) $(WELCOME) $(INFO) build-date
|
||||||
|
+all: build-date
|
||||||
|
|
||||||
|
build-date: $(GRUNT_FILES)
|
||||||
|
sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS)
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
||||||
87
license.py
87
license.py
@@ -1,87 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
from Crypto.Hash import SHA, SHA256
|
|
||||||
from Crypto.Signature import PKCS1_v1_5
|
|
||||||
from Crypto.PublicKey import RSA
|
|
||||||
from shutil import copyfile
|
|
||||||
import json
|
|
||||||
import codecs
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def gen_keys():
|
|
||||||
privKey = RSA.generate(1024)
|
|
||||||
publKey = privKey.publickey().exportKey('PEM')
|
|
||||||
|
|
||||||
f = open("/var/www/onlyoffice/license_key.pub", "w+")
|
|
||||||
f.write(publKey.decode('utf-8'))
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
return publKey, privKey
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def write_license(publKey, privKey):
|
|
||||||
license = {
|
|
||||||
"branding": False,
|
|
||||||
"connections": 9999,
|
|
||||||
"customization": False,
|
|
||||||
"end_date": "2099-01-01T23:59:59.000Z",
|
|
||||||
"light": "False",
|
|
||||||
"mode": "",
|
|
||||||
"portal_count": "0",
|
|
||||||
"process": 2,
|
|
||||||
"ssbranding": False,
|
|
||||||
"test": "False",
|
|
||||||
"trial": "False",
|
|
||||||
"user_quota": "0",
|
|
||||||
"users_count": 9999,
|
|
||||||
"users_expire": 99999,
|
|
||||||
"whiteLabel": False,
|
|
||||||
"customer_id": "customerID",
|
|
||||||
"start_date": "2020-01-01T00:00:00.000Z",
|
|
||||||
"users": [],
|
|
||||||
"version": 2
|
|
||||||
}
|
|
||||||
|
|
||||||
jsonData = codecs.encode(json.dumps(license, separators=(',', ':')), encoding='utf-8')
|
|
||||||
|
|
||||||
digest = SHA.new(jsonData)
|
|
||||||
signer = PKCS1_v1_5.new(privKey)
|
|
||||||
signature = signer.sign(digest)
|
|
||||||
finalSignature = signature.hex()
|
|
||||||
|
|
||||||
license['signature'] = finalSignature
|
|
||||||
|
|
||||||
f = open("/var/www/onlyoffice/license.lic", "w+")
|
|
||||||
f.write(json.dumps(license))
|
|
||||||
f.close
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def patch_files():
|
|
||||||
basePath = "/var/www/onlyoffice/documentserver/server/"
|
|
||||||
files = ["DocService/docservice", "FileConverter/converter"]
|
|
||||||
|
|
||||||
for file in files:
|
|
||||||
f = open(basePath + file, 'rb')
|
|
||||||
data = f.read()
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
replacedData = data.replace(b"-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRhGF7X4A0ZVlEg594WmODVVUI\niiPQs04aLmvfg8SborHss5gQXu0aIdUT6nb5rTh5hD2yfpF2WIW6M8z0WxRhwicg\nXwi80H1aLPf6lEPPLvN29EhQNjBpkFkAJUbS8uuhJEeKw0cE49g80eBBF4BCqSL6\nPFQbP9/rByxdxEoAIQIDAQAB\n-----END PUBLIC KEY-----", bytes(publKey))
|
|
||||||
|
|
||||||
f = open(basePath + file, 'wb')
|
|
||||||
f.write(replacedData)
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print("Generating and exporting key pair...")
|
|
||||||
publKey, privKey = gen_keys()
|
|
||||||
|
|
||||||
print("Writing license file...")
|
|
||||||
write_license(publKey, privKey)
|
|
||||||
|
|
||||||
print("Patching document server and converter...")
|
|
||||||
patch_files()
|
|
||||||
Reference in New Issue
Block a user