From 0c7bf0252aa5b9a2c3a3d95ce84370a3d67cb62b Mon Sep 17 00:00:00 2001 From: Lambda Date: Wed, 10 Dec 2025 18:43:52 -0500 Subject: Added README and compose example. --- README.md | 25 +++++++++++++++++++++++++ compose.yml | 17 +++++++++++++++++ etc/httpd/conf/httpd.conf | 45 +++++++++++++++++++++++++++++++++++++++++++++ etc/httpd/httpd.conf | 45 --------------------------------------------- 4 files changed, 87 insertions(+), 45 deletions(-) create mode 100644 README.md create mode 100644 compose.yml create mode 100644 etc/httpd/conf/httpd.conf delete mode 100644 etc/httpd/httpd.conf diff --git a/README.md b/README.md new file mode 100644 index 0000000..36c70f2 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# cgit-docker + +### About +cgit is a CGI web interface for git scm developed by the guy who created wireguard. You can read more on the cgit project [here](https://git.zx2c4.com/cgit/about). + +There's no official docker container for cgit. However, this will you to easily deploy it. + +### Installation +You can use Docker Compose to create an instance of the server. + +```yaml +name: 'cgit-docker' + +services: + cgit: + container_name: cgit-docker + image: ratdad/cgit-docker:latest + ports: + - 80:80 + volumes: + - ./etc/httpd/conf/httpd.conf:/etc/httpd/conf/httpd.conf # apply custom httpd config + - ./etc/cgitrc:/etc/cgitrc # apply custom cgit runtime config + - ./opt/highlight.sh:/opt/highlight.sh # use a custom highlight script + - ./srv/git/:/srv/git # mount the dir cgit reads for repositories +``` diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..aca365f --- /dev/null +++ b/compose.yml @@ -0,0 +1,17 @@ +# +# +# cgit-docker compose example + +name: 'cgit-docker' + +services: + cgit: + container_name: cgit-docker + image: ratdad/cgit-docker:latest + ports: + - 80:80 + volumes: + - ./etc/httpd/conf/httpd.conf:/etc/httpd/conf/httpd.conf # apply custom httpd config + - ./etc/cgitrc:/etc/cgitrc # apply custom cgit runtime config + - ./opt/highlight.sh:/opt/highlight.sh # use a custom highlight script + - ./srv/git/:/srv/git # mount the dir cgit reads for repositories diff --git a/etc/httpd/conf/httpd.conf b/etc/httpd/conf/httpd.conf new file mode 100644 index 0000000..d99bd92 --- /dev/null +++ b/etc/httpd/conf/httpd.conf @@ -0,0 +1,45 @@ +## +## Apache Server Configuration +## + +ServerRoot /etc/httpd + +# +# Load Standard 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 + +# +# Server config +Listen 0.0.0.0:80 +ServerName localhost +ServerAdmin root@localhost +EnableSendFile on +AddDefaultCharset UTF-8 +TypesConfig /etc/mime.types +MIMEMagicFile conf/magic + + + Require all denied + + +DocumentRoot "/srv/www/htdocs/cgit" + + DirectoryIndex cgit.cgi + AddHandler cgi-script .cgi + AllowOverride None + Options +ExecCGI -FollowSymLinks + Require all granted + + +# Future proof + + Require all denied + \ No newline at end of file diff --git a/etc/httpd/httpd.conf b/etc/httpd/httpd.conf deleted file mode 100644 index d99bd92..0000000 --- a/etc/httpd/httpd.conf +++ /dev/null @@ -1,45 +0,0 @@ -## -## Apache Server Configuration -## - -ServerRoot /etc/httpd - -# -# Load Standard 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 - -# -# Server config -Listen 0.0.0.0:80 -ServerName localhost -ServerAdmin root@localhost -EnableSendFile on -AddDefaultCharset UTF-8 -TypesConfig /etc/mime.types -MIMEMagicFile conf/magic - - - Require all denied - - -DocumentRoot "/srv/www/htdocs/cgit" - - DirectoryIndex cgit.cgi - AddHandler cgi-script .cgi - AllowOverride None - Options +ExecCGI -FollowSymLinks - Require all granted - - -# Future proof - - Require all denied - \ No newline at end of file -- cgit v1.2.3-70-g09d2