Skip to content

Make footer support link configurable - #341

Merged
cooper667 merged 2 commits into
mainfrom
configurable-support-url
Jul 14, 2026
Merged

cooper667 merged 2 commits into
mainfrom
configurable-support-url

Conversation

@A-Souhei

@A-Souhei A-Souhei commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

What

The "Report a Bug" link in the site footer pointed at a hardcoded, non-existent route (https://adr.unaids.org/bug) which 404'd — leaving live users with no working way to reach support.

image

This makes the link configurable and drops it in cleanly:

  • New get_support_url() helper reads CKAN_UNAIDS_SUPPORT_URL (env) → ckanext.unaids.support_url (config), mirroring the existing get_google_analytics_id() pattern.
  • Footer renders the link only when a valid absolute https:// URL is configured — otherwise it's hidden (no dead link).
  • Fixes the stray ")" markup typo and corrects target="blank" → target="_blank" with rel="noopener".

Security

get_support_url() validates the scheme: only absolute https:// values are exposed. http://, javascript:, data:, relative, and unset values all return None (link hidden), preventing scheme-injection into the footer href. Covered by a parametrized unit test.

Config

Set one of:

  • env: CKAN_UNAIDS_SUPPORT_URL=https://<subdomain>.freshdesk.com/support/tickets/new
  • ini: ckanext.unaids.support_url = https://...

Notes

  • Deployment side (env passthrough in adx_develop docker-compose.yml + submodule bump) is handled separately in the parent repo.
  • An in-page Freshdesk widget (embedded ticket form) was scoped as a follow-up PR and is intentionally not included here.

The "Report a Bug" footer link pointed at a hardcoded, non-existent
route (https://adr.unaids.org/bug) that 404'd. Replace it with a
support URL read from the CKAN_UNAIDS_SUPPORT_URL env var, falling back
to the ckanext.unaids.support_url config key.

The helper only exposes an absolute https:// URL; any other value
(http, javascript:, data:, relative, unset) is dropped and the link is
hidden rather than rendered dead. Also fixes the stray ")" markup typo
and corrects target="blank" to target="_blank" with rel="noopener".
@A-Souhei
A-Souhei force-pushed the configurable-support-url branch from db2a4ce to 9abd092 Compare July 10, 2026 17:05
Require an https scheme with a non-empty host (via urlsplit) instead of
a prefix check, so hostless values like "https://" or "https:///path"
are rejected rather than rendered as dead links. Add tests for the
config fallback, env-over-config precedence, unset, uppercase scheme,
protocol-relative and malformed-https cases.

@ChasNelson1990 ChasNelson1990 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Obviously @A-Souhei there will need to be a PR to the adx repo to add the config varilable (@cooper667 flagging this)

@cooper667
cooper667 merged commit 8788e30 into main Jul 14, 2026
3 checks passed
@cooper667
cooper667 deleted the configurable-support-url branch July 14, 2026 05:10
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.

3 participants