diff options
23 files changed, 162 insertions, 42 deletions
@@ -11,7 +11,7 @@ if ls *.changes > /dev/null 2> /dev/null; then if [ "$PRECLEAN" == "y" ]; then git clean; else exit 1; fi fi -for SOURCE in libpiny piny pinyadmin; do (cd "$SOURCE"; debuild -tc "$@"); done +for SOURCE in libpiny piny pinyadmin pinyconfigs; do (cd "$SOURCE"; debuild -tc "$@"); done echo echo -n "Install packages on this machine? (y/N) " diff --git a/deploy/etc/cron.daily/piny b/deploy/etc/cron.daily/piny deleted file mode 100644 index b42a806..0000000 --- a/deploy/etc/cron.daily/piny +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -export GIT_DIR - -for GIT_DIR in $(find /srv/git/ -maxdepth 1 -mindepth 1 -type d -name '*.git'); do -# echo $GIT_DIR - git gc --aggressive --auto --quiet - git update-server-info -done diff --git a/docs/issues/debian_packaging_concerns.mdwn b/docs/issues/debian_packaging_concerns.mdwn index 2594e4b..48203bd 100644 --- a/docs/issues/debian_packaging_concerns.mdwn +++ b/docs/issues/debian_packaging_concerns.mdwn @@ -1,5 +1,5 @@ * Status: [[!taglink open]] <!-- Choose one: open, closed --> -* Assigned to: [[!taglink jrayhawk]] <!-- Choose one or more: jrayhawk, jblake --> +* Assigned to: [[!taglink jblake]] <!-- Choose one or more: jrayhawk, jblake --> * Priority: [[!taglink now]] <!-- Choose one: now, soon, later --> * Opened by: jrayhawk @@ -7,23 +7,11 @@ There are a variety of things that wind up needing to be manually handled outside of the package installation in order to get piny working. It would be nice to correct all these. -* /etc/piny.conf -* /etc/cron.*/piny -* /etc/sudoers.d/pinyadmin -* /etc/sv/git-daemon/run - * --base-path=/var/cache /var/cache/git is not a very good place at all; what do we do about that? * /srv/rbin -* mkdir /srv/git -* mkdir /etc/piny -* mkdir /etc/apache2/piny-available -* mkdir /etc/apache2/piny-enabled * mkdir /srv/www/$ikiwiki_destdir/repos -* mkdir /etc/ikiwiki/wikilist.d -* lots of /etc/cgitrc changes * mkdir /srv/www/$ikiwiki_destdir/static +* all the other stuff in /srv that i need to think about * ln /usr/share/cgit/cgit.css /srv/www/$ikiwiki_destdir/static * ln /usr/share/cgit/logo.png /srv/www/$ikiwiki_destdir/static -* /srv/git-template.git -* change GROUP to shadow in /etc/apache2/envvars Dependencies should now be handled by the piny metapackage. diff --git a/piny/debian/control b/piny/debian/control index 90ae99f..5bc9988 100644 --- a/piny/debian/control +++ b/piny/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.8.4 Package: piny Architecture: all Depends: pinyadmin -Recommends: apache2, cgit, dvipng, gcc, git-daemon-run, graphviz, ikiwiki, libapache2-mod-auth-pam, libapache2-mod-auth-sys-group, libc6-dev, libcgi-formbuilder-perl, perlmagick, texlive-science +Recommends: apache2, cgit, dvipng, gcc, git-daemon-run, graphviz, ikiwiki, libapache2-mod-auth-pam, libapache2-mod-auth-sys-group, libc6-dev, libcgi-formbuilder-perl, perlmagick, pinyconfigs, texlive-science Description: Metapackage to bring in the piny infrastructure This is a virtual package which depends on the essential parts of the piny infrastructure, and recommends all the other packages used in a complete piny 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 <jblake@omgwallhack.org> 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 <jblake@omgwallhack.org> +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 <jrayhawk@omgwallhack.org> +Copyright © 2010 Julian Blake Kongslie <jblake@omgwallhack.org> +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/deploy/etc/apache2/sites-available/001-piny b/pinyconfigs/etc/apache2/sites-available/piny index 6e5c3fd..05808f4 100644 --- a/deploy/etc/apache2/sites-available/001-piny +++ b/pinyconfigs/etc/apache2/sites-available/piny @@ -8,7 +8,7 @@ AllowOverride None </Directory> - RedirectMatch 301 ^/$ http://piny.be/piny-web/ + RedirectMatch 301 ^/$ http://piny.be/piny-web/ </VirtualHost> <VirtualHost *:80> @@ -25,7 +25,7 @@ AllowOverride None </Directory> - RedirectMatch 301 ^/$ http://piny.be/piny-web/ + RedirectMatch 301 ^/$ http://piny.be/piny-web/ SSLEngine On SSLCertificateFile /etc/ssl/private/secure.piny.be.pem diff --git a/deploy/etc/cgitrc b/pinyconfigs/etc/cgitrc index db2a9c4..a557df0 100644 --- a/deploy/etc/cgitrc +++ b/pinyconfigs/etc/cgitrc @@ -1,6 +1,5 @@ # Enable caching of up to 1000 output entriess -cache-size=1000 - +cache-size=0 # Specify some default clone prefixes clone-prefix=git://piny.be git+ssh://piny.be/srv/git @@ -8,42 +7,33 @@ 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 - -# Add a cgit favicon -#favicon=/cgit/favicon.ico - - # 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. @@ -51,7 +41,7 @@ snapshots=tar.gz zip ## 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 +## include=/etc/cgitrepos ## 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 --- /dev/null +++ b/pinyconfigs/etc/piny-default.conf diff --git a/pinyconfigs/etc/piny-override.conf b/pinyconfigs/etc/piny-override.conf new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/pinyconfigs/etc/piny-override.conf 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 |