Add gitea reverse-proxy configuration.
This commit is contained in:
parent
4e8fba4443
commit
20e33f8d90
@ -113,6 +113,33 @@
|
||||
line: "127.0.0.1 git2.{{ DOMAIN }} git2"
|
||||
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
|
||||
ansible.posix.firewalld:
|
||||
zone: public
|
||||
|
@ -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>
|
Loading…
Reference in New Issue
Block a user