{"id":552,"date":"2020-06-13T05:59:11","date_gmt":"2020-06-12T21:59:11","guid":{"rendered":"https:\/\/freeapp.sbs\/blog\/?p=552"},"modified":"2025-04-01T16:44:37","modified_gmt":"2025-04-01T07:44:37","slug":"n9qsngkpszqt87p","status":"publish","type":"post","link":"https:\/\/eternalsphere.net\/echoes\/index.php\/2020\/06\/13\/n9qsngkpszqt87p\/","title":{"rendered":"Nextcloud ONLYOFFICE integration app"},"content":{"rendered":"<p>\u539f\u6587\uff1a<a href=\"https:\/\/api.onlyoffice.com\/editors\/nextcloud\">https:\/\/api.onlyoffice.com\/editors\/nextcloud<\/a><\/p>\n<p>This\u00a0<a href=\"https:\/\/github.com\/ONLYOFFICE\/onlyoffice-nextcloud\" target=\"_blank\" rel=\"noopener noreferrer\">app<\/a>\u00a0enables users to edit office documents from\u00a0<a href=\"https:\/\/nextcloud.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Nextcloud<\/a>\u00a0using ONLYOFFICE Document Server. Currently the following document formats can be edited with this app: csv, docx, pptx, txt, xlsx. The above mentioned formats are also available for viewing together with pdf. The edited files of the corresponding type can be converted into the Office Open XML formats: doc, docm, dot, dotx, epub, htm, html, odp, odt, pot, potm, potx, pps, ppsm, ppsx, ppt, pptm, rtf, xls, xlsm, xlsx, xlt, xltm, xltx.<\/p>\n<p>The app will create an item in the\u00a0<em>new<\/em>\u00a0(+) menu to create\u00a0<b>Document<\/b>,\u00a0<b>Spreadsheet<\/b>,\u00a0<b>Presentation<\/b>. It will also create a new\u00a0<b>Open in ONLYOFFICE<\/b>\u00a0menu option within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to Nextcloud.<\/p>\n<p>You can also use our\u00a0<a href=\"https:\/\/github.com\/ONLYOFFICE\/docker-onlyoffice-nextcloud\" target=\"_blank\" rel=\"noopener noreferrer\">Docker installation<\/a>\u00a0to get installed and configured Document Server and Nextcloud installation with a couple of commands.<\/p>\n<p>The latest connector signed versions are available in the official store for\u00a0<a href=\"https:\/\/apps.nextcloud.com\/apps\/onlyoffice\" target=\"_blank\" rel=\"noopener noreferrer\">Nextcloud<\/a>.<\/p>\n<h2 id=\"install-doc\" class=\"copy-link\">Installing ONLYOFFICE Document Server<\/h2>\n<p>You will need an instance of ONLYOFFICE Document Server that is resolvable and connectable both from Nextcloud and any end clients (version 4.2.7 and later are supported for use with the app). If that is not the case, use the official ONLYOFFICE Document Server documentation page:\u00a0<a href=\"https:\/\/helpcenter.onlyoffice.com\/server\/linux\/document\/linux-installation.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">Document Server for Linux<\/a>. ONLYOFFICE Document Server must also be able to POST to Nextcloud directly.<\/p>\n<p>Starting with version 4.3.0, ONLYOFFICE Document Server and Nextcloud can be installed either on different computers, or on the same machine. In case you select the latter variant, you will need to set up a custom port for Document Server as by default both ONLYOFFICE Document Server and Nextcloud work on port 80. Or you can use Document Server behind a proxy, please refer to\u00a0<a href=\"https:\/\/helpcenter.onlyoffice.com\/server\/document\/document-server-proxy.aspx\">this article<\/a>\u00a0to learn how you can configure it.<\/p>\n<p>The easiest way to start an instance of ONLYOFFICE Document Server is to use\u00a0<a href=\"https:\/\/github.com\/ONLYOFFICE\/Docker-DocumentServer\" target=\"_blank\" rel=\"noopener noreferrer\">Docker<\/a>.<\/p>\n<h2 id=\"install\" class=\"copy-link\">Installing Nextcloud ONLYOFFICE integration app<\/h2>\n<p>The Nextcloud administrator can install the integration app from the in-built application market. For that go to the user name and select\u00a0<b>Apps<\/b>. After that find\u00a0<b>ONLYOFFICE<\/b>\u00a0in the list of available applications and install it.<\/p>\n<p>If the server with the Nextcloud installed does not have an Internet access, or if you need it for some other reason, the administrator can install the application manually. To start using ONLYOFFICE Document Server with Nextcloud, the following steps must be performed:<\/p>\n<ol>\n<li>Go to the Nextcloud server\u00a0<em>apps\/<\/em>\u00a0directory (or some other directory\u00a0<a href=\"https:\/\/docs.nextcloud.com\/server\/stable\/admin_manual\/apps_management.html#using-custom-app-directories\" target=\"_blank\" rel=\"noopener noreferrer\">used<\/a>\u00a0to connect applications):<span class=\"commandline\">cd apps\/<\/span><\/li>\n<li>Get the Nextcloud ONLYOFFICE integration app. There are several ways to do that:\n<ol>\n<li>Download the latest signed version from the official store for\u00a0<a href=\"https:\/\/apps.nextcloud.com\/apps\/onlyoffice\" target=\"_blank\" rel=\"noopener noreferrer\">Nextcloud<\/a>.<\/li>\n<li>Or you can download the latest signed version from the application\u00a0<a href=\"https:\/\/github.com\/ONLYOFFICE\/onlyoffice-nextcloud\/releases\" target=\"_blank\" rel=\"noopener noreferrer\">release page<\/a>\u00a0on GitHub.<\/li>\n<li>Or you can clone the application source code and compile it yourself:<span class=\"commandline\">git clone https:\/\/github.com\/ONLYOFFICE\/onlyoffice-nextcloud.git onlyoffice<\/span><\/li>\n<\/ol>\n<\/li>\n<li>Change the owner to update the application right from Nextcloud web interface:<span class=\"commandline\">chown -R www-data:www-data onlyoffice<\/span><\/li>\n<li>In Nextcloud open the\u00a0<span class=\"fakelink\">~\/index.php\/settings\/apps?category=disabled<\/span>\u00a0page with\u00a0<em>Not enabled<\/em>\u00a0apps by administrator and click\u00a0<em>Enable<\/em>\u00a0for the\u00a0<b>ONLYOFFICE<\/b>\u00a0application.<\/li>\n<\/ol>\n<h2 id=\"settings\" class=\"copy-link\">Configuring Nextcloud ONLYOFFICE integration app<\/h2>\n<p>In Nextcloud open the\u00a0<span class=\"fakelink\">~\/index.php\/settings\/admin#onlyoffice<\/span>\u00a0page with administrative settings for\u00a0<b>ONLYOFFICE<\/b>\u00a0section. Enter the following address to connect ONLYOFFICE Document Server:<\/p>\n<p><span class=\"commandline\">https:\/\/&lt;documentserver&gt;\/<\/span><\/p>\n<p>Where the\u00a0<b>documentserver<\/b>\u00a0is the name of the server with the ONLYOFFICE Document Server installed. The address must be accessible for the user browser and from the Nextcloud server. The Nextcloud server address must also be accessible from ONLYOFFICE Document Server for correct work.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/api.onlyoffice.com\/content\/img\/editor\/nextcloud-local.jpg\" alt=\"Local\" \/><\/p>\n<p id=\"internalUrl\">Sometimes your network configuration might not allow the requests between installed Nextcloud and ONLYOFFICE Document Server using the public addresses. The\u00a0<em>Advanced server settings<\/em>\u00a0allows to set the ONLYOFFICE Document Server address for internal requests from Nextcloud server and the returning Nextcloud address for the internal requests from ONLYOFFICE Document Server. You need to enter them in the appropriate fields.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/api.onlyoffice.com\/content\/img\/editor\/nextcloud-public.jpg\" alt=\"Public\" \/><\/p>\n<p>To restrict the access to ONLYOFFICE Document Server and for security reasons and data integrity the encrypted signature is used. Specify the\u00a0<em>Secret key<\/em>\u00a0in the Nextcloud administrative configuration. In the ONLYOFFICE Document Server\u00a0<a href=\"https:\/\/api.onlyoffice.com\/editors\/signature\">config file<\/a>\u00a0specify the same secret key and enable the validation.<\/p>\n<p>Enable or disable the\u00a0<em>Open file in the same tab<\/em>\u00a0setting.<\/p>\n<p>The\u00a0<b>Open in ONLYOFFICE<\/b>\u00a0action will be added to the file context menu. You can specify this action as default and it will be used when the file name is clicked for the selected file types.<\/p>\n<p id=\"editable\">ONLYOFFICE Document Server uses Office Open XML format as a basis when opening and editing files. If the file format is different from OOXML, it will still be converted to the corresponding OOXML for the document server proper work and faster performance. After that you can edit the file, making any changes available for the base OOXML format and save the file to this base OOXML format.<\/p>\n<p>In case the source Nextcloud file format was different from the base one, and you still want to save it to the original format, the file will be converted to this format from OOXML. As the formats are fundamentally different, some data (such as charts, tables, autoshapes or images) and formatting can be lost due to the simple reason that some formats (<em>csv<\/em>,\u00a0<em>txt<\/em>, etc.) do not support them or treat them differently than OOXML standard does. That is why all the non-OOXML files by default are opened for viewing only, although there is an option to convert the file in the context menu. If you realise the data\/formatting loss risks after the conversion, but still want to open non-OOXML files for editing, you can check them in the list in the settings. Editing for\u00a0<em>csv<\/em>\u00a0and\u00a0<em>txt<\/em>\u00a0files is available by default.<\/p>\n<h2 id=\"howitworks\" class=\"copy-link\">How it works<\/h2>\n<p>When creating a new file, the user navigates to a document folder within Nextcloud and clicks the\u00a0<b>Document<\/b>,\u00a0<b>Spreadsheet<\/b>\u00a0or\u00a0<b>Presentation<\/b>\u00a0item in the\u00a0<em>new<\/em>\u00a0(+) menu.<\/p>\n<p>The browser invokes the\u00a0<em>create<\/em>\u00a0method in the\u00a0<em>\/lib\/Controller\/EditorController.php<\/em>\u00a0controller. This method adds the copy of the file from the\u00a0<em>assets<\/em>\u00a0folder to the folder the user is currently in.<\/p>\n<p>Or, when opening an existing file, the user navigates to it within Nextcloud and selects the\u00a0<b>Open in ONLYOFFICE<\/b>\u00a0menu option.<\/p>\n<p>A new browser tab is opened and the\u00a0<em>index<\/em>\u00a0method of the\u00a0<em>\/lib\/Controller\/EditorController.php<\/em>\u00a0controller is invoked.<\/p>\n<p>The app prepares a JSON object with the following properties:<\/p>\n<ul>\n<li><b>url<\/b>\u00a0&#8211; the URL that ONLYOFFICE Document Server uses to download the document;<\/li>\n<li><b>callbackUrl<\/b>\u00a0&#8211; the URL that ONLYOFFICE Document Server informs about status of the document editing;<\/li>\n<li><b>key<\/b>\u00a0&#8211; the UUID+Modified Timestamp to instruct ONLYOFFICE Document Server whether to download the document again or not;<\/li>\n<li><b>title<\/b>\u00a0&#8211; the document Title (name);<\/li>\n<li><b>id<\/b>\u00a0&#8211; the identification of the user;<\/li>\n<li><b>name<\/b>\u00a0&#8211; the name of the user.<\/li>\n<\/ul>\n<p>Nextcloud takes this object and constructs a page from\u00a0<em>templates\/editor.php<\/em>\u00a0template, filling in all of those values so that the client browser can load up the editor.<\/p>\n<p>The client browser makes a request for the javascript library from ONLYOFFICE Document Server and sends ONLYOFFICE Document Server the DocEditor configuration with the above properties.<\/p>\n<p>Then ONLYOFFICE Document Server downloads the document from Nextcloud and the user begins editing.<\/p>\n<p>ONLYOFFICE Document Server sends a POST request to the\u00a0<em>callback<\/em>\u00a0URL to inform Nextcloud that a user is editing the document.<\/p>\n<p>When all users and client browsers are done with editing, they close the editing window.<\/p>\n<p>After\u00a0<a href=\"https:\/\/api.onlyoffice.com\/editors\/save#savedelay\">10 seconds<\/a>\u00a0of inactivity, ONLYOFFICE Document Server sends a POST to the\u00a0<em>callback<\/em>\u00a0URL letting Nextcloud know that the clients have finished editing the document and closed it.<\/p>\n<p>Nextcloud downloads the new version of the document, replacing the old one.<\/p>\n<h2 id=\"issue\" class=\"copy-link\">Known issues<\/h2>\n<ul>\n<li id=\"externalStorage\">Adding the storage using the\u00a0<b>External storages<\/b>\u00a0app has issues with the co-editing in some cases. If the connection is made using the same authorization keys (the\u00a0<em>Username and password<\/em>\u00a0or\u00a0<em>Global credentials<\/em>\u00a0authentication type is selected), then the co-editing is available for the users. If different authorization keys are used (<em>Log-in credentials, save in database<\/em>\u00a0or\u00a0<em>User entered, store in database<\/em>\u00a0authentication options), the co-editing is not available. When the\u00a0<em>Log-in credentials, save in session<\/em>\u00a0authentication type is used, the files cannot be opened in the editor.<\/li>\n<li id=\"masterKey\">Nextcloud provides an option to encrypt the file storage. But if the encryption with the\u00a0<em>per-user encryption keys<\/em>\u00a0(used by default in Nextcloud\u00a0<b>Default encryption module<\/b>\u00a0app) is enabled, ONLYOFFICE Document Server cannot open the encrypted files for editing and save them after the editing. The ONLYOFFICE section of the administrative settings page will display a notification about it. However if you set the encryption with the\u00a0<em>master key<\/em>, ONLYOFFICE application will work as intended. The instruction on enabling\u00a0<em>master key<\/em>\u00a0based encryption is available in the official documentation on\u00a0<a href=\"https:\/\/docs.nextcloud.com\/server\/latest\/admin_manual\/configuration_files\/encryption_configuration.html#occ-encryption-commands\" target=\"_blank\" rel=\"noopener noreferrer\">Nextcloud<\/a>\u00a0websites.\n<div class=\"note note-important\">\n<div class=\"note-important-label\">Please note<\/div>\n<p>Nextcloud recommends using\u00a0<em>master encryption key<\/em>\u00a0only on fresh installations with no existing data, or on systems where encryption has not already been enabled, as your files previously encrypted with the use of per-user encryption keys\u00a0<b>might be lost forever<\/b>\u00a0after you enable\u00a0<em>master key<\/em>\u00a0based encryption on them.<\/div>\n<\/li>\n<li id=\"verify_peer_off\">If you are using a self-signed certificate for your\u00a0<b>Document Server<\/b>, Nextcloud will not validate such a certificate and will not allow connection to\/from\u00a0<b>Document Server<\/b>. This issue can be solved the following way: locate the Nextcloud config file (<em>\/nextcloud\/config\/config.php<\/em>) and open it. Insert the following section to it:\n<pre class=\" hljs cs\"><span class=\"hljs-string\">'onlyoffice'<\/span> =&gt; array (\n    <span class=\"hljs-string\">'verify_peer_off'<\/span> =&gt; <span class=\"hljs-keyword\">true<\/span>\n)\n<\/pre>\n<p>This will disable the certificate verification and allow Nextcloud to establish connection with\u00a0<b>Document Server<\/b>, but you must remember that this is a temporary insecure solution and we strongly recommend that you replace the certificate with the one issued by some CA. Once you do that, do not forget to remove the above section from Nextcloud config file.<\/li>\n<li id=\"federated\">If the document is shared using the Federated Cloud Sharing app, the co-editing between the Nextcloud instances connected to different ONLYOFFICE servers will not be avaialble. The users from one and the same Document Server can edit the document in the co-editing mode, but the users from two (or more) different Document Servers will not be able to collaborate on the same document in real time.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Download the Nextcloud ONLYOFFICE integration app\u00a0<a href=\"https:\/\/github.com\/ONLYOFFICE\/onlyoffice-nextcloud\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\uff1ahttps:\/\/api.onlyoffice.com\/editors\/nextcloud This\u00a0app\u00a0enables users to edit office documents from\u00a0Nextcloud\u00a0using ONLYOFFICE Document Server. Currently the following document formats can be edited with this app: csv, docx, pptx, txt, xlsx. The above mentioned formats are also available for viewing together with pdf. The edited files of the corresponding type can be converted into &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-552","post","type-post","status-publish","format-standard","hentry","category-m3fjs7w9sd6njwr"],"_links":{"self":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/552","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/comments?post=552"}],"version-history":[{"count":1,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/552\/revisions"}],"predecessor-version":[{"id":2215,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/552\/revisions\/2215"}],"wp:attachment":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/media?parent=552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/categories?post=552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/tags?post=552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}