This commit is contained in:
@@ -0,0 +1,40 @@
|
|||||||
|
name: Diag
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [diag/auth-logout]
|
||||||
|
jobs:
|
||||||
|
auth:
|
||||||
|
name: "Diag · auth logout-on-deploy"
|
||||||
|
runs-on: self-hosted
|
||||||
|
timeout-minutes: 5
|
||||||
|
env:
|
||||||
|
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
|
||||||
|
steps:
|
||||||
|
- name: Inspect JWT key, token TTL, redis persistence, container ages
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
DEF="dev-jwt-key-CHANGE-THIS-IN-PRODUCTION-min32chars"
|
||||||
|
echo "=== api env: JWT key + access TTL + environment ==="
|
||||||
|
docker exec meezi-api sh -c '
|
||||||
|
echo "ASPNETCORE_ENVIRONMENT=${ASPNETCORE_ENVIRONMENT:-unset}"
|
||||||
|
echo "AccessTokenExpiryDays=${Jwt__AccessTokenExpiryDays:-unset(appsettings=30)}"
|
||||||
|
if [ "${Jwt__Key:-}" = "'"$DEF"'" ]; then echo "JWT_KEY=INSECURE_DEFAULT (stable)"; \
|
||||||
|
elif [ -z "${Jwt__Key:-}" ]; then echo "JWT_KEY=UNSET"; \
|
||||||
|
else echo "JWT_KEY=custom len=${#Jwt__Key} fp=$(printf %s "$Jwt__Key" | sha256sum | cut -c1-12)"; fi
|
||||||
|
' || true
|
||||||
|
echo ""
|
||||||
|
echo "=== container ages + restart counts ==="
|
||||||
|
for c in meezi-api meezi-redis meezi-db; do
|
||||||
|
docker inspect "$c" --format "$c started={{.State.StartedAt}} restarts={{.RestartCount}}" 2>&1 || true
|
||||||
|
done
|
||||||
|
echo ""
|
||||||
|
echo "=== redis: persistence + refresh-token keys ==="
|
||||||
|
docker exec meezi-redis sh -c '
|
||||||
|
redis-cli DBSIZE
|
||||||
|
redis-cli CONFIG GET appendonly
|
||||||
|
echo "refresh-ish keys:"; redis-cli --scan --pattern "*refresh*" | head -5
|
||||||
|
echo "total refresh-ish:"; redis-cli --scan --pattern "*refresh*" | wc -l
|
||||||
|
' || true
|
||||||
|
echo ""
|
||||||
|
echo "=== api logs: token validation failures / 401 (last 72h) ==="
|
||||||
|
docker logs meezi-api --since 72h 2>&1 | grep -iE "was not authenticated|SecurityToken|signature|IDX10|invalid token" | tail -15 || true
|
||||||
Reference in New Issue
Block a user