From 9d1707fbdbc717b3e7f6d54720654f9c3375246c Mon Sep 17 00:00:00 2001 From: Antigravity AI Date: Mon, 6 Jul 2026 18:53:00 +0800 Subject: [PATCH] fix: use Gitea authenticated download for WP plugin zips (GitHub repo is private) --- ummah-wordpress/deploy.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/ummah-wordpress/deploy.sh b/ummah-wordpress/deploy.sh index f3af685..cabf8a9 100644 --- a/ummah-wordpress/deploy.sh +++ b/ummah-wordpress/deploy.sh @@ -80,15 +80,28 @@ docker compose run --rm wpcli rewrite structure '/%postname%/' --hard 2>/dev/nul # ── Install plugins ─────────────────────────────────────────────────────────── echo "── Installing Falah plugins ──" -# Falah Shortcodes from GitHub raw -docker compose run --rm wpcli plugin install \ - "https://github.com/maifors/falah-os/raw/community-edition/wordpress-plugins/falah-shortcodes.zip" \ - --activate --force 2>/dev/null && echo " falah-shortcodes ✅" || echo " falah-shortcodes: upload manually" +GITEA_BASE="https://git.falahos.my/falahos/falah-os-ce/raw/branch/community-edition/wordpress-plugins" +GITEA_TOKEN="${GITEA_TOKEN:-81dad6b01711baff0f23218dd3fd53d60e97751b}" -# Hermes AI Bridge from GitHub raw -docker compose run --rm wpcli plugin install \ - "https://github.com/maifors/falah-os/raw/community-edition/wordpress-plugins/hermes-ai-bridge.zip" \ - --activate --force 2>/dev/null && echo " hermes-ai-bridge ✅" || echo " hermes-ai-bridge: upload manually" +# Download zips locally (WP-CLI can't auth via header, so pre-download) +curl -sL -H "Authorization: token $GITEA_TOKEN" \ + "$GITEA_BASE/falah-shortcodes.zip" -o /tmp/falah-shortcodes.zip +curl -sL -H "Authorization: token $GITEA_TOKEN" \ + "$GITEA_BASE/hermes-ai-bridge.zip" -o /tmp/hermes-ai-bridge.zip + +# Copy zips into the WP container volume mount +WP_VOLUME=$(docker volume inspect ummah-wordpress_ummah2-wp-data --format '{{.Mountpoint}}' 2>/dev/null || echo "") +if [ -n "$WP_VOLUME" ]; then + cp /tmp/falah-shortcodes.zip "$WP_VOLUME/falah-shortcodes.zip" + cp /tmp/hermes-ai-bridge.zip "$WP_VOLUME/hermes-ai-bridge.zip" + docker compose run --rm wpcli plugin install /var/www/html/falah-shortcodes.zip \ + --activate --force 2>/dev/null && echo " falah-shortcodes ✅" || echo " falah-shortcodes: upload manually" + docker compose run --rm wpcli plugin install /var/www/html/hermes-ai-bridge.zip \ + --activate --force 2>/dev/null && echo " hermes-ai-bridge ✅" || echo " hermes-ai-bridge: upload manually" + rm -f "$WP_VOLUME/falah-shortcodes.zip" "$WP_VOLUME/hermes-ai-bridge.zip" +else + echo " ⚠️ Volume not found — install plugins manually from /tmp/*.zip" +fi # Essential WP.org plugins echo "── Installing WP.org plugins ──"