Compare commits
No commits in common. "6.2.0.123" and "main" have entirely different histories.
11 changed files with 557 additions and 302 deletions
34
.forgejo/bin/check_ver.sh
Executable file
34
.forgejo/bin/check_ver.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
# expects the following env variables:
|
||||
# downstream: downstream repo
|
||||
|
||||
repo=${downstream/*\/}
|
||||
|
||||
curl --silent $downstream/binary-amd64/Packages > Packages
|
||||
|
||||
owned_by_you=$(awk -F ': ' '{if($1=="Package"){print $2}}' Packages | sort | uniq)
|
||||
|
||||
echo "Found $(printf '%s\n' $owned_by_you | wc -l ) packages"
|
||||
|
||||
rm -f out_of_date not_in_anitya
|
||||
|
||||
for pkg in $owned_by_you; do
|
||||
upstream_version=$(curl --fail -X GET -sS -H 'Content-Type: application/json' "https://release-monitoring.org/api/v2/packages/?name=$pkg&distribution=Debian" | jq -r '.items.[].stable_version')
|
||||
downstream_version=$(sed -n "/^Package: $pkg$/,/^$/p" Packages| awk -F ': ' '{if($1=="Version"){print $2 }}' | sort -V | tail -n 1)
|
||||
downstream_version=${downstream_version/-*}
|
||||
|
||||
echo $upstream_version
|
||||
echo $downstream_version
|
||||
|
||||
if [ -z "$upstream_version" ]; then
|
||||
echo "$pkg not in anitya"
|
||||
echo "$pkg" >> not_in_anitya
|
||||
elif [ "$downstream_version" != "$(printf '%s\n' $upstream_version $downstream_version | sort -V | head -n 1)" ]; then
|
||||
echo "$pkg higher downstream"
|
||||
continue
|
||||
elif [ "$upstream_version" != "$downstream_version" ]; then
|
||||
echo "$pkg upstream version $upstream_version does not match downstream version $downstream_version"
|
||||
echo "$pkg $downstream_version $upstream_version $repo" >> out_of_date
|
||||
fi
|
||||
done
|
165
.forgejo/bin/create_issue.sh
Executable file
165
.forgejo/bin/create_issue.sh
Executable file
|
@ -0,0 +1,165 @@
|
|||
#!/bin/bash
|
||||
|
||||
# expects:
|
||||
# env variable FORGEJO_TOKEN
|
||||
# file out_of_date
|
||||
|
||||
IFS='
|
||||
'
|
||||
repo=${downstream/*\/}
|
||||
|
||||
does_it_exist() {
|
||||
name=$1
|
||||
downstream_version=$2
|
||||
upstream_version=$3
|
||||
repo=$4
|
||||
|
||||
query="$repo/$name: upgrade to $upstream_version"
|
||||
query="$(echo $query | sed 's| |%20|g' | sed 's|:|%3A|g' | sed 's|/|%2F|g' )"
|
||||
|
||||
result="$(curl --silent -X 'GET' \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \
|
||||
-H 'accept: application/json' \
|
||||
-H "authorization: Basic $FORGEJO_TOKEN"
|
||||
)"
|
||||
|
||||
if [ "$result" == "[]" ]; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
is_it_old() {
|
||||
name=$1
|
||||
downstream_version=$2
|
||||
upstream_version=$3
|
||||
repo=$4
|
||||
|
||||
query="$repo/$name: upgrade to"
|
||||
query="$(echo $query | sed 's| |%20|g' | sed 's|:|%3A|g' | sed 's|/|%2F|g' )"
|
||||
|
||||
result="$(curl --silent -X 'GET' \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \
|
||||
-H 'accept: application/json' \
|
||||
-H "authorization: Basic $FORGEJO_TOKEN"
|
||||
)"
|
||||
|
||||
result_title="$(echo $result | jq -r '.[].title' )"
|
||||
result_id="$(echo $result | jq -r '.[].number' )"
|
||||
result_upstream_version="$(echo $result_title | awk '{print $4}')"
|
||||
|
||||
if [ "$upstream_version" != "$result_upstream_version" ]; then
|
||||
echo $result_id
|
||||
else
|
||||
echo 0
|
||||
fi
|
||||
}
|
||||
|
||||
update_title() {
|
||||
name=$1
|
||||
downstream_version=$2
|
||||
upstream_version=$3
|
||||
repo=$4
|
||||
id=$5
|
||||
|
||||
result=$(curl --silent -X 'PATCH' \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$id" \
|
||||
-H 'accept: application/json' \
|
||||
-H "authorization: Basic $FORGEJO_TOKEN" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "{
|
||||
\"title\": \"$repo/$name: upgrade to $upstream_version\"
|
||||
}"
|
||||
)
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
create_issue() {
|
||||
name=$1
|
||||
downstream_version=$2
|
||||
upstream_version=$3
|
||||
repo=$4
|
||||
|
||||
result=$(curl --silent -X 'POST' \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \
|
||||
-H 'accept: application/json' \
|
||||
-H "authorization: Basic $FORGEJO_TOKEN" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "{
|
||||
\"title\": \"$repo/$name: upgrade to $upstream_version\",
|
||||
\"labels\": [
|
||||
$LABEL_NUMBER
|
||||
]
|
||||
}")
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ -f out_of_date ]; then
|
||||
out_of_date="$(cat out_of_date)"
|
||||
|
||||
echo "Detected $(wc -l out_of_date) out-of-date packages, creating issues"
|
||||
|
||||
for pkg in $out_of_date; do
|
||||
name="$(echo $pkg | awk '{print $1}')"
|
||||
downstream_version="$(echo $pkg | awk '{print $2}')"
|
||||
upstream_version="$(echo $pkg | awk '{print $3}')"
|
||||
repo="$(echo $pkg | awk '{print $4}')"
|
||||
|
||||
if does_it_exist $name $downstream_version $upstream_version $repo; then
|
||||
echo "Issue for $repo/$name already exists"
|
||||
continue
|
||||
fi
|
||||
|
||||
id=$(is_it_old $name $downstream_version $upstream_version $repo)
|
||||
|
||||
if [ "$id" != "0" ] && [ -n "$id" ]; then
|
||||
echo "Issue for $repo/$name needs updating"
|
||||
update_title $name $downstream_version $upstream_version $repo $id
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Creating issue for $repo/$name"
|
||||
create_issue $name $downstream_version $upstream_version $repo
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -f not_in_anitya ]; then
|
||||
query="Add missing $repo packages to anitya"
|
||||
query="$(echo $query | sed 's| |%20|g')"
|
||||
|
||||
result="$(curl --silent -X 'GET' \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \
|
||||
-H 'accept: application/json' \
|
||||
-H "authorization: Basic $FORGEJO_TOKEN"
|
||||
)"
|
||||
|
||||
if [ "$result" == "[]" ]; then
|
||||
echo "Creating anitya issue"
|
||||
result=$(curl --silent -X 'POST' \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \
|
||||
-H 'accept: application/json' \
|
||||
-H "authorization: Basic $FORGEJO_TOKEN" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "{
|
||||
\"title\": \"Add missing $repo packages to anitya\",
|
||||
\"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\",
|
||||
\"labels\": [
|
||||
$LABEL_NUMBER
|
||||
]
|
||||
}")
|
||||
|
||||
else
|
||||
echo "Updating anitya issue"
|
||||
result_id="$(echo $result | jq -r '.[].number' )"
|
||||
result=$(curl --silent -X 'PATCH' \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$result_id" \
|
||||
-H 'accept: application/json' \
|
||||
-H "authorization: Basic $FORGEJO_TOKEN" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "{
|
||||
\"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\"
|
||||
}"
|
||||
)
|
||||
fi
|
||||
fi
|
24
.forgejo/workflows/check-pkg.yml
Normal file
24
.forgejo/workflows/check-pkg.yml
Normal file
|
@ -0,0 +1,24 @@
|
|||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
check-user:
|
||||
name: Check user repo
|
||||
runs-on: x86_64
|
||||
container:
|
||||
image: alpine:latest
|
||||
env:
|
||||
downstream: https://forge.ilot.io/api/packages/ilot/debian/dists/jammy/main
|
||||
FORGEJO_TOKEN: ${{ secrets.forgejo_token }}
|
||||
LABEL_NUMBER: 4
|
||||
steps:
|
||||
- name: Environment setup
|
||||
run: apk add grep coreutils gawk curl wget bash nodejs git jq sed
|
||||
- name: Get scripts
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Check out-of-date packages
|
||||
run: ${{ github.workspace }}/.forgejo/bin/check_ver.sh
|
||||
- name: Create issues
|
||||
run: ${{ github.workspace }}/.forgejo/bin/create_issue.sh
|
76
.forgejo/workflows/release-build.yaml
Normal file
76
.forgejo/workflows/release-build.yaml
Normal file
|
@ -0,0 +1,76 @@
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
release-build:
|
||||
runs-on: x86_64
|
||||
container:
|
||||
image: ubuntu:22.04
|
||||
env:
|
||||
pkgver: 8.3.3
|
||||
buildno: 21
|
||||
qtver: 5.15.3
|
||||
steps:
|
||||
- name: Environment setup
|
||||
run: |
|
||||
cat /etc/os-release
|
||||
apt-get update
|
||||
apt-get install -y git make g++ bzip2 sudo patch python2 curl lsb-release p7zip-full qtbase5-dev debhelper clang-14 lld-14
|
||||
# node version set in build_tools/scripts/build_server variable pkg_target
|
||||
curl -sL https://deb.nodesource.com/setup_16.x | bash -
|
||||
apt-get install -y nodejs
|
||||
npm install -g pkg grunt grunt-cli
|
||||
- name: Getting patches
|
||||
uses: actions/checkout@v4
|
||||
- name: Fetching sources
|
||||
run: |
|
||||
git clone https://github.com/ONLYOFFICE/DocumentServer --recursive -b v$pkgver build
|
||||
git clone https://github.com/ONLYOFFICE/build_tools.git -b v$pkgver.$buildno build/build_tools
|
||||
git clone https://github.com/ONLYOFFICE/document-server-integration -b v$pkgver.$buildno build/document-server-integration
|
||||
git clone https://github.com/ONLYOFFICE/document-templates -b v$pkgver.$buildno build/document-templates
|
||||
git clone https://github.com/ONLYOFFICE/onlyoffice.github.io build/onlyoffice.github.io
|
||||
git clone https://github.com/ONLYOFFICE/document-server-package.git -b v$pkgver.$buildno build/document-server-package
|
||||
- name: Applying patches
|
||||
run: |
|
||||
cd build
|
||||
git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-use-system-clang.patch
|
||||
git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/disable-licensing-limits.patch
|
||||
git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_common-officefileformatchecker2-add-limits-include.patch
|
||||
- name: Development setup
|
||||
run: |
|
||||
mkdir -p build/build_tools/system_qt-$qtver/gcc_64
|
||||
ln -s /usr/lib/x86_64-linux-gnu build/build_tools/system_qt-$qtver/gcc_64/lib
|
||||
ln -s /usr/lib/x86_64-linux-gnu/qt5/bin build/build_tools/system_qt-$qtver/gcc_64/bin
|
||||
ln -s /usr/lib/x86_64-linux-gnu/qt5/plugins build/build_tools/system_qt-$qtver/gcc_64/plugins
|
||||
cd build/build_tools/tools/linux
|
||||
python2 ./deps.py
|
||||
- name: Build server
|
||||
run: |
|
||||
cd build/build_tools
|
||||
python2 ./configure.py --update 0 --module "server" --qt-dir $(pwd)/system_qt-$qtver
|
||||
python2 ./make.py
|
||||
- name: Build package
|
||||
run: |
|
||||
cd build/document-server-package
|
||||
PRODUCT_VERSION=$pkgver BUILD_NUMBER=$buildno make deb
|
||||
- name: Package upload
|
||||
uses: forgejo/upload-artifact@v3
|
||||
with:
|
||||
name: documentserver-deb
|
||||
path: build/document-server-package/deb/onlyoffice-documentserver_*.deb
|
||||
release-deploy:
|
||||
needs: [release-build]
|
||||
runs-on: x86_64
|
||||
container:
|
||||
image: alpine:latest
|
||||
steps:
|
||||
- name: Setting up environment
|
||||
run: apk add nodejs curl
|
||||
- name: Package download
|
||||
uses: forgejo/download-artifact@v3
|
||||
- name: Package deployment
|
||||
run: curl --user ${{ vars.FORGE_REPO_USER }}:${{ secrets.FORGE_REPO_PRIVKEY }} --upload-file */onlyoffice-documentserver_*.deb https://forge.ilot.io/api/packages/ilot/debian/pool/jammy/main/upload
|
||||
|
||||
|
61
.forgejo/workflows/test-build.yaml
Normal file
61
.forgejo/workflows/test-build.yaml
Normal file
|
@ -0,0 +1,61 @@
|
|||
on:
|
||||
pull_request:
|
||||
types: [ assigned, opened, synchronize, reopened ]
|
||||
|
||||
jobs:
|
||||
test-build:
|
||||
runs-on: x86_64
|
||||
container:
|
||||
image: ubuntu:22.04
|
||||
env:
|
||||
pkgver: 8.2.2
|
||||
buildno: 22
|
||||
qtver: 5.15.3
|
||||
steps:
|
||||
- name: Environment setup
|
||||
run: |
|
||||
cat /etc/os-release
|
||||
apt-get update
|
||||
apt-get install -y git make g++ bzip2 sudo patch python2 curl lsb-release p7zip-full qtbase5-dev debhelper clang-14 lld-14
|
||||
curl -sL https://deb.nodesource.com/setup_16.x | bash -
|
||||
apt-get install -y nodejs
|
||||
npm install -g pkg grunt grunt-cli
|
||||
- name: Getting patches
|
||||
uses: actions/checkout@v4
|
||||
- name: Fetching sources
|
||||
run: |
|
||||
git clone https://github.com/ONLYOFFICE/DocumentServer --recursive -b v$pkgver build
|
||||
git clone https://github.com/ONLYOFFICE/build_tools.git -b v$pkgver.$buildno build/build_tools
|
||||
git clone https://github.com/ONLYOFFICE/document-server-integration -b v$pkgver.$buildno build/document-server-integration
|
||||
git clone https://github.com/ONLYOFFICE/document-templates -b v$pkgver.$buildno build/document-templates
|
||||
git clone https://github.com/ONLYOFFICE/onlyoffice.github.io build/onlyoffice.github.io
|
||||
git clone https://github.com/ONLYOFFICE/document-server-package.git -b v$pkgver.$buildno build/document-server-package
|
||||
- name: Applying patches
|
||||
run: |
|
||||
cd build
|
||||
git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-use-system-clang.patch
|
||||
git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/disable-licensing-limits.patch
|
||||
- name: Development setup
|
||||
run: |
|
||||
mkdir -p build/build_tools/system_qt-$qtver/gcc_64
|
||||
ln -s /usr/lib/x86_64-linux-gnu build/build_tools/system_qt-$qtver/gcc_64/lib
|
||||
ln -s /usr/lib/x86_64-linux-gnu/qt5/bin build/build_tools/system_qt-$qtver/gcc_64/bin
|
||||
ln -s /usr/lib/x86_64-linux-gnu/qt5/plugins build/build_tools/system_qt-$qtver/gcc_64/plugins
|
||||
cd build/build_tools/tools/linux
|
||||
python2 ./deps.py
|
||||
- name: Build server
|
||||
run: |
|
||||
cd build/build_tools
|
||||
python2 ./configure.py --update 0 --module "server" --qt-dir $(pwd)/system_qt-$qtver
|
||||
python2 ./make.py
|
||||
- name: Build package
|
||||
run: |
|
||||
cd build/document-server-package
|
||||
PRODUCT_VERSION=$pkgver BUILD_NUMBER=$buildno make deb
|
||||
- name: Package upload
|
||||
uses: forgejo/upload-artifact@v3
|
||||
with:
|
||||
name: documentserver-deb
|
||||
path: build/document-server-package/deb/onlyoffice-documentserver_*.deb
|
||||
|
||||
|
66
Dockerfile
66
Dockerfile
|
@ -1,66 +0,0 @@
|
|||
## Build stage
|
||||
ARG product_version=6.2.0
|
||||
ARG build_number=123
|
||||
ARG oo_root='/var/www/onlyoffice/documentserver'
|
||||
|
||||
FROM onlyoffice/documentserver:${product_version}.${build_number} as build-stage
|
||||
ARG product_version
|
||||
ARG build_number
|
||||
ARG oo_root
|
||||
|
||||
ENV PRODUCT_VERSION=${product_version}
|
||||
ENV BUILD_NUMBER=${build_number}
|
||||
|
||||
# Mobile apps patching
|
||||
ARG me_search='isSupportEditFeature:function(){return!1}'
|
||||
ARG me_patch='s/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g'
|
||||
|
||||
RUN grep -q "${me_search}" ${oo_root}/web-apps/apps/documenteditor/mobile/app.js \
|
||||
&& sed -si "${me_patch}" ${oo_root}/web-apps/apps/documenteditor/mobile/app.js
|
||||
|
||||
RUN grep -q "${me_search}" ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js \
|
||||
&& sed -si "${me_patch}" ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js
|
||||
|
||||
RUN grep -q "${me_search}" ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js \
|
||||
&& sed -si "${me_patch}" ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js
|
||||
|
||||
|
||||
# Rebuild with license checks replaced
|
||||
ARG build_deps="git make g++ nodejs npm"
|
||||
RUN apt-get update && apt-get install -y ${build_deps}
|
||||
|
||||
ARG tag=v${product_version}.${build_number}
|
||||
RUN mkdir /build \
|
||||
&& git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/build_tools.git /build/build_tools \
|
||||
&& git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/server.git /build/server
|
||||
|
||||
|
||||
WORKDIR /build/server
|
||||
|
||||
RUN npm install -g pkg grunt grunt-cli
|
||||
|
||||
COPY license.patch /build/
|
||||
RUN git apply /build/license.patch
|
||||
|
||||
RUN make \
|
||||
&& pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter --targets=node10-linux -o /build/converter \
|
||||
&& pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/DocService --targets=node10-linux --options max_old_space_size=4096 -o /build/docservice \
|
||||
&& cp /build/converter ${oo_root}/server/FileConverter/converter \
|
||||
&& cp /build/docservice ${oo_root}/server/DocService/docservice
|
||||
|
||||
|
||||
## Prod image
|
||||
FROM onlyoffice/documentserver:${product_version}.${build_number}
|
||||
ARG oo_root
|
||||
|
||||
COPY --from=build-stage ${oo_root}/web-apps/apps/documenteditor/mobile/app.js \
|
||||
${oo_root}/web-apps/apps/documenteditor/mobile/app.js
|
||||
COPY --from=build-stage ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js \
|
||||
${oo_root}/web-apps/apps/presentationeditor/mobile/app.js
|
||||
COPY --from=build-stage ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js \
|
||||
${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js
|
||||
|
||||
COPY --from=build-stage ${oo_root}/server/FileConverter/converter \
|
||||
${oo_root}/server/FileConverter/converter
|
||||
COPY --from=build-stage ${oo_root}/server/DocService/docservice \
|
||||
${oo_root}/server/DocService/docservice
|
99
README.md
99
README.md
|
@ -1,93 +1,22 @@
|
|||
# OnlyOffice Community server with license
|
||||
# onlyoffice-document-server
|
||||
Upstream: https://forge.ilot.io/ilot/onlyoffice-document-server
|
||||
|
||||
## Description
|
||||
|
||||
## Usage
|
||||
This repository contains the necessary workflows to build onlyoffice-document-server
|
||||
from source, and produce a usable Debian package. The build process also allows
|
||||
introducing patches for ilot's application.
|
||||
|
||||
### Podman CLI
|
||||
## How to use
|
||||
|
||||
```sh
|
||||
podman run \
|
||||
--name=onlyoffice \
|
||||
--detach \
|
||||
--publish=80:80 \
|
||||
docker.io/alehoho/oo-ce-docker-license
|
||||
```
|
||||
Follow the instruction the guide on [OnlyOffice's docs](https://helpcenter.onlyoffice.com/installation/docs-community-install-ubuntu.aspx).
|
||||
Instead of adding their repository, use ilot's by following the instructions [here](https://forge.ilot.io/ilot/-/packages/debian/onlyoffice-documentserver)
|
||||
|
||||
### Docker CLI
|
||||
## Support
|
||||
|
||||
```sh
|
||||
docker run \
|
||||
--name=onlyoffice \
|
||||
--detach \
|
||||
--publish=80:80 \
|
||||
alehoho/oo-ce-docker-license
|
||||
```
|
||||
As these aports are built for ilot's own application, we make no guarantees that
|
||||
they will work for you.
|
||||
|
||||
### docker-compose.yml
|
||||
## License
|
||||
This readme, workflows and support scripts are licensed under MIT License.
|
||||
|
||||
```yml
|
||||
services:
|
||||
onlyoffice:
|
||||
container_name: onlyoffice
|
||||
image: alehoho/oo-ce-docker-license
|
||||
ports:
|
||||
- "80"
|
||||
```
|
||||
|
||||
|
||||
## Build
|
||||
|
||||
### Buildah CLI
|
||||
|
||||
```sh
|
||||
buildah build-using-dockerfile \
|
||||
--tag=onlyoffice-patched \
|
||||
https://github.com/aleho/onlyoffice-ce-docker-license.git
|
||||
```
|
||||
|
||||
### Docker CLI
|
||||
|
||||
```sh
|
||||
docker build \
|
||||
--tag=onlyoffice-patched \
|
||||
https://github.com/aleho/onlyoffice-ce-docker-license.git
|
||||
```
|
||||
|
||||
|
||||
### 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
|
||||
Recently, just about a month after Nextcloud announced their partnership with
|
||||
Ascensio and featuring a community version of OnlyOffice, the latter decided
|
||||
to remove support for mobile editing of documents via the Nextcloud app.
|
||||
|
||||
This happened without any prior notice and alienated quite a lot of home users,
|
||||
who would now be forced to pay more than €1.000 to unlock that previously free
|
||||
feature. Only after some outcries Ascensio deigned to release a statement and
|
||||
a new, albeit "limited", offer of €90 for home servers.
|
||||
|
||||
In my opinion these deceptive practices are unacceptable for a company
|
||||
advertising itself and their product as open source.
|
||||
|
||||
|
||||
## Thanks
|
||||
|
||||
This repo was heavily inspired by the works of
|
||||
[Zegorax/OnlyOffice-Unlimited](https://github.com/Zegorax/OnlyOffice-Unlimited).
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
diff --git a/core/Common/OfficeFileFormatChecker2.cpp b/core/Common/OfficeFileFormatChecker2.cpp
|
||||
index d2887d78..43c28a0b 100644
|
||||
--- a/core/Common/OfficeFileFormatChecker2.cpp
|
||||
+++ b/core/Common/OfficeFileFormatChecker2.cpp
|
||||
@@ -44,6 +44,7 @@
|
||||
|
||||
#include "3dParty/pole/pole.h"
|
||||
#include <algorithm>
|
||||
+#include <limits>
|
||||
|
||||
#include "OfficeFileFormatDefines.h"
|
||||
|
12
core_v8-use-system-clang.patch
Normal file
12
core_v8-use-system-clang.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
--- a/build_tools/scripts/core_common/modules/v8_89.py
|
||||
+++ b/build_tools/scripts/core_common/modules/v8_89.py
|
||||
@@ -48,6 +48,8 @@ def make_args(args, platform, is_64=True, is_debug=False):
|
||||
|
||||
if (platform == "linux"):
|
||||
args_copy.append("is_clang=true")
|
||||
+ args_copy.append("clang_base_path=\\\"/usr/lib/llvm-14\\\"")
|
||||
+ args_copy.append("clang_use_chrome_plugins=false")
|
||||
args_copy.append("use_sysroot=false")
|
||||
if (platform == "windows"):
|
||||
args_copy.append("is_clang=false")
|
||||
|
159
disable-licensing-limits.patch
Normal file
159
disable-licensing-limits.patch
Normal file
|
@ -0,0 +1,159 @@
|
|||
From 5ee269eef8bd02d066151deaa4d8c0fe6b6cbce4 Mon Sep 17 00:00:00 2001
|
||||
Patch-Source: https://github.com/xbeeant/onlyoffice-ce-docker-license
|
||||
From: xbeeant
|
||||
Date: Tue, 15 Nov 2022 01:04:46 -0500
|
||||
Subject: onlyoffice-ce-docker-license
|
||||
|
||||
This patches OnlyOffice Docs server with mobile editing enabled in the
|
||||
Nextcloud apps for an unlimited amount of concurrent users.
|
||||
|
||||
Background: Just about two months after Nextcloud released their partnership
|
||||
with Ascensio and featured a community version of OnlyOffice, the latter
|
||||
decided to remove support for mobile editing of documents. This affected the
|
||||
Nextcloud app, killing a feature that was previously marketed by both
|
||||
companies.
|
||||
|
||||
The changes were executed without any prior notice and alienated quite a lot of
|
||||
home users, who would now be forced to pay more than €1.000 to unlock that
|
||||
previously free feature. Only after some outcries Ascensio deigned to release a
|
||||
statement and a new, albeit "limited", offer of €90 for home servers. This
|
||||
offer has since expired and their licensing tier suggests current licenses are
|
||||
valid for one year, starting at about €140.
|
||||
|
||||
In my opinion these deceptive practices of advertising a feature only to take
|
||||
it away are unacceptable for a company presenting itself and their products as
|
||||
open source.
|
||||
|
||||
---
|
||||
|
||||
diff --git a/server/DocService/sources/server.js b/server/DocService/sources/server.js
|
||||
index 76303af9..9d2e6888 100644
|
||||
--- a/server/DocService/sources/server.js
|
||||
+++ b/server/DocService/sources/server.js
|
||||
@@ -129,7 +129,7 @@ if (!(cfgTokenEnableBrowser && cfgTokenEnableRequestInbox && cfgTokenEnableReque
|
||||
}
|
||||
|
||||
updateLicense();
|
||||
-fs.watchFile(cfgLicenseFile, updateLicense);
|
||||
+// fs.watchFile(cfgLicenseFile, updateLicense);
|
||||
setInterval(updateLicense, 86400000);
|
||||
|
||||
try {
|
||||
|
||||
diff --git a/server/Makefile b/server/Makefile
|
||||
index e8e1308f..23f7e2ef 100644
|
||||
--- a/server/Makefile
|
||||
+++ b/server/Makefile
|
||||
@@ -87,7 +87,7 @@ DEBUG = $(BRANDING_DIR)/debug.js
|
||||
.PHONY: all clean install uninstall build-date
|
||||
|
||||
.NOTPARALLEL:
|
||||
-all: $(SPELLCHECKER_DICTIONARIES) $(TOOLS) $(SCHEMA) $(CORE_FONTS) $(DOCUMENT_TEMPLATES) $(LICENSE) $(WELCOME) $(INFO) build-date
|
||||
+all: $(SCHEMA) $(LICENSE) $(WELCOME) $(INFO) build-date
|
||||
|
||||
build-date: $(GRUNT_FILES)
|
||||
sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS)
|
||||
diff --git a/web-apps/apps/documenteditor/mobile/src/lib/patch.jsx b/web-apps/apps/documenteditor/mobile/src/lib/patch.jsx
|
||||
index 963aca451..1ee48e856 100644
|
||||
--- a/web-apps/apps/documenteditor/mobile/src/lib/patch.jsx
|
||||
+++ b/web-apps/apps/documenteditor/mobile/src/lib/patch.jsx
|
||||
@@ -4,7 +4,7 @@ const EditorUIController = () => {
|
||||
};
|
||||
|
||||
EditorUIController.isSupportEditFeature = () => {
|
||||
- return false
|
||||
+ return true
|
||||
};
|
||||
|
||||
EditorUIController.getToolbarOptions = () => {
|
||||
diff --git a/web-apps/apps/presentationeditor/mobile/src/lib/patch.jsx b/web-apps/apps/presentationeditor/mobile/src/lib/patch.jsx
|
||||
index ec7b37a2c..bfd879583 100644
|
||||
--- a/web-apps/apps/presentationeditor/mobile/src/lib/patch.jsx
|
||||
+++ b/web-apps/apps/presentationeditor/mobile/src/lib/patch.jsx
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
const EditorUIController = () => null;
|
||||
|
||||
-EditorUIController.isSupportEditFeature = () => false;
|
||||
+EditorUIController.isSupportEditFeature = () => true;
|
||||
|
||||
export default EditorUIController;
|
||||
diff --git a/web-apps/apps/spreadsheeteditor/mobile/src/lib/patch.jsx b/web-apps/apps/spreadsheeteditor/mobile/src/lib/patch.jsx
|
||||
index ec7b37a2c..bfd879583 100644
|
||||
--- a/web-apps/apps/spreadsheeteditor/mobile/src/lib/patch.jsx
|
||||
+++ b/web-apps/apps/spreadsheeteditor/mobile/src/lib/patch.jsx
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
const EditorUIController = () => null;
|
||||
|
||||
-EditorUIController.isSupportEditFeature = () => false;
|
||||
+EditorUIController.isSupportEditFeature = () => true;
|
||||
|
||||
export default EditorUIController;
|
||||
diff --git a/server/Common/sources/constants.js b/server/Common/sources/constants.js
|
||||
index 700696ff..d8bb9178 100644
|
||||
--- a/server/Common/sources/constants.js
|
||||
+++ b/server/Common/sources/constants.js
|
||||
@@ -87,8 +87,8 @@ exports.LICENSE_RESULT = {
|
||||
NotBefore: 16
|
||||
};
|
||||
|
||||
-exports.LICENSE_CONNECTIONS = 20;
|
||||
-exports.LICENSE_USERS = 3;
|
||||
+exports.LICENSE_CONNECTIONS = 999999;
|
||||
+exports.LICENSE_USERS = 999999;
|
||||
exports.LICENSE_EXPIRE_USERS_ONE_DAY = 24 * 60 * 60; // day in seconds
|
||||
|
||||
exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000;
|
||||
diff --git a/server/FileConverter/sources/convertermaster.js b/server/FileConverter/sources/convertermaster.js
|
||||
index 2209e8c9..feef6247 100644
|
||||
--- a/server/FileConverter/sources/convertermaster.js
|
||||
+++ b/server/FileConverter/sources/convertermaster.js
|
||||
@@ -90,7 +90,7 @@ if (cluster.isMaster) {
|
||||
|
||||
updateLicense();
|
||||
|
||||
- fs.watchFile(cfgLicenseFile, updateLicense);
|
||||
+ // fs.watchFile(cfgLicenseFile, updateLicense);
|
||||
setInterval(updateLicense, 86400000);
|
||||
} else {
|
||||
const converter = require('./converter');
|
||||
diff --git a/server/Common/sources/license.js b/server/Common/sources/license.js
|
||||
index d43ee210..9e787b08 100644
|
||||
--- a/server/Common/sources/license.js
|
||||
+++ b/server/Common/sources/license.js
|
||||
@@ -44,24 +44,24 @@ exports.readLicense = async function () {
|
||||
return [{
|
||||
count: 1,
|
||||
type: c_LR.Success,
|
||||
- packageType: constants.PACKAGE_TYPE_OS,
|
||||
+ packageType: constants.PACKAGE_TYPE_I,
|
||||
mode: constants.LICENSE_MODE.None,
|
||||
- branding: false,
|
||||
+ branding: true,
|
||||
connections: constants.LICENSE_CONNECTIONS,
|
||||
connectionsView: constants.LICENSE_CONNECTIONS,
|
||||
- customization: false,
|
||||
- advancedApi: false,
|
||||
- usersCount: 0,
|
||||
- usersViewCount: 0,
|
||||
+ customization: true,
|
||||
+ advancedApi: true,
|
||||
+ usersCount: constants.LICENSE_CONNECTIONS,
|
||||
+ usersViewCount: constants.LICENSE_CONNECTIONS,
|
||||
usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY,
|
||||
- hasLicense: false,
|
||||
+ hasLicense: true,
|
||||
buildDate: oBuildDate,
|
||||
startDate: startDate,
|
||||
- endDate: null,
|
||||
+ endDate: new Date("2099-01-01T23:59:59.000Z"),
|
||||
customerId: "",
|
||||
- alias: "",
|
||||
+ alias: "community",
|
||||
multitenancy: false
|
||||
}, null];
|
||||
};
|
||||
|
||||
-exports.packageType = constants.PACKAGE_TYPE_OS;
|
||||
+exports.packageType = constants.PACKAGE_TYPE_I;
|
151
license.patch
151
license.patch
|
@ -1,151 +0,0 @@
|
|||
From 11b275653eb1961c7392aa1badd1a29a09bcfda0 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Hofbauer <alex@derhofbauer.at>
|
||||
Date: Sun, 27 Dec 2020 21:49:37 +0100
|
||||
Subject: [PATCH] Patch for license
|
||||
|
||||
---
|
||||
Common/sources/commondefines.js | 4 ++--
|
||||
Common/sources/constants.js | 2 +-
|
||||
Common/sources/license.js | 16 ++++++++--------
|
||||
DocService/sources/DocsCoServer.js | 5 +++--
|
||||
DocService/sources/server.js | 1 -
|
||||
FileConverter/sources/convertermaster.js | 1 -
|
||||
Makefile | 2 +-
|
||||
7 files changed, 15 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js
|
||||
index 2a38911..25b8608 100644
|
||||
--- a/Common/sources/commondefines.js
|
||||
+++ b/Common/sources/commondefines.js
|
||||
@@ -992,8 +992,8 @@ const c_oAscUnlockRes = {
|
||||
Empty: 2
|
||||
};
|
||||
|
||||
-const buildVersion = '4.1.2';
|
||||
-const buildNumber = 37;
|
||||
+const buildVersion = '6.2.0';
|
||||
+const buildNumber = 123;
|
||||
|
||||
exports.TaskQueueData = TaskQueueData;
|
||||
exports.CMailMergeSendData = CMailMergeSendData;
|
||||
diff --git a/Common/sources/constants.js b/Common/sources/constants.js
|
||||
index 2b79e02..738df37 100644
|
||||
--- a/Common/sources/constants.js
|
||||
+++ b/Common/sources/constants.js
|
||||
@@ -70,7 +70,7 @@ exports.LICENSE_RESULT = {
|
||||
ExpiredLimited: 11
|
||||
};
|
||||
|
||||
-exports.LICENSE_CONNECTIONS = 20;
|
||||
+exports.LICENSE_CONNECTIONS = 9999;
|
||||
exports.LICENSE_EXPIRE_USERS_ONE_DAY = 24 * 60 * 60; // day in seconds
|
||||
|
||||
exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000;
|
||||
diff --git a/Common/sources/license.js b/Common/sources/license.js
|
||||
index 19f0b61..fb20c21 100644
|
||||
--- a/Common/sources/license.js
|
||||
+++ b/Common/sources/license.js
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
const constants = require('./constants');
|
||||
|
||||
-const buildDate = '6/29/2016';
|
||||
+const buildDate = '2021-03-01T12:10:00.000Z';
|
||||
const oBuildDate = new Date(buildDate);
|
||||
|
||||
exports.readLicense = function*() {
|
||||
@@ -43,17 +43,17 @@ exports.readLicense = function*() {
|
||||
count: 1,
|
||||
type: c_LR.Success,
|
||||
light: false,
|
||||
- packageType: constants.PACKAGE_TYPE_OS,
|
||||
+ packageType: constants.PACKAGE_TYPE_I,
|
||||
mode: constants.LICENSE_MODE.None,
|
||||
branding: false,
|
||||
connections: constants.LICENSE_CONNECTIONS,
|
||||
- customization: false,
|
||||
+ customization: true,
|
||||
usersCount: 0,
|
||||
- usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY,
|
||||
- hasLicense: false,
|
||||
- plugins: false,
|
||||
+ usersExpire: new Date("2099-01-01T23:59:59.000Z").getTime() / 1000,
|
||||
+ hasLicense: true,
|
||||
+ plugins: true,
|
||||
buildDate: oBuildDate,
|
||||
- endDate: null
|
||||
+ endDate: "2099-01-01T23:59:59.000Z"
|
||||
};
|
||||
};
|
||||
-exports.packageType = constants.PACKAGE_TYPE_OS;
|
||||
+exports.packageType = constants.PACKAGE_TYPE_I;
|
||||
diff --git a/DocService/sources/DocsCoServer.js b/DocService/sources/DocsCoServer.js
|
||||
index bd209ea..9151489 100644
|
||||
--- a/DocService/sources/DocsCoServer.js
|
||||
+++ b/DocService/sources/DocsCoServer.js
|
||||
@@ -103,6 +103,7 @@ const pubsubService = require('./pubsubRabbitMQ');
|
||||
const queueService = require('./../../Common/sources/taskqueueRabbitMQ');
|
||||
const rabbitMQCore = require('./../../Common/sources/rabbitMQCore');
|
||||
const activeMQCore = require('./../../Common/sources/activeMQCore');
|
||||
+const license = require('./../../Common/sources/license');
|
||||
|
||||
const editorDataStorage = require('./' + configCommon.get('services.CoAuthoring.server.editorDataStorage'));
|
||||
let cfgEditor = JSON.parse(JSON.stringify(config.get('editor')));
|
||||
@@ -162,7 +163,7 @@ let connections = []; // Активные соединения
|
||||
let lockDocumentsTimerId = {};//to drop connection that can't unlockDocument
|
||||
let pubsub;
|
||||
let queue;
|
||||
-let licenseInfo = {type: constants.LICENSE_RESULT.Error, light: false, branding: false, customization: false, plugins: false};
|
||||
+let licenseInfo = license.readLicense().next().value;
|
||||
let shutdownFlag = false;
|
||||
|
||||
const MIN_SAVE_EXPIRATION = 60000;
|
||||
@@ -2976,7 +2977,7 @@ exports.install = function(server, callbackFunction) {
|
||||
});
|
||||
};
|
||||
exports.setLicenseInfo = function(data) {
|
||||
- licenseInfo = data;
|
||||
+ logger.debug('Not updating license info', data)
|
||||
};
|
||||
exports.getLicenseInfo = function() {
|
||||
return licenseInfo;
|
||||
diff --git a/DocService/sources/server.js b/DocService/sources/server.js
|
||||
index b623759..29574bd 100644
|
||||
--- a/DocService/sources/server.js
|
||||
+++ b/DocService/sources/server.js
|
||||
@@ -129,7 +129,6 @@ try {
|
||||
} catch (e) {
|
||||
logger.warn('Failed to subscribe to plugin folder updates. When changing the list of plugins, you must restart the server. https://nodejs.org/docs/latest/api/fs.html#fs_availability');
|
||||
}
|
||||
-fs.watchFile(configCommon.get('license').get('license_file'), updateLicense);
|
||||
setInterval(updateLicense, 86400000);
|
||||
|
||||
// Если захочется использовать 'development' и 'production',
|
||||
diff --git a/FileConverter/sources/convertermaster.js b/FileConverter/sources/convertermaster.js
|
||||
index c246bb8..9fe3d41 100644
|
||||
--- a/FileConverter/sources/convertermaster.js
|
||||
+++ b/FileConverter/sources/convertermaster.js
|
||||
@@ -85,7 +85,6 @@ if (cluster.isMaster) {
|
||||
|
||||
updateLicense();
|
||||
|
||||
- fs.watchFile(configCommon.get('license').get('license_file'), updateLicense);
|
||||
setInterval(updateLicense, 86400000);
|
||||
} else {
|
||||
const converter = require('./converter');
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 40bf93e..1df9c10 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -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: $(SCHEMA) $(LICENSE) $(WELCOME) $(INFO) build-date
|
||||
|
||||
build-date: $(GRUNT_FILES)
|
||||
sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS)
|
||||
--
|
||||
2.30.2
|
||||
|
Loading…
Add table
Reference in a new issue