====== Vibemosphere Let's Encrypt ====== Serves the hosts with Let's Encrypt certificates (ACME http-01 on a challenge port of its own), with automatic renewal. ^ Id | ''letsencrypt'' | ^ Role | ''deployment'' - needed for the page and the REST API (administrators always may) | ^ Page | **Plugins > Open** (overlay with an X at the top right) or ''/plugins/letsencrypt/'' | ^ REST | ''/api/plugins/letsencrypt/...'' and, for callers with the role, ''/plugins/letsencrypt/...'' | ===== Open the configuration ===== In the administration open **Plugins**, select the row of this plug-in and press **Open**. The page opens in an overlay dialog: close it with the **X** at the top right, with Esc or by clicking outside; //Open in a new tab// next to the title shows it full size. {{vibecat:plugin-letsencrypt.png?900|Vibemosphere Let's Encrypt: the plug-in page in its overlay dialog}} ===== Step by step ===== - Set the challenge port (the ACME http-01 request must reach Vibecat on port 80 from the internet), the contact e-mail and the hosts. Use **staging** first. In the port form choose //Certificate source: Let's Encrypt// for an HTTPS port; renewal is automatic. ===== The page in detail ===== {{vibecat:plugin-letsencrypt-full.png?900|Vibemosphere Let's Encrypt: the whole page (playground instance)}} The page has these sections: **Settings**, **Method**, **Certificate**. ===== Fields and columns ===== ^ Label ^ Meaning ^ | Host names (public DNS names, one per line; the first is the common name; no wildcards) | | | ACME server | | | Directory address (other server) | | | E-mail of the account | | | Challenge port (port 80 is forwarded to it) | | | Bind address (empty = all) | | | Key | | | Renew when fewer days are left | | | HTTPS ports to serve (ids, empty = all) | | | How the certificate is requested | | | Challenge | | | Standalone port (80 = what Let's Encrypt validates) | | | Extra certbot arguments | | | Docker command | | | Image | | | Volume (or folder) for /etc/letsencrypt | | | Volume (or folder) for /var/lib/letsencrypt | | | certbot command (e.g. sudo -n certbot ) | | | Configuration folder | | | HTTPS port | Column of a table | | PFX | Column of a table | | Serves Let's Encrypt | Column of a table | ===== Actions ===== * **Save** * **Test the challenge port** * **Request / renew the certificate now** ===== Notes from the page ===== * I agree to the terms of service of the ACME server renew automatically Save Test the challenge port ===== Reference ===== Ported from the Let's Encrypt support of PIMIA. When switched on, the hosts you name are served with Let's Encrypt certificates (or those of another ACME server) and the certificate is renewed automatically. Access needs the role **deployment** (or admin). ==== How it works ==== - **Challenge port.** While the plug-in is on it opens an HTTP port of its own (default **8085**, optional bind address) that answers only ''/.well-known/acme-challenge/{token}'' from ''plugin-data\letsencrypt\challenges'' and 404 for everything else. **Port 80 of every host name has to be forwarded to this port** (router, firewall or reverse proxy) - Let's Encrypt validates on port 80 only. //Test the challenge port// checks that it answers on this machine. - **Certificate.** One certificate for all host names (the first is the common name; no wildcards with http-01). The ACME account (ES256 key) is created on the first request and kept; the e-mail address and the agreement to the terms of service are required. - **Ports.** The certificate and key are written as a PFX file (''certs\letsencrypt.pfx'') and set as the PFX of the HTTPS ports of Vibecat (all of them, or the ids you list); the ports are opened again with it. Add an HTTPS port first on the Ports page (any PFX, it is replaced). - **Renewal.** Every 6 hours (and 1 minute after the start) the plug-in checks and requests a new certificate when none exists, the hosts or the ACME server changed, a port does not use the certificate, or it runs out within //renew before// days (default 30). Start with **Let's Encrypt staging** (test certificates, not trusted by browsers, generous limits) and switch to **production** when the challenge works. The Certificate Authority plug-in leaves ports that Let's Encrypt serves alone. ==== REST ==== ^ Call ^ Purpose ^ | ''GET%%|%%PUT /plugins/letsencrypt/settings'' | ''enabled'', ''hosts'', ''directory'' (staging, production, custom), ''customUrl'', ''email'', ''agreeToTerms'', ''challengePort'', ''bindAddress'', ''keyType'' (rsa2048, ec256), ''renewBeforeDays'', ''autoRenew'', ''ports'' | | ''GET /plugins/letsencrypt/status'' | Challenge port, certificate, ports, reason a renewal is due, log | | ''POST /plugins/letsencrypt/issue'' | Requests / renews now (runs in the background; poll ''status'') | | ''POST /plugins/letsencrypt/selftest'' | Tests the challenge port | [[vibecat:plugins:start|All plug-ins]]