Aurora Files 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

Starting from version 7.2, OnlyOffice installs with JWT-compatible token protection enabled by default, otherwise installation would be available over the web to anyone. To obtain the autogenerated secret, check the Welcome screen of your OnlyOffice installation. In case of Ubuntu/Debian installation, it's shown as follows:

OnlyOffice JWT protection

Make sure the matching "Secret" value is supplied in data/settings/modules/OfficeDocumentEditor.config.json file.

Token-based protection is enabled in /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"
  }
}

Note that the following changes are made to enable the token-based protection:

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

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 Files and OnlyOffice Docs installed on the same server (without Docker used), we recommend to check these guidelines.