2019-05-07 19:23:35 +00:00
|
|
|
#jinja2: lstrip_blocks: "True"
|
2018-08-29 06:37:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# For renewal to work, matrix-nginx-proxy (or another webserver, if matrix-nginx-proxy is disabled)
|
|
|
|
# need to forward requests for `/.well-known/acme-challenge` to the certbot container.
|
|
|
|
#
|
2019-01-27 18:25:13 +00:00
|
|
|
# This can happen inside the container network by proxying to `http://matrix-certbot:8080`
|
2019-02-05 09:11:28 +00:00
|
|
|
# or outside (on the host) by proxying to `http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }}`.
|
2018-08-29 06:37:44 +00:00
|
|
|
|
|
|
|
docker run \
|
|
|
|
--rm \
|
|
|
|
--name=matrix-certbot \
|
2019-01-27 18:25:13 +00:00
|
|
|
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
2020-04-16 22:52:09 +00:00
|
|
|
--cap-drop=ALL \
|
2018-08-29 06:37:44 +00:00
|
|
|
--network="{{ matrix_docker_network }}" \
|
2019-01-27 18:25:13 +00:00
|
|
|
-p 127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }}:8080 \
|
2020-11-25 08:49:59 +00:00
|
|
|
--mount type=bind,src={{ matrix_ssl_config_dir_path }},dst=/etc/letsencrypt \
|
|
|
|
--mount type=bind,src={{ matrix_ssl_log_dir_path }},dst=/var/log/letsencrypt \
|
2018-12-23 09:00:12 +00:00
|
|
|
{{ matrix_ssl_lets_encrypt_certbot_docker_image }} \
|
2018-08-29 06:37:44 +00:00
|
|
|
renew \
|
|
|
|
--non-interactive \
|
2019-01-27 18:25:13 +00:00
|
|
|
--work-dir=/tmp \
|
2019-01-31 07:43:09 +00:00
|
|
|
--http-01-port 8080 \
|
2018-12-23 09:00:12 +00:00
|
|
|
{% if matrix_ssl_lets_encrypt_staging %}
|
2018-08-29 06:37:44 +00:00
|
|
|
--staging \
|
|
|
|
{% endif %}
|
|
|
|
--standalone \
|
|
|
|
--preferred-challenges http \
|
|
|
|
--agree-tos \
|
2021-01-19 17:41:45 +00:00
|
|
|
--email={{ matrix_ssl_lets_encrypt_support_email }} \
|
|
|
|
--no-random-sleep-on-renew
|