Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashing due to automatic changing authorization method local.json and default.json #570

Open
SaschaMuehl opened this issue Jan 23, 2023 · 3 comments

Comments

@SaschaMuehl
Copy link

SaschaMuehl commented Jan 23, 2023

Do you want to request a feature or report a bug?
Bug (is also related to #556)

What is the current behavior?
After installation and testing the server sucessfully the jwt token isn't working anymore due to automatic changes (e.g. after restart of the container or the server, after approx. a day) in local.json and default.json.
After new installation or reconfiguration of the Docker-Container the server works well.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Installing Onlyoffice with JWT enabled in Linux Docker:
    docker run --name=ONLYOFFICEDOCKER -i -t -d -p 4433:443 -e JWT_ENABLED='true' -e JWT_SECRET='mypasswd' --restart=always -v logs:/var/log/onlyoffice -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data onlyoffice/documentserver

  2. Change values in installation i.a.w. https://helpcenter.onlyoffice.com/installation/docs-configure-jwt.aspx

    a. Open the Docker Container :    
    docker exec -it <dockernummer> /bin/sh
    b. set all values in “header” to: “AuthorizationJwt”  (before “Authorization”)    
    nano /etc/onlyoffice/documentserver/local.json
    c. set all value: “rejectUnauthorized” to false:
    nano /etc/onlyoffice/documentserver/default.json
    d. goto https://onlyoffice.xXx.de/ and start test example
    e. supervisorctl restart ds:example

  3. check, if https://onlyoffice.xXx.de/ works

  4. Start Test example

  5. Integrate server adress and JWT password in Nextcloud.

What is the expected behavior?
No automatic changes in local.json and default.json

Host Operating System:
Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-137-generic x86_64)
nginx version: nginx/1.23.3
PHP 8.1.14 (cli)

How can I tell the container to not change the authorization method?
The system tells me the ds:example is just for testing purposes only but how can I start my own production/environment? (eg. ds:myserver)

@SaschaMuehl
Copy link
Author

The problem still exists. Any suggestions?

@weasam
Copy link

weasam commented Jul 20, 2023

I'm using this for docker
docker run -i -t -d -p 8082:80 --restart=always -e JWT_SECRET=<my_secret_phrase> onlyoffice/documentserver

My situation is every time the docker restart it change my custom setting "AuthorizationJwt" back to "Authorization"
nano /etc/onlyoffice/documentserver/default.json
"Authorization" change to "AuthorizationJwt" both inbox & outbox line
This fixed my case when restart the docker without change /etc/onlyoffice/documentserver/local.json

In addiction, Another solution might be like this
docker run -i -t -d -p 127.0.0.1:8478:80 --restart=always
-e JWT_ENABLED=true
-e JWT_SECRET=<my_secret_phrase>
-e JWT_HEADER=AuthorizationJwt
-e JWT_IN_BODY=true
-v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data onlyoffice/documentserver

@SaschaMuehl
Copy link
Author

I'm using this for docker docker run -i -t -d -p 8082:80 --restart=always -e JWT_SECRET=<my_secret_phrase> onlyoffice/documentserver

My situation is every time the docker restart it change my custom setting "AuthorizationJwt" back to "Authorization"

nano /etc/onlyoffice/documentserver/default.json
"Authorization" change to "AuthorizationJwt" both inbox & outbox line
This fixed my case when restart the docker without change /etc/onlyoffice/documentserver/local.json
In addiction, Another solution might be like this docker run -i -t -d -p 127.0.0.1:8478:80 --restart=always -e JWT_ENABLED=true -e JWT_SECRET=<my_secret_phrase> -e JWT_HEADER=AuthorizationJwt -e JWT_IN_BODY=true -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data onlyoffice/documentserver

100% Same Problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants