From 1ca8af5992876388393e7522ecf55d1953de8fcd Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Sun, 14 Mar 2010 18:03:53 +0000 Subject: [PATCH] Web build: separate htaccess files, add to security process. --- Documentation/contributor/website-work.itexi | 9 +++++++-- Documentation/web/server/lilypond.org.htaccess | 2 ++ Documentation/web/server/website-dir.htaccess | 2 ++ website.make | 7 ++++++- 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 Documentation/web/server/website-dir.htaccess diff --git a/Documentation/contributor/website-work.itexi b/Documentation/contributor/website-work.itexi index 14b6b301b0..7e570aca85 100644 --- a/Documentation/contributor/website-work.itexi +++ b/Documentation/contributor/website-work.itexi @@ -67,7 +67,7 @@ git fetch origin git merge origin/master @end verbatim -Check for any updates to trusted scripts: +Check for any updates to trusted scripts / files: @verbatim ### check-git.sh @@ -81,6 +81,8 @@ diff -u $DEST/create-version-itexi.py $GIT/scripts/build/create-version-itexi.py diff -u $DEST/create-weblinks-itexi.py $GIT/scripts/build/create-weblinks-itexi.py diff -u $DEST/mass-link.py $GIT/scripts/build/mass-link.py diff -u $DEST/website_post.py $GIT/scripts/build/website_post.py +diff -u $DEST/lilypond.org.htaccess $GIT/Documentation/web/server/lilypond.org.htaccess +diff -u $DEST/website-dir.htaccess $GIT/Documentation/web/server/website-dir.htaccess @end verbatim If the changes look ok, make them trusted: @@ -97,6 +99,8 @@ cp $GIT/scripts/build/create-version-itexi.py $DEST/create-version-itexi.py cp $GIT/scripts/build/create-weblinks-itexi.py $DEST/create-weblinks-itexi.py cp $GIT/scripts/build/mass-link.py $DEST/mass-link.py cp $GIT/scripts/build/website_post.py $DEST/website_post.py +cp $GIT/Documentation/web/server/lilypond.org.htaccess $DEST/lilypond.org.htaccess +cp $GIT/Documentation/web/server/website-dir.htaccess $DEST/website-dir.htaccess @end verbatim Build the website: @@ -104,13 +108,14 @@ Build the website: @verbatim ### make-website.sh #!/bin/sh -DEST=$HOME/public_html/ +DEST=$HOME/web/ cd $HOME/src/build-website cp $HOME/lilypond/trusted-scripts/website.make . make -f website.make WEBSITE_ONLY_BUILD=1 website rsync -ra $HOME/src/build-website/out-website/website/ $DEST/website/ cp $HOME/src/build-website/out-website/pictures $DEST +cp $HOME/src/build-website/out-website/.htaccess $DEST @end verbatim Cronjob to automate the trusted portions: diff --git a/Documentation/web/server/lilypond.org.htaccess b/Documentation/web/server/lilypond.org.htaccess index 9143740855..3052dc04de 100644 --- a/Documentation/web/server/lilypond.org.htaccess +++ b/Documentation/web/server/lilypond.org.htaccess @@ -1,3 +1,5 @@ +# htaccess for root dir of lilypond.org + RewriteEngine On # Deny following of symlinks by robots. diff --git a/Documentation/web/server/website-dir.htaccess b/Documentation/web/server/website-dir.htaccess new file mode 100644 index 0000000000..21e3aada16 --- /dev/null +++ b/Documentation/web/server/website-dir.htaccess @@ -0,0 +1,2 @@ +# htaccess for /website/ dir of lilypond.org +DirectoryIndex index diff --git a/website.make b/website.make index f6da80dea4..b03012d151 100644 --- a/website.make +++ b/website.make @@ -11,6 +11,8 @@ ifeq ($(WEBSITE_ONLY_BUILD),1) trusted-dir=$(HOME)/lilypond/trusted-scripts script-dir=$(trusted-dir) texi2html-init-file=$(trusted-dir)/lilypond-texi2html.init + top-htaccess=$(trusted-dir)/lilypond.org.htaccess + dir-htaccess=$(trusted-dir)/website-dir.htaccess TEXI2HTML_PROGRAM=$(HOME)/usr/bin/texi2html EXAMPLES=$(HOME)/media/ly-examples/ PICTURES=$(HOME)/media/pictures @@ -18,6 +20,8 @@ else ### for normal git script-dir=$(top-src-dir)/scripts/build/ texi2html-init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init + top-htaccess=$(top-src-dir)/Documentation/web/server/lilypond.org.htaccess + dir-htaccess=$(top-src-dir)/Documentation/web/server/website-dir.htaccess include $(config_make) # I assume this is run from top-build-dir EXAMPLES=Documentation/web/ly-examples/out-www/ @@ -130,7 +134,8 @@ web-post: website: website-texinfo website-css website-pictures website-examples web-post cp $(SERVER_FILES)/favicon.ico $(OUT)/website/ - cp $(SERVER_FILES)/lilypond.org.htaccess $(OUT)/website/.htaccess cp $(SERVER_FILES)/robots.txt $(OUT)/website/ + cp $(top-htaccess) $(OUT)/.htaccess + cp $(dir-htaccess) $(OUT)/website/.htaccess -- 2.39.5