From: Frank Lichtenheld Date: Tue, 21 Nov 2006 21:52:29 +0000 (+0000) Subject: Do some often needed adjustments when setting up a site with X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=9eb53c9d4f615e0af9f605281f07da3c99266d65;p=deb%2Fpackages.git Do some often needed adjustments when setting up a site with a central script --- diff --git a/bin/mod_perl-startup b/bin/mod_perl-startup deleted file mode 100644 index 47d4b5d..0000000 --- a/bin/mod_perl-startup +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/perl - -use lib "/org/packages.debian.org/lib"; - -1; diff --git a/bin/mod_perl-startup.sed.in b/bin/mod_perl-startup.sed.in new file mode 100644 index 0000000..85d169d --- /dev/null +++ b/bin/mod_perl-startup.sed.in @@ -0,0 +1,5 @@ +#!/usr/bin/perl + +use lib "%TOPDIR%/lib"; + +1; diff --git a/bin/setup-site b/bin/setup-site new file mode 100755 index 0000000..8e720df --- /dev/null +++ b/bin/setup-site @@ -0,0 +1,21 @@ +#!/bin/bash + +topdir=$1 +site=$2 + +if [ -z "$topdir" -o -z "$site" ]; +then + echo "Usage: setup-site " >&2 + exit 1 +fi + +echo -e "Using\n\ttopdir=$topdir\n\tsite=$site" + +find "$topdir" -name '*.sed.in' | while read file; +do + wdir=$(dirname "$file") + newfile="$wdir/"$(basename "$file" .sed.in) + echo -e "processing\n\t$file\n->\t$newfile" + sed -e "s#%SITE%#$site#g;s#%TOPDIR%#$topdir#g" "$file" > "$newfile" + diff -u "$file" "$newfile" +done diff --git a/conf/apache.conf b/conf/apache.conf deleted file mode 100644 index f551e49..0000000 --- a/conf/apache.conf +++ /dev/null @@ -1,128 +0,0 @@ -# Need to turn on negotiation_module - - Options +MultiViews +FollowSymLinks +Indexes - AddHandler type-map var - # Make sure that the srm.conf directive is commented out. - AddDefaultCharSet utf-8 - AllowOverride AuthConfig FileInfo - - # Nice caching.. - ExpiresActive On - ExpiresDefault "access plus 1 day" - ExpiresByType image/gif "access plus 1 week" - ExpiresByType image/jpeg "access plus 1 week" - - # language stuff - # you need to keep this in sync with lib/Packages/I18N/Locale.pm - # %lang2charset - AddLanguage en .en - AddLanguage en-us .en-us - AddLanguage en-gb .en-gb - AddLanguage ar .ar - AddLanguage bg .bg - AddLanguage ca .ca - AddLanguage cs .cs - AddCharset ISO-8859-2 .cs - AddLanguage da .da - AddCharset ISO-8859-1 .da - AddLanguage de .de - AddLanguage el .el - AddLanguage eo .eo - AddLanguage es .es - AddCharset ISO-8859-1 .es - AddLanguage fi .fi - AddCharset ISO-8859-1 .fi - AddLanguage fr .fr - AddLanguage hr .hr - AddLanguage hu .hu - AddCharset ISO-8859-2 .hu - AddLanguage id .id - AddLanguage it .it - AddCharset ISO-8859-1 .it - AddLanguage ja .ja - AddCharset EUC_JP .ja - AddLanguage ko .ko - AddLanguage lt .lt - AddLanguage nl .nl - AddCharset ISO-8859-1 .nl - AddLanguage no .no - AddLanguage nb .nb - AddLanguage pl .pl - AddCharset ISO-8859-2 .pl - AddLanguage pt .pt - AddCharset ISO-8859-1 .pt - AddLanguage pt-pt .pt_PT - AddCharset ISO-8859-1 .pt_PT - AddLanguage pt-br .pt_BR - AddCharset ISO-8859-1 .pt_BR - AddLanguage ro .ro - AddLanguage ru .ru - AddLanguage sk .sk - AddCharset ISO-8859-2 .sk - AddLanguage sl .sl - AddLanguage sv .sv_SE - AddCharset ISO-8859-1 .sv_SE - AddLanguage tr .tr - AddLanguage uk .uk - AddCharset KOI8-U .uk - AddLanguage zh-CN .zh-cn - AddLanguage zh-HK .zh-hk - AddLanguage zh-TW .zh-tw - LanguagePriority en fr de it es ja pl hr da pt pt-pt pt-br fi zh-cn zh-hk zh-tw cs sv sv-se ko no nb ru tr uk eo ar nl hu ro sk el ca en-us en-gb id lt sl bg - - DirectoryIndex index - - # RSS stuff - AddType application/rss+xml .rdf .xml - - - - ServerAdmin webmaster@debian.org - DocumentRoot /org/packages.debian.org/www/ - ServerName packages.debian.net - ErrorLog /var/log/apache/packages.debian.org-error.log - CustomLog /var/log/apache/packages.debian.org-access.log combined - -# ScriptAlias /cgi-bin /org/packages.debian.org/cgi-bin/ - - Alias /cgi-bin/ /org/packages.debian.org/cgi-bin/ - - PerlModule Apache::Registry - PerlTaintCheck On - - SetHandler perl-script - PerlRequire /org/packages.debian.org/bin/mod_perl-startup - PerlInitHandler Apache::Reload - PerlHandler Apache::Registry - Options +ExecCGI - PerlSendHeader On - allow from all - - - ScriptAlias /cgi-old /org/packages.debian.net/cgi-bin/ - - RewriteEngine on - RewriteLog /var/log/apache/rewrite.log - RewriteLogLevel 0 - - # we never want to rewrite those URLs - RewriteRule ^/cgi-(bin|old)/ - [L] - RewriteRule ^/changelogs/ - [L] - RewriteRule ^/Pics/ - [L] - RewriteRule ^/[^/]+\.css - [L] - -# RewriteRule ^/$ http://www.debian.org/distrib/packages - RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N] - RewriteRule ^/src:([^/]+)$ /source/$1 [R,L,NE] - - RewriteRule ^/(.+)$ /cgi-bin/dispatcher.pl/$1 [PT] - -# In case we need to disable the site again -# -# ErrorDocument 404 /index.html -# RewriteCond %{SCRIPT_FILENAME} !^/(sbin|cgi-bin|Pics|test)/ -# RewriteCond %{SCRIPT_FILENAME} !^/favicon.ico -# RewriteCond %{SCRIPT_FILENAME} !^/(stable|testing|unstable|experimental)/ -# RewriteRule . /index.html - - diff --git a/conf/apache.conf.sed.in b/conf/apache.conf.sed.in new file mode 100644 index 0000000..5f5dea4 --- /dev/null +++ b/conf/apache.conf.sed.in @@ -0,0 +1,124 @@ +# Need to turn on negotiation_module + + Options +MultiViews +FollowSymLinks +Indexes + AddHandler type-map var + # Make sure that the srm.conf directive is commented out. + AddDefaultCharSet utf-8 + AllowOverride AuthConfig FileInfo + + # Nice caching.. + ExpiresActive On + ExpiresDefault "access plus 1 day" + ExpiresByType image/gif "access plus 1 week" + ExpiresByType image/jpeg "access plus 1 week" + + # language stuff + # you need to keep this in sync with lib/Packages/I18N/Locale.pm + # %lang2charset + AddLanguage en .en + AddLanguage en-us .en-us + AddLanguage en-gb .en-gb + AddLanguage ar .ar + AddLanguage bg .bg + AddLanguage ca .ca + AddLanguage cs .cs + AddCharset ISO-8859-2 .cs + AddLanguage da .da + AddCharset ISO-8859-1 .da + AddLanguage de .de + AddLanguage el .el + AddLanguage eo .eo + AddLanguage es .es + AddCharset ISO-8859-1 .es + AddLanguage fi .fi + AddCharset ISO-8859-1 .fi + AddLanguage fr .fr + AddLanguage hr .hr + AddLanguage hu .hu + AddCharset ISO-8859-2 .hu + AddLanguage id .id + AddLanguage it .it + AddCharset ISO-8859-1 .it + AddLanguage ja .ja + AddCharset EUC_JP .ja + AddLanguage ko .ko + AddLanguage lt .lt + AddLanguage nl .nl + AddCharset ISO-8859-1 .nl + AddLanguage no .no + AddLanguage nb .nb + AddLanguage pl .pl + AddCharset ISO-8859-2 .pl + AddLanguage pt .pt + AddCharset ISO-8859-1 .pt + AddLanguage pt-pt .pt_PT + AddCharset ISO-8859-1 .pt_PT + AddLanguage pt-br .pt_BR + AddCharset ISO-8859-1 .pt_BR + AddLanguage ro .ro + AddLanguage ru .ru + AddLanguage sk .sk + AddCharset ISO-8859-2 .sk + AddLanguage sl .sl + AddLanguage sv .sv_SE + AddCharset ISO-8859-1 .sv_SE + AddLanguage tr .tr + AddLanguage uk .uk + AddCharset KOI8-U .uk + AddLanguage zh-CN .zh-cn + AddLanguage zh-HK .zh-hk + AddLanguage zh-TW .zh-tw + LanguagePriority en fr de it es ja pl hr da pt pt-pt pt-br fi zh-cn zh-hk zh-tw cs sv sv-se ko no nb ru tr uk eo ar nl hu ro sk el ca en-us en-gb id lt sl bg + + DirectoryIndex index + + # RSS stuff + AddType application/rss+xml .rdf .xml + + + + ServerAdmin webmaster@debian.org + DocumentRoot %TOPDIR%/www/ + ServerName %SITE% + ErrorLog /var/log/apache2/%SITE%-error.log + CustomLog /var/log/apache2/%SITE%-access.log combined + + Alias /cgi-bin/ %TOPDIR%/cgi-bin/ + + PerlModule Apache::Registry + PerlTaintCheck On + + SetHandler perl-script + PerlRequire %TOPDIR%/bin/mod_perl-startup + PerlInitHandler Apache::Reload + PerlHandler Apache::Registry + Options +ExecCGI + PerlSendHeader On + allow from all + + + RewriteEngine on + RewriteLog /var/log/apache2/rewrite.log + RewriteLogLevel 0 + + # we never want to rewrite those URLs + RewriteRule ^/cgi-(bin|old)/ - [L] + RewriteRule ^/changelogs/ - [L] + RewriteRule ^/Pics/ - [L] + RewriteRule ^/[^/]+\.css - [L] + +# RewriteRule ^/$ http://www.debian.org/distrib/packages + RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N] + RewriteRule ^/src:([^/]+)$ /source/$1 [R,L,NE] + + RewriteRule ^/(.+)$ /cgi-bin/dispatcher.pl/$1 [PT] + +# In case we need to disable the site again +# +# ErrorDocument 404 /index.html +# RewriteCond %{SCRIPT_FILENAME} !^/(sbin|cgi-bin|Pics|test)/ +# RewriteCond %{SCRIPT_FILENAME} !^/favicon.ico +# RewriteCond %{SCRIPT_FILENAME} !^/(stable|testing|unstable|experimental)/ +# RewriteRule . /index.html + + diff --git a/config.sh b/config.sh deleted file mode 100644 index eab1b2b..0000000 --- a/config.sh +++ /dev/null @@ -1,67 +0,0 @@ -# Configuration for packages.debian.org -# - -topdir=/org/packages.debian.org - -tmpdir=${topdir}/tmp -bindir=${topdir}/bin -scriptdir=${topdir}/htmlscripts -libdir=${topdir}/lib -filesdir=${topdir}/files -htmldir=${topdir}/www -archivedir=${topdir}/archive -podir=${topdir}/po -localedir=/org/packages.debian.org/locale -staticdir=${topdir}/static -configdir=${topdir}/conf - -# unset this if packages.debian.org moves somewhere where the packages files -# cannot be obtained locally -# -localdir=/org/ftp.debian.org/ftp - -# path to private ftp directory -ftproot=/org/ftp.root - -ftpsite=http://ftp.debian.org/debian -nonus_ftpsite=http://ftp.uk.debian.org/debian-non-US -security_ftpsite=http://security.debian.org/debian-security -volatile_ftpsite=http://volatile.debian.net/debian-volatile -backports_ftpsite=http://backports.org/debian -amd64_ftpsite=http://amd64.debian.net/debian -kfreebsd_ftpsite=http://kfreebsd-gnu.debian.net/debian - -root="" -hostname="http://packages.debian.net" -search_page="http://packages.debian.net/" -search_url="/search" -webmaster=webmaster@debian.org -contact=debian-www@lists.debian.org -home="http://www.debian.org" -bug_url="http://bugs.debian.org/" -src_bug_url="http://bugs.debian.org/src:" -qa_url="http://packages.qa.debian.org/" -ddpo_url="http://qa.debian.org/developer.php?email=" -cn_help_url="http://www.debian.org/intro/cn" - -# Architectures -# -polangs="de fi nl fr uk" -ddtplangs="de cs da eo es fi fr hu it ja nl pl pt_BR pt_PT ru sk sv_SE uk" -archives="us non-US security amd64 kfreebsd backports volatile" -sections="main contrib non-free" -parts="$sections" -suites="oldstable stable stable-volatile stable-backports testing unstable experimental" -dists="$suites" -architectures="alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc" -arch_oldstable="alpha arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc" -arch_stable="${arch_oldstable} amd64" -arch_testing="${arch_stable}" -arch_unstable="${arch_stable} hurd-i386 kfreebsd-i386 kfreebsd-amd64" -arch_experimental="${arch_unstable}" -arch_testing_proposed_updates="${arch_testing}" -arch_stable_proposed_updates="${arch_stable}" - -# Miscellaneous -# -admin_email="djpig@debian.org,joey@infodrom.org" diff --git a/config.sh.sed.in b/config.sh.sed.in new file mode 100644 index 0000000..ea6703a --- /dev/null +++ b/config.sh.sed.in @@ -0,0 +1,56 @@ +# Configuration for %SITE% +# + +topdir=%TOPDIR% + +tmpdir=${topdir}/tmp +bindir=${topdir}/bin +scriptdir=${topdir}/htmlscripts +libdir=${topdir}/lib +filesdir=${topdir}/files +htmldir=${topdir}/www +archivedir=${topdir}/archive +podir=${topdir}/po +localedir=%TOPDIR%/locale +staticdir=${topdir}/static +configdir=${topdir}/conf + +# unset this if %SITE% moves somewhere where the packages files +# cannot be obtained locally +# +localdir=/org/ftp.debian.org/ftp + +# path to private ftp directory +ftproot=/org/ftp.root + +ftpsite=http://ftp.debian.org/debian +nonus_ftpsite=http://ftp.uk.debian.org/debian-non-US +security_ftpsite=http://security.debian.org/debian-security +volatile_ftpsite=http://volatile.debian.net/debian-volatile +backports_ftpsite=http://backports.org/debian +amd64_ftpsite=http://amd64.debian.net/debian +kfreebsd_ftpsite=http://kfreebsd-gnu.debian.net/debian + +root="" + +# Architectures +# +polangs="de fi nl fr uk" +ddtplangs="de cs da eo es fi fr hu it ja nl pl pt_BR pt_PT ru sk sv_SE uk" +archives="us non-US security amd64 kfreebsd backports volatile" +sections="main contrib non-free" +parts="$sections" +suites="oldstable stable stable-volatile stable-backports testing unstable experimental" +dists="$suites" +architectures="alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc" +arch_oldstable="alpha arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc" +arch_stable="${arch_oldstable} amd64" +arch_testing="${arch_stable}" +arch_unstable="${arch_stable} hurd-i386 kfreebsd-i386 kfreebsd-amd64" +arch_experimental="${arch_unstable}" +arch_testing_proposed_updates="${arch_testing}" +arch_stable_proposed_updates="${arch_stable}" + +# Miscellaneous +# +admin_email="djpig@debian.org,joey@infodrom.org" diff --git a/static/packages.css b/static/packages.css deleted file mode 100644 index 64bdd10..0000000 --- a/static/packages.css +++ /dev/null @@ -1,171 +0,0 @@ -#hpacketsearch { - display: block; - padding-top: 1px; - padding-left: 5px; - margin-right: 0.2em; - margin-left: auto; - text-align: left; - width: 25em; - top: 0em; - right: 0em; -} - -#hpacketsearch p small { - color: #990000; - font-size: 0.8em; - font-weight: normal; -} - -#hpacketsearch p select { - font-size: 88%; -} - -#hpacketsearch p input { - font-size: 88%; -} - -/* classes and div names for package pages */ - -#pdesc, #ptags, #pdeps, #pdownload, #pmoreinfo { - margin-left: 1em; - margin-right: 1em; -} - -#pdesc p { - text-align: justify; -} - -.pdescshort { - text-align: left; - font-size: large; - font-weight: bold; -} - -#pdeps table tr td { - font-size: 0.9em; -} - -#pdeps ul { - list-style-type: none; - padding-left: 2em; -} - -#pdeps li { - text-indent: -2em; -} - -#pdeps ul.uldep, #pdeps ul.uladep { - list-style-type: disc; - list-style-image: url(http://packages.debian.org/Pics/dep.gif); -} - -#pdeps ul.ulrec, #pdeps ul.ulidep { - list-style-type: disc; - list-style-image: url(http://packages.debian.org/Pics/rec.gif); -} - -#pdeps ul.ulsug { - list-style-type: disc; - list-style-image: url(http://packages.debian.org/Pics/sug.gif); -} - -#pdeps ul.uldep li, #pdeps ul.ulrec li, #pdeps ul.ulsug li, #pdeps ul.uladep li, #pdeps ul.ulidep li { - padding-left: 2em; -} -#pdeps dl { - margin: 0; -} - -#pdownload p { - display: inline; -} - - -#pmoreinfo p { - font-size: 0.85em; -} - -.pmarker { - color: red; -} -.perror { - margin: .2em; - background-color: #F99; - font-weight: bold; - padding: 0.5em; - margin: 0; -} -.pdebug { - margin: .2em; - font-size: 80%; - border: solid thin gray; -} -.phints { - background-color: #FF9; - padding: 0.5em; - margin: 0; -} -.pnotes { - margin: .2em; - border: solid thin black; - background-color: #bdf; -} -.pnotes h2 { - color: red; -} - -table#pdeplegend, #pdownload table { - border-width: 4px; - border-color: gray; - margin: 0 1em 1em 1em; - border-style: ridge; - border-collapse: collapse; -} - -#pcontentsres table { - margin: 0 1em 1em 1em; - min-width: 50%; - border: 2px gray; - border-style: ridge; - border-collapse: collapse; -} -#pcontentsres col, #pcontentsres th, #pdownload th, #pdownload td, - #pdeplegend td { - border: 2px #BFC3DC; - border-style: ridge; - padding: 0.1em; -} -#pcontentsres td.file { - font-family: monospace; -} -#pdownload td { - font-size: 0.85em; - text-align: center; -} - -#pdownload td.size { - text-align: right; -} -#pdownload td.md5sum { - font-family: monospace; -} -#pcontentsres td { -/* font-size: smaller;*/ - padding: .4em; -} -#pcontentsres th { - text-align: center; -} -#psearchres h2 { - padding: .3em; - border-top: solid gray thin; - border-bottom: solid gray thin; - background-color: #bdf; -} -#pfilelist pre { - border-top: solid #BFC3DC thin; - padding: .5em; -} -.keyword { - font-weight: bold; -} diff --git a/static/packages.css.sed.in b/static/packages.css.sed.in new file mode 100644 index 0000000..00ab1b5 --- /dev/null +++ b/static/packages.css.sed.in @@ -0,0 +1,171 @@ +#hpacketsearch { + display: block; + padding-top: 1px; + padding-left: 5px; + margin-right: 0.2em; + margin-left: auto; + text-align: left; + width: 25em; + top: 0em; + right: 0em; +} + +#hpacketsearch p small { + color: #990000; + font-size: 0.8em; + font-weight: normal; +} + +#hpacketsearch p select { + font-size: 88%; +} + +#hpacketsearch p input { + font-size: 88%; +} + +/* classes and div names for package pages */ + +#pdesc, #ptags, #pdeps, #pdownload, #pmoreinfo { + margin-left: 1em; + margin-right: 1em; +} + +#pdesc p { + text-align: justify; +} + +.pdescshort { + text-align: left; + font-size: large; + font-weight: bold; +} + +#pdeps table tr td { + font-size: 0.9em; +} + +#pdeps ul { + list-style-type: none; + padding-left: 2em; +} + +#pdeps li { + text-indent: -2em; +} + +#pdeps ul.uldep, #pdeps ul.uladep { + list-style-type: disc; + list-style-image: url(http://%SITE%/Pics/dep.gif); +} + +#pdeps ul.ulrec, #pdeps ul.ulidep { + list-style-type: disc; + list-style-image: url(http://%SITE%/Pics/rec.gif); +} + +#pdeps ul.ulsug { + list-style-type: disc; + list-style-image: url(http://%SITE%/Pics/sug.gif); +} + +#pdeps ul.uldep li, #pdeps ul.ulrec li, #pdeps ul.ulsug li, #pdeps ul.uladep li, #pdeps ul.ulidep li { + padding-left: 2em; +} +#pdeps dl { + margin: 0; +} + +#pdownload p { + display: inline; +} + + +#pmoreinfo p { + font-size: 0.85em; +} + +.pmarker { + color: red; +} +.perror { + margin: .2em; + background-color: #F99; + font-weight: bold; + padding: 0.5em; + margin: 0; +} +.pdebug { + margin: .2em; + font-size: 80%; + border: solid thin gray; +} +.phints { + background-color: #FF9; + padding: 0.5em; + margin: 0; +} +.pnotes { + margin: .2em; + border: solid thin black; + background-color: #bdf; +} +.pnotes h2 { + color: red; +} + +table#pdeplegend, #pdownload table { + border-width: 4px; + border-color: gray; + margin: 0 1em 1em 1em; + border-style: ridge; + border-collapse: collapse; +} + +#pcontentsres table { + margin: 0 1em 1em 1em; + min-width: 50%; + border: 2px gray; + border-style: ridge; + border-collapse: collapse; +} +#pcontentsres col, #pcontentsres th, #pdownload th, #pdownload td, + #pdeplegend td { + border: 2px #BFC3DC; + border-style: ridge; + padding: 0.1em; +} +#pcontentsres td.file { + font-family: monospace; +} +#pdownload td { + font-size: 0.85em; + text-align: center; +} + +#pdownload td.size { + text-align: right; +} +#pdownload td.md5sum { + font-family: monospace; +} +#pcontentsres td { +/* font-size: smaller;*/ + padding: .4em; +} +#pcontentsres th { + text-align: center; +} +#psearchres h2 { + padding: .3em; + border-top: solid gray thin; + border-bottom: solid gray thin; + background-color: #bdf; +} +#pfilelist pre { + border-top: solid #BFC3DC thin; + padding: .5em; +} +.keyword { + font-weight: bold; +}