aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/deploy.sh.erb8
-rw-r--r--templates/refresh.sh.erb23
2 files changed, 16 insertions, 15 deletions
diff --git a/templates/deploy.sh.erb b/templates/deploy.sh.erb
index edcae12..e895546 100644
--- a/templates/deploy.sh.erb
+++ b/templates/deploy.sh.erb
@@ -5,12 +5,12 @@
# Parameters
NAME="$1"
-WEB_OWNER="$2"
-WEB_GROUP="$3"
-INSTANCE="ikiwiki"
-BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>"
+OWNER="$2"
+GROUP="$3"
SITE=$BASE/$NAME
+INSTANCE="ikiwiki"
CONF="/etc/ikiwiki"
+BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>"
REPO_OWNER="<%= scope.lookupvar('ikiwiki::git_implementation') %>"
REMOTE="$REPO_OWNER@localhost:$NAME"
REPO="/var/git/repositories/$NAME.git"
diff --git a/templates/refresh.sh.erb b/templates/refresh.sh.erb
index fbf1dfd..10b96c1 100644
--- a/templates/refresh.sh.erb
+++ b/templates/refresh.sh.erb
@@ -5,15 +5,16 @@
# Parameters
NAME="$1"
-WEB_OWNER="$2"
-WEB_GROUP="$3"
-WWW_USER="<%= scope.lookupvar('ikiwiki::www_user') %>"
-BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>"
+OWNER="$2"
+GROUP="$3"
SITE="$BASE/$NAME"
CONF="/etc/ikiwiki"
INSTANCE="ikiwiki"
+WWW_USER="<%= scope.lookupvar('ikiwiki::www_user') %>"
+BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>"
REPO_OWNER="<%= scope.lookupvar('ikiwiki::git_implementation') %>"
REPO_GROUP="<%= scope.lookupvar('ikiwiki::git_implementation') %>"
+REPO="/var/git/repositories/$NAME.git"
# Syntax check
if [ -z "$INSTANCE" ]; then
@@ -26,19 +27,19 @@ fi
# Deploy if needed
if [ ! -d "$REPO" ]; then
- ikiwiki-deploy $NAME $WEB_OWNER $WEB_GROUP
+ ikiwiki-deploy $NAME $OWNER $GROUP
fi
# Setup
ikiwiki --setup /etc/ikiwiki/$NAME.setup
# Fix permissions
-chown -R $REPO_OWNER. $REPO
-chown -R $WEB_OWNER.$WEB_GROUP $SITE/"$INSTANCE"_src $SITE/$INSTANCE
-chown $WEB_OWNER.$WWW_USER $SITE/$INSTANCE/ikiwiki.cgi
-chmod 6550 $SITE/$INSTANCE/ikiwiki.cgi
-chown $WEB_OWNER.$REPO $REPO/hooks/post-update
-chmod 6550 $REPO/hooks/post-update
+chown -R $REPO_OWNER. $REPO
+chown -R $OWNER.$GROUP $SITE/"$INSTANCE"_src $SITE/$INSTANCE
+chown $OWNER.$WWW_USER $SITE/$INSTANCE/ikiwiki.cgi
+chmod 6550 $SITE/$INSTANCE/ikiwiki.cgi
+chown $OWNER.$REPO $REPO/hooks/post-update
+chmod 6550 $REPO/hooks/post-update
# Setuid/setgid
chmod 0755 $REPO/hooks/post-update