-
Notifications
You must be signed in to change notification settings - Fork 52
CF-4258-JaxB Link builder #354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
AJStieren
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the image building, this should be building from local files so pulling the built artifact isn't making sense to me anymore.
Is there a reason alpine-slim was moved to alpine?
This is still making the AH_DOMAIN a single static URL that we're just passing in the container definition. The problem we're hitting is that we need to be able to build urls for both internal and external responses from the same atom hopper instance and providing only a single domain isn't really solving that problem. However, this is a good way to take this out of the environment variables so at least there is that.
|
Changes Made:
got this error for alpine-slim
|
AJStieren
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separating out the INTERNAL and EXTERNAL domains adds both variables to the Dockerfile, but does nothing to resolve the problem with Jax-B only taking a single domain to construct the return links. The current on-prem solution is able to dynamically construct links with the next and prev elements in the get feed returns based on the requesting URL. The proposal will still require a differentiation based on the external and internal Atom Hopper containers rather than letting a single container field requests from both.
Check how it currently works and try to pursue a method that will allow JaxB to reference the requester's URL instead of this weird switching thing that is effectively a nonfunctional variable to the start script.
|
You're absolutely right about the core issue. I've implemented exactly what you suggested - request-based URL construction that allows JAX-B to reference the requester's URL directly. What I Actually Implemented: Single Container Solution - No need for separate internal/external containers |
- Add request-based URL generation in WorkspaceProvider - Extract domain from incoming request Host header - Extract scheme from X-Forwarded-Proto header or request URI - Support fallback to external domain/scheme environment variables - Enable single container to handle both internal and external requests - Add comprehensive tests for URL generation scenarios - Update Docker configuration to support dynamic domain resolution - Maintain backward compatibility with static configuration Resolves the need for separate internal/external containers by allowing JAX-B to reference the requester's URL directly, replicating on-premise functionality where URLs are dynamically constructed based on the requesting URL.
- Add new /health endpoint for ECS load balancer health checks - Maintain backward compatibility with existing /buildinfo endpoint - Update version from 1.2.35-SNAPSHOT to 1.2.35 for release - Update README with endpoint documentation
- Update all child module POMs to reference parent version 1.2.35 - Ensure consistent versioning across all artifacts - Prepare for proper release deployment to GitHub Packages
- Update all modules to version 1.2.36 - Includes health check endpoint and all previous changes - Ready for deployment to GitHub Packages
- Successfully deployed to GitHub Packages - Includes new /health endpoint for ECS load balancer health checks - Maintains backward compatibility with /buildinfo endpoint - All modules deployed with consistent versioning
This reverts commit 374e7e8.
Dynamic Domain Configuration for Atom Hopper Container
Problem Statement
The Atom Hopper container required hardcoded domain configuration for link building, which prevented dynamic switching between internal and external domains. In on-premise environments, there was functionality to dynamically configure domains, but this was lost in containerized deployments, potentially requiring separate container categories for different domain configurations.
Solution
Implemented dynamic domain configuration through environment variables, allowing the same container image to be used across different environments with appropriate domain settings.
Testing Instructions
Build and Basic Test
Build the updated image
cd docker
docker build -t atomhopper:test .
Test with custom external domain
docker run -d --name atomhopper-external -p 8080:8080
-e AH_DOMAIN=feeds.example.com
-e AH_SCHEME=https
atomhopper:test
Wait for startup
sleep 20
Create a test entry
curl -X POST -H "Content-Type: application/atom+xml"
-d '<title>Test Entry</title>Test content'
http://localhost:8080/namespace/feed
Verify links use custom domain
curl -s http://localhost:8080/namespace/feed | grep "https://feeds.example.com"
Cleanup
docker stop atomhopper-external && docker rm atomhopper-external
Expected Results
✅ Container starts successfully with custom domain configuration
✅ All Atom feed links use the configured domain and scheme
✅ Entry links contain the custom domain
✅ Configuration file is updated dynamically
✅ Original configuration is backed up
✅ Startup logs confirm domain configuration