summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Gordon <assafgordon@gmail.com>2014-11-05 00:29:15 (GMT)
committerA. Gordon <assafgordon@gmail.com>2014-11-05 00:29:15 (GMT)
commit039c1f1db2b5b874512cd0f71feaa7c4ad489bed (patch)
tree37f1248e7129122615281c4be4fdf08876446669
parent161838ff5f29c23ef25af3c8b6a8ff11268f662e (diff)
downloadgnu-sv-gitweb-039c1f1db2b5b874512cd0f71feaa7c4ad489bed.zip
gnu-sv-gitweb-039c1f1db2b5b874512cd0f71feaa7c4ad489bed.tar.gz
gnu-sv-gitweb-039c1f1db2b5b874512cd0f71feaa7c4ad489bed.tar.bz2
Added 'vcs.sv.gnu.org' configuration info
-rw-r--r--vcs-server/README-vcs.md77
-rw-r--r--vcs-server/apache-conf/webgit82
-rw-r--r--vcs-server/etc-conf/cgitrc-webgit46
-rw-r--r--vcs-server/etc-conf/gitweb-webgit.conf58
-rwxr-xr-xvcs-server/setup-scripts/gnu-webgit-fix-permissions.sh108
-rwxr-xr-xvcs-server/setup-scripts/gnu-webgit-setup-hooks.sh76
-rwxr-xr-xvcs-server/usr-src-infra-scripts/gnu-sv-get-project-type102
-rwxr-xr-xvcs-server/usr-src-infra-scripts/webgit/hooks/post-receive32
-rwxr-xr-xvcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/10-update-server-info15
-rwxr-xr-xvcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/20-update-web-server52
-rwxr-xr-xvcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/30-experimental-warning71
11 files changed, 719 insertions, 0 deletions
diff --git a/vcs-server/README-vcs.md b/vcs-server/README-vcs.md
new file mode 100644
index 0000000..1cafe76
--- /dev/null
+++ b/vcs-server/README-vcs.md
@@ -0,0 +1,77 @@
+# GNU Savannah GitWeb Project - VCS server configuration
+
+The Web-Git repositories (converted from WebCVS) are stored on
+`vcs.gnu.org` server, and use similar setup to the existing GIT repositories.
+
+The following items have been added on `vcs.gnu.org`.
+
+## GIT Repositories configuration
+
+The repositories are stored in `/srv/git/web/` .
+
+This enables seamless anonymous clone through git-daemon (which is
+already configured to expose `/srv/git/`.
+
+After conversion from CVS to GIT (done off-line, see elsewhere in this
+repository for details), the repositories have been copied to the VCS server.
+
+Each repository is configured as follows:
+
+1. Owner is `root`.
+2. Group owner is the project's name (e.g. `/srv/git/web/coreutils.git` is
+ owned by group `coreutils`, which already exists on `vcs.gnu.org`.
+3. Access mode is u=rwx,g=rws,o=rx (excepts for `hooks` subdir).
+4. The `hooks` sub-directory is owned by `root:root`, and has the immutable
+ attribute (`chattr +i`).
+5. A `post-receive` hook is installed to updated the web-server (see below).
+
+The scripts `./setup-scripts/gnu-webgit-fix-permissions.sh` and
+`./setup-scripts/gnu-webgit-setup-hooks.sh` were used to set permissions and
+hooks.
+
+## Hook Configuration
+
+Each WebGit repository has a `post-receive` hook symlinked to
+`/usr/src/infra/webgit/hooks/post-receive` .
+
+This script uses `run-parts` to execute three scripts in
+`./usr-src-infra-scripts/webgit/hooks/post-receive.d/`:
+
+1. `10-update-server-info` - runs `git update-server-info`
+2. `20-update-web-server` - notifies the webserver about repository updated.
+ Uses wget to activate the `new.py` script on the web server, with an
+ additional parameter signifing this is a git repository (as opposed to a
+ WebCVS repository update).
+3. `30-experimental-warning` - prints a warning to the user on every
+ `git push` about the experimental nature of this setup.
+
+An additional helper script `/usr-src-infra-scripts/gnu-sv-get-project-type`
+is used by the hooks to detect the project's type
+(i.e. gnu/non-gnu/www/translations).
+
+The scripts are available in this repository under `./usr-src-infra-scripts`.
+
+## Git Web / CGIT Configuration
+
+A separate GitWeb/CGIT configuration files are in `/etc/cgitrc-webgit` and
+`/etc/gitweb-webgit.conf`.
+
+The scripts are available in this repository under `./etc-conf` .
+
+The apache configuration file uses `SetEnv` to point gitweb/cgit to these
+custom configuration files.
+
+## Apache configuration
+
+The apache configuration file is in `/etc/apache2/sites-available`.
+
+The file is available in this repository under `./apache-conf/webgit`.
+
+The server names are:
+
+* web.git.savannah.gnu.org
+* web.git.sv.gnu.org
+
+To prevent any accidental confusion during development, the website is
+'protected' by a simple password (user 'demo', password 'demo').
+
diff --git a/vcs-server/apache-conf/webgit b/vcs-server/apache-conf/webgit
new file mode 100644
index 0000000..8e32368
--- /dev/null
+++ b/vcs-server/apache-conf/webgit
@@ -0,0 +1,82 @@
+## Configuration file for the experimental Web-Git repositories
+## (converted from CVS).
+##
+## Created by Assaf Gordon (agn@gnu.org)
+## Last Update: 03-Nov-2014
+
+<VirtualHost *:80>
+ ServerName web.git.sv.gnu.org
+ ServerAlias web.git.sv.nongnu.org
+ ServerAlias web.git.savannah.nongnu.org
+ Redirect permanent / http://web.git.savannah.gnu.org/
+</VirtualHost>
+
+<VirtualHost *:80>
+ ServerName web.git.savannah.gnu.org
+
+ ####################################################
+ ## During testing period, to prevent any confusion,
+ ## password-protect this website.
+ ## username: demo
+ ## passsword: demo
+ ## File created with:
+ ## htpasswd -b -c /etc/apache2/webgit-users demo demo
+ ####################################################
+ <Location />
+ AuthType Basic
+ AuthName "GNU Savannah Web-Git Demo Server (enter demo/demo)"
+ AuthUserFile /etc/apache2/webgit-users
+ Require valid-user
+ </Location>
+
+ DocumentRoot /var/www/webgit/
+ ScriptAlias /awstats.pl /var/www/webgit/awstats.pl
+
+ # Using git-http-backend (a CGI script) to speed-up HTTP access
+ SetEnv GIT_PROJECT_ROOT /srv/git/web
+ SetEnv GIT_HTTP_EXPORT_ALL
+ # - Basic:
+ #ScriptAlias /r-tmp/ /usr/lib/git-core/git-http-backend/
+ # - Maintain direct access to files:
+ ScriptAliasMatch \
+ "(?x)^/r/(.*/(HEAD | \
+ info/refs | \
+ objects/info/[^/]+ | \
+ git-(upload|receive)-pack))$" \
+ /usr/lib/git-core/git-http-backend/$1
+ #AliasMatch ^/r/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /srv/git/web/$1
+ #AliasMatch ^/r/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /srv/git/web/$1
+
+ Alias /r/ /srv/git/web/
+ <Directory /srv/git/web/>
+ Options Indexes FollowSymlinks
+ AllowOverride None
+ </Directory>
+
+ # gitweb
+ SetEnv GITWEB_CONFIG /etc/gitweb-webgit.conf
+ #ScriptAlias /gitweb/ /usr/lib/cgi-bin/gitweb.cgi
+ # Put .cgi and icons in /gitweb/
+ <Directory /usr/share/gitweb/>
+ Options ExecCGI FollowSymLinks
+ AddHandler cgi-script cgi
+ DirectoryIndex index.cgi
+ </Directory>
+
+ # Use the non-default CGIT configuration file
+ SetEnv CGIT_CONFIG /etc/cgitrc-webgit
+
+ Alias /cgit/cgit.css /var/www/webgit/cgit/cgit.css
+ Alias /cgit/cgit.png /var/www/webgit/cgit/cgit.png
+ ScriptAlias /cgit /var/www/webgit/cgit/cgit.cgi
+ ## Put .cgi and icons in /cgit/
+ #<Directory /var/www/webgit/cgit/>
+ # Options ExecCGI FollowSymLinks
+ # AddHandler cgi-script cgi
+ # DirectoryIndex cgit.cgi
+ #</Directory>
+
+ LogLevel warn
+ CustomLog /var/log/apache2/webgit/access.log combined
+ ErrorLog /var/log/apache2/webgit/error.log
+</VirtualHost>
diff --git a/vcs-server/etc-conf/cgitrc-webgit b/vcs-server/etc-conf/cgitrc-webgit
new file mode 100644
index 0000000..a9db44e
--- /dev/null
+++ b/vcs-server/etc-conf/cgitrc-webgit
@@ -0,0 +1,46 @@
+#TODO
+#create agefile=info/web/last-modified
+
+## This configuration file is used for the Web/Git CGIT viewer.
+## It is called from /etc/apache2/sites-available/webgit.
+##
+## Created by Assaf Gordon (agn@gnu.org)
+## Last update: 03-nov-2014
+
+# Enable caching of up to 10000 output entriess
+cache-size=10000
+#cache-size=0
+
+css=/cgit/cgit.css
+logo=/cgit/cgit.png
+favicon=/gitweb/git-favicon.png
+max-repo-count=1000
+max-repodesc-length=40
+
+enable-index-links=1
+enable-log-filecount=1
+enable-log-linecount=1
+
+# Use a separate cache directory (from the default cgit)
+cache-root=/var/cache/cgit-webgit/
+
+
+# Specify some default clone prefixes
+clone-prefix=git://git.sv.gnu.org/web ssh://git.sv.gnu.org/srv/git/web http://web.git.savannah.gnu.org/r
+
+# Set the title and heading of the repository index page
+root-title=Savannah Web-Git Hosting
+
+# Set a subheading for the repository index page
+root-desc=cgit browser
+
+# Include some more info about foobar.com on the index page
+root-readme=/var/www/webgit/gitweb/indextext.html
+footer=/var/www/webgit/cgit/footer.html
+
+about-filter=/var/www/webgit/cgit/about_page.pl
+
+# Allow download of tar.gz, tar.bz and zip-files
+snapshots=tar.gz
+
+scan-path=/srv/git/web/
diff --git a/vcs-server/etc-conf/gitweb-webgit.conf b/vcs-server/etc-conf/gitweb-webgit.conf
new file mode 100644
index 0000000..06fdf8e
--- /dev/null
+++ b/vcs-server/etc-conf/gitweb-webgit.conf
@@ -0,0 +1,58 @@
+##
+## This file is used for the GitWeb CGI script when
+## viewing the WEB-GIT repositories.
+## It is referenced in /etc/apache2/sites-available/webgit .
+##
+## Created by Assaf Gordon (agn@gnu.org)
+## Last update: 03-Nov-2014
+##
+
+# path to git projects (<project>.git)
+$projectroot = "/srv/git/web/";
+
+# directory to use for temp files
+$git_temp = "/tmp";
+
+# target of the home link on top of all pages
+#$home_link = $my_uri || "/";
+
+# html text to include at home page
+$home_text = "indextext.html";
+
+# file with project list; by default, simply scan the projectroot dir.
+$projects_list = $projectroot;
+
+##
+## NOTE: having a project-list file is not yet implemented for web-git viewing.
+##
+## At SV, we use a file list:
+## - can set the "Owner" field to something else than 'root'
+## - performances
+## $projects_list = "/srv/git/project-list";
+
+# stylesheet to use
+$stylesheet = "gitweb.css";
+
+# javascript code for gitweb
+$javascript = "gitweb.js";
+
+# logo to use
+$logo = "git-logo.png";
+
+# the 'favicon'
+$favicon = "git-favicon.png";
+
+
+$site_name = "Savannah Git Hosting";
+@git_base_url_list = ("git://git.sv.gnu.org/web", "http://web.git.savannah.gnu.org/r", "ssh://git.sv.gnu.org/srv/git/web");
+
+# Not released yet
+#$feature{'blame'}{'default'} = [1];
+#$feature{'pathinfo'}{'default'} = [1];
+#$feature{'forks'}{'default'} = [1];
+#$my_uri = 'http://git.sv.gnu.org/gitweb/w';
+
+# Disable snapshots
+#$feature{'snapshot'}{'default'} = [];
+
+$home_link_str = "git\@sv";
diff --git a/vcs-server/setup-scripts/gnu-webgit-fix-permissions.sh b/vcs-server/setup-scripts/gnu-webgit-fix-permissions.sh
new file mode 100755
index 0000000..7e4b327
--- /dev/null
+++ b/vcs-server/setup-scripts/gnu-webgit-fix-permissions.sh
@@ -0,0 +1,108 @@
+#!/bin/sh
+
+##
+## Copyright (C) 2014 Assaf Gordon (agn@gnu.org)
+## License: GPLv3+
+## Last update: 03-nov-2014
+##
+
+##
+## This script fixes permissions (owner,group,mode)
+## on all web-git repositories (with stricter access on 'hooks').
+##
+
+# The root on vcs.sv.gnu.org
+GIT_ROOT=/srv/git/web/
+
+die()
+{
+ base=$(basename -- "$0")
+ echo "$base: error: $@" >&2
+ exit 1
+}
+
+usage()
+{
+ base=$(basename -- "$0")
+ echo "GNU Savannah Helper Script:
+ Web-Git repositories permission setter
+
+Usage:
+ $base
+
+"
+ exit 0
+}
+
+test "x$1" = "x-h" && usage
+
+for i in $(find "$GIT_ROOT" -maxdepth 1 -type d -iname "*.git") ;
+do
+ project=$(basename -- "$i" .git)
+
+ ## Ensure assumptions about project names hold
+ echo "$project" | grep -qE '^[A-Za-z0-9][A-Za-z0-9_\-]+$' \
+ || die "invalid project name '$project'"
+
+ repodir="$GIT_ROOT/$project.git"
+ hookdir="$repodir/hooks"
+
+ ## Ensure this is a bare git repository
+ test -e "$repodir/config" \
+ || die "directory '$repodir' is not a bare git repository"
+
+ # Get the Group owner of the project's directory.
+ # In GNU Savannah, it should be the same as the project's name.
+ # If this is ont the case - fix it
+ group=$(stat -c %G -- "$repodir") \
+ || die "failed to stat project directory"
+
+ # Check if the hooks directory have +i attribute
+ immutable=$(lsattr -d "$hookdir" | \
+ cut -f1 -d' ' | grep -q i && echo yes)
+
+ set_perms=
+
+ # Check if permissions are set correctly.
+ if test "x$group" != "x$project" \
+ || test "x$immutable" != "xyes" ; then
+
+ # Permissions are not OK.
+
+ # Check if there's a group named like the project.
+ # if so - set the permissions (below)
+ # if not, move the project's directory elsewhere
+
+ if getent group "$project" >/dev/null ; then
+ set_perms=yes
+ else
+ mv "$repodir" ~/agn/bad-webgit-repos/ \
+ || die "failed to move repo '$repodir' to bad-repos directory"
+ continue
+ fi
+ fi
+
+ if test "$set_perms" = "yes" ; then
+ # Set owner and group
+ chown -R "root:$project" "$repodir" \
+ || die "failed to set owner of '$repodir'"
+ # Set permissions on files
+ chmod 0664 $(find "$repodir" -type f) \
+ || die "failed to set files permissions in '$repodir'"
+ # Set permissions on directories:
+ # In GNU Savannah, they need to have +s
+ chmod u=rwx,g+rws,o=rx $(find "$repodir" -type d) \
+ || die "failed to set directories permissions in '$repodir'"
+
+ # Forbid access to hooks
+ chown -R root:root "$hookdir" \
+ || die "failed to set owner of '$hookdir' to root:root"
+
+ # Lock-down hooks directory
+ chattr +i "$hookdir" \
+ || die "failed to change attributes of '$hookdir'"
+ fi
+
+ # Run the update hook once (to enable quick check on the web interface)
+ # (cd $repodir ; ./hooks/post-update)
+done
diff --git a/vcs-server/setup-scripts/gnu-webgit-setup-hooks.sh b/vcs-server/setup-scripts/gnu-webgit-setup-hooks.sh
new file mode 100755
index 0000000..f6d8fbd
--- /dev/null
+++ b/vcs-server/setup-scripts/gnu-webgit-setup-hooks.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+##
+## Copyright (C) 2014 Assaf Gordon (agn@gnu.org)
+## License: GPLv3+
+## Last update: 03-nov-2014
+##
+
+##
+## This script setup the update hooks in the Web-Git repositories.
+##
+
+# The root on vcs.sv.gnu.org
+GIT_ROOT=/srv/git/web/
+
+die()
+{
+ base=$(basename -- "$0")
+ echo "$base: error: $@" >&2
+ exit 1
+}
+
+usage()
+{
+ base=$(basename -- "$0")
+ echo "GNU Savannah Helper Script:
+ Web-Git repositories Hook Setup script
+
+Usage:
+ $base
+
+"
+ exit 0
+}
+
+test "x$1" = "x-h" && usage
+
+for i in $(find "$GIT_ROOT" -maxdepth 1 -type d -iname "*.git") ;
+do
+ project=$(basename -- "$i" .git)
+
+ ## Ensure assumptions about project names hold
+ echo "$project" | grep -qE '^[A-Za-z0-9][A-Za-z0-9_\-]+$' \
+ || die "invalid project name '$project'"
+
+ repodir="$GIT_ROOT/$project.git"
+ hookdir="$repodir/hooks"
+
+ test -d "$repodir" \
+ || die "can't find project directory '$repodir'"
+ test -d "$hookdir" \
+ || die "can't find hooks directory '$hookdir'"
+
+ ## Skip if 'post-receive' hook already exists
+ test -e "$hookdir/post-receive" \
+ && continue
+
+ ## Remove immutable attribute
+ chattr -i "$hookdir" \
+ || die "failed to remove immutable attribute from '$hookdir'"
+
+ ## if there's a stale 'update' hook (from gitolite transfer) - remove it
+ if test -h "$hookdir/update" ; then
+ rm "$hookdir/update" \
+ || die "failed to remove 'update' hook in $hookdir"
+ fi
+
+ ## Make an 'run-parts' directory
+ ln -s "/usr/src/infra/webgit/hooks/post-receive" \
+ "$hookdir" \
+ || die "failed to symlink hook script '$hookdir/post-receive'"
+
+ # Lock-down hooks directory
+ chattr +i "$hookdir" \
+ || die "failed to change attributes of '$hookdir'"
+done
diff --git a/vcs-server/usr-src-infra-scripts/gnu-sv-get-project-type b/vcs-server/usr-src-infra-scripts/gnu-sv-get-project-type
new file mode 100755
index 0000000..9f73648
--- /dev/null
+++ b/vcs-server/usr-src-infra-scripts/gnu-sv-get-project-type
@@ -0,0 +1,102 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use File::Basename;
+use Getopt::Long;
+use Savane;
+
+sub usage()
+{
+ my $base = basename($0);
+ print<<"EOF";
+GNU Savannah - Project Type Finder
+A helper script, to return the project type of a GNU Savannah project.
+Contact: Assaf Gordon (agn\@gnu.org)
+License: GPLv3+
+
+Usage: $base PROJECT
+
+Returns the type of PROJECT (based on GNU Savannah's database).
+Possible return values (printed to STDOUT):
+ gnu
+ non-gnu
+ translations
+ www
+
+If a project is not found, prints nothing and returns exit code 1.
+
+Example:
+ \$ $base texinfo
+ gnu
+
+ \$ $base www-it
+ translations
+
+ \$ $base lwip
+ non-gnu
+EOF
+ exit 0;
+}
+
+##
+## Program Start
+##
+
+my $rc = GetOptions("help|h" => \&usage)
+ or die "error: invalid command-line options\n";
+
+my $project = shift @ARGV
+ or die "error: missing PROJECT name. See --help for details.\n";
+
+die "invalid project name ($project)\n"
+ unless $project =~ /^[A-Za-z0-9][A-Za-z0-9_\-]+$/;
+
+
+## Hard-Coded, the main www project for www.gnu.org
+if ( $project eq "www" ) {
+ print "www\n";
+ exit 0;
+}
+
+# Import Database object from Savane
+our $dbd;
+
+# Get the project's type from the database
+my ($type) = $dbd->selectrow_array(q[
+ SELECT type
+ FROM groups
+ WHERE unix_group_name = ?], undef, $project);
+die "error: project '$project' not found in GNU Savannah database\n"
+ unless defined $type;
+
+=pod
+Hack Note:
+The type field in 'groups' table is associated with the 'group_type' table:
+
+mysql> select type_id, name from group_type ;
++---------+------------------------------------+
+| type_id | name |
++---------+------------------------------------+
+| 1 | Official GNU software |
+| 2 | non-GNU software and documentation |
+| 3 | www.gnu.org portions |
+| 4 | GUG |
+| 6 | www.gnu.org translation teams |
++---------+------------------------------------+
+5 rows in set (0.00 sec)
+
+Since this table hasn't changed in a long while, the script
+will hard-code the values instead of using an SQL join.
+=cut
+
+## Accept only these types
+my %types = ( 1 => "gnu", 2 => "non-gnu", 6 => "translations" );
+if ( exists $types{$type} ) {
+ print $types{$type}, "\n";
+ exit 0;
+}
+
+## Otherwise, report an error
+die "error: project '$project' has type '$type' in the GNU Savannah database - " .
+ "not a gnu/non-gnu/translation type.\n";
diff --git a/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive b/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive
new file mode 100755
index 0000000..07f086e
--- /dev/null
+++ b/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+##
+## GNU Savannah WebGit hook script
+## This file is typically symlinked from webgit repositories in
+## /srv/git/web/*.git/hooks/post-receive
+##
+## For more information, contact
+## Assaf Gordon ( agn@gnu.org )
+## or
+## savannah-hackers-public@gnu.org
+
+
+## Avoid hard-coding the parts directory.
+## If the script is /usr/src/infra/webgit/hooks/post-receive ,
+## assume the parts directory will be:
+## /usr/src/infra/webgit/hooks/post-receive.d
+
+die()
+{
+ base=$(basename -- "$0")
+ echo "$base: error: $@" >&2
+ exit 1
+}
+
+partsdir=$(readlink -f -- "$0").d \
+ || die "failed to get full-path of '$0'"
+
+test -d "$partsdir" \
+ || die "expected parts directory '$partsdir' not found"
+
+exec run-parts "$partsdir"
diff --git a/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/10-update-server-info b/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/10-update-server-info
new file mode 100755
index 0000000..0b3c989
--- /dev/null
+++ b/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/10-update-server-info
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+## GNU Savannah WebGit hook script
+## This file is typically symlinked from webgit repositories in
+## /srv/git/web/*.git/hooks/post-receive.d/
+##
+## For more information, contact
+## Assaf Gordon ( agn@gnu.org )
+## or
+## savannah-hackers-public@gnu.org
+
+##
+## a simple post-receive hook script to update the dump HTTP interface
+##
+exec git update-server-info
diff --git a/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/20-update-web-server b/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/20-update-web-server
new file mode 100755
index 0000000..88ce671
--- /dev/null
+++ b/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/20-update-web-server
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+## GNU Savannah WebGit hook script
+## This file is typically symlinked from webgit repositories in
+## /srv/git/web/*.git/hooks/post-receive.d/
+##
+## For more information, contact
+## Assaf Gordon ( agn@gnu.org )
+## or
+## savannah-hackers-public@gnu.org
+
+##
+## This is a post-receive hook script to notify the web server
+## that a repository has changed, and needs to be updated.
+##
+
+die()
+{
+ base=$(basename -- "$0")
+ echo "$base: error: $@" >&2
+ exit 1
+}
+
+## The experimental mockup-server, replace with "www.gnu.org" when ready.
+host=gnu.housegordon.org
+
+## This hook is expected to run in the directory of each project.
+proj=$(basename -- "$(pwd)")
+proj=${proj%.git}
+echo "$proj" | grep -qE '^[A-Za-z0-9][A-Za-z0-9_\-]+$' \
+ || die "invalid project name '$proj'"
+
+## Get the project's type (gnu/non-gnu/translations/www)
+type=$(/usr/src/infra/gnu-sv-get-project-type "$proj") \
+ || die "failed to get project type of '$proj'"
+
+## This should never fail, but better safe than sorry
+echo "$type" | grep -qE '^(gnu|non-gnu|www|translations)$' \
+ || die "unrecognized project type '$type' for '$proj'"
+
+##
+## This URL (and the 'new.py' script) are defined in the apache
+## configuration on the web-server host.
+##
+## Hack note:
+## The 'vcs=git' CGI parameter will alert the 'new.py' script that this
+## update comes from a GIT repository.
+## without this paramter, the default (old behaviour) is to assume the update
+## originated from a CVS repository.
+URL="http://$host/new-savannah-project/new.py?project=${proj}&type=${type}&vcs=git"
+
+exec wget -q -O /dev/null "$URL"
diff --git a/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/30-experimental-warning b/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/30-experimental-warning
new file mode 100755
index 0000000..64527c7
--- /dev/null
+++ b/vcs-server/usr-src-infra-scripts/webgit/hooks/post-receive.d/30-experimental-warning
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+## GNU Savannah WebGit hook script
+## This file is typically symlinked from webgit repositories in
+## /srv/git/web/*.git/hooks/post-receive.d/
+##
+## For more information, contact
+## Assaf Gordon ( agn@gnu.org )
+## or
+## savannah-hackers-public@gnu.org
+
+##
+## This is a post-receive hook script to notify the GIT user
+## that this repository is experimental, and changes will not appear
+## on http://gnu.org .
+##
+
+die()
+{
+ base=$(basename -- "$0")
+ echo "$base: error: $@" >&2
+ exit 1
+}
+
+## NOTE: this is a post-receive hook,
+## so STDOUT will be transmitted to the user's STDOUT.
+
+## The experimental mockup-server
+host=gnu.housegordon.org
+
+## This hook is expected to run in the directory of each project.
+proj=$(basename -- "$(pwd)")
+proj=${proj%.git}
+echo "$proj" | grep -qE '^[A-Za-z0-9][A-Za-z0-9_\-]+$' \
+ || die "invalid project name '$proj'"
+
+## Get the project's type (gnu/non-gnu/translations/www)
+type=$(/usr/src/infra/gnu-sv-get-project-type "$proj") \
+ || die "failed to get project type of '$proj'"
+
+## This should never fail, but better safe than sorry
+echo "$type" | grep -qE '^(gnu|non-gnu|www|translations)$' \
+ || die "unrecognized project type '$type' for '$proj'"
+
+if test "$type" = "www" || test "$type" = "translations" ; then
+ NOTHOST="http://www.nongnu.org/"
+ YESHOST="http://gnu.housegordon.org/"
+elif test "$type" = "gnu" ; then
+ NOTHOST="http://www.gnu.org/software/$proj"
+ YESHOST="http://gnu.housegordon.org/software/$proj"
+elif test "$type" = "non-gnu" ; then
+ NOTHOST="http://www.nongnu.org/$proj"
+ YESHOST="http://nongnu.housegordon.org/$proj"
+else
+ die "internal error: type '$type' not handled in $0"
+fi
+
+echo "
+******************************************************************
+* WARNING: This is an experimental repository.
+*
+* Changes commited to this repository WILL NOT appear on
+* $NOTHOST
+*
+* The mock-up web server is:
+* $YESHOST
+*
+* For details please contact:
+* savannah-hackers-public@gnu.org
+******************************************************************
+"