Skip to content

Commit

Permalink
Merge pull request #12 from aservo/feature/cgit
Browse files Browse the repository at this point in the history
cgit
  • Loading branch information
pathob authored Apr 23, 2023
2 parents 5893dc3 + 73d610a commit 6b164be
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 30 deletions.
34 changes: 26 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG REGISTRY=docker.io
ARG APACHE_IMAGE_TAG=2.4.57-debian-11-r2
ARG APACHE_IMAGE_TAG=2.4.57-debian-11-r7
ARG MOD_AUTH_MELLON_VERSION=0.18.1

FROM ${REGISTRY}/bitnami/apache:${APACHE_IMAGE_TAG} as builder
Expand All @@ -10,15 +10,15 @@ USER root
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
dh-autoreconf \
libcurl4-openssl-dev \
liblasso3-dev \
make \
unzip \
wget \
openssl \
liblasso3-dev \
libcurl4-openssl-dev \
publicsuffix \
pkg-config \
dh-autoreconf \
publicsuffix \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*

ARG MOD_AUTH_MELLON_VERSION
Expand All @@ -36,10 +36,28 @@ RUN wget "https://github.com/latchset/mod_auth_mellon/releases/download/v${MOD_A

# install generic packages (keep separated in case we want to use builder image)
RUN apt-get update && apt-get install -y \
git \
inotify-tools \
zip \
&& rm -rf /var/lib/apt/lists/*

# install cgit without postinst script (does not work with the Bitnami Apache image)
ARG CGIT_PACKAGE=cgit
ARG CGIT_TMP_DIR=/tmp/${CGIT_PACKAGE}
RUN apt-get update \
&& mkdir -p ${CGIT_TMP_DIR} \
&& chown -R _apt:root ${CGIT_TMP_DIR} \
&& cd ${CGIT_TMP_DIR} \
&& apt-get download ${CGIT_PACKAGE} \
&& dpkg --unpack $(find . -name "${CGIT_PACKAGE}*.deb" -printf "%f" | head -n 1) \
&& rm /var/lib/dpkg/info/${CGIT_PACKAGE}.postinst -f \
## usually, we would need to run 'dpkg --configure ${CGIT_PACKAGE}' now, but then the dependencies would be missing
## instead, we just run 'apt-get install -yf' which installs both, dependencies and cgit without postinst script
&& apt-get install -yf \
&& rm -rf /tmp/${CGIT_PACKAGE}* \
&& rm -rf /var/lib/apt/lists/*

# add (and override) scripts to scripts in upstream image
COPY ./scripts /opt/bitnami/scripts/apache/

USER www-data
USER 1001
55 changes: 33 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,54 @@ Archiving

## Purpose

This Docker image is intended for
* use with the bitnami apache helmchart
* SAML authentication

## Github actions

It is a Docker image that has been "optimized" to run with GitHub Actions.

This means:

* it can be run with the `root` user
* it does not declare an own workdir

See https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions
This Docker image is intended for:

* providing an all-in-one archiving solution based on Apache webserver for text, files, and SCM repos
* use with the [Bitnami Apache Helm chart](https://github.com/bitnami/charts/tree/main/bitnami/apache)
* SAML authentication

## Binaries

It contains the following primary binaries:

* [`bitnami apache`](https://hub.docker.com/r/bitnami/apache)
* `mod_auth_mellon` [code](https://packages.debian.org/de/source/sid/libapache2-mod-auth-mellon) ([github](https://github.com/latchset/mod_auth_mellon))
* [`mod_auth_mellon`](https://github.com/latchset/mod_auth_mellon)
* [`cgit`](https://git.zx2c4.com/cgit)

Additionally it contains the following secondary binaries:

* `git` (for `cgit`)
* `inotify-tools` (for Apache config auto-reload)
* `zip` (for `cgit`)

## Configuration

### Apache

From: https://github.com/bitnami/containers/tree/main/bitnami/apache#customize-this-image

Configuration files are located in `/opt/bitnami/apache/conf`.
To deviate from defaults, start with mouting /opt/bitnami/apache/conf/httpd.conf
Configuration files are located in `/opt/bitnami/apache/conf`.
To deviate from defaults, start with mounting `/opt/bitnami/apache/conf/httpd.conf`

#### Defaults

### Defaults
* Document Root: `/app`
* Document Root: `/app`
* Virtual hosts files: `/opt/bitnami/apache/conf/vhosts/`
* Certificates: `/certs`
* `server.crt`
* `server.key`

### Environment Variables
* APACHE_HTTP_PORT_NUMBER
* APACHE_HTTPS_PORT_NUMBER
#### Environment Variables

* `APACHE_HTTP_PORT_NUMBER`
* `APACHE_HTTPS_PORT_NUMBER`

### cgit

The cgit installation uses the following directories:

* CGI script: `/usr/lib/cgit/cgit.cgi`
* Web assets: `/usr/share/cgit/`
* `cgit.css`
* `cgit.png`
* Configuration: `/etc/cgitrc`

0 comments on commit 6b164be

Please sign in to comment.