mirror of
https://github.com/koel/koel.git
synced 2026-04-25 00:36:03 +03:00
[PR #2169] Fix S3 key derivation #2124
Labels
No labels
Authentication
Dependencies
Documentation
Feature Request
Flac
Help Wanted
Installation/Setup
Integration
Mobile
PR Welcome
Pending Release
Performance
Playlist
S3
Search
Sync
[Pri] Low
[Pri] Normal
[Status] Keep Open
[Status] Needs Author Reply
[Status] Needs Review
[Status] Stale
[Status] Will Implement
[Type] Blessed
[Type] Bug
[Type] Duplicate
[Type] Enhancement
[Type] Help Request
[Type] Question
[Type] Task
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/koel-koel#2124
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/koel/koel/pull/2169
Author: @RomanHargrave
Created: 12/1/2025
Status: 🔄 Open
Base:
master← Head:roman/s3📝 Commits (2)
30ec427Fix S3 key derivation5f6cecbRemove S3LambdaMetadata📊 Changes
2 files changed (+10 additions, -13 deletions)
View changed files
📝
app/Models/Song.php(+10 -6)➖
app/Values/SongStorageMetadata/S3LambdaMetadata.php(+0 -7)📄 Description
Description
Koel presently derives s3cs URLs incorrectly: when translating an
s3://bucket/key/for/objectURI to a signed URL, it effectively uses the last segment of the key as the the entire object key. For instance, given the aforementioned example URI, the generated download URL ishttps://bucket.{endpoint}/objectwhen it should behttps://bucket.{endpoint}/key/for/object.This happens because of match greediness: as both capture groups contain zero-or-more wildcard (
.) matches, the regex will only fill the second group as much as is necessary to satisfy a complete match, which places a/between the groups.Motivation
Koel is in theory easier to use with preexisting object stores than Funkwhale, and this is essentially the only blocking issue.
Screenshots (if applicable)
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.