You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
4.6 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :alt: License: AGPL-3
  3. =============================================
  4. Request SSL certificates from letsencrypt.org
  5. =============================================
  6. This module was written to have your Odoo installation request SSL certificates
  7. from https://letsencrypt.org automatically.
  8. Installation
  9. ============
  10. After installation, this module generates a private key for your account at
  11. letsencrypt.org automatically in ``$data_dir/letsencrypt/account.key``. If you
  12. want or need to use your own account key, replace the file.
  13. For certificate requests to work, your site needs to be accessible via plain
  14. HTTP, see below for configuration examples in case you force your clients to
  15. the SSL version.
  16. After installation, trigger the cronjob `Update letsencrypt certificates` and
  17. watch your log for messages.
  18. Configuration
  19. =============
  20. This addons requests a certificate for the domain named in the configuration
  21. parameter ``web.base.url`` - if this comes back as ``localhost`` or the like,
  22. the module doesn't request anything.
  23. If you want your certificate to contain multiple alternative names, just add
  24. them as configuration parameters ``letsencrypt.altname.N`` with ``N`` starting
  25. from ``0``. The amount of domains that can be added are subject to `rate
  26. limiting <https://community.letsencrypt.org/t/rate-limits-for-lets-encrypt/6769>`_.
  27. Note that all those domains must be publicly reachable on port 80 via HTTP, and
  28. they must have an entry for ``.well-known/acme-challenge`` pointing to your odoo
  29. instance.
  30. Usage
  31. =====
  32. The module sets up a cronjob that requests and renews certificates automatically.
  33. After the first run, you'll find a file called ``domain.crt`` in
  34. ``$datadir/letsencrypt``, configure your SSL proxy to use this file as certificate.
  35. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  36. :alt: Try me on Runbot
  37. :target: https://runbot.odoo-community.org/runbot/149/8.0
  38. For further information, please visit:
  39. * https://www.odoo.com/forum/help-1
  40. In depth configuration
  41. ======================
  42. This module uses ``openssl`` to generate CSRs suitable to be submitted to
  43. letsencrypt.org. In order to do this, it copies ``/etc/ssl/openssl.cnf`` to a
  44. temporary and adapts it according to its needs (currently, that's just adding a
  45. ``[SAN]`` section if necessary). If you want the module to use another configuration
  46. template, set config parameter ``letsencrypt.openssl.cnf``.
  47. After refreshing the certificate, the module attempts to run the content of
  48. ``letsencrypt.reload_command``, which is by default ``sudo service nginx reload``.
  49. Change this to match your server's configuration.
  50. You'll also need a matching sudo configuration, like::
  51. your_odoo_user ALL = NOPASSWD: /usr/sbin/service nginx reload
  52. Further, if you force users to https, you'll need something like for nginx::
  53. if ($scheme = "http") {
  54. set $redirect_https 1;
  55. }
  56. if ($request_uri ~ ^/.well-known/acme-challenge/) {
  57. set $redirect_https 0;
  58. }
  59. if ($redirect_https) {
  60. rewrite ^ https://$server_name$request_uri? permanent;
  61. }
  62. and this for apache::
  63. RewriteEngine On
  64. RewriteCond %{HTTPS} !=on
  65. RewriteCond %{REQUEST_URI} "!^/.well-known/"
  66. RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
  67. In case you need to redirect other nginx sites to your Odoo instance, declare
  68. an upstream for your odoo instance and do something like::
  69. location /.well-known {
  70. proxy_pass http://yourodooupstream;
  71. }
  72. Bug Tracker
  73. ===========
  74. Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
  75. In case of trouble, please check there if your issue has already been reported.
  76. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  77. `here <https://github.com/OCA/server-tools/issues/new?body=module:%20letsencrypt%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  78. Credits
  79. =======
  80. Contributors
  81. ------------
  82. * Holger Brunn <hbrunn@therp.nl>
  83. ACME implementation
  84. -------------------
  85. * https://github.com/diafygi/acme-tiny/blob/master/acme_tiny.py
  86. Icon
  87. ----
  88. * https://helloworld.letsencrypt.org
  89. Maintainer
  90. ----------
  91. .. image:: https://odoo-community.org/logo.png
  92. :alt: Odoo Community Association
  93. :target: https://odoo-community.org
  94. This module is maintained by the OCA.
  95. OCA, or the Odoo Community Association, is a nonprofit organization whose
  96. mission is to support the collaborative development of Odoo features and
  97. promote its widespread use.
  98. To contribute to this module, please visit https://odoo-community.org.