|
1 |
| -gitblob.py |
2 |
| -========== |
3 |
| -Delivers Git-based websites via apache2/mod_python |
| 1 | +# gitblob.py |
| 2 | +This program renders websites from a bare git repository. |
| 3 | +It's a handler for mod_python in the Apache2 webserver. |
4 | 4 |
|
5 | 5 | Author: Armin Pech <github (at) arminpech (dot) de>
|
6 |
| - |
7 |
| - |
8 |
| -Description |
9 |
| -=========== |
10 |
| - |
| 6 | +(Copyright & License)[/LICENSE] |
| 7 | + |
| 8 | +## Description |
| 9 | +You manage your website content hierachically in a local git repository |
| 10 | +based on normal files and directories: |
| 11 | + |
| 12 | +``` |
| 13 | +/ |
| 14 | +| |
| 15 | +`-- /about |
| 16 | +| | |
| 17 | +| `-- /about/me |
| 18 | +| `-- /about/imprint |
| 19 | +`-- /blog |
| 20 | + | |
| 21 | + `-- /blog/2017-01-01-happy-new-year |
| 22 | +``` |
| 23 | + |
| 24 | +After content modifications you push your local repository content |
| 25 | +to a remote base repository on your webserver. |
| 26 | +The gitblog.py handler serves client requests from the base repo. |
| 27 | +The URI of the request matches the file and directory structure of |
| 28 | +your repository content. |
| 29 | + |
| 30 | +``` |
11 | 31 | Client --> Apache --> mod_python --> gitblog.py <--.
|
12 | 32 | |
|
13 | 33 | Desktop --> Local Repo --> Server Bare Repo -------´
|
14 |
| - |
15 |
| - |
16 |
| -Setup with Apache2 |
17 |
| -================== |
18 |
| -# Install mod_python for Apache2 webserver |
19 |
| -# Clone gitblog.py as webroot on your server |
20 |
| -# Setup a local Git repository on your desktop and create a directory structure |
21 |
| -# Setup a git bare repository on your server and push your local content to it |
22 |
| -# Create a VHost in your webserver configuration |
23 |
| -<VirtualHost *:80> |
24 |
| - ServerName gitblog.tld |
25 |
| - |
26 |
| - |
27 |
| - LogLevel warn |
28 |
| - ErrorLog /var/log/apache2/error_log-%{SERVER_NAME} |
29 |
| - CustomLog /var/log/apache2/access_log-%{SERVER_NAME} vhost |
30 |
| - |
31 |
| - DocumentRoot /var/www/gitblog.py/ |
32 |
| - |
33 |
| - <Location /> |
34 |
| - Require all granted |
35 |
| - SetHandler mod_python |
36 |
| - PythonPath "sys.path + ['/var/www/gitblog.py']" |
37 |
| - PythonOptimize On |
38 |
| - PythonAutoReload Off |
39 |
| - PythonDebug Off |
40 |
| - PythonHandlerModule gitblog |
41 |
| - PythonOption gitblog.wwwroot /var/git/gitblog.tld.git/ |
42 |
| - PythonOption gitblog.report_errors True |
43 |
| - </Location> |
44 |
| - |
45 |
| - # Compress output by filter |
46 |
| - <IfModule mod_deflate.c> |
47 |
| - SetOutputFilter DEFLATE |
48 |
| - </IfModule> |
49 |
| - |
50 |
| - # Cache website responses |
51 |
| - <IfModule mod_cache.c> |
52 |
| - <IfModule mod_disk_cache.c> |
53 |
| - CacheRoot /var/cache/apache2/gitblog.tld/ |
54 |
| - CacheEnable disk / |
55 |
| - CacheDirLevels 5 |
56 |
| - CacheDirLength 3 |
57 |
| - </IfModule> |
58 |
| - </IfModule> |
59 |
| -</VirtualHost> |
| 34 | +``` |
| 35 | + |
| 36 | +## Features |
| 37 | +* History and permanent links based on git commits/references |
| 38 | + /blog/1?ref=93faf2001885d7292c1d757bd21da9b10e786b42 |
| 39 | + /blog/1?ref=mytag1 |
| 40 | +* Multiple branches |
| 41 | + /blog/2?ref=HEAD |
| 42 | + /blog/2?ref=master |
| 43 | + /blog/2?ref=preview |
| 44 | + |
| 45 | +## Setup |
| 46 | +see (SETUP)[/SETUP] |
0 commit comments