From 3bc366b198f1e250d4588f52d110bfdb13db8234 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Fri, 15 Jan 2010 23:42:26 +0100 Subject: [PATCH] Update createBlog script for use on production server MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- createBlog.sh | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/createBlog.sh b/createBlog.sh index 3636c30..4b6c25d 100755 --- a/createBlog.sh +++ b/createBlog.sh @@ -1,13 +1,34 @@ #!/bin/sh -x +# Usage: +# ./createBlog.sh type owner baseurl +# type = user | group-member | group-admin +# * user: this is a blog for a user +# * group-member: this is a blog for a group, all the members of the group can post +# * group-admin: this is a blog for a group, only group admins can post +# owner = name of the owner +# * user blog: forlife of the owner of the blog +# * group blog: 'diminutif' of the group (from X.net database) +# baseurl = base url of the blog. + +# WARNING: The script generates a .htaccess. The rewrite base might be edited to match +# the installation. Default value is based on a blog-farm of the form +# http://base.url/$owner/ + +# Once the blog has been installed and the .htaccess set-up, you can go on the administration +# page of the blog at baseurl/admin/ +# +# Their, go to the section 'Widget' and add (by drag-n-drop) the widgets 'Auth X.org' and 'Copyright'. +# (should be set up by default in near future). + type=$1 owner=$2 url=$3 apache_group=www-data -rootpath=/home/x2003bruneau/public_html/ +rootpath=/home/web/blogs templatepath=dotclear -baseurl=/~x2003bruneau -serviceurl="http://murphy.m4x.org/~x2003bruneau/dotclear2/xorgservice/createBlog" +baseurl=/ +serviceurl="http://blog.polytechnique.org/xorgservice/createBlog" die() { echo $1 @@ -19,10 +40,13 @@ die() { ( cd $rootpath && mkdir $owner ) || die "Can't create the repository for the blog" cd $owner -for i in admin db inc index.php locales plugins themes public ; do +for i in admin db inc index.php locales plugins themes; do ln -s $rootpath/$templatepath/$i || die "Can't add path to $i" done mkdir -p "$rootpath/$templatepath/public/$owner" +chgrp -R "$apache_group" "$rootpath/$templatepath/public/$owner" +chmod g+wr "$rootpath/$templatepath/public/$owner" +ln -s $rootpath/$templatepath/public/$owner public ( cat <