1 { gitweb, writeText, stdenv, coreutils, writeScript, gitolite, git, cgit, gitoliteDir, mailcap, highlight }:
4 config = writeText "gitweb.conf" ''
7 # The directories where your projects are. Must not end with a
9 $projectroot = "${varDir}/repositories";
11 $projects_list = "${varDir}/projects.list";
12 $strict_export = "true";
14 # Base URLs for links displayed in the web interface.
15 our @git_base_url_list = qw(ssh://gitolite@git.immae.eu https://git.immae.eu);
17 $feature{'blame'}{'default'} = [1];
18 $feature{'avatar'}{'default'} = ['gravatar'];
19 $feature{'highlight'}{'default'} = [1];
21 @stylesheets = ("gitweb-theme/gitweb.css");
22 $logo = "gitweb-theme/git-logo.png";
23 $favicon = "gitweb-theme/git-favicon.png";
24 $javascript = "gitweb-theme/gitweb.js";
25 $logo_url = "https://git.immae.eu/";
26 $projects_list_group_categories = "true";
27 $projects_list_description_width = 60;
28 $project_list_default_category = "__Others__";
29 $highlight_bin = "${highlight}/bin/highlight";
31 aboutFilter = writeScript "about-filter.sh" ''
34 if [ -f "$CGIT_REPO_PATH/README.html" ]; then
35 cat "$CGIT_REPO_PATH/README.html"
37 ${cgit}/lib/cgit/filters/about-formatting.sh "$@"
40 cgitConfig = writeText "cgitrc" ''
41 css=/cgit-css/cgit.css
42 logo=/cgit-css/cgit.png
43 favicon=/cgit-css/favicon.ico
44 head-include=${./cgit_js.html}
46 root-title=Immae’s git
47 root-desc=To go back to the old interface: https://git.immae.eu/?old
51 readme=:DOCUMENTATION.md
52 about-filter=${aboutFilter}
53 #${cgit}/lib/cgit/filters/about-formatting.sh
54 source-filter=${cgit}/lib/cgit/filters/syntax-highlighting.py
59 enable-log-filecount=1
60 enable-log-linecount=1
63 # Allow using gitweb.* keys
67 snapshots=tar.gz tar.zst zip
68 mimetype-file=${mailcap}/etc/mime.types
71 clone-url=ssh://gitolite@git.immae.eu/$CGIT_REPO_URL https://git.immae.eu/$CGIT_REPO_URL
73 project-list=${varDir}/projects.list
74 scan-path=${varDir}/repositories
82 SetEnv GIT_PROJECT_ROOT ${varDir}/repositories/
86 objects/(info/[^/]+ | \
87 [0-9a-f]{2}/[0-9a-f]{38} | \
88 pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
89 git-(upload|receive)-pack))$" \
90 ${git}/libexec/git-core/git-http-backend/$1
92 <Directory "${git}/libexec/git-core">
96 DirectoryIndex gitweb.cgi
99 Options ExecCGI FollowSymLinks
101 SetHandler cgi-script
102 SetEnv GITWEB_CONFIG "${config}"
106 SetEnv CGIT_CONFIG ${cgitConfig}
107 ScriptAlias /cgit "${cgit}/cgit/cgit.cgi/"
108 Alias /cgit-css "${cgit}/cgit"
109 <Directory "${cgit}/cgit/">
111 Options ExecCGI FollowSymlinks
116 RewriteCond %{QUERY_STRING} ^$
117 RewriteRule ^/?$ /cgit [L,R=302]
119 RewriteCond %{REQUEST_URI} ^(.*)(\.git)?/?$
120 RewriteCond ${varDir}/repositories/%1.git/HEAD -f
121 RewriteRule ^(.+)$ /cgit$1 [L,R=302]