Skip to content

Commit

Permalink
Fix access right to the volume repository from www-data user in the c…
Browse files Browse the repository at this point in the history
…ontainer
  • Loading branch information
David Bariod committed Apr 7, 2018
1 parent 65f4894 commit d8ee503
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ RUN mkdir /wiki-setup
RUN chown www-data: /wiki-setup

# Startup program configuration
COPY setup.pl /wiki-setup
RUN chown www-data: /wiki-setup/setup.pl
COPY setup.sh /wiki-setup
RUN chown www-data: /wiki-setup/setup.sh
RUN chmod 755 /wiki-setup/setup.sh
COPY ikiwiki_supervisord.conf /etc/supervisor/conf.d

# Setup the lighttpd configuration
Expand All @@ -49,4 +50,4 @@ COPY ikiwiki_supervisord.conf /etc/supervisor/conf.d
VOLUME /wiki
EXPOSE 22
EXPOSE 80
CMD su www-data -c /wiki-setup/setup.pl && supervisord -n
CMD /wiki-setup/setup.sh && supervisord -n
19 changes: 0 additions & 19 deletions setup.pl

This file was deleted.

27 changes: 27 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

die() {
echo $0
exit 1
}

cd /wiki
git status 2>&1 > /dev/null
if [[ $? -ne 0 ]] ; then
die "Can not find a git repository at /wiki"
fi
cd -

set -e
git clone --bare /wiki /var/www/wiki.git
chown -R www-data: /var/www/wiki.git
tmpfile=$(mktemp)
cat > $tmpfile <<EOF
#!/bin/bash
git clone /var/www/wiki.git /var/www/wiki-src
ikiwiki --setup /etc/ikiwiki/ikiwiki.setup --rebuild --wrappers
EOF
chmod 755 $tmpfile
su www-data -c $tmpfile

echo "The setup script has been run"

0 comments on commit d8ee503

Please sign in to comment.