rr- / szurubooru

Image board engine, Danbooru-style.
GNU General Public License v3.0
704 stars 178 forks source link

Install SSL Cert on Docker Szuru image? #511

Closed UsualVII closed 10 months ago

UsualVII commented 2 years ago

I've made it, a really clean install, but I have this Let's Encypt! certificate with ca_bundle.crt, certificate.crt and private.key, and I was wondering how to install it on my VPS IP (i've then fowarded that IP via A and C Name in a domain name)

Running on Ubuntu with Docker

neobooru commented 2 years ago

The easiest way to get this is to use a reverse proxy. There are a bazillion different ways to achieve this. This page (point 3 & 4) show you some possible configurations. Those however do not show how to add SSL/TLS, so if you have no experience with NGINX it is kinda tricky to get working.

If you tell me what you want your setup to look like then I can probably give you an example config. For example which http server you want to use, and if you want your site to be accessible from either http://example.com, or http://szuru.example.com, or http://example.com/szuru.

UsualVII commented 2 years ago

just https://example.com/

skybldev commented 1 year ago

If this issue is still up in the air, here's what you can do using NGINX:

  1. Create a config for your site. Don't worry about the cert yet. Just follow the config example from the bottom of this page: https://github.com/rr-/szurubooru/blob/master/doc/INSTALL.md and put it in /etc/nginx/sites-available
  2. Run sudo certbot --nginx. It will present you with a list of domains that it can activate HTTPS for. Choose the appropriate one, and let it do its thing. When it's done, you can go check on the config you just made and see Certbot's modifications to it. You should be ready to go.