From 0c03f5b5e5e7b57dd6d617fa7513d7f5e807e877 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 19 Oct 2026 18:16:09 -0700 Subject: Rename cgit to git and acme to ssl for httpd --- roles/obsd_cgit/tasks/main.yml | 4 ++-- roles/obsd_cgit/templates/httpd.d/cgit.conf.j2 | 20 -------------------- roles/obsd_cgit/templates/httpd.d/git.conf.j2 | 20 ++++++++++++++++++++ roles/obsd_ssl/tasks/main.yml | 4 ++-- roles/obsd_ssl/templates/httpd.d/acme.conf | 12 ------------ roles/obsd_ssl/templates/httpd.d/ssl.conf | 12 ++++++++++++ site.yml | 4 ++-- 7 files changed, 38 insertions(+), 38 deletions(-) delete mode 100644 roles/obsd_cgit/templates/httpd.d/cgit.conf.j2 create mode 100644 roles/obsd_cgit/templates/httpd.d/git.conf.j2 delete mode 100644 roles/obsd_ssl/templates/httpd.d/acme.conf create mode 100644 roles/obsd_ssl/templates/httpd.d/ssl.conf diff --git a/roles/obsd_cgit/tasks/main.yml b/roles/obsd_cgit/tasks/main.yml index 9490085..e0b7ea4 100644 --- a/roles/obsd_cgit/tasks/main.yml +++ b/roles/obsd_cgit/tasks/main.yml @@ -84,8 +84,8 @@ - name: Deploy cgit vhost fragment ansible.builtin.template: - src: httpd.d/cgit.conf.j2 - dest: "{{ obsd_httpd_conf_d }}/cgit.conf" + src: httpd.d/git.conf.j2 + dest: "{{ obsd_httpd_conf_d }}/git.conf" owner: root group: wheel mode: "0644" diff --git a/roles/obsd_cgit/templates/httpd.d/cgit.conf.j2 b/roles/obsd_cgit/templates/httpd.d/cgit.conf.j2 deleted file mode 100644 index d309057..0000000 --- a/roles/obsd_cgit/templates/httpd.d/cgit.conf.j2 +++ /dev/null @@ -1,20 +0,0 @@ -server "{{ obsd_cgit_domain }}" { - listen on egress tls port 443 - tls { - certificate "/etc/ssl/{{ obsd_cgit_domain }}.fullchain.pem" - key "/etc/ssl/private/{{ obsd_cgit_domain }}.key" - } - - # Serve cgit static files (cgit.css, cgit.png) directly from disk - location "/cgit.*" { - root "/htdocs/cgit" - no fastcgi - } - - # Don't send a "Server: OpenBSD httpd" header. - no banner - - # Route any other cgit paths/actions via fastcgi - root "/htdocs/cgit/cgi-bin/cgit.cgi" - fastcgi socket "/run/slowcgi.sock" -} diff --git a/roles/obsd_cgit/templates/httpd.d/git.conf.j2 b/roles/obsd_cgit/templates/httpd.d/git.conf.j2 new file mode 100644 index 0000000..d309057 --- /dev/null +++ b/roles/obsd_cgit/templates/httpd.d/git.conf.j2 @@ -0,0 +1,20 @@ +server "{{ obsd_cgit_domain }}" { + listen on egress tls port 443 + tls { + certificate "/etc/ssl/{{ obsd_cgit_domain }}.fullchain.pem" + key "/etc/ssl/private/{{ obsd_cgit_domain }}.key" + } + + # Serve cgit static files (cgit.css, cgit.png) directly from disk + location "/cgit.*" { + root "/htdocs/cgit" + no fastcgi + } + + # Don't send a "Server: OpenBSD httpd" header. + no banner + + # Route any other cgit paths/actions via fastcgi + root "/htdocs/cgit/cgi-bin/cgit.cgi" + fastcgi socket "/run/slowcgi.sock" +} diff --git a/roles/obsd_ssl/tasks/main.yml b/roles/obsd_ssl/tasks/main.yml index ff8cadc..d29c576 100644 --- a/roles/obsd_ssl/tasks/main.yml +++ b/roles/obsd_ssl/tasks/main.yml @@ -5,8 +5,8 @@ - name: Deploy acme challenge vhost fragment ansible.builtin.template: - src: httpd.d/acme.conf - dest: "{{ obsd_httpd_conf_d }}/acme.conf" + src: httpd.d/ssl.conf + dest: "{{ obsd_httpd_conf_d }}/ssl.conf" owner: root group: wheel mode: "0644" diff --git a/roles/obsd_ssl/templates/httpd.d/acme.conf b/roles/obsd_ssl/templates/httpd.d/acme.conf deleted file mode 100644 index 357a294..0000000 --- a/roles/obsd_ssl/templates/httpd.d/acme.conf +++ /dev/null @@ -1,12 +0,0 @@ -{% for domain in obsd_ssl_domains %} -server "{{ domain }}" { - listen on * port 80 - location "/.well-known/acme-challenge/*" { - root "/acme" - request strip 2 - } - location * { - block return 302 "https://$HTTP_HOST$REQUEST_URI" - } -} -{% endfor %} diff --git a/roles/obsd_ssl/templates/httpd.d/ssl.conf b/roles/obsd_ssl/templates/httpd.d/ssl.conf new file mode 100644 index 0000000..357a294 --- /dev/null +++ b/roles/obsd_ssl/templates/httpd.d/ssl.conf @@ -0,0 +1,12 @@ +{% for domain in obsd_ssl_domains %} +server "{{ domain }}" { + listen on * port 80 + location "/.well-known/acme-challenge/*" { + root "/acme" + request strip 2 + } + location * { + block return 302 "https://$HTTP_HOST$REQUEST_URI" + } +} +{% endfor %} diff --git a/site.yml b/site.yml index 99a5ce8..6dbea39 100644 --- a/site.yml +++ b/site.yml @@ -7,8 +7,8 @@ - role: obsd_httpd vars: obsd_httpd_fragments: - - acme.conf - - cgit.conf + - ssl.conf + - git.conf - role: obsd_ssl vars: obsd_ssl_domains: -- cgit v1.2.3