fraschetti / Octoslack

OctoPrint plugin for Slack, Mattermost, Pushbullet, Pushover, Rocket.Chat, Discord, Riot/Matrix, & Microsoft Teams
MIT License
74 stars 34 forks source link

Fixed S3 URL to uploaded snapshot. #24

Closed slintak closed 5 years ago

slintak commented 6 years ago

Bucket name should be part of domain name {bucket}.s3.amazonaws.com/{filename} and not part of URL path s3.amazonaws.com/{bucket}/{filename}.

This should fix issue #20.

fraschetti commented 6 years ago

Hi @slintak It looks like the proper fix might be to change the config to require a full hostname + path instead of attempting to construct it automagically. The primary reason being that the URL may vary depending on how you've setup your S3 bucket.

https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro (virtual-hosted–style URL vs. path-style URL)

Feel free to take a stab at this generalization but keep in mind we'll need to ensure the solution is backwards compatible.

fraschetti commented 5 years ago

I've submitted a different change set of changes which will allow users to use both S3 URL styles. Stay tuned for what will likely be Octoslack 1.7.2 (it'll be in anything > 1.7.1).

fraschetti commented 5 years ago

I've just pushed 1.7.2 which includes a drop-down option to switch between the two Amazon S3 URL styles. It's rare that this should matter but if your bucket meets one of a limited number of critiera, you might need to use one or the other.