[GH-ISSUE #509] Set static secret key #245

Closed
opened 2026-02-26 10:31:17 +03:00 by kerem · 7 comments
Owner

Originally created by @hari-bo on GitHub (Oct 10, 2022).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/509

For the connection with Nextcloud i'm using the secret key which can be found with;
docker exec [name or id docker container] /var/www/onlyoffice/documentserver/npm/json -f /etc/onlyoffice/documentserver/local.json 'services.CoAuthoring.secret.session.string'

But when the container is deployed with a new version the secret keys changes so Nexclout will be disconnected.

I can't find to set a static secret key. Is there a envorionment variable for this?

Originally created by @hari-bo on GitHub (Oct 10, 2022). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/509 For the connection with Nextcloud i'm using the secret key which can be found with; docker exec [name or id docker container] /var/www/onlyoffice/documentserver/npm/json -f /etc/onlyoffice/documentserver/local.json 'services.CoAuthoring.secret.session.string' But when the container is deployed with a new version the secret keys changes so Nexclout will be disconnected. I can't find to set a static secret key. Is there a envorionment variable for this?
kerem 2026-02-26 10:31:17 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@ShockwaveNN commented on GitHub (Oct 10, 2022):

Hi, I think it's done by design, so users who already connected to some document lost connection during update

Without that - users with old front-end scripts may be connected to new version of back-end and something unpredictable should happen

In any way we strongly advice run documentserver-prepare4shutdown.sh before any operation with documentsever, so all users save all data and nothing is lost

<!-- gh-comment-id:1272965354 --> @ShockwaveNN commented on GitHub (Oct 10, 2022): Hi, I think it's done by design, so users who already connected to some document lost connection during update Without that - users with old front-end scripts may be connected to new version of back-end and something unpredictable should happen In any way we strongly advice run [`documentserver-prepare4shutdown.sh`](https://helpcenter.onlyoffice.com/installation/docs-community-update-linux.aspx) before any operation with documentsever, so all users save all data and nothing is lost
Author
Owner

@tobylibo commented on GitHub (Oct 12, 2022):

I had the same problem.

The secret key will be restored each time when I restart Docker container.

As a result, Nextcloud was unable to successfully connect onlyoffice. I had to manually re-check the new secret key, and then re-enter it to connect.

I also want to set static secret key.

<!-- gh-comment-id:1275632946 --> @tobylibo commented on GitHub (Oct 12, 2022): I had the same problem. The secret key will be restored each time when I restart Docker container. As a result, Nextcloud was unable to successfully connect onlyoffice. I had to manually re-check the new secret key, and then re-enter it to connect. I also want to set static secret key.
Author
Owner

@ShockwaveNN commented on GitHub (Oct 12, 2022):

Whoops, I may be wrong before

Are you meaning JWT key?

You know you can use docker env JWT_KEY to set it statically

<!-- gh-comment-id:1275648949 --> @ShockwaveNN commented on GitHub (Oct 12, 2022): Whoops, I may be wrong before Are you meaning JWT key? You know you can use docker env [`JWT_KEY`](https://github.com/ONLYOFFICE/Docker-DocumentServer#available-configuration-parameters) to set it statically
Author
Owner

@tobylibo commented on GitHub (Oct 12, 2022):

@ShockwaveNN Thank you very much. The way you told me is right.

Adding environment variables:

JWT_ENABLED=false
When nextcloud connects to onlyoffice, you do not need to enter a JWT key

or

JWT_SECRET=<your own JWT key>
The JWT key will NOT be restored each time when you restart Docker container.

Maybe help you @hari-bo

<!-- gh-comment-id:1275663067 --> @tobylibo commented on GitHub (Oct 12, 2022): @ShockwaveNN Thank you very much. The way you told me is right. Adding environment variables: `JWT_ENABLED=false` When nextcloud connects to onlyoffice, you do not need to enter a JWT key or `JWT_SECRET=<your own JWT key>` The JWT key will NOT be restored each time when you restart Docker container. Maybe help you @hari-bo
Author
Owner

@ShockwaveNN commented on GitHub (Oct 12, 2022):

And please note that we strongly advice do not disable JWT, since it may lead to vulnerabilities

<!-- gh-comment-id:1275669984 --> @ShockwaveNN commented on GitHub (Oct 12, 2022): And please note that we strongly advice do not disable JWT, since it may lead to vulnerabilities
Author
Owner

@igwyd commented on GitHub (Dec 28, 2023):

@ShockwaveNN Thank you very much. The way you told me is right.

Adding environment variables:

JWT_ENABLED=false When nextcloud connects to onlyoffice, you do not need to enter a JWT key

or

JWT_SECRET=<your own JWT key> The JWT key will NOT be restored each time when you restart Docker container.

Maybe help you @hari-bo

You are right, JWT_SECRET env set a constant JWT key, and after restart the container it is not cnange.
I close this issue. Feel free to comment or reopen it if you got further questions.

<!-- gh-comment-id:1871315910 --> @igwyd commented on GitHub (Dec 28, 2023): > @ShockwaveNN Thank you very much. The way you told me is right. > > Adding environment variables: > > `JWT_ENABLED=false` When nextcloud connects to onlyoffice, you do not need to enter a JWT key > > or > > `JWT_SECRET=<your own JWT key>` The JWT key will NOT be restored each time when you restart Docker container. > > Maybe help you @hari-bo You are right, ```JWT_SECRET``` env set a constant JWT key, and after restart the container it is not cnange. I close this issue. Feel free to comment or reopen it if you got further questions.
Author
Owner

@Rita-Bubnova commented on GitHub (Dec 28, 2023):

I close this issue. Feel free to comment or reopen it if you got further questions.

<!-- gh-comment-id:1871317621 --> @Rita-Bubnova commented on GitHub (Dec 28, 2023): I close this issue. Feel free to comment or reopen it if you got further questions.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#245
No description provided.