Add gitea reverse-proxy configuration.

This commit is contained in:
yohan 2024-10-31 16:57:59 +01:00
parent 4e8fba4443
commit 20e33f8d90
2 changed files with 35 additions and 0 deletions

View File

@ -113,6 +113,33 @@
line: "127.0.0.1 git2.{{ DOMAIN }} git2" line: "127.0.0.1 git2.{{ DOMAIN }} git2"
become: true become: true
- name: Template reverse-proxy configuration
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "/mnt/volumes/reverse-proxy_conf/data/{{ item }}"
become: true
with_items:
- reverse-proxy-gitea.conf
- name: Enable reverse-proxy configuration
containers.podman.podman_container_exec:
name: reverse-proxy
command: 'sh -c ''a2ensite reverse-proxy-gitea && service apache2 reload'''
become: true
- name: Check if lets encrypt certificate installation is already done
stat:
path: /mnt/volumes/reverse-proxy_conf/data/reverse-proxy-gitea-le-ssl.conf
register: gitea_certificate_flag
become: true
- name: Install lets encrypt certificate
containers.podman.podman_container_exec:
name: reverse-proxy
command: 'sh -c ''certbot --apache -vvv --domains gitea.{{ DOMAIN }} -m {{ recipient_email }} --agree-tos --reinstall --redirect --hsts --non-interactive'''
become: true
when: not gitea_certificate_flag.stat.exists
- name: Allow git SSH port - name: Allow git SSH port
ansible.posix.firewalld: ansible.posix.firewalld:
zone: public zone: public

View File

@ -0,0 +1,8 @@
<VirtualHost *:80>
ServerName gitea.{{ DOMAIN }}
ServerAdmin postmaster@{{ DOMAIN }}
ProxyPreserveHost on
ProxyPass / http://gitea:3000/
ProxyPassReverse / http://gitea:3000/
ProxyRequests Off
</VirtualHost>