Merge pull request #12 from funkypenguin/master

Upated for changed git URL for tt-rss HEAD
This commit is contained in:
x86dev 2017-07-28 22:35:44 +02:00 committed by GitHub
commit 8c2fe770bd
3 changed files with 49 additions and 7 deletions

View File

@ -23,6 +23,10 @@ COPY root /
# Note: Tweak this line if you're running anything other than x86 AMD64 (64-bit). # Note: Tweak this line if you're running anything other than x86 AMD64 (64-bit).
RUN curl -L -s https://github.com/just-containers/s6-overlay/releases/download/v1.19.1.1/s6-overlay-amd64.tar.gz | tar xvzf - -C / RUN curl -L -s https://github.com/just-containers/s6-overlay/releases/download/v1.19.1.1/s6-overlay-amd64.tar.gz | tar xvzf - -C /
# Add wait-for-it.sh
ADD https://raw.githubusercontent.com/Eficode/wait-for/master/wait-for /srv
RUN chmod 755 /srv/wait-for
# Expose Nginx ports. # Expose Nginx ports.
EXPOSE 8080 EXPOSE 8080
EXPOSE 4443 EXPOSE 4443

View File

@ -0,0 +1,28 @@
#!/usr/bin/with-contenv sh
# Wait for the DB to be reachable before proceeding. This avoids race condition
# whereby database is not ready (yet), and so TTRSS config isn't correctly created
#############
# This simply duplicates the logic from ttrss-configure-db.php
ename='DB';
eport=5432;
if [ '$DB_TYPE' = 'mysql' ];
then
eport=3306;
dbhost=$DB_PORT_3306_TCP_ADDR
else
eport=5432;
dbhost=$DB_PORT_5432_TCP_ADDR
fi
#############
# Run wait-for to confirm DB comes up before we proceed
# Reduce default timeout to 1s because if the DB is not instantly available,
# Then it's even if it _happens_ to become available while we're testing,
# it won't be ready for us yet. Better to exit and restart the container altogether,
# So set "S6_BEHAVIOUR_IF_STAGE2_FAILS=2" in docker-compose.yml if you need this (i.e., in swarm mode, where dependencies don't work)
echo "Checking database responds within 1s on $dbhost:$eport..."
/srv/wait-for $dbhost:$eport --timeout=1

View File

@ -43,7 +43,13 @@ setup_nginx()
setup_ttrss() setup_ttrss()
{ {
if [ -z "$TTRSS_REPO" ]; then
TTRSS_HOST=https://git.tt-rss.org/git/tt-rss.git
fi
if [ -z "$TTRSS_PATH" ]; then
TTRSS_PATH=/var/www/ttrss TTRSS_PATH=/var/www/ttrss
fi
if [ ! -d ${TTRSS_PATH} ]; then if [ ! -d ${TTRSS_PATH} ]; then
mkdir -p ${TTRSS_PATH} mkdir -p ${TTRSS_PATH}
@ -51,11 +57,11 @@ setup_ttrss()
echo "Setup: Setting up Tiny Tiny RSS '$TTRSS_GIT_TAG' ..." echo "Setup: Setting up Tiny Tiny RSS '$TTRSS_GIT_TAG' ..."
cd ${TTRSS_PATH} cd ${TTRSS_PATH}
git init . git init .
git fetch --depth=1 https://tt-rss.org/gitlab/fox/tt-rss.git refs/tags/${TTRSS_GIT_TAG}:refs/tags/${TTRSS_GIT_TAG} git fetch --depth=1 $TTRSS_REPO refs/tags/${TTRSS_GIT_TAG}:refs/tags/${TTRSS_GIT_TAG}
git checkout tags/${TTRSS_GIT_TAG} git checkout tags/${TTRSS_GIT_TAG}
else else
echo "Setup: Setting up Tiny Tiny RSS (latest revision) ..." echo "Setup: Setting up Tiny Tiny RSS (latest revision) ..."
git clone --depth=1 https://tt-rss.org/gitlab/fox/tt-rss.git ${TTRSS_PATH} git clone --depth=1 $TTRSS_REPO ${TTRSS_PATH}
fi fi
git clone --depth=1 https://github.com/sepich/tt-rss-mobilize.git ${TTRSS_PATH}/plugins/mobilize git clone --depth=1 https://github.com/sepich/tt-rss-mobilize.git ${TTRSS_PATH}/plugins/mobilize
git clone --depth=1 https://github.com/hrk/tt-rss-newsplus-plugin.git ${TTRSS_PATH}/plugins/api_newsplus git clone --depth=1 https://github.com/hrk/tt-rss-newsplus-plugin.git ${TTRSS_PATH}/plugins/api_newsplus
@ -98,8 +104,12 @@ setup_ttrss()
fi fi
fi fi
# If we've been passed $TTRSS_SELF_URL as an env variable, then use that,
# otherwise use the URL we constructed above.
if [ -z "$TTRSS_SELF_URL" ]; then
# Construct the final URL TTRSS will use. # Construct the final URL TTRSS will use.
TTRSS_SELF_URL=${TTRSS_PROTO}://${TTRSS_URL}${TTRSS_PORT}/ TTRSS_SELF_URL=${TTRSS_PROTO}://${TTRSS_URL}${TTRSS_PORT}/
fi
echo "Setup: URL is: $TTRSS_SELF_URL" echo "Setup: URL is: $TTRSS_SELF_URL"