Skip to content

feat: add configurable Docker registry support#27

Open
JohnPreston wants to merge 1 commit intofivexl:mainfrom
JohnPreston:feature/url-with-ip-restrictions
Open

feat: add configurable Docker registry support#27
JohnPreston wants to merge 1 commit intofivexl:mainfrom
JohnPreston:feature/url-with-ip-restrictions

Conversation

@JohnPreston
Copy link

@JohnPreston JohnPreston commented Nov 7, 2025

  • Make Docker registry and image name configurable via environment variables
  • Update GoReleaser to use REGISTRY and IMAGE_NAME env vars
  • Add workflow-level environment variables with sensible defaults
  • Create comprehensive CONTRIBUTING.md with setup instructions
  • Support multiple registries (GHCR, Docker Hub, GCR)
  • Maintain backward compatibility with original ghcr.io/fivexl/lprobe

Note

Add URL-based health check with hostname/IP validation, make Docker registry/image configurable across CI and GoReleaser, add CONTRIBUTING docs, and update dependencies.

  • Core (CLI):
    • Add -url option with automatic scheme/port/path parsing, TLS inference, and -tls-server-name setting.
    • Validate hostnames/IPs; allow only 127.0.0.1, ::1, 169.254.169.254, 169.254.170.2, fd00:ec2::254.
    • Update address resolution to honor parsed host.
  • Tests:
    • Extend scripts/test.sh with URL-based HTTP checks and failure cases.
  • CI/Release:
    • Add workflow-level REGISTRY and IMAGE_NAME env vars with defaults; use in Docker login and GoReleaser steps (.github/workflows/ci.yml).
  • GoReleaser:
    • Use {{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }} for dockers and docker_manifests.
    • Update image labels to use {{ .Env.GITHUB_REPOSITORY_OWNER }}.
  • Docs:
    • Add CONTRIBUTING.md with instructions for publishing images to custom registries and contribution guidelines.
  • Dependencies:
    • Bump Go toolchain and libraries (go.mod/go.sum), including go-spiffe, grpc, x/*, genproto, protobuf.
  • Misc:
    • Minor Dockerfile and workflow formatting tweaks.

Written by Cursor Bugbot for commit ff06cd6. This will update automatically on new commits. Configure here.

- Make Docker registry and image name configurable via environment variables
- Update GoReleaser to use REGISTRY and IMAGE_NAME env vars
- Add workflow-level environment variables with sensible defaults
- Create comprehensive CONTRIBUTING.md with setup instructions
- Support multiple registries (GHCR, Docker Hub, GCR)
- Maintain backward compatibility with original ghcr.io/fivexl/lprobe
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

if err := validateIPAddress(ip); err != nil {
return fmt.Errorf("hostname %q resolves to disallowed IP %s: %v", hostname, ip, err)
}
}
Copy link

Choose a reason for hiding this comment

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

Bug: IP validation: Intent vs. Implementation conflict.

The validateHostname function's comment states "Check if any resolved IP is allowed" but the implementation requires ALL resolved IPs to be allowed. When a hostname resolves to multiple IPs (like localhost resolving to both 127.0.0.1 and ::1), if any single IP fails validation, the entire hostname is rejected. This contradicts the comment and could incorrectly reject valid hostnames that have at least one allowed IP address.

Fix in Cursor Fix in Web

echo "URL HTTP path test failed"
docker stop nginx-lprobe-test
exit 1
fi
Copy link

Choose a reason for hiding this comment

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

Bug: Test Fails Custom Path Validation

The test labeled "URL HTTP with custom path Check Test" uses the same URL as the previous test (http://127.0.0.1:8080/) without actually testing a custom path. This makes the test redundant and fails to validate the intended functionality of custom path handling in the -url flag.

Fix in Cursor Fix in Web

@cageyv
Copy link
Member

cageyv commented Nov 7, 2025

Hi, @JohnPreston
Thanks a lot for your contribution
Could you please add more details about that part ?

	// AWS metadata IPv4 address
	AWSMetadataIPv4 = "169.254.169.254"
	// AWS EKS metadata IPv4 address
	AWSEKSIPv4 = "169.254.170.2"
	// AWS metadata IPv6 address
	AWSMetadataIPv6 = "fd00:ec2::254"

@JohnPreston
Copy link
Author

Hi, @JohnPreston Thanks a lot for your contribution Could you please add more details about that part ?

	// AWS metadata IPv4 address
	AWSMetadataIPv4 = "169.254.169.254"
	// AWS EKS metadata IPv4 address
	AWSEKSIPv4 = "169.254.170.2"
	// AWS metadata IPv6 address
	AWSMetadataIPv6 = "fd00:ec2::254"

Hey. Sorry about the cursor bot stuff as I am here. I just created an account with it by curiosity through GH and here it goes, doing all sorts of things I didn't want it to do.... So I no longer have an account now 😅 . Be damned with tracking...

Right, so I thought, while trying to make the -url a little friendlier, that we wanted to retain the single hop limit. I just thought that in a cloud environment, it might be something that one might want to be able to query as well, although now that I think about it "out loud", the purpose is debatable 🤔 I'd be quite a niche thing to be able to query those specific IP addresses. Happy to take those out, that's easy enough.

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.

2 participants