From 553d9e47593049f1b38e9b137cebb20045550863 Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 4 Jul 2026 22:49:06 +0200 Subject: [PATCH] build: force GPM index refresh before install; add remote-diag - remote-install-plugins now runs 'gpm index -f' before install so a fresh server doesn't rely on the stale package index bundled in the grav-admin zip (which can miss recently-published plugins). - Add read-only remote-diag target: Grav version, installed plugin versions, GPM view of the api plugin, api override keys, and log tail. Surfaced the prod rc.10 vs 2.0.4 mismatch that blocked the api plugin. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Np4cMQLF77i664CAQXySzU --- Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 745c8c8..16f6df2 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ SITE_CONFIG_DIR ?= $(REMOTE_HOME)/site-config REMOTE_TARGETS := remote-env-setup remote-env-remove remote-wipe remote-install \ remote-fetch remote-fetch-content remote-install-plugins remote-update-plugins \ remote-upgrade-grav remote-git-sync-disable remote-git-sync-enable \ - remote-content-status remote-clean remote-maintenance-on remote-maintenance-off + remote-content-status remote-clean remote-diag remote-maintenance-on remote-maintenance-off ENVS := test prod guard-env: @@ -153,7 +153,7 @@ remote-fetch-content: guard-env $(SSH) "git -C $(WEBROOT)/user fetch origin main && git -C $(WEBROOT)/user sparse-checkout disable && git -C $(WEBROOT)/user reset --hard origin/main" remote-install-plugins: guard-env - $(SSH) "cd $(WEBROOT) && php bin/gpm install $(shell cat plugins.txt | tr '\n' ' ') -y" + $(SSH) "cd $(WEBROOT) && php bin/gpm index -f && php bin/gpm install $(shell cat plugins.txt | tr '\n' ' ') -y" remote-update-plugins: guard-env $(SSH) "cd $(WEBROOT) && php bin/gpm update -y && php bin/grav cache" @@ -173,6 +173,15 @@ remote-content-status: guard-env remote-clean: guard-env $(SSH) "cd $(WEBROOT) && php bin/grav clearcache" +# Read-only health check: plugin install state, versions, key config, log tail. +remote-diag: guard-env + $(SSH) "cd $(WEBROOT) && \ + echo '=== Grav version ==='; php bin/grav --version 2>/dev/null; \ + echo '=== installed plugin versions ==='; for p in login admin2 flex-objects form api; do printf '%s: ' \"\$$p\"; grep -m1 '^version:' user/plugins/\$$p/blueprints.yaml 2>/dev/null || echo '(NOT installed)'; done; \ + echo '=== what does GPM say about api? ==='; php bin/gpm info api 2>&1 | head -12; \ + echo '=== api override (enabled/route/session) ==='; grep -nE '^enabled:|^route:|session_enabled:' user/config/plugins/api.yaml 2>&1; \ + echo '=== grav.log tail ==='; tail -8 logs/grav.log 2>/dev/null" + remote-maintenance-on: guard-env $(SSH) "bash -s on $(WEBROOT)" < scripts/server-maintenance.sh