git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Pfeiffer <coding _ lirion.de> 2018-06-26 23:32:40 +0200
committerHarald Pfeiffer <coding _ lirion.de> 2018-06-26 23:32:40 +0200
commit0fc1cb64def2ac7c0e234670d2c72bd71107a818 (patch)
tree7146b8e417ac5439ac55dbb3321f34b04794c54f
downloadcgit-config-0fc1cb64def2ac7c0e234670d2c72bd71107a818.tar.bz2
Initial commit
-rw-r--r--README.md16
-rw-r--r--apache/cgit.conf56
-rw-r--r--etc/cgitrc78
-rw-r--r--lib/email-filter.py28
-rw-r--r--www/assets/content.txt1
-rw-r--r--www/cgit.css1
l---------www/cgit.png1
l---------www/favicon.ico1
-rw-r--r--www/fonts/content.txt1
-rw-r--r--www/head.html15
-rw-r--r--www/head.php5
-rw-r--r--www/lirionnet.css6
l---------www/nav.php1
l---------www/robot.txt1
-rwxr-xr-xwww/update13
15 files changed, 224 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d39d562
--- /dev/null
+++ b/README.md
@@ -0,0 +1,16 @@
+## Objective
+
+This is just a mirror of what few adjustments I made to cgit to host my own repository.
+
+Some of this just reflects mechanisms - so it serves two simple purposes:
+
+1. For myself: reminder what I did
+2. For others: kickoff to your own customisation
+
+## Folders
+
+* **apache:** The apache config file
+* **www:** The www host referenced in the apache file; contains the CSS and stuff
+* **lib:** Your cgit lib folder, most likely /usr/lib/cgit when coming from
+ a distro package
+* **etc:** cgit's own configuration file(s)
diff --git a/apache/cgit.conf b/apache/cgit.conf
new file mode 100644
index 0000000..30c9d04
--- /dev/null
+++ b/apache/cgit.conf
@@ -0,0 +1,56 @@
+#vim:syntax=apache
+
+<IfModule mod_ssl.c>
+<VirtualHost *:80>
+ ServerName git.lirion.de
+ ServerAlias git.lirion.de
+ ServerSignature Off
+
+ RewriteEngine on
+ RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
+ RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
+ RewriteCond %{HTTPS} !=on
+ RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L]
+</VirtualHost>
+<VirtualHost *:443>
+ header set Public-Key-Pins 'pin-sha256="NxMynxRVjjSnl8BnON+6WwexY53HOyKtctua48Am6xA=";pin-sha256="8cwqjzxOlLuW9OGaHAj5GG6DCgZdXEd+OB9UJPWV9KE=";max-age=2419200;'
+ ServerAdmin webmaster@lirion.net
+ ServerName git.lirion.de
+ ServerAlias git.lirion.de git.lirion.net
+ # not my true DocRoot. Remember to replace this, and pay respect to the FHS, kids!
+ DocumentRoot "/www/cgit"
+
+ <Directory "/www/cgit">
+ AllowOverride None
+ Options ExecCGI FollowSymlinks
+ Order allow,deny
+ Allow from all
+ </Directory>
+
+ Alias /cgit.css "/www/cgit/cgit.css"
+ Alias /cgit.png "/www/cgit/cgit.png"
+ Alias /favicon.ico "/www/cgit/favicon.ico"
+ Alias /assets "/www/cgit/assets"
+ Alias /fonts "/www/cgit/fonts"
+ ScriptAlias / "/usr/lib/cgit/cgit.cgi/"
+
+ ErrorLog ${APACHE_LOG_DIR}/git.lirion.de-error.log
+ LogLevel warn
+ CustomLog ${APACHE_LOG_DIR}/git.lirion.de-access.log combined
+ SSLEngine on
+ # same as above - this is not the true entry. Adjust!
+ SSLCertificateKeyFile /ssl/private/git.lirion.de.key
+ SSLCertificateFile /ssl/public/git.lirion.de-chain.pem
+ <FilesMatch "\.(cgi|shtml|phtml|php)$">
+ SSLOptions +StdEnvVars
+ </FilesMatch>
+ <Directory /usr/lib/cgi-bin>
+ SSLOptions +StdEnvVars
+ </Directory>
+ BrowserMatch "MSIE [2-6]" \
+ nokeepalive ssl-unclean-shutdown \
+ downgrade-1.0 force-response-1.0
+ # MSIE 7 and newer should be able to use keepalive
+ BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
+</VirtualHost>
+</IfModule>
diff --git a/etc/cgitrc b/etc/cgitrc
new file mode 100644
index 0000000..7a9ac27
--- /dev/null
+++ b/etc/cgitrc
@@ -0,0 +1,78 @@
+#vim:syntax=config
+css=/cgit.css
+logo=/cgit.png
+favicon=/favicon.ico
+root-title=repositories @ lirion.de
+root-desc=...because we can. hosted in vogtland, saxony!
+enable-index-owner=1
+enable-http-clone=0
+enable-index-links=1
+enable-commit-graph=1
+enable-log-filecount=1
+enable-log-linecount=1
+cache-root=/var/cache/cgit
+case-sensitive-sort=0
+header=/www/cgit/head.html
+head-include=/www/cgit/lirionnet.css
+#favicon=/pommes.ico
+#logo=img(mylogo.png
+max-stats=quarter
+snapshots=tar.bz2
+#source-filter=/usr/lib/cgit/filters/syntax-highlighting.py
+source-filter=/usr/lib/cgit/filters/syntax-highlighting.sh
+about-filter=/usr/lib/cgit/filters/about-formatting.sh
+email-filter=/usr/lib/cgit/filters/email-filter.py
+readme=master:README.md
+readme=master:readme.md
+readme=master:README.rst
+readme=master:readme.rst
+readme=master:README.html
+readme=master:readme.html
+readme=master:README.htm
+readme=master:readme.htm
+readme=master:README.txt
+readme=master:readme.txt
+readme=master:README
+readme=master:readme
+readme=master:INSTALL.md
+readme=master:install.md
+readme=master:INSTALL.mkd
+readme=master:install.mkd
+readme=master:INSTALL.rst
+readme=master:install.rst
+readme=master:INSTALL.html
+readme=master:install.html
+readme=master:INSTALL.htm
+readme=master:install.htm
+readme=master:INSTALL.txt
+readme=master:install.txt
+readme=master:INSTALL
+readme=master:install
+section=os
+repo.url=systeminfo
+# This is obfuscated. Remember the FHS, kids!
+repo.path=/git/systeminfo.git
+repo.desc=Gives you system information on a Linux machine. Born from checks inside docker, yet to grow.
+repo.owner=H. P.
+#repo.readme=README.md
+section=server
+repo.url=gitlab-apache
+repo.path=/git/gitlab-apache.git
+repo.desc=Setup for a gitlab integrated as vhost into an already running apache, i.e. don't fork yet another non-distro web server thingy making maintenance and security a hell of a job.
+repo.url=mp3dir2html
+repo.path=/git/mp3dir2html.git
+repo.desc=Creates PHP/HTML from music directories
+repo.owner=H. P.
+repo.url=infinoted-init
+repo.path=/git/infinoted.git
+repo.desc=Infinoted SysVinit script and whatever else
+repo.owner=H. P.
+repo.url=cgit
+repo-path=/git/cgit.git
+repo.desc=My few adjustments to my own cgit instance.
+repo.owner=H. P.
+section=desktop
+repo.url=hattrick
+repo.path=/git/hattrick.git
+repo.desc=Personal hattrick.org scripts
+repo.owner=H.P.
diff --git a/lib/email-filter.py b/lib/email-filter.py
new file mode 100644
index 0000000..1b44e1e
--- /dev/null
+++ b/lib/email-filter.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+
+# Please prefer the email-gravatar.lua using lua: as a prefix over this script. This
+# script is very slow, in comparison.
+#
+# This script may be used with the email-filter or repo.email-filter settings in cgitrc.
+#
+# The following environment variables can be used to retrieve the configuration
+# of the repository for which this script is called:
+# CGIT_REPO_URL ( = repo.url setting )
+# CGIT_REPO_NAME ( = repo.name setting )
+# CGIT_REPO_PATH ( = repo.path setting )
+# CGIT_REPO_OWNER ( = repo.owner setting )
+# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting )
+# CGIT_REPO_SECTION ( = section setting )
+# CGIT_REPO_CLONE_URL ( = repo.clone-url setting )
+#
+# This simply receives text on stdin and replaces any occurrence of "@" by
+# " _ " to obfuscate emails. Not the most sophisticated algorithm (for now),
+# but laziness and time are two important factors.
+# It still helps with receiving email only from the wealthy Nigerian princes.
+# I need to make money, too.
+
+from sys import stdin
+text = stdin.read().strip()
+text=text.replace("@", " _ ")
+
+print(text)
diff --git a/www/assets/content.txt b/www/assets/content.txt
new file mode 100644
index 0000000..ed0f2a4
--- /dev/null
+++ b/www/assets/content.txt
@@ -0,0 +1 @@
+the assets/ folder
diff --git a/www/cgit.css b/www/cgit.css
new file mode 100644
index 0000000..df048d1
--- /dev/null
+++ b/www/cgit.css
@@ -0,0 +1 @@
+/* here be a symlink to cgit's native CSS */
diff --git a/www/cgit.png b/www/cgit.png
new file mode 120000
index 0000000..1d72e3c
--- /dev/null
+++ b/www/cgit.png
@@ -0,0 +1 @@
+the actual cgit logo \ No newline at end of file
diff --git a/www/favicon.ico b/www/favicon.ico
new file mode 120000
index 0000000..baee530
--- /dev/null
+++ b/www/favicon.ico
@@ -0,0 +1 @@
+your favicon \ No newline at end of file
diff --git a/www/fonts/content.txt b/www/fonts/content.txt
new file mode 100644
index 0000000..3c61089
--- /dev/null
+++ b/www/fonts/content.txt
@@ -0,0 +1 @@
+the actual fonts folder
diff --git a/www/head.html b/www/head.html
new file mode 100644
index 0000000..fedb311
--- /dev/null
+++ b/www/head.html
@@ -0,0 +1,15 @@
+<header>
+ <h1>git.lirion.de</h1>
+ <p>Of git, get, and gud</p>
+</header>
+<nav>
+ <a href="//lirion.de/" title="home"><span>lirion.de</span></a>
+ <a href="//lirion.de/" title="links"><span>Links</span></a>
+ <a href="//lirion.de/" title="about"><span>About</span></a>
+ <a href="//mail.lirion.de/" title="contact"><span>Contact</span></a>
+ <a href="//hots.lirion.de" title="hots"><span>Heroes of the Storm</span></a>
+ <a href="//minecraft.lirion.de" title="minecraft"><span>Minecraft</span></a>
+ <a href="//git.lirion.de" title="git"><span>GIT</span></a>
+ <a href="//autoconfig.lirion.de" title="autoconf"><span>autoconf</span></a>
+ <a href="//redhat.lirion.de" title="redhat"><span>RedHat</span></a>
+ </nav>
diff --git a/www/head.php b/www/head.php
new file mode 100644
index 0000000..8d40e16
--- /dev/null
+++ b/www/head.php
@@ -0,0 +1,5 @@
+<header>
+ <h1>git.lirion.de</h1>
+ <p>Of git, get, and gud</p>
+</header>
+<?php include('./nav.php'); ?>
diff --git a/www/lirionnet.css b/www/lirionnet.css
new file mode 100644
index 0000000..64d8b61
--- /dev/null
+++ b/www/lirionnet.css
@@ -0,0 +1,6 @@
+<style type="text/css">
+ /* here be the CSS included from my main domain */
+</style>
+<link rel="stylesheet" type="text/css" href="/fonts/telex-ht-regular.css"/>
+<link rel="stylesheet" type="text/css" href="/fonts/alte-din.css"/>
+<link rel="stylesheet" type="text/css" href="/fonts/elusive-icons.css"/>
diff --git a/www/nav.php b/www/nav.php
new file mode 120000
index 0000000..bbf3731
--- /dev/null
+++ b/www/nav.php
@@ -0,0 +1 @@
+symlink to the navigation fragment of the main website code \ No newline at end of file
diff --git a/www/robot.txt b/www/robot.txt
new file mode 120000
index 0000000..4e330c7
--- /dev/null
+++ b/www/robot.txt
@@ -0,0 +1 @@
+cgit's robot.txt \ No newline at end of file
diff --git a/www/update b/www/update
new file mode 100755
index 0000000..b118e70
--- /dev/null
+++ b/www/update
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+php head.php > head.html
+
+# style.css
+# This will be included in the cgit head itself, so... well. Let's wrap it.
+echo '<style type="text/css">' > lirionnet.css
+cat "/wherever/lirionnet.css" >> lirionnet.css
+echo '</style>' >> lirionnet.css
+for i in "/fonts/telex-ht-regular.css" "/fonts/alte-din.css" "/fonts/elusive-icons.css"
+do
+ echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$i\"/>" >> lirionnet.css
+done