|
| 1 | +# gitlist — Git Browser Component for code.bioconductor.org |
| 2 | + |
| 3 | +## Description |
| 4 | +The `gitlist` directory contains the Dockerized GitList web application used to browse Bioconductor package repositories. |
| 5 | + |
| 6 | +## Architecture |
| 7 | + |
| 8 | +The service runs as two cooperating processes inside a single container: |
| 9 | + |
| 10 | +- **nginx** – A lightweight web server that: |
| 11 | + - Listens for HTTP requests from clients. |
| 12 | + - Serves static assets (CSS, JS, images) directly for speed. |
| 13 | + - Forwards requests that require PHP processing to `php-fpm`. |
| 14 | + |
| 15 | +- **php-fpm** – The PHP FastCGI Process Manager that: |
| 16 | + - Runs the GitList PHP code. |
| 17 | + - Handles dynamic requests like rendering repository views, diffs, and commit history. |
| 18 | + - Returns generated HTML back to `nginx` over a FastCGI interface. |
| 19 | + |
| 20 | +**Flow of a request:** |
| 21 | +1. User requests a GitList page (e.g., `/packages/myPackage/commit/1234`). |
| 22 | +2. `nginx` checks if it’s a static file — if not, it proxies the request to `php-fpm` via FastCGI. |
| 23 | +3. `php-fpm` executes the GitList PHP code, which reads from the Git repositories mounted at `/var/git`. |
| 24 | +4. The generated HTML is sent back through `nginx` to the user’s browser. |
| 25 | + |
| 26 | +This separation allows: |
| 27 | +- Static files to be served very quickly without touching PHP. |
| 28 | +- PHP code to run in a managed, pooled environment (improving performance and stability). |
| 29 | + |
| 30 | +## GoAccess Web Logs |
| 31 | + |
| 32 | +The GitList service’s access logs are analysed using **[GoAccess](https://goaccess.io/)**, a real-time log analyzer. |
| 33 | +The GoAccess output is published as a password-protected dashboard at: https://code.bioconductor.org/logs |
| 34 | + |
| 35 | +### GoAccess Features: |
| 36 | + |
| 37 | +- Tracks visitor counts, request types, most popular repositories/pages. |
| 38 | +- Monitors response codes, referrers, and bandwidth usage. |
| 39 | +- Generates a live HTML report updated every second. |
| 40 | +- The `/logs` endpoint is protected by HTTP Basic Authentication configured in `nginx`. Contact Mike Smith for details on the password or update the `nginx-auth-secret` in kubernetes. |
| 41 | + |
| 42 | +## Log Rotation & Maintenance |
| 43 | + |
| 44 | +To prevent large log files from filling the disk: |
| 45 | +- **`logrotate`** is configured to: |
| 46 | + - Rotate `nginx` access and error logs on a daily schedule retaining the last 90 days. |
| 47 | + - Trigger GoAccess processing after rotation so that stats are up-to-date. |
| 48 | + |
| 49 | +- **Kubernetes CronJob**: |
| 50 | + - Runs `logrotate` daily to ensure log files are rotated without manual intervention. |
| 51 | + - Sends a `kill -USR1 1` message to the pods running `nginx` and `goaccess` to ensure they start using the newly created log files. |
| 52 | + |
0 commit comments