aboutsummaryrefslogtreecommitdiff
path: root/src/cgit/bin/entrypoint.sh
blob: 8e17aa560b92511b8587de8c8387987ecca7b7de (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
#!/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

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