Skip to content
This repository has been archived by the owner on Jul 25, 2020. It is now read-only.

Commit

Permalink
add script to include apps in owncloud
Browse files Browse the repository at this point in the history
Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
  • Loading branch information
silvio committed Jan 28, 2015
1 parent a83df74 commit 0d2561c
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND noninteractive
RUN dpkg-divert --local --rename --add /sbin/initctl && ln -sf /bin/true /sbin/initctl

RUN apt-get update && \
apt-get install -y php5-cli php5-gd php5-pgsql php5-sqlite php5-mysqlnd php5-curl php5-intl php5-mcrypt php5-ldap php5-gmp php5-apcu php5-imagick php5-fpm smbclient nginx
apt-get install -y php5-cli php5-gd php5-pgsql php5-sqlite php5-mysqlnd php5-curl php5-intl php5-mcrypt php5-ldap php5-gmp php5-apcu php5-imagick php5-fpm smbclient nginx wget

ADD https://download.owncloud.org/community/owncloud-7.0.4.tar.bz2 /tmp/oc.tar.bz2
RUN mkdir -p /var/www/owncloud /owncloud /var/log/cron && \
Expand All @@ -23,6 +23,11 @@ ADD php.ini /etc/php5/fpm/
ADD cron.conf /etc/oc-cron.conf
RUN crontab /etc/oc-cron.conf

ADD extensions.sh extensions.conf /var/www/owncloud/apps/
RUN chmod a+x /var/www/owncloud/apps/extensions.sh ; \
/var/www/owncloud/apps/extensions.sh /var/www/owncloud/apps/extensions.conf /var/www/owncloud/apps ; \
rm /var/www/owncloud/apps/extensions.sh /var/www/owncloud/apps/extensions.conf

EXPOSE 80
EXPOSE 443

Expand Down
25 changes: 25 additions & 0 deletions extensions.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# configfile for extensions.sh
# one line with separator "!" for ...
# NAME = Short text
# CMDLINE = A small line to install and to do all shell things, separate this
# with a ";". No multiline supported currently

# 1NAME!2CMDLINE

# example: remove the first comment char "#"

## tools for installation
#tool installation!apt-get install -y git-core curl
#
### apps
## sms sync
#ownCloud SMS!git clone https://github.com/nerzhul/ocsms.git --branch=stable
#
## youtubedl - with some manipulation things
#Youtube Downloader depencies!apt-get install -y libav-tools python
#Youtube Downloader Binary!curl https://yt-dl.org/downloads/2015.01.25/youtube-dl -o /usr/bin/youtube-dl ; chmod a+x /usr/bin/youtube-dl
#Youtube Downloader App!git clone https://github.com/shibby/owncloud-youtubedl.git ; mv owncloud-youtubedl/youtubedl .; rm -rf owncloud-youtubedl
#
## this tools are not used anymore
#tool remove;apt-get remove -y git-core curl
49 changes: 49 additions & 0 deletions extensions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env bash

EXTCONF="${1}"
EXTAPPDIR="${2}"

if [ ! -d "${EXTAPPDIR}" ]; then
echo "app dir not located ad ${EXTAPPDIR}. Exit processing of extensions.sh"
exit 1
fi

pushd "${EXTAPPDIR}"

if [ ! -e "${EXTCONF}" ]; then
echo "extconf doesn exists at ${EXTCONF}. Exit processing of extensions.sh"
exit 1
fi

while read line
do
# filter empty and commented lines
[ "${line}" == "" ] && continue
[ "${line:0:1}" == "#" ] && continue

# parsing
IFS="!" read -ra entry <<< "${line}"

NAME="${entry[0]}"
CMDL="${entry[1]}"

echo ""
echo "-=> work on ... ${NAME} "

# yea - its secure nightmare here, but we call this only in a docker
# container at buildtime
if [ ! -z "${CMDL}" ]; then
while IFS=";" read -ra cmdarr; do
for cmd in "${cmdarr[@]}"; do
[ -z "${cmd}" ] && continue
echo "::: execute \"${cmd}\""
${cmd}
done
done <<< $(echo "${CMDL}")
fi

echo "<=- ${NAME} done"
done < "${EXTCONF}"

popd

0 comments on commit 0d2561c

Please sign in to comment.