summaryrefslogtreecommitdiff
path: root/gen_conf.sh
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-07-24 21:36:18 -0400
committerDeterminant <[email protected]>2018-07-24 21:36:18 -0400
commitf6f44360ea2d3b98156ffa6aed237f6ef4da26d0 (patch)
tree0ee974b605eed1b1f9d0f9b44911d875a0cf0af4 /gen_conf.sh
downloadcgit-dark-f6f44360ea2d3b98156ffa6aed237f6ef4da26d0.tar.gz
cgit-dark-f6f44360ea2d3b98156ffa6aed237f6ef4da26d0.tar.bz2
cgit-dark-f6f44360ea2d3b98156ffa6aed237f6ef4da26d0.zip
init
Diffstat (limited to 'gen_conf.sh')
-rwxr-xr-xgen_conf.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/gen_conf.sh b/gen_conf.sh
new file mode 100755
index 0000000..cea5592
--- /dev/null
+++ b/gen_conf.sh
@@ -0,0 +1,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