diff options
Diffstat (limited to 'roles/cgit/templates')
-rw-r--r-- | roles/cgit/templates/cgit_nginx.conf.j2 | 36 | ||||
-rw-r--r-- | roles/cgit/templates/cgitrc.j2 | 56 |
2 files changed, 92 insertions, 0 deletions
diff --git a/roles/cgit/templates/cgit_nginx.conf.j2 b/roles/cgit/templates/cgit_nginx.conf.j2 new file mode 100644 index 0000000..365daaf --- /dev/null +++ b/roles/cgit/templates/cgit_nginx.conf.j2 @@ -0,0 +1,36 @@ +# {{ ansible_managed }} + +server { + listen 80; + listen [::]:80; + server_name {{ cgit_subdomain }}; + + include snippets/letsencrypt.conf; + + location / { + return 301 https://$host$request_uri; + } +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name {{ cgit_subdomain }}; + + root /usr/share/webapps/cgit; + index index.html index.htm; + + ssl_certificate /etc/letsencrypt/live/{{ cgit_subdomain }}/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/{{ cgit_subdomain }}/privkey.pem; + ssl_trusted_certificate /etc/letsencrypt/live/{{ cgit_subdomain }}/chain.pem; + + try_files $uri @cgit; + location @cgit { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root/cgit.cgi; + fastcgi_param PATH_INFO $uri; + fastcgi_param QUERY_STRING $args; + fastcgi_param HTTP_HOST $server_name; + fastcgi_pass unix:/run/fcgiwrap.sock; + } +} diff --git a/roles/cgit/templates/cgitrc.j2 b/roles/cgit/templates/cgitrc.j2 new file mode 100644 index 0000000..562a002 --- /dev/null +++ b/roles/cgit/templates/cgitrc.j2 @@ -0,0 +1,56 @@ +# +# cgit config +# see cgitrc(5) for details + +css=/cgit.css +logo=/cgit.png + +# source highlighting +source-filter=/usr/lib/cgit/filters/syntax-highlighting.py + +# Display README.md files (located with your repos) in HTML (like github) +readme=:README.md +readme=:README +about-filter=/usr/lib/cgit/filters/about-formatting.sh + +# Specify some default clone urls using macro expansion +clone-url=https://$HTTP_HOST/$CGIT_REPO_URL git://{{ gitolite_clone }}:$CGIT_REPO_URL ssh://{{ gitolite_clone }}/$CGIT_REPO_URL + +# enable git blame +# not implemented yet in v1.1 +#enable-blame=1 + +# use information from gitolite +enable-git-config=1 + +# Show extra links for each repository on the index page +enable-index-links=1 + +# Enable ASCII art commit history graph on the log pages +enable-commit-graph=1 + +# Show number of affected files per commit on the log pages +enable-log-filecount=1 + +# Show number of added/removed lines per commit on the log pages +enable-log-linecount=1 + +# enable mimetypes +enable-html-serving=1 + +# enable stats page +max-stats=year + +# no .git suffix please +remove-suffix=1 + +# common mimetypes +mimetype-file=/etc/mime.types + +# download repo as tar.* +snapshots=tar.gz tar.xz zip + +project-list=/srv/git/projects.list +scan-path=/srv/git/repositories + +virtual-root=/ |