Harbor: Mobile-responsive CSS via nginx sub_filter injection #345
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/pal-e-platform#345
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Type
Feature
Lineage
Standalone -- discovered during SSO wiring session (2026-05-05). Phase 2.5: mobile access for SSO'd services.
Repo
ldraney/pal-e-platformUser Story
As a platform admin on mobile,
I want Harbor's UI to be usable on my phone
So that I can check image repos and scan results without a laptop.
Context
Harbor portal is an Angular app served by nginx from
/usr/share/nginx/html/. Itsglobal.scss(481 lines) has zero responsive breakpoints -- it was never designed for mobile.How the fix works: nginx
sub_filteris a text-replacement directive that modifies the HTML response before it reaches the browser. We configure Harbor's portal nginx to find</head>and replace it with<link rel="stylesheet" href="/custom.css"></head>. The browser then loads our custom CSS on top of Harbor's existing styles. Our CSS adds@mediaqueries that only activate on narrow screens -- desktop stays identical. Requiresproxy_set_header Accept-Encoding ""because sub_filter can't search gzipped responses.Two viable approaches confirmed by investigation:
/usr/share/nginx/html/custom.css.goharbor/harbor-portal, add media queries tosrc/portal/src/global.scss, setportal.image.repositoryin Helm values.Branding config at
setting.jsonsupportsheaderBgColor,loginBgImg,product.name,product.logobut no custom CSS field. Helm chart (v1.18.2) exposesportal.initContainersbut lacksextraVolumes/extraVolumeMounts.File Targets
Files the agent should modify or create:
terraform/modules/harbor/main.tf-- add nginx config override and/or custom CSS volume mount to Helm valuesterraform/modules/harbor/variables.tf-- new variables if needed for CSS configFiles the agent should NOT touch:
terraform/modules/storage/main.tf-- MinIO is a separate ticketterraform/modules/forgejo/main.tf-- Forgejo is a separate ticketAcceptance Criteria
@media (min-width: 600px)for desktopTest Expectations
tofu validatepassestofu plan -lock=falseshows expected changes to Harbor Helm releaseConstraints
terraform/modules/harbor/Checklist
tofu validatepassesRelated
project-pal-e-platform-- platform project#338-- SSO: Wire Harbor OIDC (completed)