1
0
Fork
You've already forked pyfedi
0
forked from rimu/pyfedi

Implement S3 media serving with local fallback #12

Merged
saint merged 1 commit from s3-migration-support into main 2025年09月03日 18:47:52 +02:00
Owner
Copy link
  • Add dynamic URL generation based on S3_PUBLIC_URL configuration
  • Fallback to HTTP_PROTOCOL://SERVER_NAME when S3 not configured
  • Handle mixed database state (relative paths + existing full URLs)
  • Update File model URL methods with S3/local logic
  • Fix upload function to use configuration-based URLs
  • Simplify Community/User/Feed image methods to use File model URLs
  • Store relative paths in database for migration flexibility

Configuration:

  • S3_PUBLIC_URL: Primary media base URL (e.g. 'https://media.example.com')
  • HTTP_PROTOCOL + SERVER_NAME: Fallback for local serving

Fixes template relative path issues and double-https URL problems.
Enables production deployments to switch between local and S3 storage
without code changes or database migrations.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

- Add dynamic URL generation based on S3_PUBLIC_URL configuration - Fallback to HTTP_PROTOCOL://SERVER_NAME when S3 not configured - Handle mixed database state (relative paths + existing full URLs) - Update File model URL methods with S3/local logic - Fix upload function to use configuration-based URLs - Simplify Community/User/Feed image methods to use File model URLs - Store relative paths in database for migration flexibility Configuration: - S3_PUBLIC_URL: Primary media base URL (e.g. 'https://media.example.com') - HTTP_PROTOCOL + SERVER_NAME: Fallback for local serving Fixes template relative path issues and double-https URL problems. Enables production deployments to switch between local and S3 storage without code changes or database migrations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Implement S3 media serving with local fallback
Some checks failed
/ lint (push) Failing after 9s
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
/ lint (pull_request) Failing after 9s
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
cd8a43f439
- Add dynamic URL generation based on S3_PUBLIC_URL configuration
- Fallback to HTTP_PROTOCOL://SERVER_NAME when S3 not configured
- Handle mixed database state (relative paths + existing full URLs)
- Update File model URL methods with S3/local logic
- Fix upload function to use configuration-based URLs
- Simplify Community/User/Feed image methods to use File model URLs
- Store relative paths in database for migration flexibility
- Remove 87 lines of complex path manipulation code
- Support seamless migration from local storage to S3
Configuration:
- S3_PUBLIC_URL: Primary media base URL (e.g. 'https://media.example.com')
- HTTP_PROTOCOL + SERVER_NAME: Fallback for local serving
Fixes template relative path issues and double-https URL problems.
Enables production deployments to switch between local and S3 storage
without code changes or database migrations.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
saint deleted branch s3-migration-support 2025年09月03日 18:47:54 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
saint/pyfedi!12
Reference in a new issue
saint/pyfedi
No description provided.
Delete branch "s3-migration-support"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?