Skip to content

fix: healthcheck reads the same config file and addresses as start.sh - #143

Merged
oleksandr-nc merged 1 commit into
mainfrom
fix/healthcheck-match-start
Oct 21, 2026
Merged

oleksandr-nc merged 1 commit into
mainfrom
fix/healthcheck-match-start

Conversation

@oleksandr-nc

@oleksandr-nc oleksandr-nc commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

healthcheck.sh does not read the configuration the way start.sh does, so a working HaRP can stay unhealthy:

  • It prefers /run/harp/haproxy.cfg whenever that file exists, while start.sh runs HAProxy with /haproxy.cfg whenever that one exists. With /run/harp kept in a volume, a config generated on an earlier start is checked instead of /haproxy.cfg.
  • start.sh strips surrounding quotes from HP_FRP_ADDRESS, HP_EXAPPS_ADDRESS and HP_EXAPPS_HTTPS_ADDRESS (for example - HP_EXAPPS_ADDRESS="0.0.0.0:8780" in a compose file), but the healthcheck probes the quoted value, which never succeeds.

Changes

  • healthcheck.sh uses /haproxy.cfg when it exists and /run/harp/haproxy.cfg otherwise.
  • healthcheck.sh strips surrounding quotes from the addresses before probing them, as start.sh does.

Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

📝 Walkthrough

The healthcheck sets CFG_DIR to an empty value when /haproxy.cfg exists. Otherwise, it uses /run/harp. The check_port function strips surrounding single or double quotes from an address before parsing and checking it.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to c3478

The healthcheck may briefly report the wrong startup status when a stale fallback configuration exists. Aligning its selector with start.sh is advisable, but the risk is bounded and does not block merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly states that healthcheck.sh now matches start.sh for configuration files and addresses.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The pull request description directly explains both changes to healthcheck.sh: configuration path selection and removal of surrounding quotes from healthcheck addresses.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3c0c8e92-f520-4a11-a3ff-359f1b1465af
📥 Commits

Reviewing files that changed from the base of the PR and between ff2417c and c347893.

📒 Files selected for processing: 1
  • healthcheck.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread healthcheck.sh
@oleksandr-nc
oleksandr-nc merged commit 5797416 into main Oct 21, 2026
18 checks passed
@oleksandr-nc
oleksandr-nc deleted the fix/healthcheck-match-start branch October 21, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant