Add registry.lunarfront.tech: DNS-only subdomain with Let's Encrypt cert, no CF upload limit

This commit is contained in:
Ryan Moon
2026-03-31 19:14:03 -05:00
parent c280fb8cbe
commit 1ce49a7ed3
7 changed files with 96 additions and 8 deletions

View File

@@ -86,3 +86,51 @@
name: nginx
enabled: true
state: started
# ─── Registry (Let's Encrypt cert, DNS-only / no Cloudflare proxy) ────────────
- name: Install certbot and Cloudflare DNS plugin
apt:
name: [certbot, python3-certbot-dns-cloudflare]
state: present
- name: Write Cloudflare credentials for certbot
copy:
content: |
dns_cloudflare_api_token = {{ cloudflare_api_token }}
dest: /etc/letsencrypt/cloudflare.ini
owner: root
group: root
mode: "0600"
- name: Obtain Let's Encrypt cert for registry domain
command: >
certbot certonly
--dns-cloudflare
--dns-cloudflare-credentials /etc/letsencrypt/cloudflare.ini
--non-interactive
--agree-tos
--email {{ letsencrypt_email }}
-d {{ gitea_registry_domain }}
args:
creates: /etc/letsencrypt/live/{{ gitea_registry_domain }}/fullchain.pem
- name: Deploy registry nginx config
template:
src: nginx-registry.conf.j2
dest: /etc/nginx/sites-available/registry
mode: "0644"
notify: Reload nginx
- name: Enable registry nginx site
file:
src: /etc/nginx/sites-available/registry
dest: /etc/nginx/sites-enabled/registry
state: link
notify: Reload nginx
- name: Enable certbot renewal timer
systemd:
name: certbot.timer
enabled: true
state: started