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.

125 lines
4.2 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::
  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. Bug Tracker
  63. ===========
  64. Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
  65. In case of trouble, please check there if your issue has already been reported.
  66. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  67. `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**>`_.
  68. Credits
  69. =======
  70. Contributors
  71. ------------
  72. * Holger Brunn <hbrunn@therp.nl>
  73. ACME implementation
  74. -------------------
  75. * https://github.com/diafygi/acme-tiny/blob/master/acme_tiny.py
  76. Icon
  77. ----
  78. * https://helloworld.letsencrypt.org
  79. Maintainer
  80. ----------
  81. .. image:: https://odoo-community.org/logo.png
  82. :alt: Odoo Community Association
  83. :target: https://odoo-community.org
  84. This module is maintained by the OCA.
  85. OCA, or the Odoo Community Association, is a nonprofit organization whose
  86. mission is to support the collaborative development of Odoo features and
  87. promote its widespread use.
  88. To contribute to this module, please visit https://odoo-community.org.