Skip to content

Commit

Permalink
Item1334: set configure pwd from debconf, use templatelogin
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@3214 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Mar 20, 2009
1 parent 0715ac4 commit 1398e40
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 88 deletions.
12 changes: 6 additions & 6 deletions core/tools/pkg/build_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ if [ -e /tmp/build_deb ]; then
echo '/tmp/build_deb already exists, please move aside'
exit -1;
fi
if [ ! -e Foswiki-1.0.0.tgz ]; then
echo 'need Foswiki-1.0.0.tgz file to build'
if [ ! -e Foswiki-1.0.4.tgz ]; then
echo 'need Foswiki-1.0.4.tgz file to build'
exit -1;
fi

mkdir /tmp/build_deb
cp -r debian /tmp/build_deb/
cp Foswiki-1.0.0.tgz /tmp/build_deb/foswiki_1.0.0.orig.tar.gz
cp Foswiki-1.0.4.tgz /tmp/build_deb/foswiki_1.0.4.orig.tar.gz

cd /tmp/build_deb
tar zxvf /tmp/build_deb/foswiki_1.0.0.orig.tar.gz
tar zxvf /tmp/build_deb/foswiki_1.0.4.orig.tar.gz

#add * to allow for -beta, -auto etc
mv /tmp/build_deb/Foswiki-1.0.0*/ /tmp/build_deb/foswiki-1.0.0/
cd /tmp/build_deb/foswiki-1.0.0
mv /tmp/build_deb/Foswiki-1.0.4*/ /tmp/build_deb/foswiki-1.0.4/
cd /tmp/build_deb/foswiki-1.0.4

mv ../debian .

Expand Down
4 changes: 3 additions & 1 deletion core/tools/pkg/debian/LocalSite.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ $Foswiki::cfg{PubUrlPath} = '/foswiki/pub';
$Foswiki::cfg{PubDir} = '/var/lib/foswiki/pub';
$Foswiki::cfg{TemplateDir} = '/var/lib/foswiki/templates';
$Foswiki::cfg{Site}{CharSet} = 'iso-8859-15';
$Foswiki::cfg{LoginManager} = 'Foswiki::LoginManager::ApacheLogin';
$Foswiki::cfg{LoginManager} = 'Foswiki::LoginManager::TemplateLogin';
$Foswiki::cfg{Plugins}{WysiwygPlugin}{Enabled} = 1;
$Foswiki::cfg{RCS}{WorkAreaDir} = '/var/lib/foswiki/working/work_area';
$Foswiki::cfg{TempfileDir} = '/var/lib/foswiki/working/tmp';
$Foswiki::cfg{WorkingDir} = '/var/lib/foswiki/working';
$Foswiki::cfg{SafeEnvPath} = '/usr/bin:/bin';
$Foswiki::cfg{Register}{EnableNewUserRegistration} = 1;
$Foswiki::cfg{EnableEmail} = 0;
$Foswiki::cfg{WebMasterEmail} = 'WEBMASTEREMAIL';
$Foswiki::cfg{Password} = 'PASSWORD';

$Foswiki::cfg{LogDir} = '/var/log/foswiki';
$Foswiki::cfg{ConfigurationLogName} = '$Foswiki::cfg{LogDir}/configurationlog.txt';
Expand Down
77 changes: 3 additions & 74 deletions core/tools/pkg/debian/apache.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,75 +15,6 @@
# BrowserMatchNoCase ^SiteSucker blockAccess
# BrowserMatchNoCase ^$ blockAccess

BrowserMatchNoCase ^Accoona blockAccess
BrowserMatchNoCase ^ActiveAgent blockAccess
BrowserMatchNoCase ^Attache blockAccess
BrowserMatchNoCase BecomeBot blockAccess
BrowserMatchNoCase ^bot blockAccess
BrowserMatchNoCase Charlotte/ blockAccess
BrowserMatchNoCase ^ConveraCrawler blockAccess
BrowserMatchNoCase ^CrownPeak-HttpAgent blockAccess
BrowserMatchNoCase ^EmailCollector blockAccess
BrowserMatchNoCase ^EmailSiphon blockAccess
BrowserMatchNoCase ^e-SocietyRobot blockAccess
BrowserMatchNoCase ^Exabot blockAccess
BrowserMatchNoCase ^FAST blockAccess
BrowserMatchNoCase ^FDM blockAccess
BrowserMatchNoCase ^GetRight/6.0a blockAccess
BrowserMatchNoCase ^GetWebPics blockAccess
BrowserMatchNoCase ^Gigabot blockAccess
BrowserMatchNoCase ^gonzo1 blockAccess
BrowserMatchNoCase ^Google\sSpider blockAccess
BrowserMatchNoCase ^ichiro blockAccess
BrowserMatchNoCase ^ie_crawler blockAccess
BrowserMatchNoCase ^iGetter blockAccess
BrowserMatchNoCase ^IRLbot blockAccess
BrowserMatchNoCase Jakarta blockAccess
BrowserMatchNoCase ^Java blockAccess
BrowserMatchNoCase ^KrakSpider blockAccess
BrowserMatchNoCase ^larbin blockAccess
BrowserMatchNoCase ^LeechGet blockAccess
BrowserMatchNoCase ^LinkWalker blockAccess
BrowserMatchNoCase ^Lsearch blockAccess
BrowserMatchNoCase ^Microsoft blockAccess
BrowserMatchNoCase ^MJ12bot blockAccess
BrowserMatchNoCase MSIECrawler blockAccess
BrowserMatchNoCase ^MSRBOT blockAccess
BrowserMatchNoCase ^noxtrumbot blockAccess
BrowserMatchNoCase ^NutchCVS blockAccess
BrowserMatchNoCase ^RealDownload blockAccess
BrowserMatchNoCase ^Rome blockAccess
BrowserMatchNoCase ^Roverbot blockAccess
BrowserMatchNoCase ^schibstedsokbot blockAccess
BrowserMatchNoCase ^Seekbot blockAccess
BrowserMatchNoCase ^SiteSnagger blockAccess
BrowserMatchNoCase ^SiteSucker blockAccess
BrowserMatchNoCase ^Snapbot blockAccess
BrowserMatchNoCase ^sogou blockAccess
BrowserMatchNoCase ^SpiderKU blockAccess
BrowserMatchNoCase ^SpiderMan blockAccess
BrowserMatchNoCase ^Squid blockAccess
BrowserMatchNoCase ^Teleport blockAccess
BrowserMatchNoCase ^User-Agent\: blockAccess
BrowserMatchNoCase VoilaBot blockAccess
BrowserMatchNoCase ^voyager blockAccess
BrowserMatchNoCase ^W3C blockAccess
BrowserMatchNoCase ^w3search blockAccess
BrowserMatchNoCase ^Web\sDownloader blockAccess
BrowserMatchNoCase ^WebCopier blockAccess
BrowserMatchNoCase ^WebDevil blockAccess
BrowserMatchNoCase ^WebSec blockAccess
BrowserMatchNoCase ^WebVac blockAccess
BrowserMatchNoCase ^Webwhacker blockAccess
BrowserMatchNoCase ^Webzip blockAccess
BrowserMatchNoCase ^Wells blockAccess
BrowserMatchNoCase ^WhoWhere blockAccess
BrowserMatchNoCase www\.netforex\.org blockAccess
BrowserMatchNoCase ^WX_mail blockAccess
BrowserMatchNoCase ^yacybot blockAccess
BrowserMatchNoCase ^ZIBB blockAccess
BrowserMatchNoCase ^$ blockAccess

RedirectMatch /foswiki/?$ /cgi-bin/foswiki/view$1
RedirectMatch /foswiki(/([A-Z].*)?)?$ /cgi-bin/foswiki/view$1

Expand All @@ -94,8 +25,6 @@ RedirectMatch /foswiki(/([A-Z].*)?)?$ /cgi-bin/foswiki/view$1
#RewriteRule ^configure$ /bin/configure
#RewriteRule ^([A-Z].*) /bin/view/$1 [PT] [L]



# The ScriptAlias defines the bin directory as a directory where CGI
# scripts are allowed.
# The first parameter will be part of the URL to your installation e.g.
Expand Down Expand Up @@ -143,9 +72,9 @@ SetEnvIf Request_URI "foswiki/pub/System/.*\.[hH][tT][mM][lL]?$" !blockAccess
# When using Apache type login the following defines the Foswiki scripts
# that makes Apache ask the browser to authenticate. It is correct that
# scripts such as view are not authenticated.
<FilesMatch "(attach|edit|manage|rename|save|upload|mail|logon|rest|.*auth).*">
require valid-user
</FilesMatch>
#<FilesMatch "(attach|edit|manage|rename|save|upload|mail|logon|rest|.*auth).*">
# require valid-user
#</FilesMatch>

</Directory>

Expand Down
2 changes: 2 additions & 0 deletions core/tools/pkg/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ foswiki (1.0.4-1) unstable; urgency=low

* upgrade to foswiki 1.0.4
* added Warning to configure Extension installer to _not_ use it
* switched to TemplateLogin - its much more useful
* set configure password from the debconf too

-- Sven Dowideit <SvenDowideit@fosiki.com> Fri, 20 Mar 2009 09:53:40 +0100

Expand Down
11 changes: 4 additions & 7 deletions core/tools/pkg/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,7 @@ perl -pi~ -e 's{/(/cgi-bin)}{$1}g;' /etc/foswiki/apache.conf
rm /etc/foswiki/*~

db_get foswiki/wikiwebmaster
# do rcs checkout first?
#TODO: these settings should move to Main.SitePreferences
if [ ! -e /var/lib/foswiki/data/System/DefaultPreferences.txt ]; then
perl -pi~ -e '$U=q{'"$RET"'}; s/^(.*\*\s*Set\s*WIKIWEBMASTER\s*=\s*).*(\r?\n)$/\1$U\2/;' /var/lib/foswiki/data/System/DefaultPreferences.txt
#force default to use sendmail by setting SMTPMAILHOST to blank
perl -pi~ -e 's/^(\s*\*\s*Set\s*SMTPMAILHOST\s*=\s*).*(\r\n)$/$1$2/;' /var/lib/foswiki/data/System/DefaultPreferences.txt
fi
perl -pi~ -e '$U=q{'"$RET"'}; s{WEBMASTEREMAIL}{$U}g;' /etc/foswiki/LocalSite.cfg

# user + password authorized to run configure script
db_get foswiki/adminuser
Expand Down Expand Up @@ -143,6 +137,9 @@ case "$1" in
fi
$HTPASSWDCMD -b /var/lib/foswiki/data/.htpasswd "$configuser" "$configpassword"
chown $WIKI_OWNER.www-data /var/lib/foswiki/data/.htpasswd
#add the same password into the LocalLib.cfg
passwordhash=`grep "$configuser" /var/lib/foswiki/data/.htpasswd | sed "s/$configuser://"`
perl -pi~ -e '$U=q{'"$passwordhash"'}; s{PASSWORD}{$U}g;' /etc/foswiki/LocalSite.cfg
fi
fi

Expand Down

0 comments on commit 1398e40

Please sign in to comment.