From 82f9c9f1fa19c59e296570412656c66607d46f48 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 7 Nov 2010 00:09:53 -0700 Subject: pinyconfigs Adding a package that does all the config file magic to get a piny instance running. Signed-off-by: Julian Blake Kongslie --- pinyconfigs/Makefile | 20 +++++++ pinyconfigs/debian/changelog | 5 ++ pinyconfigs/debian/compat | 1 + pinyconfigs/debian/control | 16 +++++ pinyconfigs/debian/copyright | 3 + pinyconfigs/debian/pinyconfigs.postinst | 19 ++++++ pinyconfigs/debian/pinyconfigs.postrm | 34 +++++++++++ pinyconfigs/debian/pinyconfigs.preinst | 18 ++++++ pinyconfigs/debian/pinyconfigs.prerm | 14 +++++ pinyconfigs/debian/rules | 4 ++ pinyconfigs/debian/source/format | 1 + pinyconfigs/etc/apache2/envvars | 3 + pinyconfigs/etc/apache2/sites-available/piny | 63 +++++++++++++++++++ pinyconfigs/etc/cgitrc | 90 ++++++++++++++++++++++++++++ pinyconfigs/etc/cron.weekly/piny | 8 +++ pinyconfigs/etc/piny-default.conf | 0 pinyconfigs/etc/piny-override.conf | 0 pinyconfigs/etc/sudoers.d/pinyadmin | 1 + pinyconfigs/etc/sv/git-daemon/run | 4 ++ 19 files changed, 304 insertions(+) create mode 100644 pinyconfigs/Makefile create mode 100644 pinyconfigs/debian/changelog create mode 100644 pinyconfigs/debian/compat create mode 100644 pinyconfigs/debian/control create mode 100644 pinyconfigs/debian/copyright create mode 100755 pinyconfigs/debian/pinyconfigs.postinst create mode 100755 pinyconfigs/debian/pinyconfigs.postrm create mode 100755 pinyconfigs/debian/pinyconfigs.preinst create mode 100755 pinyconfigs/debian/pinyconfigs.prerm create mode 100755 pinyconfigs/debian/rules create mode 100644 pinyconfigs/debian/source/format create mode 100644 pinyconfigs/etc/apache2/envvars create mode 100644 pinyconfigs/etc/apache2/sites-available/piny create mode 100644 pinyconfigs/etc/cgitrc create mode 100755 pinyconfigs/etc/cron.weekly/piny create mode 100644 pinyconfigs/etc/piny-default.conf create mode 100644 pinyconfigs/etc/piny-override.conf create mode 100644 pinyconfigs/etc/sudoers.d/pinyadmin create mode 100755 pinyconfigs/etc/sv/git-daemon/run (limited to 'pinyconfigs') diff --git a/pinyconfigs/Makefile b/pinyconfigs/Makefile new file mode 100644 index 0000000..8a23b38 --- /dev/null +++ b/pinyconfigs/Makefile @@ -0,0 +1,20 @@ +build: + +install: + install -o root -g root -m 755 -d \ + $(DESTDIR)/etc/apache2/piny-available \ + $(DESTDIR)/etc/apache2/piny-enabled \ + $(DESTDIR)/etc/apache2/sites-available \ + $(DESTDIR)/etc/cron.weekly \ + $(DESTDIR)/etc/ikiwiki/wikilist.d \ + $(DESTDIR)/etc/sudoers.d \ + $(DESTDIR)/etc/sv/git-daemon \ + $(DESTDIR)/srv/git + install -o root -g root -m 644 etc/cgitrc etc/piny-default.conf etc/piny-override.conf $(DESTDIR)/etc + install -o root -g root -m 644 etc/apache2/envvars $(DESTDIR)/etc/apache2 + install -o root -g root -m 644 etc/apache2/sites-available/piny $(DESTDIR)/etc/apache2/sites-available + install -o root -g root -m 755 etc/cron.weekly/piny $(DESTDIR)/etc/cron.weekly + install -o root -g root -m 600 etc/sudoers.d/pinyadmin $(DESTDIR)/etc/sudoers.d + install -o root -g root -m 755 etc/sv/git-daemon/run $(DESTDIR)/etc/sv/git-daemon + +clean: diff --git a/pinyconfigs/debian/changelog b/pinyconfigs/debian/changelog new file mode 100644 index 0000000..e34f3f8 --- /dev/null +++ b/pinyconfigs/debian/changelog @@ -0,0 +1,5 @@ +pinyconfigs (0.1) unstable; urgency=low + + * Initial release. + + -- Julian Blake Kongslie Fri, 05 Nov 2010 11:01:59 -0700 diff --git a/pinyconfigs/debian/compat b/pinyconfigs/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/pinyconfigs/debian/compat @@ -0,0 +1 @@ +7 diff --git a/pinyconfigs/debian/control b/pinyconfigs/debian/control new file mode 100644 index 0000000..fe1c839 --- /dev/null +++ b/pinyconfigs/debian/control @@ -0,0 +1,16 @@ +Source: pinyconfigs +Maintainer: Julian Blake Kongslie +Section: admin +Build-depends: debhelper (>= 7) +Priority: extra +Homepage: http://www.piny.be/piny-code/ +Standards-version: 3.8.4 + +Package: pinyconfigs +Architecture: all +Depends: ${misc:Depends} +Description: Configuration files for piny + The configuration files needed for a piny configuration. + . + This package diverts config files from many other packages in order to + configure a system to run a piny instance. diff --git a/pinyconfigs/debian/copyright b/pinyconfigs/debian/copyright new file mode 100644 index 0000000..9d12aab --- /dev/null +++ b/pinyconfigs/debian/copyright @@ -0,0 +1,3 @@ +Copyright © 2010 Joe Rayhawk +Copyright © 2010 Julian Blake Kongslie +Licensed under the BSD 3-clause license. diff --git a/pinyconfigs/debian/pinyconfigs.postinst b/pinyconfigs/debian/pinyconfigs.postinst new file mode 100755 index 0000000..919f205 --- /dev/null +++ b/pinyconfigs/debian/pinyconfigs.postinst @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +case "$1" in + + configure) + + if [ "$2" = "" ]; then + # If this is a fresh install, enable the piny site in apache. + a2ensite piny || true + fi + + ;; + + *) + ;; + +esac diff --git a/pinyconfigs/debian/pinyconfigs.postrm b/pinyconfigs/debian/pinyconfigs.postrm new file mode 100755 index 0000000..ac69cc8 --- /dev/null +++ b/pinyconfigs/debian/pinyconfigs.postrm @@ -0,0 +1,34 @@ +#!/bin/sh + +set -e + +case "$1" in + + remove) + + dpkg-divert --divert /etc/apache2/envvars.default --package pinyconfigs --remove /etc/apache2/envvars + dpkg-divert --divert /etc/cgitrc.default --package pinyconfigs --remove /etc/cgitrc + dpkg-divert --divert /etc/sv/git-daemon/run.default --package pinyconfigs --remove /etc/sv/git-daemon/run + + ;; + + purge) + + if [ -e /etc/apache2/envvars.default ]; then + mv /etc/apache2/envvars.default /etc/apache2/envvars + fi + + if [ -e /etc/cgitrc.default ]; then + mv /etc/cgitrc.default /etc/cgitrc + fi + + if [ -e /etc/sv/git-daemon/run.default ]; then + mv /etc/sv/git-daemon/run.default /etc/sv/git-daemon/run + fi + + ;; + + *) + ;; + +esac diff --git a/pinyconfigs/debian/pinyconfigs.preinst b/pinyconfigs/debian/pinyconfigs.preinst new file mode 100755 index 0000000..e09313a --- /dev/null +++ b/pinyconfigs/debian/pinyconfigs.preinst @@ -0,0 +1,18 @@ +#!/bin/sh + +set -e + +case "$1" in + + install) + + dpkg-divert --divert /etc/apache2/envvars.default --package pinyconfigs --rename /etc/apache2/envvars + dpkg-divert --divert /etc/cgitrc.default --package pinyconfigs --rename /etc/cgitrc + dpkg-divert --divert /etc/sv/git-daemon/run.default --package pinyconfigs --rename /etc/sv/git-daemon/run + + ;; + + *) + ;; + +esac diff --git a/pinyconfigs/debian/pinyconfigs.prerm b/pinyconfigs/debian/pinyconfigs.prerm new file mode 100755 index 0000000..2556521 --- /dev/null +++ b/pinyconfigs/debian/pinyconfigs.prerm @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +case "$1" in + + remove) + a2dissite piny || true + ;; + + *) + ;; + +esac diff --git a/pinyconfigs/debian/rules b/pinyconfigs/debian/rules new file mode 100755 index 0000000..2d33f6a --- /dev/null +++ b/pinyconfigs/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff --git a/pinyconfigs/debian/source/format b/pinyconfigs/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/pinyconfigs/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/pinyconfigs/etc/apache2/envvars b/pinyconfigs/etc/apache2/envvars new file mode 100644 index 0000000..c129349 --- /dev/null +++ b/pinyconfigs/etc/apache2/envvars @@ -0,0 +1,3 @@ +. /etc/apache2/envvars.default + +export APACHE_RUN_GROUP=shadow diff --git a/pinyconfigs/etc/apache2/sites-available/piny b/pinyconfigs/etc/apache2/sites-available/piny new file mode 100644 index 0000000..05808f4 --- /dev/null +++ b/pinyconfigs/etc/apache2/sites-available/piny @@ -0,0 +1,63 @@ + + ServerName piny.be + + DocumentRoot /srv/www/piny.be + + + Options Indexes FollowSymLinks MultiViews + AllowOverride None + + + RedirectMatch 301 ^/$ http://piny.be/piny-web/ + + + + ServerName www.piny.be + RedirectMatch 301 (.*) http://piny.be$1 + + + + ServerName piny.be + DocumentRoot /srv/www/piny.be + + + Options Indexes FollowSymLinks MultiViews + AllowOverride None + + + RedirectMatch 301 ^/$ http://piny.be/piny-web/ + + SSLEngine On + SSLCertificateFile /etc/ssl/private/secure.piny.be.pem + SSLCACertificateFile /etc/ssl/private/GandiStandardSSLCA.pem + + + + ServerName secure.piny.be + RedirectMatch 301 (.*) https://secure.piny.be$1 + + + + ServerName secure.piny.be + DocumentRoot /srv/www/secure.piny.be + + + SSLRequireSSL + SetHandler cgi-script + AllowOverride None + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + + + ScriptAlias /cgit /usr/lib/cgi-bin/cgit.cgi + + Include /etc/apache2/piny-enabled + + SSLEngine On + SSLCertificateFile /etc/ssl/private/secure.piny.be.pem + SSLCACertificateFile /etc/ssl/private/GandiStandardSSLCA.pem + + + + ServerName piny.svcs.cs.pdx.edu + RedirectMatch 301 (.*) http://piny.be$1 + diff --git a/pinyconfigs/etc/cgitrc b/pinyconfigs/etc/cgitrc new file mode 100644 index 0000000..a557df0 --- /dev/null +++ b/pinyconfigs/etc/cgitrc @@ -0,0 +1,90 @@ +# Enable caching of up to 1000 output entriess +cache-size=0 + +# Specify some default clone prefixes +clone-prefix=git://piny.be git+ssh://piny.be/srv/git + +# Specify the css url +css=http://piny.be/piny-shared/cgit/cgit.css + +# Show extra links for each repository on the index page +enable-index-links=1 + +# Show number of affected files per commit on the log pages +enable-log-filecount=1 + +# Show number of added/removed lines per commit on the log pages +enable-log-linecount=1 + +# Use a custom logo +logo=http://piny.be/piny-shared/cgit/cgit.png + +# Set the title and heading of the repository index page +root-title=Piny git repositories + +# Set a subheading for the repository index page +root-desc=For all your informational needs. + +# Include some more info about foobar.com on the index page +#root-readme=/var/www/htdocs/about.html + +# Allow download of tar.gz, tar.bz and zip-files +snapshots=tar.gz zip + +scan-path=/srv/git + +enable-gitweb-owner=1 + +## +## List of repositories. +## PS: Any repositories listed when repo.group is unset will not be +## displayed under a group heading +## PPS: This list could be kept in a different file (e.g. '/etc/cgitrepos') +## and included like this: +## include=/etc/cgitrepos +## + + +#repo.url=piny-web +#repo.path=/srv/git/piny-web.git +#repo.desc=piny-web +#repo.owner=jrayhawk+piny.be@omgwallhack.org +#repo.readme=info/web/about.html + + +#repo.url=piny-shared +#repo.path=/srv/git/piny-shared.git +#repo.desc=piny-shared +#repo.owner=jrayhawk+piny.be@omgwallhack.org +#repo.readme=info/web/about.html + + +# The next repositories will be displayed under the 'extras' heading + +#repo.url=baz +#repo.path=/pub/git/baz.git +#repo.desc=a set of extensions for bar users + +#repo.url=wiz +#repo.path=/pub/git/wiz.git +#repo.desc=the wizard of foo + + +# Add some mirrored repositories +#repo.group=mirrors + + +#repo.url=git +#repo.path=/pub/git/git.git +#repo.desc=the dscm + + +#repo.url=linux +#repo.path=/pub/git/linux.git +#repo.desc=the kernel + +# Disable adhoc downloads of this repo +repo.snapshots=0 + +# Disable line-counts for this repo +repo.enable-log-linecount=0 diff --git a/pinyconfigs/etc/cron.weekly/piny b/pinyconfigs/etc/cron.weekly/piny new file mode 100755 index 0000000..3719879 --- /dev/null +++ b/pinyconfigs/etc/cron.weekly/piny @@ -0,0 +1,8 @@ +#/bin/sh + +export GIT_DIR + +for GIT_DIR in `find /srv/git/ -mindepth 1 -type d -name '*.git' -print -prune`; do + git gc --aggressive --auto --quiet + git pack-refs --all +done diff --git a/pinyconfigs/etc/piny-default.conf b/pinyconfigs/etc/piny-default.conf new file mode 100644 index 0000000..e69de29 diff --git a/pinyconfigs/etc/piny-override.conf b/pinyconfigs/etc/piny-override.conf new file mode 100644 index 0000000..e69de29 diff --git a/pinyconfigs/etc/sudoers.d/pinyadmin b/pinyconfigs/etc/sudoers.d/pinyadmin new file mode 100644 index 0000000..c6702b7 --- /dev/null +++ b/pinyconfigs/etc/sudoers.d/pinyadmin @@ -0,0 +1 @@ +%users ALL=(root) NOPASSWD: /usr/sbin/addaccess, /usr/sbin/newrepo, /usr/sbin/newuser, /usr/sbin/pinyconfig, /usr/sbin/rmaccess, /usr/sbin/rmrepo diff --git a/pinyconfigs/etc/sv/git-daemon/run b/pinyconfigs/etc/sv/git-daemon/run new file mode 100755 index 0000000..307377e --- /dev/null +++ b/pinyconfigs/etc/sv/git-daemon/run @@ -0,0 +1,4 @@ +#!/bin/sh +exec 2>&1 +echo 'git daemon starting.' +exec chpst -ugitdaemon git daemon --verbose --base-path=/srv/git -- cgit v1.2.3