diff options
| author | 2026-10-22 20:28:49 +0000 | |
|---|---|---|
| committer | 2026-10-22 20:28:49 +0000 | |
| commit | 84682c67b65e51be9168bb87d30d31bbd6d614a5 (patch) | |
| tree | 7bcc1aaa0fdaaf494379d67694007b61462f684a /roles/cgit/templates | |
| parent | feat: add private (diff) | |
| download | infra-84682c67b65e51be9168bb87d30d31bbd6d614a5.tar.gz | |
feat: add cgit
Diffstat (limited to 'roles/cgit/templates')
| -rw-r--r-- | roles/cgit/templates/cgitrc-instance.j2 | 15 | ||||
| -rw-r--r-- | roles/cgit/templates/cgitrc.j2 | 29 | ||||
| -rw-r--r-- | roles/cgit/templates/nginx.conf.j2 | 27 | ||||
| -rw-r--r-- | roles/cgit/templates/spawn-fcgi.cgit.j2 | 6 |
4 files changed, 77 insertions, 0 deletions
diff --git a/roles/cgit/templates/cgitrc-instance.j2 b/roles/cgit/templates/cgitrc-instance.j2 new file mode 100644 index 0000000..2e55b67 --- /dev/null +++ b/roles/cgit/templates/cgitrc-instance.j2 | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | {# -*- Conf -*- #} | ||
| 2 | # {{ ansible_managed }} | ||
| 3 | |||
| 4 | include=/etc/cgitrc | ||
| 5 | |||
| 6 | root-readme=/srv/http/{{ domain }}/about.html | ||
| 7 | root-title={{ root_title }} | ||
| 8 | root-desc={{ root_desc }} | ||
| 9 | |||
| 10 | module-link=https://{{ domain }}/%s/tree/?id=%s | ||
| 11 | clone-url=https://{{ domain }}/$CGIT_REPO_URL ssh://git@{{ domain }}/$CGIT_REPO_URL | ||
| 12 | |||
| 13 | scan-path={{ scan_path }} | ||
| 14 | |||
| 15 | {{ extra }} | ||
diff --git a/roles/cgit/templates/cgitrc.j2 b/roles/cgit/templates/cgitrc.j2 new file mode 100644 index 0000000..9aee5f0 --- /dev/null +++ b/roles/cgit/templates/cgitrc.j2 | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | {# -*- Conf -*- #} | ||
| 2 | # {{ ansible_managed }} | ||
| 3 | |||
| 4 | enable-log-filecount=1 | ||
| 5 | enable-log-linecount=1 | ||
| 6 | enable-remote-branches=1 | ||
| 7 | enable-subject-links=1 | ||
| 8 | enable-git-config=1 | ||
| 9 | |||
| 10 | virtual-root=/ | ||
| 11 | |||
| 12 | local-time=1 | ||
| 13 | |||
| 14 | # logo= | ||
| 15 | |||
| 16 | source-filter=/usr/local/lib/cgit/filters/syntax-highlighting.sh | ||
| 17 | email-filter=lua:/usr/local/lib/cgit/filters/email-libravatar.lua | ||
| 18 | about-filter=/usr/local/lib/cgit/filters/about-formatting.sh | ||
| 19 | |||
| 20 | readme=master:README.org | ||
| 21 | |||
| 22 | # repository-sort=name | ||
| 23 | side-by-side-diffs=1 | ||
| 24 | |||
| 25 | snapshots=tar.gz | ||
| 26 | |||
| 27 | strict-export=git-daemon-export-ok | ||
| 28 | remove-suffix=1 | ||
| 29 | section-from-path=1 | ||
diff --git a/roles/cgit/templates/nginx.conf.j2 b/roles/cgit/templates/nginx.conf.j2 new file mode 100644 index 0000000..2483471 --- /dev/null +++ b/roles/cgit/templates/nginx.conf.j2 | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | # -*- Nginx -*- | ||
| 2 | # {{ ansible_managed }} | ||
| 3 | |||
| 4 | server { | ||
| 5 | listen 443 ssl; | ||
| 6 | listen [::]:443 ssl; | ||
| 7 | server_name {{ domain }}; | ||
| 8 | |||
| 9 | ssl_certificate /etc/ssl/{{ domain | regex_replace('^git\\.', '') }}.fullchain.pem; | ||
| 10 | ssl_certificate_key /etc/ssl/private/{{ domain | regex_replace('^git\\.', '') }}.key; | ||
| 11 | |||
| 12 | root /usr/share/webapps/cgit/; | ||
| 13 | try_files $uri @cgit_{{ instance }}; | ||
| 14 | |||
| 15 | location / { | ||
| 16 | try_files $uri @cgit_{{ instance }}; | ||
| 17 | } | ||
| 18 | |||
| 19 | location @cgit_{{ instance }} { | ||
| 20 | include fastcgi_params; | ||
| 21 | fastcgi_param SCRIPT_FILENAME /usr/bin/cgit.cgi; | ||
| 22 | fastcgi_param PATH_INFO $uri; | ||
| 23 | fastcgi_param QUERY_STRING $args; | ||
| 24 | fastcgi_param HTTP_HOST $server_name; | ||
| 25 | fastcgi_pass 127.0.0.1:{{ port }}; | ||
| 26 | } | ||
| 27 | } | ||
diff --git a/roles/cgit/templates/spawn-fcgi.cgit.j2 b/roles/cgit/templates/spawn-fcgi.cgit.j2 new file mode 100644 index 0000000..8cbfced --- /dev/null +++ b/roles/cgit/templates/spawn-fcgi.cgit.j2 | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | # {{ ansible_managed }} | ||
| 2 | FCGI_SOCKET=/var/run/cgit.sock | ||
| 3 | FCGI_PROGRAM="/usr/bin/fcgiwrap -f" | ||
| 4 | FCGI_USER=git | ||
| 5 | FCGI_GROUP=git | ||
| 6 | FCGI_EXTRA_OPTIONS="-U nginx -G nginx" | ||
