disfactory-notification

Month: 2025-07

2025-07-02

github2 20:10:52

`<https://github.com/Disfactory/Disfactory/commit/3d0b9a8f53e5ffa7a7afe22be721be4fc8860fd3|3d0b9a8f>` - feat(review-app): add project-independent configuration and usage support `<https://github.com/Disfactory/Disfactory/commit/651e5701bfea63dc021186efecef6cc889849e16|651e5701>` - refactor: extract zeabur script as standalone action `<https://github.com/Disfactory/Disfactory/commit/f9d301cbf013b4aaa4fff1e08d89a0c31ca1f752|f9d301cb>` - fix(log): redirect all log output to stderr for better error handling `<https://github.com/Disfactory/Disfactory/commit/22a6405b09d4efcea98e53bf1b48cba80ec09287|22a6405b>` - fix: full sha image reference `<https://github.com/Disfactory/Disfactory/commit/f2082368f974445b7ab5a2d3f805ed4d8fc84de4|f2082368>` - style: strip trailing spaces `<https://github.com/Disfactory/Disfactory/commit/43193213f14e4324b8a8b0d3bfafcf6f840291fb|43193213>` - fix: try expanding sha in the script `<https://github.com/Disfactory/Disfactory/commit/5a7ace6fce1b7487df93f4c9e8a158f2dd3e1dab|5a7ace6f>` - fix: try fixing workflow outputs `<https://github.com/Disfactory/Disfactory/commit/09e1533ce2c4f430809a6436babaa7ad015b49fa|09e1533c>` - feat: update github workflow action reference `<https://github.com/Disfactory/Disfactory/commit/238da4b0e53fb387f0e6238cc763e8d9af2c7119|238da4b0>` - docs: update README of zeabur review app action `<https://github.com/Disfactory/Disfactory/commit/bc56a628482844b3124bc4af6f2e8e9cd991b9a2|bc56a628>` - chore: remove zeabur-review-app-action from repo `<https://github.com/Disfactory/Disfactory/commit/f6ed374bb58d7b13fcdfa5b624bd671213964ddc|f6ed374b>` - Merge pull request #675 from Disfactory/chore/make-zeabur-deploy-script-project-independent

github2 20:23:17

<https://github.com/Disfactory/Disfactory/pull/660|#660 Support multiple image upload backends with ImageBB and automatic fallback>

This PR implements a comprehensive solution for multiple image upload backends to address Imgur API being blocked in Taiwan. ## Problem The current implementation only supports Imgur for image uploads, which is problematic because: • Imgur's API is blocked in Taiwan • No fallback mechanism when external services fail • Frontend handles image upload, limiting backend control ## Solution ### :wrench: New Multi-Backend Image Upload Service Created `api/services/image_upload.py` with: • *Abstract backend interface* for pluggable upload providers • *ImgurBackend* - Enhanced existing Imgur support with better error handling • *ImageBBBackend* - New backend supporting ImageBB API as Imgur alternative • *LocalBackend* - Fallback local storage when external services fail • *ImageUploadService* - Orchestrates backends with automatic failover ### :rocket: New Direct Upload API Endpoint Added `POST /factories/{id}/images/upload` supporting: • Direct multipart file uploads (no more frontend pre-upload) • All existing metadata: GPS coordinates, datetime, contact info • Automatic backend selection with graceful fallback • Same response format as existing endpoint ### :gear: Enhanced Configuration # Existing Imgur support DISFACTORY_IMGUR_CLIENT_ID=your_imgur_client_id # New ImageBB support DISFACTORY_IMAGEBB_API_KEY=your_imagebb_api_key Service automatically detects available backends and provides fallback order: *Imgur → ImageBB → Local Storage* ### :arrows_counterclockwise: Backward Compatibility • Existing `/factories/{id}/images` URL-based endpoint unchanged • Legacy `upload_image` task enhanced to use new multi-backend service • All existing functionality preserved • No database schema changes required ### :test_tube: Comprehensive Testing • Unit tests for all backend implementations • Integration tests for new file upload endpoint • Mock validation confirms service logic • Management commands for testing and maintenance ### :books: Documentation &amp; Tools • Complete user guide with API examples • Migration guide for frontend developers • Enhanced `reupload` management command with dry-run support • New `test_image_upload` command for service validation ## Usage Examples ### Frontend Integration (New Direct Upload) const formData = new FormData(); formData.append('image', imageFile); formData.append('nickname', 'Reporter'); formData.append('Latitude', '23.5'); fetch(`/api/factories/${factoryId}/images/upload`, { method: 'POST', body: formData }); ### Backend Service Usage from api.services.image_upload import ImageUploadService service = ImageUploadService() result = service.upload_image(image_buffer) # Automatically tries Imgur → ImageBB → Local with detailed logging ## Benefits :white_check_mark: *Reliability*: Multiple providers ensure upload success even when services are blocked :white_check_mark: *Flexibility*: Easy to add new backends (Cloudinary, AWS S3, etc.) :white_check_mark: *Control*: Backend handles uploads with better error handling and logging :white_check_mark: *Compatibility*: Existing integrations continue working unchanged :white_check_mark: *Monitoring*: Detailed logging shows which backend succeeded/failed This implementation ensures robust image upload functionality regardless of regional service restrictions while maintaining full backward compatibility. Fixes <https://github.com/Disfactory/Disfactory/issues/659|#659>. Warning Firewall rules blocked me from connecting to one or more addresses #### I tried to connect to the following addresses, but was blocked by firewall rules: • `<http://esm.ubuntu.com|esm.ubuntu.com>` • Triggering command: `/usr/lib/apt/methods/https ` (dns block) If you need me to access, download, or install something from one of these locations, you can either: • Configure <https://gh.io/copilot/actions-setup-steps|Actions setup steps> to set up my environment, which run before the firewall is enabled • Add the appropriate URLs or hosts to my <https://gh.io/copilot/firewall-config|firewall allow list> --- :speech_balloon: Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click <https://survey.alchemer.com/s3/8343779/Copilot-Coding-agent|here> to start the survey.

github2 20:41:09

<https://github.com/Disfactory/Disfactory/pull/677|#677 fix(ci): ensure workflow uses input commit SHA for Docker builds>

## Summary • Fixed issue where workflow_dispatch with specific commit SHA would still build Docker images from branch HEAD • Updated checkout actions to use input commit SHA when provided • Ensures Docker image tags match the actual commit being built ## Changes • Modified build-backend-image.yml to checkout the specified commit SHA • Updated both build and deploy jobs to use consistent commit references • Docker images will now be tagged with the correct commit SHA ## Test plan • Test workflow_dispatch with specific commit SHA • Verify Docker images are built from correct commit • Confirm image tags match specified commit SHA :robot_face: Generated with <https://claude.ai/code|Claude Code>

github2 20:47:31

`<https://github.com/Disfactory/Disfactory/commit/ec11a8b37e8b5d8b1cc544d26fdd818fe714eb88|ec11a8b3>` - fix(ci): use input commit SHA for git operations in workflow (#677)

github2 20:49:39

<https://github.com/Disfactory/Disfactory/issues/15|#15 imgur 上傳的時候的注意事項,特別是每半年打一次>

• 可以壓縮一下 • 記得把 metadata (EXIF) 刪掉 • 每半年打一次

github2 21:25:54

<https://github.com/Disfactory/frontend/issues/190|#190 Fix Font-family in different browsers>

• 不同瀏覽器下(Edge、firefox),標題字體會跑掉。 • 需統一修改為微軟正黑體。 Assigns:<https://github.com/ChangRongXuan|Xuan>

github2 21:31:15

<https://github.com/Disfactory/Disfactory/pull/678|#678 feat: add extensible image upload service with S3/R2 support>

## Summary • Add new `/api/upload` endpoint for direct image file uploads • Implement extensible image upload service architecture supporting S3/R2 and local storage • Replace imgur dependency with configurable storage backends • Add comprehensive unit tests for both controller and services ## Changes • *New endpoint*: `POST /api/upload` - accepts image files directly and returns URL • *Service architecture*: Abstract base class with S3 and local storage implementations • *Configuration*: Environment-based settings for storage service selection • *Dependencies*: Added boto3 for S3-compatible storage support • *Tests*: Complete test coverage for all components ## Configuration # For S3/Cloudflare R2 IMAGE_UPLOAD_SERVICE = 's3' # or 'local' IMAGE_UPLOAD_BUCKET = 'your-bucket-name' IMAGE_UPLOAD_ACCESS_KEY = 'your-access-key' IMAGE_UPLOAD_SECRET_KEY = 'your-secret-key' IMAGE_UPLOAD_ENDPOINT_URL = '<https://your-r2-endpoint.com>' # For R2 IMAGE_UPLOAD_PUBLIC_URL_BASE = '<https://your-cdn.com>' # Optional CDN ## Test plan • Unit tests for image upload controller • Unit tests for S3 and local storage services • Integration tests for endpoint validation • Error handling and edge cases • Manual testing with actual S3/R2 configuration • Performance testing with large files :robot_face: Generated with <https://claude.ai/code|Claude Code>