Add unauthenticated /ping health endpoint for TrueNAS#566
Closed
lzinga wants to merge 3 commits into
Closed
Conversation
therobbiedavis
requested changes
May 3, 2026
Collaborator
therobbiedavis
left a comment
There was a problem hiding this comment.
Again some minor changes
therobbiedavis
approved these changes
May 5, 2026
Collaborator
therobbiedavis
left a comment
There was a problem hiding this comment.
@lzinga There are a couple non-blockers, so approving for now. If you want to address the non-blockers, feel free, and i'll re-review.
| { | ||
| services.AddSingleton<Listenarr.Api.Services.IStartupConfigService>(sp => | ||
| { | ||
| return new TestStartupConfigService(new StartupConfig { AuthenticationRequired = "Disabled" }); |
Collaborator
There was a problem hiding this comment.
The rest of the test suite uses "false" instead of "Disabled". It returns false here only because it falls through the allowlist same as any other unknown string. Can you change is to false to be consistent and explicit?
| @@ -0,0 +1,80 @@ | |||
| /* | |||
Collaborator
There was a problem hiding this comment.
I think we should also add a test case for the new [HttpHead("/ping")]. Which in that case it might be worth looking at going ahead and creating a private helper to make the test fixture setups easier.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a lightweight
/pingendpoint at the root URL for use as a Docker/TrueNAS liveness probe. This matches theconvention used by Sonarr, Radarr, Lidarr, and other *arr apps, where TrueNAS app catalog templates call
curl /pingfor health checks.Changes
Added
GET /pingendpoint in SystemController — returns{"status":"OK"}with no authentication required<remarks>XML doc explaining why the route uses a leading/to override the controller prefixTesting
PingEndpointTests.cs:Ping_Returns200_WhenAuthDisabled— verifies 200 OK without authPing_Returns200_WhenAuthEnabled_WithoutCredentials— verifies [AllowAnonymous] bypasses auth middlewareListenarrWebApplicationFactoryhealthcheck.set_test("curl", {"path": "/ping"})at rootNotes
/in[HttpGet("/ping")]is intentional — it overrides the controller'sapi/v{version}/systemprefix so the endpoint lives at the root, matching the *arr convention
Follow-up: TrueNAS App Catalog Submission
Once this PR is approved and merged, the next step is to submit Listenarr to the TrueNAS Apps
Catalog:
truenas/appsinto the Listenarrs orgix-dev/community/listenarr/modeled after Sonarr'sdefinition, which includes:
app.yaml— metadata (name, version, categories, icon, screenshots, maintainers, run_as_context)item.yaml— catalog entry (categories, icon_url, tags)ix_values.yaml— default image config (Docker image repo + tag)questions.yaml— user config schema (port, storage mounts, env vars, resources)templates/docker-compose.yaml— Jinja2 template withc1.healthcheck.set_test("curl", {"port": ..., "path": "/ping"})templates/test_values/basic-values.yaml— CI test scenario (required)README.md— short app descriptionghcr.io/listenarrs/listenarr) — required byix_values.yamlapp.yamltruenas/appstargeting the community trainfirst, run
python .github/scripts/ci.pylocally to validate, and open a draft PR early for maintainer feedback