aboutsummaryrefslogtreecommitdiff
path: root/src/cgit/bin/entrypoint.sh
blob: 80d37886347a9d3e69ff2b92485da6c3640dcef6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash

cat << EOF > /etc/nginx/sites-enabled/default
server {
    listen $CGIT_PORT;
    server_name $CGIT_HOSTNAME;
    server_tokens off;
    root /usr/share/cgit;

    # Serve static files with nginx
    location ~* ^.+(cgit.(css|png)|favicon.ico|robots.txt) {
      root /usr/share/cgit;
      expires 30d;
    }
    location / {
            try_files \$uri @cgit;
    }
    location @cgit {
      gzip off;
      include uwsgi_params;
      uwsgi_modifier1 9;
      uwsgi_pass unix:/run/uwsgi/cgit.sock;
    }
}
EOF

cat << EOF > /etc/cgitrc
#
# cgit config
# see cgitrc(5) for details

root-title=git.ofmax.li
root-desc=grumpy software

readme=:README.md

about-filter=/usr/lib/cgit/filters/about-formatting.sh
source-filter=/usr/lib/cgit/filters/syntax-highlighting.py

enable-index-links=1
enable-log-filecount=1
enable-commit-graph=1
enable-index-owner=1
enable-http-clone=1
snapshots=tar.gz
css=/cgit.css
logo=/cgit.png
virtual-root=/
robots=nofollow
remove-suffix=1

project-list=/var/lib/git/projects.list
scan-path=/var/lib/git/repositories

EOF

uwsgi --daemonize --ini /etc/uwsgi/cgit.ini > /dev/stdout 2> /dev/stderr < /dev/null &
nginx -c /etc/nginx/nginx.conf -g "daemon off;"