From 28f740a2a0200a299bb3c48a28fc727767b7798e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 18 Nov 2021 18:59:16 +0300 Subject: [PATCH] update all local plugins on startup, unless forbidden by TTRSS_NO_STARTUP_PLUGIN_UPDATES --- app/Dockerfile | 3 +++ app/startup.sh | 25 +++++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index efdc4aa..4f9d3fd 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -28,6 +28,9 @@ ADD config.docker.php ${SCRIPT_ROOT} ENV OWNER_UID=1000 ENV OWNER_GID=1000 +# don't try to update local plugins on startup (except for nginx_xaccel) +ENV TTRSS_NO_STARTUP_PLUGIN_UPDATES="" + # TTRSS_XDEBUG_HOST defaults to host IP if unset ENV TTRSS_XDEBUG_ENABLED="" ENV TTRSS_XDEBUG_HOST="" diff --git a/app/startup.sh b/app/startup.sh index b120aee..cae025d 100755 --- a/app/startup.sh +++ b/app/startup.sh @@ -45,13 +45,26 @@ fi if [ ! -d $DST_DIR/plugins.local/nginx_xaccel ]; then echo cloning plugins.local/nginx_xaccel... git clone https://git.tt-rss.org/fox/ttrss-nginx-xaccel.git \ - $DST_DIR/plugins.local/nginx_xaccel || echo error: failed to clone plugin repository. + $DST_DIR/plugins.local/nginx_xaccel || echo warning: failed to clone nginx_xaccel. else - echo updating plugins.local/nginx_xaccel... - cd $DST_DIR/plugins.local/nginx_xaccel && \ - git config core.filemode false && \ - git config pull.rebase false && \ - git pull origin master || echo error: failed to update plugin repository. + if [ -z "$TTRSS_NO_STARTUP_PLUGIN_UPDATES" ]; then + echo updating all local plugins... + + find $DST_DIR/plugins.local -type d -maxdepth 1 | while read PLUGIN; do + echo updating $PLUGIN... + + cd $PLUGIN && \ + git config core.filemode false && \ + git config pull.rebase false && \ + git pull origin master || echo warning: attempt to update plugin $PLUGIN failed. + done + else + echo updating plugins.local/nginx_xaccel... + cd $DST_DIR/plugins.local/nginx_xaccel && \ + git config core.filemode false && \ + git config pull.rebase false && \ + git pull origin master || echo warning: attempt to update plugin nginx_xaccel failed. + fi fi cp ${SCRIPT_ROOT}/config.docker.php $DST_DIR/config.php