summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/cgitrc27
-rw-r--r--etc/httpd/conf/httpd.conf40
2 files changed, 50 insertions, 17 deletions
diff --git a/etc/cgitrc b/etc/cgitrc
index dad2e2a..6d04348 100644
--- a/etc/cgitrc
+++ b/etc/cgitrc
@@ -1,30 +1,39 @@
#
+#
# cgit Runtime Configuration
# see cgitrc(5) for details
#
-# General options
-root-title=Git Repository Browser
-root-desc=a fast webinterface for the git dscm
+# Global Settings
robots=noindex, nofollow
-scan-path=/srv/git
+snapshots=tar.gz tar.bz2 zip
source-filter=/opt/highlight.sh
#
-# Site options
+# Site Settings
enable-index-links=1
enable-remote-branches=1
enable-log-filecount=1
enable-log-linecount=1
enable-git-config=1
-snapshots=tar.gz tar.bz2 zip
#
-# Cache
+# Cache Settings
cache-root=/var/cache/cgit
cache-size=1000
#
+# List of common mimetypes
+#
+mimetype.gif=image/gif
+mimetype.html=text/html
+mimetype.jpg=image/jpeg
+mimetype.jpeg=image/jpeg
+mimetype.pdf=application/pdf
+mimetype.png=image/png
+mimetype.svg=image/svg+xml
+
+#
# Search for these files in the root of the default branch of repos.
# This will determine the "about" page for the repo.
readme=:README.md
@@ -55,3 +64,7 @@ readme=:INSTALL.txt
readme=:install.txt
readme=:INSTALL
readme=:install
+
+# NOTE: According to the cgit mailing list, these options should go last.
+virtual-root=/
+scan-path=/srv/git \ No newline at end of file
diff --git a/etc/httpd/conf/httpd.conf b/etc/httpd/conf/httpd.conf
index d99bd92..3b6da71 100644
--- a/etc/httpd/conf/httpd.conf
+++ b/etc/httpd/conf/httpd.conf
@@ -1,20 +1,35 @@
-##
-## Apache Server Configuration
-##
+#
+#
+# Apache Server Configuration
ServerRoot /etc/httpd
#
-# Load Standard Modules
+# Load Modules
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mime_module modules/mod_mime.so
-LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
-LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
+LoadModule rewrite_module modules/mod_rewrite.so
+LoadModule alias_module modules/mod_alias.so
+LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
+
+# Load CGI Module
+<IfModule !mpm_prefork_module>
+ LoadModule cgid_module modules/mod_cgid.so
+</IfModule>
+<IfModule mpm_prefork_module>
+ LoadModule cgi_module modules/mod_cgi.so
+</IfModule>
+
+# And Basic Auth Modules
+LoadModule auth_basic_module modules/mod_auth_basic.so
+LoadModule authn_core_module modules/mod_authn_core.so
+LoadModule authn_file_module modules/mod_authn_file.so
+LoadModule authz_user_module modules/mod_authz_user.so
#
# Server config
@@ -25,21 +40,26 @@ EnableSendFile on
AddDefaultCharset UTF-8
TypesConfig /etc/mime.types
MIMEMagicFile conf/magic
+AddHandler cgi-script .cgi
+# Always wear protection.
<Directory />
Require all denied
</Directory>
-DocumentRoot "/srv/www/htdocs/cgit"
+# NOTE: Alias matcher MUST end in /, not /cgit.cgi. It WILL break otherwise.
+# ALSO: "cgitrc must have a virtual-root=/".
+# Remove /cgit.cgi/ from url paths.
+ScriptAlias "/" "/srv/www/htdocs/cgit/cgit.cgi/"
<Directory "/srv/www/htdocs/cgit/">
DirectoryIndex cgit.cgi
- AddHandler cgi-script .cgi
AllowOverride None
- Options +ExecCGI -FollowSymLinks
+ Options +ExecCGI +FollowSymLinks
+ SetHandler cgi-script
Require all granted
</Directory>
-# Future proof
+# Deny access to .htaccess/.htpasswd
<Files ".ht">
Require all denied
</Files> \ No newline at end of file