cgit: Don't depend on unmaintained upstream; work directly with debian

Change-Id: Ifa98f77c24298265e39313b679944d649e25ddde
changes/16/20416/3
Harald Welte 2 years ago
parent e5f036796c
commit 28a44de777
  1. 27
      cgit/Dockerfile
  2. 36
      cgit/config/cgitrc
  3. 23
      cgit/config/nginx.conf

@ -1,7 +1,30 @@
FROM ankitrgadiya/cgit:debian-nginx
# from https://github.com/ankitrgadiya/docker-cgit/blob/master/debian-nginx/Dockerfile
################################################################################
FROM debian:latest
# This adds the Osmocom specific syntax highlighting + redmine/gerrit integration
# Update repositories the system
RUN apt-get update
# Install packages
RUN apt-get install git cgit nginx highlight fcgiwrap -y
# Add configurations
ADD config/nginx.conf /etc/nginx/sites-available/git
ADD config/cgitrc /etc/cgitrc
# Enable configuration
RUN rm -rf /etc/nginx/sites-enabled/*
RUN ln -s /etc/nginx/sites-available/git /etc/nginx/sites-enabled/git
# Start
EXPOSE 80
CMD service fcgiwrap restart && nginx -g 'daemon off;'
# osmocom additions
################################################################################
# This adds the Osmocom specific syntax highlighting + redmine/gerrit integration
RUN apt-get update
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 \

@ -0,0 +1,36 @@
# CGIT config
virtual-root=/
css=/cgit.css
# logo=/logo.png
footer=
source-filter=/usr/lib/cgit/filters/syntax-highlighting.sh
root-title=Repositories
root-desc=
noplainemail=1
# clone-prefix=http://example.com
# Enable snapshots
snapshots=tar.gz zip
# Disable owner index
enable-index-owner=0
mimetype.git=image/git
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
# Caching
cache-dynamic-ttl=60
cache-static-ttl=44640
cache-root-ttl=6
cache-repo-ttl=120
scan-path=/git

@ -0,0 +1,23 @@
server {
listen 80 default_server;
# listen 443 ssl;
# ssl_certificate /etc/nginx/certs/final.crt;
# ssl_certificate_key /etc/nginx/certs/private.key;
server_name localhost;
index cgit.cgi;
root /usr/share/cgit;
try_files $uri @cgit;
location @cgit {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi;
fastcgi_param PATH_INFO $uri;
fastcgi_param QUERY_STRING $args;
fastcgi_param HTTP_HOST $server_name;
fastcgi_pass unix:/run/fcgiwrap.socket;
}
}
Loading…
Cancel
Save