summaryrefslogtreecommitdiff
path: root/gen_conf.sh
blob: cea5592b4800c692bdcfde37b0ffc783d832886e (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
#!/bin/bash
BASE_DIR="$(cd $(dirname $0); pwd -P)"
if [[ ! "$#" -eq 1 ]]; then
    echo "please specify the virtual root, e.g. /git/"
    exit 1
fi
VIRT_ROOT=${1%/}
cat > theme.cgitrc << EOF
css=
logo=
virtual-root=$VIRT_ROOT
header=${BASE_DIR}/header.html
footer=${BASE_DIR}/footer.html
source-filter=${BASE_DIR}/syntax-highlighting.py
about-filter=${BASE_DIR}/about-formatting.sh
readme=:README.md
readme=:README.rst
enable-commit-graph=1
EOF
echo "Done."

cat > nginx.conf << EOF
location $VIRT_ROOT/assets {
    root ${BASE_DIR};
    rewrite ^$VIRT_ROOT/assets(.*)$ /assets\$1 break;
    disable_symlinks off;
}
EOF