From b709a73e34dcf0ee280fa32092e9b3715e757645 Mon Sep 17 00:00:00 2001 From: supahgreg Date: Wed, 8 Oct 2025 16:34:35 +0000 Subject: [PATCH] Also migrate 'official' plugins that are from the old site but are using 'main'. These would be plugins cloned from 'git.tt-rss.org' after the Cloudflare redirect to their corresponding GitHub repos was implemented. Their remote should be updated to just use the GitHub URLs directly. --- .docker/app/startup.sh | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.docker/app/startup.sh b/.docker/app/startup.sh index df730c336..64111dd19 100644 --- a/.docker/app/startup.sh +++ b/.docker/app/startup.sh @@ -102,16 +102,26 @@ if [ -z "$TTRSS_NO_STARTUP_PLUGIN_UPDATES" ]; then esac if [ -n "$NEW_ORIGIN_URL" ]; then - if [ $(sudo -u app git branch --show-current) = "master" ]; then - echo "Migrating origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL}" - sudo -u app git remote set-url origin "$NEW_ORIGIN_URL" - sudo -u app git branch -m master main - sudo -u app git fetch origin - sudo -u app git branch --set-upstream-to origin/main main - sudo -u app git remote set-head origin --auto - else - echo "Skipping migration of origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL} (local branch is not 'master')" - fi + case $(sudo -u app git branch --show-current) in + master) + echo "Migrating origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL} (and switching the branch from 'master' to 'main')" + sudo -u app git remote set-url origin "$NEW_ORIGIN_URL" + sudo -u app git branch -m master main + sudo -u app git fetch origin + sudo -u app git branch --set-upstream-to origin/main main + sudo -u app git remote set-head origin --auto + ;; + main) + echo "Migrating origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL}" + sudo -u app git remote set-url origin "$NEW_ORIGIN_URL" + sudo -u app git fetch origin + sudo -u app git branch --set-upstream-to origin/main main + sudo -u app git remote set-head origin --auto + ;; + *) + echo "Skipping migration of origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL} (local branch is not 'master' or 'main')" + ;; + esac fi fi