Skip to content

Commit 41febee

Browse files
committed
Switch to Nginx's built-in Acme module
Replaces the custom `letsencrypt` role with Nginx's new automated solution using the `nginx-acme` module. This drastically simplifies Trellis' SSL setup with Let's Encrypt by delegating most of the functionality to Nginx. See https://nginx.org/en/docs/http/ngx_http_acme_module.html
1 parent b322acc commit 41febee

23 files changed

Lines changed: 71 additions & 431 deletions

File tree

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- run: trellis exec ansible-playbook --version
5252
working-directory: example.com/trellis
5353
- name: Provision
54-
run: trellis provision --extra-vars "web_user=runner letsencrypt_ca=https://127.0.0.1:8443/acme/acme" production
54+
run: trellis provision --extra-vars "web_user=runner acme_server=https://127.0.0.1:8443/acme/acme/directory acme_ssl_verify=off" production
5555
working-directory: example.com
5656
- name: Deploy non-https site
5757
run: trellis deploy --extra-vars "web_user=runner project_git_repo=https://github.com/roots/bedrock.git" production example.com

group_vars/all/helpers.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ object_cache_enabled_memcached: "{{ item.value.object_cache.enabled | default(fa
3333
# Sites using Redis or Memcached object cache
3434
sites_using_redis: "{{ (wordpress_sites | select_sites('object_cache.enabled', 'true') | select_sites('object_cache.provider', 'eq', 'redis')).keys() | list }}"
3535
sites_using_memcached: "{{ (wordpress_sites | select_sites('object_cache.enabled', 'true') | select_sites('object_cache.provider', 'eq', 'memcached')).keys() | list }}"
36+
sites_using_letsencrypt: "{{ (wordpress_sites | select_sites('ssl.enabled', 'true') | select_sites('ssl.provider', 'eq', 'letsencrypt')).keys() | list }}"
3637
site_hosts_canonical: "{{ item.value.site_hosts | map(attribute='canonical') | list }}"
3738
site_hosts_redirects: "{{ item.value.site_hosts | selectattr('redirects', 'defined') | sum(attribute='redirects', start=[]) | list }}"
3839
site_hosts: "{{ site_hosts_canonical | union(site_hosts_redirects) }}"

group_vars/development/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
acme_tiny_challenges_directory: "{{ www_root }}/letsencrypt"
21
env: development
32
mysql_root_password: "{{ vault_mysql_root_password }}" # Define this variable in group_vars/development/vault.yml
43
web_user: "{{ ansible_user | default ('web') }}"

roles/common/handlers/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
---
2-
- name: disable temporary challenge sites
3-
import_tasks: disable_challenge_sites.yml
4-
52
- name: restart memcached
63
service:
74
name: memcached

roles/common/tasks/disable_challenge_sites.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

roles/common/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
loop_control:
1313
label: "{{ item.key }}"
1414
when: item.value.site_hosts | rejectattr('canonical', 'defined') | list | count > 0
15-
tags: [letsencrypt, wordpress]
15+
tags: [wordpress]
1616

1717
- name: Import PHP version specific vars
1818
include_vars: "{{ lookup('first_found', params) }}"

roles/letsencrypt/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

roles/letsencrypt/defaults/main.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

roles/letsencrypt/library/test_challenges.py

Lines changed: 0 additions & 84 deletions
This file was deleted.

roles/letsencrypt/tasks/certificates.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)