From a53f889d9d0cf79b69d8f1fd3266e7ffe5bf210e Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 11 Apr 2018 22:11:36 +0800 Subject: web/sites: rename liwt.git.conf.j2 to liwt.cgit.conf.j2 --- roles/web/templates/sites/liwt.cgit.conf.j2 | 46 ++++++++++++++++++++++++++++ roles/web/templates/sites/liwt.git.conf.j2 | 47 ----------------------------- 2 files changed, 46 insertions(+), 47 deletions(-) create mode 100644 roles/web/templates/sites/liwt.cgit.conf.j2 delete mode 100644 roles/web/templates/sites/liwt.git.conf.j2 (limited to 'roles') diff --git a/roles/web/templates/sites/liwt.cgit.conf.j2 b/roles/web/templates/sites/liwt.cgit.conf.j2 new file mode 100644 index 0000000..1c9af01 --- /dev/null +++ b/roles/web/templates/sites/liwt.cgit.conf.j2 @@ -0,0 +1,46 @@ +{% set domain = "liwt.net" %} +# +# nginx/sites: liwt.cgit.conf +# Website: git.{{ domain }} +# Share/publish projects (git repositories) using `cgit`. +# +# Refernce: +# [1] ArchWiki - cgit +# https://wiki.archlinux.org/index.php/Cgit +# +# +# Aaron LI +# 2017-06-18 +# + +{% if cgit is defined and domains_hascert[domain] %} +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name git.{{ domain }}; + + # SSL/TLS Certificate kindly provided by Let's Encrypt + ssl_certificate /usr/local/etc/ssl/acme/{{ domain }}/fullchain.pem; + ssl_certificate_key /usr/local/etc/ssl/acme/private/{{ domain }}.pem; + + # Projects (git repositories) location + root /usr/local/www/cgit; + try_files $uri @cgit; + + location @cgit { + include uwsgi_params; + # modifier1: 9 - size of CGI block vars (HTTP request body excluded) + uwsgi_modifier1 9; + uwsgi_pass unix:/var/run/uwsgi-cgit.sock; + } + + location /static/ { + root /home/www/git/; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/local/www/nginx-dist; + } +} +{% endif %} diff --git a/roles/web/templates/sites/liwt.git.conf.j2 b/roles/web/templates/sites/liwt.git.conf.j2 deleted file mode 100644 index f448dd6..0000000 --- a/roles/web/templates/sites/liwt.git.conf.j2 +++ /dev/null @@ -1,47 +0,0 @@ -{% set domain = "liwt.net" %} -# -# nginx/sites: liwt.git.conf -# Website: git.{{ domain }} -# Share/publish projects (git repositories) using `cgit`. -# -# Refernce: -# [1] ArchWiki - cgit -# https://wiki.archlinux.org/index.php/Cgit -# -# -# Aaron LI -# 2017-06-18 -# - -{% if cgit is defined and domains_hascert[domain] %} -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name git.{{ domain }}; - - # SSL/TLS Certificate kindly provided by Let's Encrypt - ssl_certificate /usr/local/etc/ssl/acme/{{ domain }}/fullchain.pem; - ssl_certificate_key /usr/local/etc/ssl/acme/private/{{ domain }}.pem; - - # Projects (git repositories) location - root /usr/local/www/cgit; - try_files $uri @cgit; - - location @cgit { - # Require `www/uwsgi` package and configurations in `/etc/rc.conf`. - include uwsgi_params; - # modifier1: 9 - size of CGI block vars (HTTP request body excluded) - uwsgi_modifier1 9; - uwsgi_pass unix:/var/run/uwsgi-cgit.sock; - } - - location /static/ { - root /home/www/git/; - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/local/www/nginx-dist; - } -} -{% endif %} -- cgit v1.2.2