Code Monkey home page Code Monkey logo

Comments (10)

aleho avatar aleho commented on May 28, 2024 1

I'm aware that there's a new release. Actually I had a tag and update pushed, but I reverted to the previous version.

Updating the patches to work is easy, but either something changed or the container is broken, but I was not able to use a spreadsheet, neither in mobile app nor Nextcloud webinterface integrated version.

Did not have time to investigate further as the current version is working fine and the changes are minor.

from onlyoffice-ce-docker-license.

gituser avatar gituser commented on May 28, 2024

@kikislater it's easy to upgrade just alter the version in the Dockerfile and also change the version inside the license.patch file, then build the docker.

from onlyoffice-ce-docker-license.

kikislater avatar kikislater commented on May 28, 2024

Yes, just to notify ...
Related PR : #13

from onlyoffice-ce-docker-license.

kikislater avatar kikislater commented on May 28, 2024

They change something like path or files ...

Step 20/30 : RUN npm install -g pkg grunt grunt-cli
 ---> Running in 4c6f89a963b0
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt/bin/grunt
/usr/local/bin/pkg -> /usr/local/lib/node_modules/pkg/lib-es5/bin.js
+ [email protected]
+ [email protected]
+ [email protected]
added 325 packages from 240 contributors in 121.965s
Removing intermediate container 4c6f89a963b0
 ---> fd6097470891
Step 21/30 : COPY license.patch /build/
 ---> b6de8ccbe7de
Step 22/30 : RUN git apply /build/license.patch
 ---> Running in 1613baf6566b
error: patch failed: DocService/sources/server.js:129
error: DocService/sources/server.js: patch does not apply
error: patch failed: Makefile:83
error: Makefile: patch does not apply
The command '/bin/sh -c git apply /build/license.patch' returned a non-zero code: 1

from onlyoffice-ce-docker-license.

gituser avatar gituser commented on May 28, 2024

For me this version works fine.

However I'm not using docker.

I simply grabbed the onlyoffice source code, this repository, checked out the relevant revision, applied the patches from same as in Dockerfile and replaced binaries in installed debian packages.

This is what I've adjusted in this repository:

 git diff
diff --git a/license.patch b/license.patch
index d29c69f..9d61aeb 100644
--- a/license.patch
+++ b/license.patch
@@ -23,8 +23,8 @@ index 694a13a..b2b2e9b 100644
  
 -const buildVersion = '4.1.2';
 -const buildNumber = 37;
-+const buildVersion = '6.1.0';
-+const buildNumber = 83;
++const buildVersion = '6.1.1';^M
++const buildNumber = 53;^M
  
  exports.TaskQueueData = TaskQueueData;
  exports.CMailMergeSendData = CMailMergeSendData;

Here is my script I'm using to patch already installed debian package (script is one level up from the checked out repo):

#!/bin/bash

## Build stage
product_version=6.1.1
build_number=53
oo_root='/var/www/onlyoffice/documentserver'

export PRODUCT_VERSION=${product_version}
export BUILD_NUMBER=${build_number}
WORKDIR=/home/build

# Mobile apps patching
me_search='isSupportEditFeature:function(){return!1}'
me_patch='s/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g'

function patch_oo() {
# stop oo
sudo /etc/init.d/supervisor stop
# Update root
sudo -u ds cp $WORKDIR/server/converter ${oo_root}/server/FileConverter/converter
sudo -u ds cp $WORKDIR/server/docservice ${oo_root}/server/DocService/docservice
grep -q "${me_search}" ${oo_root}/web-apps/apps/documenteditor/mobile/app.js \
  && sudo -u ds sed -si "${me_patch}" ${oo_root}/web-apps/apps/documenteditor/mobile/app.js

grep -q "${me_search}" ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js \
  && sudo -u ds sed -si "${me_patch}" ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js

grep -q "${me_search}" ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js \
  && sudo -u ds sed -si "${me_patch}" ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js

# start oo
sudo /etc/init.d/supervisor start
}

# Rebuild with license checks replaced
#build_deps="git make g++ nodejs npm"
#apt-get update && apt-get install -y ${build_deps}

function build_oo() {
  tag=v${product_version}.${build_number}
  [ ! -d build_tools ] && git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/build_tools.git ./build_tools || (cd build_tools && git fetch origin refs/tags/$tag:refs/tags/$tag && git reset --hard $tag)
  [ ! -d server ] && git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/server.git ./server || (cd server && git fetch origin refs/tags/$tag:refs/tags/$tag && git reset --hard $tag)

  #WORKDIR./server
  cd $WORKDIR/server

# do as root once!
# npm install -g pkg grunt grunt-cli

  git apply ../onlyoffice-ce-docker-license/license.patch

  make && pkg /home/build/build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter --targets=node10-linux -o ./converter \
  && pkg /home/build/build_tools/out/linux_64/onlyoffice/documentserver/server/DocService --targets=node10-linux --options max_old_space_size=4096 -o ./docservice 
  if [ "$?" != 0 ]; then
     echo "[-] Build failed!"
     exit 1
  fi
}

build_oo
patch_oo

NOTE: make sure the user from which you will run this script (in my case it's build) has the sudo access to ds user and can start/stop supervisor, you can put this in /etc/sudoers.d/build:

# allow build to start commands from ds
build	ALL=(ds) NOPASSWD:ALL

# allow build to stop, restart supervisor
Cmnd_Alias RESTART = /etc/init.d/supervisor stop,/etc/init.d/supervisor start,/etc/init.d/supervisor restart
build ALL=(root)      NOPASSWD: RESTART

Also make sure to chmod 0440 /etc/sudoers.d/build.

In new version you need to specify externalHost in /etc/onlyoffice/documentserver/production-linux.json like this:

{
  "log": {
    "filePath": "/etc/onlyoffice/documentserver/log4js/production.json"
  },
  "storage": {
    "fs": {
      "folderPath": "/var/lib/onlyoffice/documentserver/App_Data/cache/files"
    },
    "externalHost": "https://xxx.com"
  },
....
}

Otherwise you will get an error: file loading failed or something like this, because it tries to load from local ip or ip inside the docker (most likely).

from onlyoffice-ce-docker-license.

aleho avatar aleho commented on May 28, 2024

@gituser You don't event have to "use" a docker image to pull its files. So you could basically just pull the 5 files from an image, if you have the docker client (or podman) installed.

from onlyoffice-ce-docker-license.

gituser avatar gituser commented on May 28, 2024

@aleho I understand that I can download docker image, but I prefer to build from the source code and apply on top of the installed package.

I don't like docker because of the logs management, layers and some other complicated stuff, especially updates.

from onlyoffice-ce-docker-license.

aleho avatar aleho commented on May 28, 2024

Then non-root, daemon-less podman might be an option.

from onlyoffice-ce-docker-license.

gituser avatar gituser commented on May 28, 2024

@aleho, sure it's just a matter of personal preference, I'm using LXC containers at the moment.

Nonetheless, 6.1.1.53 should work just fine with your patch.

from onlyoffice-ce-docker-license.

aleho avatar aleho commented on May 28, 2024

I was able to reproduce my failures tonight. Strange. Maybe I mistyped a command and accidentally tagged an outdated local container as upstream, which resulted in it starting from the wrong release? Can't say for sure.

Anyways, new version pushed.

from onlyoffice-ce-docker-license.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.