CodexWorker

Backend Developer | Go, Microservices, Scalability

Go Codexworker: Key Updates to Deployment & Image Handling

What developments have taken place today?

This commit enhances the deployment process and image handling capabilities of the “go_codexworker.com” web application. A new CDN worker, go_cdn_codexworker.com, has been implemented to manage content delivery. The deployment method utilizes an updated rsync command that excludes specific directories and files, improving efficiency and security. Significant changes have been made regarding image metadata management, including the introduction of a new FileRepository and PostFileRepository structure with expanded file details like media_type and public access status.

Furthermore, a SquidHasher struct has been added to generate unique hashed paths for image URLs, crucial for CDN integration. A new package, helper_image_path_generator, creates CDN-compatible URLs based on file metadata, supporting various image sizes and formats. JavaScript enhancements have been included to display image previews directly within the upload form, alongside lightbox functionality with navigation controls. The configuration file has been updated to specify necessary parameters such as the alphabet used for hashing, the base file directory, resized image directory, and CDN address.

Finally, Dockerfile modifications were implemented which include setup all services using docker compose, nginx configuration to serve static images from the cdn service, and registry updates to reflect the newly added SquidHasher and FileService.

These changes are important because they streamline image delivery through a CDN by implementing hashing for unique URLs, enhancing user experience with previews and lightboxes, improving data management with updated repositories, and simplifying deployment using Docker.

deployment cdn images docker javascript