fix(nginx): make Let's Encrypt opt-in per service
certbot cannot issue for internal hostnames (*.nas.local), which made nginx-enabled services with internal names fail on deploy. Add a <service>_nginx_letsencrypt flag (default false) and computed <service>_nginx_ssl_certificate/_key paths: when off the vhost uses the shared self-signed cert (nginx_default_ssl_cert), when on it uses the Let's Encrypt lineage. Gate the certbot include on the flag and apply the pattern to all service roles (deluge, fdroid, gitea, grafana, immich, metabase, ntfy, prowlarr, radarr, seerr, static_web, uptime_kuma).
This commit is contained in:
@@ -28,7 +28,10 @@ The image runs as the unprivileged `node` user (UID/GID 1000). The pod maps the
|
||||
|
||||
## Nginx Reverse Proxy
|
||||
|
||||
Set `seerr_nginx_enabled: true` and `seerr_nginx_hostname` to expose the web UI over HTTPS. Certificates are provisioned via the shared `nginx` role's certbot tasks. If the hostname is not the apex, point a DNS record at the host first.
|
||||
Set `seerr_nginx_enabled: true` and `seerr_nginx_hostname` to expose the web UI over HTTPS. TLS is opt-in:
|
||||
|
||||
- `seerr_nginx_letsencrypt: false` (default) — use the shared self-signed cert (`nginx_default_ssl_cert`, generated by the `nginx` role). Required for internal names like `*.nas.local`, which Let's Encrypt cannot issue.
|
||||
- `seerr_nginx_letsencrypt: true` — provision a Let's Encrypt cert via the shared `nginx` role's certbot tasks. Requires a publicly-resolvable hostname with a DNS record pointing at the host.
|
||||
|
||||
## Backup
|
||||
|
||||
|
||||
@@ -26,3 +26,16 @@ seerr_backup_paths:
|
||||
# Nginx reverse proxy configuration
|
||||
seerr_nginx_enabled: false
|
||||
seerr_nginx_hostname: seerr.nas.local
|
||||
# Let's Encrypt (certbot) requires a publicly-resolvable hostname. Internal
|
||||
# names (e.g. *.nas.local) cannot get a public cert: leave this false to use
|
||||
# the shared self-signed cert (nginx_default_ssl_cert). Set true once a public
|
||||
# DNS record points at the host.
|
||||
seerr_nginx_letsencrypt: false
|
||||
seerr_nginx_ssl_certificate: >-
|
||||
{{ seerr_nginx_letsencrypt | ternary(
|
||||
'/etc/letsencrypt/live/' ~ seerr_nginx_hostname ~ '/fullchain.pem',
|
||||
nginx_default_ssl_cert) }}
|
||||
seerr_nginx_ssl_certificate_key: >-
|
||||
{{ seerr_nginx_letsencrypt | ternary(
|
||||
'/etc/letsencrypt/live/' ~ seerr_nginx_hostname ~ '/privkey.pem',
|
||||
nginx_default_ssl_key) }}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/../nginx/tasks/certbot.yml"
|
||||
vars:
|
||||
certbot_hostname: "{{ seerr_nginx_hostname }}"
|
||||
when: seerr_nginx_enabled
|
||||
when: seerr_nginx_enabled and seerr_nginx_letsencrypt
|
||||
|
||||
- name: Deploy nginx vhost configuration for Seerr
|
||||
ansible.builtin.template:
|
||||
|
||||
@@ -22,9 +22,8 @@ server {
|
||||
listen [::]:443 ssl;
|
||||
server_name {{ seerr_nginx_hostname }};
|
||||
|
||||
# Let's Encrypt certificates (managed by Certbot)
|
||||
ssl_certificate /etc/letsencrypt/live/{{ seerr_nginx_hostname }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ seerr_nginx_hostname }}/privkey.pem;
|
||||
ssl_certificate {{ seerr_nginx_ssl_certificate }};
|
||||
ssl_certificate_key {{ seerr_nginx_ssl_certificate_key }};
|
||||
|
||||
# SSL configuration
|
||||
ssl_protocols {{ nginx_ssl_protocols | default('TLSv1.3') }};
|
||||
|
||||
Reference in New Issue
Block a user