Issue setting '"prefix": "JWT"' in local.json

Document Server version: 8.3.3.1 Community version
Type of installation of the Document Server : Docker - Recently updated Updating ONLYOFFICE Docs for Docker to the latest version

OS: Linux host running docker 28

Hello,

Forgive me if this is a bad question as I’m new to OnlyOffice (as of this morning)

I am a devops engingeer and have recently updated OnlyOffice to version 3.8.8.1 by following the update documentation here Updating ONLYOFFICE Docs for Docker to the latest version

I have a docker-compose file we use to manage the docker install/configuration which has environment variables set for JWT_SECRET and JWT_HEADER. We use our own secret and not the autogenerated one.

I tested the update but had an issue downloading files where I got a 401 and a 500 errors.

I discovered that this was due to a missing value from /etc/onlyoffice/documentserver/local.json

As a test I manually added the "prefix": "JWT" value to local.json, restarted the container and the issue resolved.

  "token": {
    "enable": {
      "request": {
        "inbox": true,
        "outbox": true
      },
      "browser": true
    },
    "inbox": {
      "header": "MyApp-Authorization",
      "prefix": "JWT",
      "inBody": false
    },
    "outbox": {
      "header": "MyApp-Authorization",
      "prefix": "JWT",
      "inBody": false
    }

My question is can this be set via an environment variable in my docker-compose file like the other JWT values, or is there another way to set this value? I really don’t want to manually edit this file each time I deploy or update as everything else is automated/scripted.

If I have no other option but to do it manually, what’s the best way to manage this? I understand I can’t update default.json but I’m concerned if I manually update local.json, I will overwrite some things that OO controls like the private keys.

Appreciate any help!

Hello @devhops

Unfortunately, there is no variable that allows specifying this parameter. As a workaround, you can create another config called local-production-linux.json on host, define all your custom parameters in it strictly according to JSON structure and mount it into /etc/onlyoffice/documentserver directory.

Please use this config for your custom values, do not create and mount custom local.json, use the naming I’ve provided.

1 Like

Thank you, I will give this a try and report back

1 Like

This worked flawlessly.

For anyone encountering the same issue, you only need to add the parameters you wish to change into the new file, then have docker mount it into the container.

{
  "services": {
    "CoAuthoring": {
      "token": {
        "enable": {
          "request": {
            "inbox": true,
            "outbox": true
          },
          "browser": true
        },
        "inbox": {
          "header": "Custom-Authorization",
          "prefix": "JWT",
          "inBody": false
        },
        "outbox": {
          "header": "Custom-Authorization",
          "prefix": "JWT",
          "inBody": false
          }
        }
      }
    }
}