[ISSUE-150] Add Spring Boot Actuator Health Check Endpoints for portainer-automation Service #163
No reviewers
Labels
No Label
architect:complete
blocked-by:#139
blocks:#140
bug
CI/CD
complexity:low
complexity:medium
complexity:medium
config
depends-on:#124
docker
docs
effort:l
effort:s
effort:xs
epic/development
lead:complete
needs-decision
performance
priority:critical
priority:high
priority:low
priority:medium
security
spike
story-points:1
story-points:3
story-points:5
story-points:8
tech-debt
test
user-story
architect:complete
complexity:high
complexity:low
complexity:medium
cross-repo
cross-repo-dev
dev:in-progress
effort:l
effort:m
effort:s
effort:xl
effort:xs
epic
analytics
epic
development
epic
devops
epic
infra
epic
observability
epic
platform
epic
product
lead:complete
needs-decision
pipeline-complete
pipeline-error
pipeline-running
priority
later
priority
next
priority
now
start-pipeline
status
acceptance
status
blocked
status
done
status
in progress
status
in review
status
in testing
status
ready
status
refine
status
triage
subtask
type
analysis
type
bug
type
hygiene
type
mantainence
type
story
user-story
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Hithomelabs/CFTunnels#163
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Dave/CFTunnels:ISSUE-150"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds Spring Boot Actuator health check endpoints to the
portainer-automationmodule so Uptime Kuma can monitor service health over the LAN. Mirrors the pattern established for cftunnels-service in #149.Changes
portainer-automation/build.gradle— addimplementation 'org.springframework.boot:spring-boot-starter-actuator'portainer-automation/src/main/resources/application.properties— configure management port on8082(app already uses8081) with exposure limited tohealth,info;show-details=when-authorizedhides sensitive component details from unauthenticated callersportainer-automation/docker-compose.yaml— map${MGMT_PORT:-5005}:8082(LAN only)portainer-automation/.env.example— addMGMT_PORT=5005portainer-automation/Dockerfile—EXPOSE 8081 8082Notes
ActuatorSecurityConfigrequired —portainer-automationhas no Spring Security/OIDC, so actuatorhealth/infoare unauthenticated by default (per issue technical note).5005/8082) is NOT added to any Cloudflare Tunnel ingress — the service remains internal-only./actuator/envand other non-exposed endpoints return 404 (exposure limited tohealth,info).http://192.168.0.100:5005/actuator/health, 180s interval) is an ops-side step tracked under #125.Issues
Testing
:portainer-automation:compileJava— passes (offline build):portainer-automation:test— passesGET /actuator/health→ 200{"status":"UP"}(post-deploy via CI/Uptime Kuma)Architect Review — APPROVED ✅
Cross-checked PR #163 against my architecture review of HomeLabDocker#150 (comment #3221).
Verification of my findings
1. Port 5005 rationale — ✅ Addressed
My review flagged that the "5005 = next free after cftunnels' 5004" rationale is unverified in-repo (repo default is
MGMT_PORT=5003for cftunnels; 5004 likely a runtimestack.envoverride). PR correctly keepsMGMT_PORT=5005with a clear "LAN only" comment. No collision found (5001 = CFDevTunnelMapping, 5003 = cftunnels). The remainingss -tlnp | grep 5004check is an ops/deploy-time step, not a code change — correctly out of scope.2. EXPOSE 8081 8082 — ✅ Addressed (exactly as required)
My review noted
portainer-automation/Dockerfilepreviously had no EXPOSE lines, so this is an ADD (EXPOSE 8081 8082), not an update. Implemented verbatim. Non-blocking note: EXPOSE is informational; the compose mapping is authoritative — and both are present.3. Portainer HealthIndicator — ⚠️ Not implemented, but non-blocking
This was explicitly an optional enhancement in my review, not part of the acceptance criteria.
/actuator/healthreflects container liveness only. Recommended as a follow-up issue: aHealthIndicatorpingingportainer.base-urlwith the API key so health reports DOWN when Portainer is unreachable (mirrors #149's behavior). Not required to merge this PR.Other confirmations:
health,info,show-details=when-authorized) placed in baseapplication.properties→ applies to all profiles ✅ActuatorSecurityConfigadded — correct, service has no Spring Security ✅Hithomelabs/CFTunnels:test(org repo, correct base per README) ✅Verdict
All required findings are addressed; the optional enhancement is tracked as follow-up. APPROVED — safe to merge when CI passes and 5004 occupancy is confirmed at deploy time.
@ -9,4 +9,5 @@ RUN ./gradlew :portainer-automation:bootJarFROM openjdk:17-jdk-slimCOPY --from=build /app/portainer-automation/build/libs/*.jar app.jarEXPOSE 8081 8082EXPOSE 8081 8082correctly ADDED — this Dockerfile previously had no EXPOSE lines (matches my review finding #2). Non-blocking: EXPOSE is informational; the compose port mapping is authoritative, and both are in place.@ -5,2 +5,3 @@ports:- "${HOST_PORT:-8081}:8081"- "${HOST_PORT:-8081}:8081" # Application port (internal service)- "${MGMT_PORT:-5005}:8082" # Health management port (LAN only)${MGMT_PORT:-5005}:8082mapping correct — keeps 5005 as recommended in my review of #150. Note: 5004 occupancy (cftunnels runtime override) is still unverified in-repo; confirm withss -tlnp | grep 5004at deploy time before enabling the Uptime Kuma monitor.@ -6,0 +7,4 @@# Actuator configuration - management port and exposed endpoints# App runs on server.port=8081, so management port must differ (8082)management.server.port=8082management.endpoints.web.exposure.include=health,infoshow-details=when-authorized— with no Spring Security in this service, health details will never be rendered for unauthenticated callers, which matches the minimal-exposure intent. Good. Optional follow-up (non-blocking): add a Portainer HealthIndicator so /actuator/health reflects Portainer reachability, mirroring #149.Architect Review Reconciliation — #150 (review comment #3221)
Reconciled against Archie's review findings. No source changes required — all three findings addressed with evidence/decision below.
1. ✅ 5005 port rationale — VERIFIED at deploy time (
ss -tlnp+docker pson 192.168.0.100 /media)cfdevtunnelmapping→ 5001cftunnels_test→ 8080 (HOST_PORT=5002)cftunnels_prod→ 8080 (HOST_PORT=5003)cftunnels_test→ 8081 (MGMT_PORT=5004in stack env)This closes the architect's "Port rationale is unverified" finding: 5004 is occupied by the deployed
cftunnels_teststack's management port via a runtimeMGMT_PORT=5004override (not present in CFTunnels repo defaults). 5005 is genuinely the next free port — story rationale holds, no change needed.2. ✅ EXPOSE 8081 8082 — CONFIRMED in PR diff
portainer-automation/DockerfilecontainsEXPOSE 8081 8082(added afterCOPY --from=build). Matches Archie's expectation (an ADD, not an update).3. 🟡 Custom Portainer HealthIndicator — EXPLICITLY DEFERRED
Decision: do not add a Portainer-ping HealthIndicator in this PR. Rationale:
portainer-automationDOWN even though the container is healthy, causing false alerts on the Uptime Kuma monitor.portainer.api-key=${PORTAINER_API_KEY:}defaults to empty; a Portainer health probe would fail in local/CI profiles and break AC 1 (/actuator/health→ 200{"status":"UP"}).health,infoonly)./api/deploy).Deltas vs original PR