Update createBlog script for use on production server
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 15 Jan 2010 22:42:26 +0000 (23:42 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 15 Jan 2010 22:42:26 +0000 (23:42 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
createBlog.sh

index 3636c30..4b6c25d 100755 (executable)
@@ -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 <<EOF
 RewriteEngine On