Skip to content

Conversation

@gmarcus
Copy link

@gmarcus gmarcus commented Nov 24, 2025

Motivation

See discussion at #222

Summary

This PR introduces a new optional environment variable S3_PUBLIC_URL that allows users to specify a custom public domain for S3 file URLs, enabling CDN integration, custom domain branding, and proper Cloudflare R2 public access.

Changes

• New Environment Variable: S3_PUBLIC_URL - optional configuration for customizing the base URL of returned file URLs

Updated Files:

◦ .env.example - added configuration example
◦ README.md - documented the new variable with use cases
◦ docker-compose.md - added setup instructions
◦ docs/cloud-installation/do.md - included Digital Ocean-specific guidance
◦ config.py - added configuration loading
◦ services/s3_toolkit.py - implemented URL transformation logic
◦ services/v1/s3/upload.py - applied custom URL for public file uploads
◦ CLAUDE.md - updated documentation with implementation details

Key Features

• CDN Integration: Seamlessly use CloudFlare, AWS CloudFront, Fastly, or other CDNs for improved performance and reduced bandwidth costs
• Cloudflare R2 Support: Enables public file access on R2, which requires custom domains without bucket names in URL paths
• Custom Domain Branding: Use branded domains (e.g., files.yourcompany.com) instead of exposing cloud provider domains
• Flexible Protocol Handling: Automatically prepends https:// if not specified
• Backward Compatible: Existing deployments continue working without any changes

Use Cases

  1. Cloudflare R2 public access (requires custom domains)
  2. CDN integration for performance and cost optimization
  3. Custom domain branding for professional appearance
  4. Reverse proxy and geo-routing configurations

Testing

• Verified backward compatibility (works without the variable set)
• Tested with custom domain URLs (with and without https:// prefix)
• Confirmed bucket name exclusion from public URLs when S3_PUBLIC_URL is set

Image available on Docker Hub as gmarcus/no-code-architects-toolkit:latest

- Enables CDN integration (CloudFlare, CloudFront, Fastly) for improved performance and reduced bandwidth costs
- Required for Cloudflare R2 public access, which mandates custom domains without bucket names in URL paths
- Allows custom domain branding (e.g., files.yourcompany.com) instead of exposing cloud provider domains
- Provides flexibility for reverse proxies and geo-routing configurations
- Backward compatible - existing deployments continue working without changes
@HarrisonFisher
Copy link
Collaborator

@gmarcus please remove anything unrelated to your specific feature, including comments co-pilot might have generated

@HarrisonFisher
Copy link
Collaborator

documentation unrelated to your feature should not be changed

@gmarcus
Copy link
Author

gmarcus commented Nov 27, 2025

@HarrisonFisher Can you please be more specific? The documentation is related to the new S3_PUBLIC_URL feature.

@gmarcus
Copy link
Author

gmarcus commented Dec 3, 2025

@HarrisonFisher Can you be more specific? What exactly needs to be modified relating to comments or documentation? All edits were specific to the new feature.

@HarrisonFisher
Copy link
Collaborator

@gmarcus check my comment, I gave one example

@gmarcus
Copy link
Author

gmarcus commented Dec 3, 2025

@HarrisonFisher I don't see any review comments inline. What file(s) and line number(s) are you referring to?

@gmarcus
Copy link
Author

gmarcus commented Dec 11, 2025

@HarrisonFisher can you respond with the files(s) and line numbers(s) or just comment inline?

@HarrisonFisher
Copy link
Collaborator

@gmarcus check the review comment, i gave an example

@gmarcus
Copy link
Author

gmarcus commented Dec 13, 2025

@HarrisonFisher Your kidding me right? or are you just an AI? Give me 1 filename:linenumber that you think should be removed from this PR that is not related to the implemented feature

@HarrisonFisher
Copy link
Collaborator

image

@gmarcus
Copy link
Author

gmarcus commented Dec 13, 2025

Hi @HarrisonFisher Sorry for being snarky. I think I see where the breakdown in communication is. I am not a collaborator on the project. I cannot see your inline code comments.

Can you give me screenshots of your comments so I can clean things up?

Here is what I see as a non-collaborator:

no review conversation is showing

CleanShot 2025-12-13 at 02 48 19@2x

That specific CLAUDE.md comment screenshot you shared is not showing up for me

CleanShot 2025-12-13 at 02 50 42@2x

@HarrisonFisher
Copy link
Collaborator

@gmarcus how about now?

@gmarcus
Copy link
Author

gmarcus commented Dec 14, 2025

@HarrisonFisher Thanks. I was able to see the inline comment on the PR. I cleaned up CLAUDE.md and remove any non-feature related changes.

@gmarcus
Copy link
Author

gmarcus commented Dec 29, 2025

@HarrisonFisher Happy Holidays. Ready to merge this PR or are there other issues you want me to address?

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