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

SSL encryption #43

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

SSL encryption #43

wants to merge 20 commits into from

Conversation

heatray
Copy link

@heatray heatray commented Sep 25, 2020

No description provided.

@heatray heatray changed the title Feature/ssl SSL encryption Sep 28, 2020
This was linked to issues Sep 28, 2020
@heatray heatray added the enhancement New feature or request label Sep 28, 2020
@heatray heatray marked this pull request as ready for review September 28, 2020 11:59
@agolybev agolybev removed the request for review from TatyaOO September 29, 2020 15:52
@heatray heatray linked an issue Feb 8, 2021 that may be closed by this pull request
@CLAassistant
Copy link

CLAassistant commented Mar 22, 2021

CLA assistant check
All committers have signed the CLA.

README.md Outdated
@@ -26,6 +26,13 @@ Document Server and Nextcloud Docker installation will install the preconfigured
docker-compose up -d
```

To enable SSL encryption, create `certs` folder and copy the private key named as `tls.key` and the certificate named as `tls.crt` to it.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a lot of context about how this works. Where should the certs folder be created? And where can I get the tls.key and tls.crt to copy?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in folder where docker-compose.yml and ssl.yml is

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Where can I find the tls.key and tls.cert? Do I need to generate those some where? Do I need to get them from letsencrypt?

Copy link
Author

@heatray heatray Apr 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you can get them from letsencrypt for your domain.
if you do not have your own domain, you can generate a self-signed certificate.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've spent a few hours trying to get a tls.key and tls.cert. The letsencrypt website told me to use certbot, so I installed that, and ran sudo certbot certonly --standalone, which generated some .pem files. I don't see any of the files you mentioned anywhere. I can't even find them in the certbot docs: https://certbot.eff.org/docs/search.html?q=tls.crt

Can you tell me what needs to be done to get these files?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put in certs fullchain.pem as tls.crt and privkey.pem as tls.key

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! It's working! <3 Thank you so much for your help!

For the sake of other people being able to follow the directions, it might be helpful to add a link to certbot directions and mention that the pem files should be renamed. I never would have guessed that.

This reverts commit 1b7f5bb.
README.md Outdated
@@ -26,6 +26,13 @@ Document Server and Nextcloud Docker installation will install the preconfigured
docker-compose up -d
```

To enable SSL encryption, create `certs` folder and copy the private key named as `tls.key` and the certificate named as `tls.crt` to it.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To enable SSL encryption, create `certs` folder and copy the private key named as `tls.key` and the certificate named as `tls.crt` to it.
To enable SSL encryption, first create a self-signed certificate or [get one from a certificate authority](https://certbot.eff.org/), then create a `certs` folder at the base of this repo and copy your certificate and private key files into it, naming them `tls.cert` and `tls.key`, respectively.

ssl_certificate_key /etc/nginx/certs/tls.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nextcloud's security warnings page (/index.php/settings/admin/overview) was complaining that the X-Frame-Options "SAMEORIGIN" header wasn't set. I'm not an nginx expert, so I'm not sure if this is the best place to add it, but adding this line here fixed the warning for me. For some reason, adding it in common.conf didn't seem to work.

Suggested change
add_header X-Frame-Options "SAMEORIGIN" always;

@localjo
Copy link

localjo commented Apr 18, 2021

It seems that with this setup, there is something still missing with the SSL config, that negates most of the benefits of having the document server installed.

The DocumentServer is unable to save changes to Nextcloud. Basically when the DocumentServer makes a request to http://nginx-server to save changes to Nextcloud, the response is a 400 error. With the default editor settings, this failure happens silently, and is only noticed because changes that happen in the web-based ONLYOFFICE editors never get saved back to Nextcloud, but changes directly in Nextcloud end up overwriting the unsaved changes in the ONLYOFFICE document server, potentially resulting in data loss. More details in https://github.com/ONLYOFFICE/DocumentServer/issues/1233

I think the solution is something related to making sure that the SSL certificates are working for internal requests between the document server and nextcloud, and that the certificates are installed on both containers. I spent several hours trying different variations, and haven't quite figured out the solution yet. This thread might have some hints https://help.nextcloud.com/t/warning-the-document-could-not-be-saved/26550

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

Successfully merging this pull request may close these issues.

Error opening version history in document if using SSL How to activate SSL? Having trouble setting up SSL
6 participants