summaryrefslogtreecommitdiff
path: root/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu
diff options
context:
space:
mode:
Diffstat (limited to 'web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu')
-rw-r--r--web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/new.py72
-rw-r--r--web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/star.nongnu.org36
-rw-r--r--web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-cvs.sh58
-rwxr-xr-xweb-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-gnu-rewritemaps280
-rw-r--r--web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-symlinks-xargs.py122
-rwxr-xr-xweb-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-symlinks.sh72
-rw-r--r--web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.gnu.org32
-rw-r--r--web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.gnu.org-common366
-rw-r--r--web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.nongnu.org45
-rw-r--r--web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/manifests/init.pp240
10 files changed, 1323 insertions, 0 deletions
diff --git a/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/new.py b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/new.py
new file mode 100644
index 0000000..dd455a6
--- /dev/null
+++ b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/new.py
@@ -0,0 +1,72 @@
+import os,sys
+import string
+from mod_python import apache, util
+from syslog import *
+import stat
+
+# baughj, 2007.07.06 - add logging, usage of subprocess
+# baughj, 2007.07.16 - make sure to chgrp/chmod checked out directory so that
+# it can be updated by wwwcvs user later - why doesn't everything (cron job,
+# etc) run as one user?
+# add new 'translation' type for translation team webspace, see RT #348523.
+# ward, 2008-08-18
+
+# Stripped out actual cvs update, this script now just requests an update.
+# See /usr/local/bin/update-cvs.sh for the actual cvs update code (and that
+# script is run from cron)
+# ward, 2012-09-26
+
+CHECKOUT = "/var/www/savannah-checkouts/"
+LOGFILE = "/var/log/wwwcvs/new-savannah-project.log"
+
+def touch(fname, times=None):
+ with file(fname, 'a'):
+ os.utime(fname, times)
+ os.chmod(fname, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IROTH | stat.S_IWOTH)
+
+def request_update (type, project=''):
+ if type == 'www':
+ touch('/usr/local/to-update/www')
+ syslog(LOG_INFO, "Update requested for type: %s" % type)
+ return
+ touch('/usr/local/to-update/%s___%s' % (type, project))
+ syslog(LOG_INFO, "Update requested for type: %s (project %s)" % (type,project))
+ return
+
+def handler (req):
+ openlog('savannah-update', 0, LOG_LOCAL6)
+ form = util.FieldStorage (req)
+
+ req.content_type = 'text/html'
+ req.send_http_header ()
+
+ type = None
+ project = None
+ if form.has_key('type'):
+ type = form['type']
+ if form.has_key('project'):
+ project = form['project']
+
+ if (type == 'www'):
+ request_update('www')
+ req.content_type = 'text/html'
+ req.send_http_header ()
+ return apache.OK
+
+ if not (type and project):
+ syslog(LOG_ERR, 'Error: missing type or project. Aborting.')
+ return apache.HTTP_NOT_FOUND
+
+ if (type != 'gnu') and (type != 'non-gnu') and (type != 'translations'):
+ syslog(LOG_ERR, "Error: Type unknown, was %s. Aborting." % type)
+ return apache.HTTP_NOT_FOUND
+
+ if string.find (project, "/") != -1:
+ syslog(LOG_ERR, "Error: / found in project name %s" % project)
+ return apache.HTTP_NOT_FOUND
+
+ request_update(type,project)
+ req.content_type = 'text/html'
+ req.send_http_header ()
+
+ return apache.OK
diff --git a/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/star.nongnu.org b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/star.nongnu.org
new file mode 100644
index 0000000..aaaccc1
--- /dev/null
+++ b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/star.nongnu.org
@@ -0,0 +1,36 @@
+<VirtualHost *:80>
+
+# 2005.08.20 - 2005.08.23
+#
+# This is a somewhat "clever" way of working around the ugliness of
+# providing *.nongnu.org, and supercedes the original rewrite
+# mess.
+#
+# The idea here is to work with .symlinks (and the generated
+# symlinks.conf) but without as little redirection or rewriting as
+# possible. Rewriting based on %{HTTP_HOST} was incredibly
+# problematic because of the later rewrites that may occur from
+# .symlinks. We give the server a fake name and then alias everything
+# *.nongnu.org to it. Since www.nongnu.org is canonically defined
+# above as a ServerName, it takes precedence - only project hosts
+# are caught by this net.
+#
+# - baughj
+
+ServerName foobar.nongnu.org
+ServerAlias *.nongnu.org
+
+<Directory /var/www/savannah-checkouts/non-gnu>
+ Options +Indexes
+</Directory>
+
+VirtualDocumentRoot /var/www/savannah-checkouts/non-gnu/%1
+CustomLog /var/log/apache2/nongnu-projects.log combined
+ErrorLog /var/log/apache2/nongnu-projects-error.log
+UseCanonicalName Off
+
+# Include vhost symlinks
+
+Include /etc/apache2/symlinks/symlinks-nongnu-vhost.conf
+
+</VirtualHost>
diff --git a/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-cvs.sh b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-cvs.sh
new file mode 100644
index 0000000..62ac513
--- /dev/null
+++ b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-cvs.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+# Handle cvs updates. This script looks at
+# /usr/local/to-update/
+# where the
+# /var/www/new-savannah-project/new.py
+# script creates empty files if there is work to do.
+#
+# Ward Vandewege, 2012-09-26
+
+DIR="/usr/local/to-update/"
+RUNUSER="wwwcvs"
+
+CHECKOUT="/var/www/savannah-checkouts"
+LOGFILE="/var/log/wwwcvs/update-cvs.log"
+
+if [[ "$(whoami)" != "$RUNUSER" ]]; then
+ echo "Script must be run as user: $RUNUSER"
+ exit -1
+fi
+
+if [[ -e $DIR/www ]]; then
+ cd /var/www
+ echo `date` >> $LOGFILE
+ echo "www: Beginning checkout" >> $LOGFILE
+ /usr/bin/cvs update -Pd . >> $LOGFILE 2>&1
+ rm -f $DIR/www
+ echo "www: CVS checkout completed" >> $LOGFILE
+fi
+
+for f in `ls $DIR`; do
+ NEXT=`expr index "$f" '___'`
+ if [[ "$NEXT" == "0" ]]; then
+ continue
+ fi
+
+ arr=`echo $f | tr -s "___" ' '`
+ T=''
+ for x in $arr; do
+ if [[ "$T" == '' ]]; then
+ T=$x
+ else
+ P=$x
+ fi
+ done
+
+ cd $CHECKOUT/$T
+ echo `date` >> $LOGFILE
+ echo "$P: Beginning checkout (type $T)" >> $LOGFILE
+ if [[ ! -d $P ]]; then
+ # Cf. RT #816041. This is lunacy. Ward, 2013-03-28.
+ mkdir $P
+ fi
+ /usr/bin/cvs -d :pserver:anoncvs@cvs.savannah.gnu.org:/webcvs/$P checkout -P $P >> $LOGFILE 2>&1
+ echo "$P: CVS checkout completed (type $T)" >> $LOGFILE
+ rm -f $DIR/$f
+
+done
diff --git a/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-gnu-rewritemaps b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-gnu-rewritemaps
new file mode 100755
index 0000000..96b78ef
--- /dev/null
+++ b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-gnu-rewritemaps
@@ -0,0 +1,280 @@
+#! /bin/bash
+# Create plain text maps for mod_rewrite from .symlinks files.
+# Main control is at the end.
+#
+# Originally written by Ineiev <ineiev@gmail.com>, feb 2011.
+# Ineiev <ineiev@gmail.com>, Mar 2012: fix links to absolute paths.
+
+web_root=${1-/srv/data/www-mirror}
+www_maps_dir=${2-~}
+verbose=${3-no}
+
+# The fancy /%\// here removes any trailing / that might have been
+# specified in the above variables, since we re-insert the / below.
+# Maybe not 100% necessary, but cleaner.
+web_root=${web_root/%\//}
+www_maps_dir=${www_maps_dir/%\//}
+
+max_link_depth=17
+
+# These file names are used in the vhost configuration.
+html_map_name=html-map.txt
+nonhtml_map_name=nonhtml-map.txt
+dir_map_name=dir-map.txt
+
+SED=sed
+FIND=find
+
+# function to filter out from file "$1" any
+# empty lines, comments, trailing spaces, invalid lines;
+# and replace multiple spaces with single one;
+# and prefix the line with its number if "$2" is "-n".
+cleanup-symlinks () {
+ ${SED} "s/#.*//;s/[[:blank:]]\+/ /g;\
+ s/[[:blank:]]$//;s/^[[:blank:]]//" "$1" \
+ | grep $2 ".[[:blank:]]." | grep -v "[[:blank:]].*[[:blank:]]"
+}
+
+# check if the file or directory exists,
+# assign the "type" variable accordignly
+get-file-type () {
+ if test -f "$1"; then
+ type=file
+ if test ${verbose} = yes; then
+ echo found $1 file
+ fi
+ return 0;
+ fi
+ if test -d "$1"; then
+ type=directory
+ if test ${verbose} = yes; then
+ echo found $1 directory
+ fi
+ return 0;
+ fi
+ type=
+ return 1;
+}
+
+# sed programs to normalize paths
+simplify_path=":cycle;s%/[^/]*/\.\./%/%;t cycle"
+normalize_link="${simplify_path};"
+# should we add something like
+# "s%\(^\| \)/savannah-checkouts/gnu%\1/software%g"
+# to normalize_link?
+
+# function used to subsitute software <-> savannah-checkouts/gnu in paths
+substitute-path () {
+ aliased_path=$(echo $1 | ${SED} "s%^/$2%/$3%;${simplify_path}")
+ if test ${verbose} = yes; then
+ echo "$1 is absent; I'll look in /$3"
+ fi
+}
+
+substitute-software () {
+ substitute-path "$1" software savannah-checkouts/gnu
+}
+
+substitute-checkouts () {
+ substitute-path "$1" savannah-checkouts/gnu software
+}
+
+# output the common part for diagnostic messages
+show-current-line () {
+ printf "%s" "${web_root}${symlinks_directory}.symlinks:$lineno: "
+ echo ${current_line} | ${SED} "s/[[:blank:]]\+/ <- /"
+}
+
+# function to process a single .symlinks file.
+append-symlinks () {
+
+ if test ${verbose} = yes; then
+ echo processing file "$1":
+ fi
+ symlinks_directory=$(echo $1 \
+ | ${SED} "s ^${web_root}/\(.*\)\.symlinks$ /\1 ")
+ cleanup-symlinks "$1" -n | while read current_line; do
+ lineno=$(echo ${current_line} | ${SED} "s/:.*//")
+ current_line=$(echo ${current_line} | ${SED} "s/^[^:]*://")
+
+ link=$(echo ${current_line} | ${SED} "s/^.*[[:blank:]]//")
+ target=$(echo ${current_line} | ${SED} "s/[[:blank:]].*$//")
+ target_directory=${symlinks_directory}
+
+ if test ${verbose} = yes; then
+ echo line ${lineno}: ${current_line}
+ fi
+
+ link_depth=0
+ type=none
+ # follow subsequent links until we get the real thing or find an error
+ while true; do
+ case "x${target}" in
+ # external link
+ x*://*)
+ full_target="${target}"
+ type=external
+ break
+ ;;
+ # absolute link
+ x/*)
+ target_directory=
+ ;;
+ esac
+ # check if the target exists
+ if get-file-type "${web_root}${target_directory}${target}"; then
+ full_target="${target_directory}${target}"
+ break
+ fi
+ case "x${target_directory}${target}" in
+ # look for /software files in /savannah-checkouts/gnu
+ x/software/*)
+ substitute-software "${target_directory}${target}"
+ if get-file-type "${web_root}${aliased_path}"; then
+ full_target="${aliased_path}"
+ break
+ fi
+ ;;
+ # look for /savannah-checkouts/gnu files in /software
+ x/savannah-checkouts/gnu*)
+ substitute-checkouts "${target_directory}${target}"
+ if get-file-type "${web_root}${aliased_path}"; then
+ full_target="${aliased_path}"
+ break
+ fi
+ ;;
+ esac
+ target_directory=$(echo ${target_directory}${target} \
+ | ${SED} "s%[^/]*$%%")
+ target_symlinks=${target_directory}.symlinks
+ if test ! -f "${web_root}${target_symlinks}"; then
+ # no .symlinks file found: try alternative places
+ # (/software for /savannah-checkouts/gnu and vice versa
+ case "x${target_symlinks}" in
+ x/software/*)
+ substitute-software "${target_symlinks}"
+ target_symlinks="$aliased_path"
+ if test ! -f "${web_root}${target_symlinks}"; then
+ type=no-symlinks
+ break
+ fi
+ target_directory=${target_symlinks/%.symlinks/}
+ ;;
+ x/savannah-checkouts/gnu*)
+ substitute-checkouts "${target_symlinks}"
+ target_symlinks="$aliased_path"
+ if test ! -f "${web_root}${target_symlinks}"; then
+ type=no-symlinks
+ break
+ fi
+ target_directory=${target_symlinks/%.symlinks/}
+ ;;
+ *)
+ type=no-symlinks
+ break
+ ;;
+ esac
+ fi
+
+ escaped_target=$(echo ${target} | ${SED} "s%.*/%%;s/\./\\\\./g")
+ if ! cleanup-symlinks "${web_root}${target_symlinks}" \
+ | grep -q "[[:blank:]]${escaped_target}$"; then
+ type=no-subsequent-link
+ break
+ fi
+ target=$(cleanup-symlinks "${web_root}${target_symlinks}" \
+ | ${SED} -n "s/[[:blank:]]${escaped_target}$//p")
+ link_depth=$(expr ${link_depth} + 1)
+ if test ${link_depth} -gt ${max_link_depth}; then
+ type=deep-link
+ break
+ fi
+ if test ${verbose} = yes; then
+ echo "go to the next target (depth ${link_depth}): ${target}"
+ fi
+ done # while true
+
+ # output the results of our link analysis
+ case ${type} in
+ file)
+ if (echo ${target} | grep -q "\.html$") \
+ && (echo ${link} | grep -q "\.html$"); then
+ echo ${symlinks_directory}${link} ${full_target} \
+ | ${SED} "s/\.html[[:blank:]]*/ /;s/\.html$//;\
+ ${normalize_link}" >> "${html_map_name}"
+ if test ${verbose} = yes; then
+ echo link to a HTML file found
+ fi
+ else
+ echo ${symlinks_directory}${link} ${full_target} \
+ | ${SED} "${normalize_link}" >> "${nonhtml_map_name}"
+ if test ${verbose} = yes; then
+ echo link to a non-HTML file found
+ fi
+ fi
+ ;;
+ directory | external)
+ echo ${symlinks_directory}${link} ${full_target} \
+ | ${SED} "${normalize_link}" >> "${dir_map_name}"
+ if test ${verbose} = yes; then
+ echo ${type} link found
+ fi
+ ;;
+ no-symlinks)
+ show-current-line
+ echo " ${target_symlinks} list"
+ echo " and ${target} file/directory are absent."
+ ;;
+ no-subsequent-link)
+ show-current-line
+ echo " ${target} file/directory is absent,"
+ echo " and no subsequent link in ${target_directory}.symlinks found."
+ ;;
+ deep-link)
+ show-current-line
+ echo " link depth limit ${max_link_depth} has been reached."
+ ;;
+ *)
+ show-current-line
+ echo " an unclassified error occurred."
+ exit 1
+ ;;
+ esac # case ${type} in
+ done # cleanup-symlinks "$1" -n | while read current_line; do
+}
+
+# Main program.
+
+if test "x${verbose}" != xyes; then
+ verbose=no
+fi
+
+html_map_name="${www_maps_dir}/${html_map_name}"
+nonhtml_map_name="${www_maps_dir}/${nonhtml_map_name}"
+dir_map_name="${www_maps_dir}/${dir_map_name}"
+
+# Initialize the output files.
+WARNING="# DO NOT EDIT, GENERATED by $0 `date`"
+echo ${WARNING} > "${html_map_name}"
+echo "# links to HTML files" >> "${html_map_name}"
+echo ${WARNING} > "${nonhtml_map_name}"
+echo "# links to non-HTML files" >> "${nonhtml_map_name}"
+echo ${WARNING} > "${dir_map_name}"
+echo "# links to directories and external links" >> "${dir_map_name}"
+
+# Scan every .symlinks file except
+# in non-gnu projects (they are managed with another script).
+${FIND} "${web_root}" -type f -name '.symlinks' \
+ ! -path "${web_root}/savannah-checkouts/non-gnu/*" \
+ -print \
+| while read next_file; do
+ append-symlinks ${next_file}
+ done
+
+# transform directory and external links into rewriterules
+${SED} -i '/^[^#]/ { h; s/ .*//;s/\./\\./g;
+ x; s/.* //; H; x; s/\n/ /;
+ s/ /((\/.*)?)$ /;
+ s/^/RewriteRule ^/;
+ s/ *$/$1 [R=302,L]/
+ }' "${dir_map_name}"
diff --git a/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-symlinks-xargs.py b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-symlinks-xargs.py
new file mode 100644
index 0000000..206fac6
--- /dev/null
+++ b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-symlinks-xargs.py
@@ -0,0 +1,122 @@
+#!/usr/bin/python
+# Use mod_rewrite as opposed to creating real symlinks.
+# (c) 2003, 2011, Free Software Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+
+# ChangeLog
+#
+# 2011.03.01 - Escape dots for Apache regexps. Exclude links for gnu
+# projects (they are regenerated with another script).
+#
+# 2007.11.08 - Change the script to accept more than one file at a time
+# as a commandline argument. This requires changing the order of the args
+# and I'm changing the calling shell script to reflect this
+#
+# 2005.08.23 - Change the script to support a command line argument of
+# {gnu|nongnu|nongnu-vhost}. These arguments change the form of the rewrite
+# rules output (and if they are output).
+# - baughj
+
+import sys
+import re
+from string import *
+from urllib import quote
+from os import lstat
+from stat import *
+from os.path import basename,dirname
+import os.path
+
+# escape dots in regexps
+def escape (str):
+ new_str = ''
+ for x in str:
+ if x == '.':
+ new_str = "%s\%s" % (new_str, x)
+ else:
+ new_str = "%s%s" % (new_str, x)
+ return new_str
+
+def create_rewrite_rule (links, cwd, type):
+ if len(links) != 2 or links[0][0] == '#':
+ return
+
+ # This is an ugly, horrid mess.
+
+ # Also, hilarity: We need to check for the existence of :// so we don't
+ # screw up offsite links that should Just Work.
+
+ external_link = re.compile('://').search(links[0])
+
+ if (type == 'nongnu-vhost'):
+ base = replace(cwd, '/var/www/savannah-checkouts/non-gnu/', '')
+ basedir = dirname(base)
+ if basedir:
+ relativepath = replace(base,basedir,'')
+ else:
+ relativepath = None
+
+ if ((links[1] == "index.html") or
+ (links[1] == "index.shtml") or
+ (links[1] == "index.xhtml")):
+ if (type == 'nongnu' or external_link):
+ print "RewriteRule ^[\./]*$ %s [L]" % (links[0],)
+ else:
+ if relativepath:
+ print "RewriteRule ^[\./]*$ %s/%s [L]" % (relativepath, links[0],)
+ else:
+ print "RewriteRule ^[\./]*$ /%s [L]" % (links[0])
+
+ if (type == 'nongnu' or external_link):
+ print "RewriteRule ^%s$ %s [L]" % (escape (links[1]), links[0])
+ print "RewriteRule ^%s/(.*)$ %s/$1 [L]" % (escape (links[1]), links[0])
+ else:
+ if relativepath:
+ print "RewriteRule ^%s$ %s/%s [L]" % (escape(links[1]), relativepath, links[0])
+ print "RewriteRule ^%s(.*)$ %s/%s/$1 [L]" % (escape(links[1]), relativepath, links[0])
+ else:
+ print "RewriteRule ^%s$ /%s [L]" % (escape (links[1]), links[0])
+ print "RewriteRule ^%s/(.*)$ /%s/$1 [L]" % (escape (links[1]), links[0])
+
+def main():
+ symlink_group = sys.argv[1]
+ for filename in sys.argv[2:]:
+ # print 'filename is ', filename
+ f = open(filename,'r')
+ cwd = os.path.split(filename)[0]
+ # print 'cwd is', cwd
+ nongnu = cwd.startswith('/var/www/savannah-checkouts/non-gnu/')
+ gnu = cwd.startswith('/var/www/savannah-checkouts/gnu/')
+ try:
+ if ((symlink_group == 'gnu') or gnu or \
+ (symlink_group == 'nongnu' and not nongnu) or \
+ (symlink_group == 'nongnu-vhost' and not nongnu)):
+ continue
+ except IndexError:
+ print "usage: update-symlinks.py <symlink file> [gnu|nongnu|nongnu-vhost]"
+ sys.exit(0)
+ # this is a nasty hack
+
+ print "<Directory %s>" % (cwd,)
+ print "RewriteEngine on"
+
+ for line in f.readlines():
+ create_rewrite_rule (split(line.strip()), cwd, symlink_group)
+
+ f.close ()
+ print "</Directory>"
+
+if __name__ == '__main__':
+ main()
diff --git a/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-symlinks.sh b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-symlinks.sh
new file mode 100755
index 0000000..c733e12
--- /dev/null
+++ b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/update-symlinks.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+if [ -e /var/tmp/update-symlinks.pid ]; then
+ # See if the process is still running
+ pid=`cat /var/tmp/update-symlinks.pid`
+ if [ -e /proc/$pid ]; then
+ # send a warning mail and abort
+ mail -s "[wildebeest] update-symlinks warning: pid $pid still active" sysadmin@gnu.org < /dev/null > /dev/null
+ exit -1
+ else
+ # Stale file, overwrite it, onwards and upwards
+ echo $$ > /var/tmp/update-symlinks.pid
+ fi
+else
+ # Output our PID to the pid file
+ echo $$ > /var/tmp/update-symlinks.pid
+fi
+
+exec >> /var/log/wwwcvs/update-symlinks.log 2>&1
+
+echo "Regenerating symlinks..."
+
+WARNING="# GENERATED BY /home/wwwcvs/update-symlinks.sh DO NOT EDIT"
+TMPFILE=`/bin/mktemp /tmp/hourly-website-update.XXXXXX || exit -1`
+/usr/bin/find /var/www -type f -name '.symlinks' >> $TMPFILE
+
+/home/wwwcvs/update-gnu-rewritemaps /var/www /home/wwwcvs/symlinks > /dev/null
+
+printf "${WARNING}\n\n" > /home/wwwcvs/symlinks-nongnu-vhost.conf
+cat $TMPFILE | xargs /home/wwwcvs/update-symlinks-xargs.py nongnu-vhost >> /home/wwwcvs/symlinks-nongnu-vhost.conf
+
+printf "${WARNING}\n\n" > /home/wwwcvs/symlinks-nongnu.conf
+cat $TMPFILE | xargs /home/wwwcvs/update-symlinks-xargs.py nongnu >> /home/wwwcvs/symlinks-nongnu.conf
+
+CHANGED=0
+
+dir1=/etc/apache2/symlinks
+dir2=/home/wwwcvs/symlinks
+
+# these need the -I to ignore comments.
+for file in dir-map.txt html-map.txt nonhtml-map.txt; do
+ diff -I "^#" -q {$dir1,$dir2}/$file
+ if [[ "$?" != "0" ]]; then
+ cp -f {$dir2,$dir1}/$file
+ CHANGED=1
+ fi
+done
+
+# nongnu files lack the comments and are in the top-level dir.
+dir2=/home/wwwcvs
+for file in symlinks-nongnu.conf symlinks-nongnu-vhost.conf; do
+ diff -q {$dir1,$dir2}/$file
+ if [[ "$?" != "0" ]]; then
+ cp -f {$dir2,$dir1}/$file
+ CHANGED=1
+ fi
+done
+
+rm -f $TMPFILE
+echo "Regeneration complete."
+
+if [ "$CHANGED" == "1" ]; then
+ echo "Restarting apache...."
+ sudo /usr/sbin/apache2ctl graceful && echo "Restart successful."
+else
+ echo "No changes, no apache restart necessary"
+fi
+
+# Remove our lock/pid file
+
+rm -f /var/tmp/update-symlinks.pid && echo "update-symlinks finished `date`" && exit 0
+
diff --git a/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.gnu.org b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.gnu.org
new file mode 100644
index 0000000..2538442
--- /dev/null
+++ b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.gnu.org
@@ -0,0 +1,32 @@
+<VirtualHost *:80>
+ ServerName www.gnu.org
+ ServerAdmin webmasters@gnu.org
+
+ # Temporary for IPv6: we'll assign the AAAA record directly to
+ # www.gnu.org when we're 100% confident about its reliability
+ ServerAlias www.ipv6.gnu.org
+ ServerAlias www6.gnu.org
+
+ DocumentRoot /var/www/
+
+ # The super secret RMS webxfer script that used to run on
+ # https://www.gnu.org/software/goodbye and got nadesico compromised now has its
+ # own private VM: goodbye.gnu.org.
+ # See also #658521
+ # Ward, 2011-02-02
+ RewriteEngine on
+ RewriteCond %{REQUEST_URI} ^/software/goodbye.*$
+ RewriteRule ^(.*)$ https://goodbye.gnu.org$1
+
+ ErrorLog /var/log/apache2/gnu.org-error.log
+ CustomLog /var/log/apache2/gnu.org-access.log combined
+
+ # Enable this to get compression ratio and other interesting details
+ #LogLevel debug
+
+ Include /etc/apache2/sites-available/www.gnu.org-common
+
+# LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
+# CustomLog /var/log/apache2/deflate.log deflate
+
+</VirtualHost>
diff --git a/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.gnu.org-common b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.gnu.org-common
new file mode 100644
index 0000000..7937796
--- /dev/null
+++ b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.gnu.org-common
@@ -0,0 +1,366 @@
+
+ AddHandler server-parsed .html .shtml
+ #DirectoryIndex index.html index.shtml index.xhtml home.html home.shtml
+ DirectoryIndex index.html home.html
+ <Directory /var/www/>
+ # Turn on SSI processing
+ Options Indexes IncludesNoExec MultiViews SymLinksIfOwnerMatch
+ AllowOverride Indexes FileInfo Limit
+ </Directory>
+
+ <Directory /var/www/software>
+ Options Indexes IncludesNoExec MultiViews SymLinksIfOwnerMatch
+ </Directory>
+
+ <Directory /var/www/savannah-checkouts>
+ Options Indexes IncludesNoExec MultiViews SymLinksIfOwnerMatch
+ AllowOverride Indexes FileInfo Limit
+ </Directory>
+
+ # The clisp project has old SSI commands in their html files, but they are
+ # broken. They asked us to disable SSI on their pages. See #656741. I've asked
+ # them to clean up their pages, in the mean time we have the following.
+ # 2011-01-18, Ward.
+ <Directory /var/www/savannah-checkouts/gnu/clisp>
+ Options Indexes -IncludesNoExec MultiViews SymLinksIfOwnerMatch
+ AllowOverride Indexes FileInfo Limit
+ </Directory>
+
+ # Cf RT #703015; we need apache 2.2.15 for this... Ward, 2011-11-07
+ #SSILastModified off
+
+
+ # Timeout: The number of seconds before receives and sends time out.
+ # Defaults to 300; new.py in new-savannah-project sometimes takes (much) longer.
+ # I wish there was a way to set this just for one directory, this is a bit scary.
+ # Ward, 2012-09-26.
+ TimeOut 3000
+
+ # Probably better hidden. Cf. RT #835581. Ward, 2013-06-12
+ <Directory /var/www/CVS>
+ Order Deny,Allow
+ Deny from all
+ </Directory>
+
+ <Directory /var/www/new-savannah-project>
+ Order Deny,Allow
+ Deny from all
+
+ # Savannah IPs
+ Allow from 140.186.70.70
+ Allow from 140.186.70.71
+ Allow from 140.186.70.72
+ Allow from 140.186.70.73
+ Allow from 140.186.70.74
+ Allow from 140.186.70.75
+
+ Allow from 208.118.235.70
+ Allow from 208.118.235.71
+ Allow from 208.118.235.72
+ Allow from 208.118.235.73
+ Allow from 208.118.235.74
+ Allow from 208.118.235.75
+
+ # Office dsl
+ Allow from 74.94.156.210
+
+ # localhost
+ Allow from 127.0.0.1
+
+ AddHandler python-program .py
+ PythonHandler new
+ PythonDebug on
+ </Directory>
+
+ <Directory /var/www/new-savannah-project2>
+ Order Deny,Allow
+ Deny from all
+
+ # Savannah IPs
+ Allow from 140.186.70.70
+ Allow from 140.186.70.71
+ Allow from 140.186.70.72
+ Allow from 140.186.70.73
+ Allow from 140.186.70.74
+ Allow from 140.186.70.75
+
+ Allow from 208.118.235.70
+ Allow from 208.118.235.71
+ Allow from 208.118.235.72
+ Allow from 208.118.235.73
+ Allow from 208.118.235.74
+ Allow from 208.118.235.75
+
+ # Office dsl
+ Allow from 74.94.156.210
+
+ # localhost
+ Allow from 127.0.0.1
+
+ AddHandler python-program .py
+ PythonHandler new2
+ PythonDebug on
+ </Directory>
+
+
+ <FilesMatch "\.(ico|pdf|jpe?g|png|gif|js|css)$">
+ ExpiresActive On
+ ExpiresDefault "access plus 1 month"
+ </FilesMatch>
+
+ # jag: RT#363702
+ ExpiresActive On
+ ExpiresByType text/html M600
+
+ #rt#486596
+ #ExpiresByType image/gif A86400
+ #ExpiresByType image/png A86400
+ #ExpiresByType image/jpg A86400
+ #ExpiresByType text/css A86400
+ #ExpiresByType text/javascript A86400
+
+ # jag: Switched 404 from CGI to a mod_python script
+ # ErrorDocument 404 /cgi-bin/404.cgi
+ # disabled this abomination. too slow. ward, 2008-09-02
+ #ErrorDocument 404 /mp404/404.py
+ ErrorDocument 404 /gnu-404.html
+
+ # added as per RT #326793. Ward, 2007-01-08.
+ <Files *.php>
+ ForceType text/html
+ </Files>
+
+ # Rewrite rules take precedence over ScriptAlias, so we set up the equivalent
+ # of
+ # ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
+ # by means of a Directory block and a few rewrite rules (ending in 'L' so no
+ # other rewrite rules will be processed).
+ # Ward, 2011-12-23
+
+ <Directory /usr/lib/cgi-bin >
+ Options ExecCGI SymLinksIfOwnerMatch
+ SetHandler cgi-script
+ </Directory>
+
+ RewriteCond %{REQUEST_FILENAME} /cgi-bin/
+ RewriteRule ^/cgi-bin(/.*)$ /usr/lib/cgi-bin$1 [L]
+
+ # For the new directory.
+ # Ward, 2011-09-29
+ RewriteRule ^/rss/quagga.rss$ http://directory.fsf.org/wiki?title=Special:RecentChanges&feed=atom [R=301]
+
+ # Cf #708151. Ward, 2011-09-14
+ RewriteRule ^/doc/termsofsale.html$ http://shop.fsf.org/termsofsale/ [R=301]
+
+ # Cf #697032. Ward, 2011-06-09
+ RewriteRule ^/doc/expanding.html$ http://www.fsf.org/campaigns/gnu-press/book-stores/expanding [R=301]
+ RewriteRule ^/doc/gnupresspub.html$ http://www.fsf.org/campaigns/gnu-press [R=301]
+ RewriteRule ^/doc/contact.html$ http://www.fsf.org/campaigns/gnu-press/contact [R=301]
+ RewriteRule ^/doc/potentialauthors.html$ http://www.fsf.org/campaigns/gnu-press/authors [R=301]
+ RewriteRule ^/doc/teachingprofessionals.html$ http://www.fsf.org/campaigns/gnu-press/teachers [R=301]
+ RewriteRule ^/doc/gnupresslogo.jpg$ http://static.fsf.org/nosvn/gnupresslogo.png [R=301]
+ RewriteRule ^/doc/small-gnupress.png$ http://static.fsf.org/nosvn/gnupresslogo.png [R=301]
+ RewriteRule ^/doc/GNU-Press-styleguide.texi$ http://www.fsf.org/campaigns/gnu-press/GNU-Press-styleguide.texi [R=301]
+ RewriteRule ^/doc/GNU-Press-styleguide.pdf$ http://www.fsf.org/campaigns/gnu-press/GNU-Press-styleguide.pdf [R=301]
+ RewriteRule ^/doc/bibliography.html$ http://www.fsf.org/campaigns/gnu-press/gpl-biblio [R=301]
+
+ # RT# 364396 -- with new FSF store, take gnu pages for it offline
+ RewriteRule ^/gear/.* http://shop.fsf.org/category/gnu-gear/ [R]
+ RewriteRule ^/order/ftp.html http://www.gnu.org/prep/ftp.html [R]
+ RewriteRule ^/order/.* http://shop.fsf.org/ [R]
+
+ # RT#791315
+ RewriteRule ^/software/consensus(/?.*)$ http://gnu.org/consensus$1 [R,L]
+ RewriteRule ^/consensus(/?)$ /software/consensus/consensus.html
+ RewriteRule ^/consensus(/?.*)$ /software/consensus$1
+
+ # See the freesoftware.fsf.org virtual host entry for information
+ RewriteRule ^/non-gnu/(.*)$ http://www.freesoftware.fsf.org/$1 [R,L]
+
+ # Make sure Georg Greve home page is still reachable
+ RewriteRule ^/people/greve/ http://gnuhh.org/ [R,L]
+
+ # Online ordering
+ RewriteRule ^/donate((/.*)?)$ https://www.fsf.org/donate$1 [R,L]
+ RewriteRule ^/prep/mailinglists\.html$ https://lists.gnu.org/mailman/listinfo [R,L]
+ RewriteRule ^/prep/service\.html$ http://www.fsf.org/resources/service [R,L]
+
+ # jag: rt#332934
+ RewriteRule ^/help/donate\.(es\.)?html$ http://donate.fsf.org/ [R,L]
+
+ # Jobs page moved to fsf.org
+ # updated to go to /resources/jobs as per RT #335330 (ward)
+ RewriteRule ^/jobs((/.*)?)$ http://www.fsf.org/resources/jobs$1 [R,L]
+
+ # Redirect fsf pages to the FSF site
+ RewriteRule ^/fsf(/.*)?$ http://www.fsf.org/ [R,L]
+
+ #RewriteEngine on
+ #RewriteLogLevel 3
+ #RewriteLog "/var/log/apache2/rewrite.log"
+
+ # Redirect /software/www to www.gnu.org (RT #604511)
+ RewriteRule ^/software/www/$ http://www.gnu.org/ [R=301]
+ RewriteRule ^/software/www$ http://www.gnu.org/ [R=301]
+
+ # Speedx was renamed gnukart
+ RewriteRule ^/software/speedx(.*)$ http://www.gnu.org/software/gnukart$1 [R=301]
+
+ # tell wget scripts to go away
+ RewriteCond %{HTTP_USER_AGENT} ^Wget.*
+ RewriteRule ^/directory/(.*)$ - [G]
+
+ RewriteRule ^/directory/(.*)$ http://directory.fsf.org/wiki/$1 [R=301]
+ RewriteRule ^/directory$ http://directory.fsf.org/ [R=301]
+ RewriteRule ^/licenses/info/(.*)\.html$ http://directory.fsf.org/license/$1/ [R=301]
+
+ RewriteRule ^/assembly/(.*)$ http://assembly.gnu.org/$1 [R=301]
+ RewriteRule ^/assembly$ http://assembly.gnu.org/ [R=301]
+
+ # DO A BARREL^WRICK ROLL
+
+ RewriteRule ^/usenet/rms-gnusenet.html http://www.internetisseriousbusiness.com/ [R=301]
+ # Special cases for savannah checkouts:
+ RewriteRule ^/brave-gnu-world(.*)$ /software/bravegw$1
+ RewriteRule ^/projects/dotgnu(.*)$ /software/dotgnu$1
+ RewriteRule ^/software/GNUnet(.*)$ /software/gnunet$1 [R=301]
+ # Removed as per RT #369398. Ward, 2008-08-18
+ #RewriteRule ^/education(.*)$ /savannah-checkouts/gnu/education$1
+ RewriteRule ^/software/cp-tools(.*)$ /software/classpath/cp-tools$1 [R=301]
+ RewriteRule ^/software/ac-archive/(.*)$ http://autoconf-archive.cryp.to/$1 [R=301]
+ # jag: RT#255833
+ RewriteRule ^/software/emacs/elisp/(.*)$ /software/emacs/elisp-manual/$1
+ # jag: RT#358525
+ RewriteRule ^/ghm(/?.*)$ /software/ghm$1
+
+ # This has been broken for a long time, apparently. Ward, 2010-11-28
+ RewriteRule ^/copyleft(/.*rdf)$ /licenses/$1
+
+ # This is a weird VLC bug. Ward, 2011-12-21
+ RewriteRule ^/licenses/gpl-2.0.txt/udp/.*$ /licenses/gpl-2.0.txt [R=301]
+
+ ## Removed redirects - RT #535429. Ward, 2010-05-27
+ ##RewriteCond %{REMOTE_ADDR} !74.94.156.210
+ #RewriteRule ^/software/gcc(/.*)$ http://gcc.gnu.org$1
+
+ # At the request of Matt Lee. Ward, 2010-12-05
+ # Removed cf. RT #764846. Ward, 2012-07-09
+ #RewriteRule ^/software/social(.*)$ http://social.foocorp.net/software/social$1
+
+ # This is a consequence of the madness described at
+ # http://cluestick/wiki/Nadesico.gnu.org#.2Fvar.2Fwww.2Fsoftware.2Fgcc and in #535429
+ RewriteRule ^/software/gcc/wiki(/.*)$ http://gcc.gnu.org/wiki$1
+ RewriteRule ^/software/gcc/viewcvs(/.*)$ http://gcc.gnu.org/viewcvs$1
+ RewriteRule ^/software/gcc/onlinedocs(/.*)$ http://gcc.gnu.org/onlinedocs$1
+ RewriteRule ^/software/gcc/ml(/.*)$ http://gcc.gnu.org/ml$1
+ RewriteRule ^/software/gcc/install(/.*)$ http://gcc.gnu.org/install$1
+
+ # Redirect octave ML archives to velveeta.che.wisc.edu (RT #276337)
+
+ RewriteRule ^/software/octave/mailing-lists(.*) http://velveeta.che.wisc.edu/octave/lists$1
+
+ # This redirects every other project to the corresponding cvs checkout
+ RewriteCond /var/www/savannah-checkouts/gnu/$1 -d
+ RewriteRule ^/software/([^/]+)(.*)$ /savannah-checkouts/gnu/$1$2
+
+ # For the translation project webspace (RT #348523). Ward, 2008-08-18
+ RewriteCond /var/www/savannah-checkouts/translations/www-$1 -d
+ RewriteRule ^/server/standards/translations/([^/]+)(.*)$ /savannah-checkouts/translations/www-$1$2
+
+ # Classpath exception wiki. Used to be proxied from
+ RewriteRule ^/licensing/classpath(.*)$ http://developer.classpath.org/licensing$1 [R]
+
+ # Redirect /software/cvs to nongnu.org/cvs (RT #247259)
+ RewriteRule ^/software/cvs((/.*)?)$ http://www.nongnu.org/cvs$1 [R,L]
+
+ RewriteRule ^/events.html$ http://www.fsf.org/events
+
+ # Do not gzip images and files that are already gzipped. See #706271. Ward, 2011-09-28
+ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|gz)$ no-gzip dont-vary
+
+ # Multiview support - cf. RT #690688. Ward, 2011-12-21
+
+ # Remap MultiViews-conformant requests to the names of files in a
+ # CVS working copy, namely foo.html for English and foo.${lang}.html
+ # for translations, despite that Apache does not want to support that
+ # by default.
+ #
+ # In the end, http://gnu.org/provide.html and provide.en.html and
+ # provide.html.en should all get the English (actual file: provide.html).
+ # While http://gnu.org/provide.de.html and provide.html.de should get
+ # German (actual file: provide.de.html).
+ #
+ # Convenient command for testing that German is found first:
+ # wget -nv --header "Accept-Language: de;q=0.8, en;q=0.7" \
+ # http://testvhost.org/provide.html
+
+ # Enable SSI for .html one way or another. This is one way:
+ ## Ward - disabled; we do this more selectively above.
+ ##AddOutputFilter INCLUDES .html
+
+ # Because our web site has always used file.LANG.html instead of
+ # file.html.LANG, standard MultiViews does not do what we need.
+ # We have to use mod_rewrite to remap names so MultiViews will
+ # negotiate languages and yet still serve our existing files.
+ # http://httpd.apache.org/docs/current/mod/mod_rewrite.html
+
+ # The *-map.txt files used in these RewriteMap and Include directives are
+ # generated by the update-gnu-rewritemaps script.
+
+ # Apply redirections for external links and directories.
+ # This is an Include instead of a Map because we want things like
+ # www.gnu.org/g to be visibly rewritten to www.gnu.org/graphics.
+ Include /etc/apache2/symlinks/dir-map.txt
+
+ # Redirect requests for non-HTML files (.texi, etc.) whose translations
+ # we don't need to be automatically selected with MultiViews.
+ RewriteMap nonhtml_symlinks txt:/etc/apache2/symlinks/nonhtml-map.txt
+ RewriteRule (.*) ${nonhtml_symlinks:$1|$1}
+
+ # Redirect requests for HTML files (one link fits all translations).
+ RewriteMap html_symlinks txt:/etc/apache2/symlinks/html-map.txt
+ RewriteRule ^(.*)\.en\.html$ ${html_symlinks:$1|$1}.en.html [S=2]
+ RewriteRule ^(.*?)(((\...(-..)?)?\.html)|(\.html(\...(-..)?)))$ \
+ ${html_symlinks:$1|$1}$2 [S=1]
+ # Redirect also extensionless requests.
+ RewriteRule ^(.*)$ ${html_symlinks:$1|$1}
+
+ # Don't localize included files, e.g., the fragments under /server.
+ # This file is generated by the script /server/source/gen-include-file-list.
+ RewriteMap pass_includes txt:/var/www/server/include-file-list.txt
+ RewriteRule ^(.*)\.html$ ${pass_includes:$1|$1}.html
+
+ # Skip MultiViews rewriting if a gzipped file, or ...
+ RewriteCond %{REQUEST_URI} \.gz$ [OR]
+
+ # ... if the file is in a package-specific checkout from savannah.
+ # This includes the gnu.org translation team pages (/translations),
+ # the GNU package pages handled by the maintainers (/gnu),
+ # and the non-GNU packages (/non-gnu).
+ RewriteCond %{REQUEST_FILENAME} /savannah-checkouts/ [OR]
+
+ # ... if the file is in /prep/. We don't translate documentation
+ # there, and some files from /prep/ have the same names as directories.
+ # That would result in Error 404 File Not Found.
+ RewriteCond %{REQUEST_FILENAME} /prep/
+
+ # This no-op rule ends processing if either of the above
+ # RewriteConds are satisfied.
+ RewriteRule (.*) $1 [L]
+
+ # Redirect foo.html.${lang} to foo.${lang}.html,
+ # where ${lang} might have the form aa, or aa-BB.
+ RewriteRule ^(.*)\.html\.(..(-..)?)$ $1.$2.html
+
+ # Redirect foo.en.html to foo.html and skip the next rule for
+ # MultiViews (S=1), since we now know what file we want.
+ RewriteRule ^(.*)\.en\.html$ $1.html [S=1]
+
+ # Redirect foo.html to foo.
+ # After this redirection, MultiViews should take over.
+ RewriteCond %{REQUEST_FILENAME} !(\...(-..)?\.html)$
+ RewriteRule ^(.*)\.html$ $1
+
+ # Prevent Apache from interpreting the result
+ # as a local filesystem path, e.g., "/home".
+ RewriteRule ^(/.*)$ %{DOCUMENT_ROOT}$1
diff --git a/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.nongnu.org b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.nongnu.org
new file mode 100644
index 0000000..f8b3226
--- /dev/null
+++ b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/files/www.nongnu.org
@@ -0,0 +1,45 @@
+<VirtualHost *:80>
+ ServerAdmin webmasters@gnu.org
+ ServerName www.nongnu.org
+
+ ServerAlias nongnu.org
+
+ # Temporary for IPv6: we'll assign the AAAA record directly to
+ # www.gnu.org when we're 100% confident about its reliability
+ ServerALias www.ipv6.nongnu.org
+ ServerAlias www6.nongnu.org
+
+ DocumentRoot /var/www/savannah-checkouts/non-gnu/
+
+ <Directory /var/www/savannah-checkouts/non-gnu>
+ # Turn on SSI processing
+ Options Indexes IncludesNoExec MultiViews SymLinksIfOwnerMatch
+ # AllowOverride FileInfo so that people can use .htaccess to redirect subdirectories elsewhere
+ # Cf. RT #738350. Ward, 2012-05-18
+ AllowOverride FileInfo
+ </Directory>
+
+ ErrorDocument 404 /nongnu-404.html
+
+ RewriteEngine on
+ #RewriteLog "/var/log/apache2/nongnu-rewrite.log"
+ #RewriteLogLevel 3
+ RedirectMatch ^/$ http://savannah.nongnu.org/
+ # automatically handle projects that have migrated from non-gnu to gnu
+ RewriteCond /var/www/savannah-checkouts/gnu/$1 -d
+ RewriteRule ^/([^/]+)(.*)$ http://www.gnu.org/software/$1$2 [R,L]
+ # and finally handle packages whose names have changed:
+ RewriteRule ^/auctex/$ http://www.gnu.org/software/auctex/ [R]
+ RewriteRule ^/auctex$ http://www.gnu.org/software/auctex/ [R]
+ RewriteRule ^/qadsl(.*)$ http://www.gnu.org/software/alive$1 [R,L]
+ RewriteRule ^/hotp-toolkit(.*)$ http://www.nongnu.org/oath-toolkit$1 [R,L]
+ RewriteRule ^/fenfire(.*)$ http://fenfire.org/ [R,L]
+
+ AddHandler server-parsed .html .shtml
+
+ # Include nongnu/* symlinks
+ Include /etc/apache2/symlinks/symlinks-nongnu.conf
+
+ ErrorLog /var/log/apache2/nongnu-error.log
+ CustomLog /var/log/apache2/nongnu-access.log combined
+</VirtualHost>
diff --git a/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/manifests/init.pp b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/manifests/init.pp
new file mode 100644
index 0000000..c6e50a2
--- /dev/null
+++ b/web-server/wwwcvs-orig-files/modules/wwwgnu-nongnu/manifests/init.pp
@@ -0,0 +1,240 @@
+# gnu.org/nongnu.org webpages hosting system
+# Copyright (C) 2014 Sylvain Beucler
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+class wwwgnu-nongnu {
+ ensure_packages(['apache2', 'libapache2-mod-python'])
+ service { 'apache2': require => Package['apache2'] }
+ file {
+ '/etc/apache2/sites-enabled/000-default':
+ ensure => absent,
+ require => Package['apache2'],
+ notify => Service['apache2'];
+ }
+
+ exec { 'a2enmod include':
+ provider => shell,
+ creates => '/etc/apache2/mods-enabled/include.load',
+ require => Package['apache2'],
+ notify => Service['apache2'],
+ }
+ exec { 'a2enmod rewrite':
+ provider => shell,
+ creates => '/etc/apache2/mods-enabled/rewrite.load',
+ require => Package['apache2'],
+ notify => Service['apache2'],
+ }
+ exec { 'a2enmod expires':
+ provider => shell,
+ creates => '/etc/apache2/mods-enabled/expires.load',
+ require => Package['apache2'],
+ notify => Service['apache2'],
+ }
+ exec { 'a2enmod vhost_alias':
+ provider => shell,
+ creates => '/etc/apache2/mods-enabled/vhost_alias.load',
+ require => Package['apache2'],
+ notify => Service['apache2'],
+ }
+
+ file {
+ '/etc/apache2/sites-available/www.gnu.org':
+ ensure => file,
+ source => 'puppet:///modules/wwwgnu-nongnu/www.gnu.org',
+ require => Package['apache2'],
+ notify => Service['apache2'];
+ '/etc/apache2/sites-available/www.gnu.org-common':
+ ensure => file,
+ source => 'puppet:///modules/wwwgnu-nongnu/www.gnu.org-common',
+ require => Package['apache2'],
+ notify => Service['apache2'];
+ '/etc/apache2/sites-enabled/www.gnu.org':
+ ensure => symlink,
+ target => '../sites-available/www.gnu.org',
+ require => Package['apache2'],
+ notify => Service['apache2'];
+
+ '/etc/apache2/sites-available/www.nongnu.org':
+ ensure => file,
+ source => 'puppet:///modules/wwwgnu-nongnu/www.nongnu.org',
+ require => Package['apache2'],
+ notify => Service['apache2'];
+ '/etc/apache2/sites-enabled/001-www.nongnu.org':
+ ensure => symlink,
+ target => '../sites-available/www.nongnu.org',
+ require => Package['apache2'],
+ notify => Service['apache2'];
+
+ '/etc/apache2/sites-available/star.nongnu.org':
+ ensure => file,
+ source => 'puppet:///modules/wwwgnu-nongnu/star.nongnu.org',
+ require => Package['apache2'],
+ notify => Service['apache2'];
+ '/etc/apache2/sites-enabled/002-star.nongnu.org':
+ ensure => symlink,
+ target => '../sites-available/star.nongnu.org',
+ require => Package['apache2'],
+ notify => Service['apache2'];
+
+ '/var/www/gnu-404.html':
+ ensure => file,
+ content => "404\n",
+ require => Package['apache2'];
+ }
+
+ # .symlinks handling
+ # https://www.gnu.org/server/standards/README.webmastering.html#symlinks
+ user { 'wwwcvs':
+ ensure => present,
+ managehome => true; # install skel files
+ }
+ file {
+ '/home/wwwcvs/':
+ ensure => directory,
+ mode => 0700,
+ owner => wwwcvs,
+ group => wwwcvs;
+ '/home/wwwcvs/update-symlinks.sh':
+ ensure => file,
+ mode => '0755',
+ source => 'puppet:///modules/wwwgnu-nongnu/update-symlinks.sh';
+ '/home/wwwcvs/update-symlinks-xargs.py':
+ ensure => file,
+ mode => '0755',
+ source => 'puppet:///modules/wwwgnu-nongnu/update-symlinks-xargs.py';
+ '/etc/sudoers.d/wwwcvs':
+ ensure => file,
+ mode => '0600',
+ content => "wwwcvs ALL= NOPASSWD: /usr/sbin/apache2ctl graceful\n";
+ # TODO: requires '/srv/data/www-mirror/'?
+ '/home/wwwcvs/update-gnu-rewritemaps':
+ ensure => file,
+ mode => '0755',
+ source => 'puppet:///modules/wwwgnu-nongnu/update-gnu-rewritemaps';
+ '/home/wwwcvs/symlinks/':
+ ensure => directory,
+ mode => '0755',
+ owner => wwwcvs,
+ group => wwwcvs;
+ '/etc/apache2/symlinks/':
+ ensure => directory,
+ mode => '0775',
+ owner => root,
+ group => wwwcvs;
+ }
+ # Populate those from prod's /etc/apache2/symlinks/:
+ file {
+ '/home/wwwcvs/symlinks/dir-map.txt':
+ ensure => present,
+ owner => wwwcvs,
+ group => wwwcvs;
+ '/home/wwwcvs/symlinks/html-map.txt':
+ ensure => present,
+ owner => wwwcvs,
+ group => wwwcvs;
+ '/home/wwwcvs/symlinks/nonhtml-map.txt':
+ ensure => present,
+ owner => wwwcvs,
+ group => wwwcvs;
+ '/etc/apache2/symlinks/dir-map.txt':
+ ensure => present,
+ owner => wwwcvs,
+ group => wwwcvs;
+ '/etc/apache2/symlinks/html-map.txt':
+ ensure => present,
+ owner => wwwcvs,
+ group => wwwcvs;
+ '/etc/apache2/symlinks/nonhtml-map.txt':
+ ensure => present,
+ owner => wwwcvs,
+ group => wwwcvs;
+ '/etc/apache2/symlinks/symlinks-gnu.conf':
+ ensure => present,
+ owner => wwwcvs,
+ group => wwwcvs;
+ '/etc/apache2/symlinks/symlinks-nongnu.conf':
+ ensure => present,
+ owner => wwwcvs,
+ group => wwwcvs;
+ '/etc/apache2/symlinks/symlinks-nongnu-vhost.conf':
+ ensure => present,
+ owner => wwwcvs,
+ group => wwwcvs;
+ }
+ # Used by www.gnu.org-common
+ # TODO: locate and bundle "gen-include-file-list" ?
+ ensure_packages(['cvs'])
+ exec { '/var/www/server/include-file-list.txt':
+ provider => shell,
+ command => 'cd / && cvs -d:pserver:anonymous@cvs.savannah.gnu.org:/web/www co -d var/www/server/ www/server/include-file-list.txt',
+ creates => '/var/www/server/include-file-list.txt',
+ require => Package['apache2', 'cvs'],
+ notify => Service['apache2'];
+ }
+
+ # Update webpages from CVS repo
+ file {
+ '/var/www/savannah-checkouts/':
+ ensure => directory,
+ mode => '0755';
+ '/var/www/savannah-checkouts/gnu/':
+ ensure => directory,
+ mode => '0775',
+ owner => 'root',
+ group => 'wwwcvs';
+ '/var/www/savannah-checkouts/non-gnu/':
+ ensure => directory,
+ mode => '0775',
+ owner => 'root',
+ group => 'wwwcvs';
+ '/var/log/wwwcvs/':
+ ensure => directory,
+ mode => '0775',
+ owner => 'root',
+ group => 'wwwcvs';
+ # http://www.gnu.org/new-savannah-project/new.py
+ '/var/www/new-savannah-project/':
+ ensure => directory,
+ mode => '0755';
+ '/var/www/new-savannah-project/new.py':
+ ensure => file,
+ source => 'puppet:///modules/wwwgnu-nongnu/new.py';
+ # # 'new.py' seems to conflict sometimes with /usr/lib/python2.7/new.py ?
+ # '/var/www/new-savannah-project2/':
+ # ensure => directory,
+ # mode => '0755';
+ # '/var/www/new-savannah-project2/new2.py':
+ # ensure => file,
+ # source => 'puppet:///modules/wwwgnu-nongnu/new.py';
+ # dir where new will specify which dirs to update
+ '/usr/local/to-update/':
+ ensure => directory,
+ mode => '0775',
+ owner => wwwcvs,
+ group => www-data;
+ }
+ file {
+ '/usr/local/bin/update-cvs.sh':
+ ensure => file,
+ mode => '0755',
+ source => 'puppet:///modules/wwwgnu-nongnu/update-cvs.sh';
+ }
+ cron { 'update-cvs.sh':
+ ensure => present,
+ user => 'wwwcvs',
+ minute => '*/2',
+ command => '/usr/bin/flock -w5 -x /tmp/update-cvs.lock /usr/local/bin/update-cvs.sh',
+ }
+}