Aurora Corporate documentation

Office document editor - advanced configuration

This documentation page covers advanced configuration and troubleshooting guidelines for Office document editor.

NB: upon making any changes to configuration files, be sure to restart OnlyOffice Docs services with supervisorctl restart all command. Also, make sure to backup all the configuration files before and after making changes; there's a chance some of the configuration files may get overwritten during the upgrade.

Note that if you use LetsEncrypt certificates, you may need to restart Nginx to apply changes when certificate gets updated. One of the ways to do so is to add the following to crontab -e:

0 0 1 * *       supervisorctl restart all

Setting up token protection

By default, installation of OnlyOffice Docs is available over the web to anyone. If you wish to restrict access so that OnlyOffice Docs can only be accessed from your Aurora Corporate installation, you need to enable token-based protection. That's done by editing /etc/onlyoffice/documentserver/local.json file as follows:

{
  "services": {
    "CoAuthoring": {
      "sql": {
        "type": "postgres",
        "dbHost": "localhost",
        "dbPort": "5432",
        "dbName": "onlyoffice",
        "dbUser": "onlyoffice",
        "dbPass": "onlyoffice"
      },
      "token": {
        "enable": {
          "request": {
            "inbox": true,
            "outbox": true
          },
          "browser": true
        },
        "inbox": {
          "header": "Authorization"
        },
        "outbox": {
          "header": "Authorization"
        }
      },
      "secret": {
        "inbox": {
          "string": "secret"
        },
        "outbox": {
          "string": "secret"
        },
        "session": {
          "string": "secret"
        },
        "browser": {
          "string": "secret"
        }
      }
    }
  },
  "rabbitmq": {
    "url": "amqp://guest:guest@localhost"
  }
}

The changes we're making to this file are:

  1. Setting "inbox", "outbox" and "browser" to true in "token" section;
  2. "header" is set to "Authorization" for both "inbox" and "outbox";
  3. We also need to specify "secret" key value. It's the same value supplied for "inbox", "outbox", "session" and "browser". For example:
  "secret": {
    "inbox": {
      "string": "someSecretValue"
    },
    "outbox": {
      "string": "someSecretValue"
    },
    "session": {
      "string": "someSecretValue"
    },
    "browser": {
      "string": "someSecretValue"
    },
  }

Technical details on this are explained here.

You will need to supply the same Secret in data/settings/modules/OfficeDocumentEditor.config.json configuration file.

Decrease delay after document editing is done

When you've completed editing the document and closed the editor, it takes a few seconds to convert the edited file into the internal format, and an additional delay is used, 5 seconds by default. The delay is necessary to allow to return to the file editing session without the file saving, e.g. when reloading the browser page with the file opened for editing.

If you want to change the value of extra delay, you can use local.json file where all the edited parameters are stored (see the example in the previous section). It's important to retain the correct hierarchy for the property you're editing. In this particular case, the hierarchy would be as follows:

{
    "services": {
        "CoAuthoring": {
            "server": {
                "savetimeoutdelay": 5000
            }
        }
    }
}

Technical details on this are explained here.

Configuring OnlyOffice Docs with non-standard port

If you choose to have Aurora Corporate and OnlyOffice Docs installed on the same server (without Docker used), we recommend to check these guidelines.