New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minio Implementation for Amazon S3 #1195

Closed
armouredking opened this Issue Dec 23, 2018 · 3 comments

Comments

2 participants
@armouredking
Copy link

armouredking commented Dec 23, 2018

Describe the feature you'd like
Bookstack does not apparently allow you to set a URL for S3. I'm not 100% certain about the STORAGE_URL field, but given the Laravel logs I have to assume it does not do what I'm thinking it would/should.

Describe the benefits this feature would bring to BookStack users
Minio is a compatible stack, and given that quite a few people using BookStack will be self hosted, supporting Minio should be implemented. And it should be fairly easily done. RocketChat accomplishes this simply by allowing you to specify the link (instead of trying to magic it into existence as it seems is currently done).

Additional context
Log entry:

[2018-12-23 02:28:23] production.ERROR: Encountered a permanent redirect while requesting https://bookstack.s3.us-west-1.amazonaws.com/?prefix=uploads%2Fimages%2Fuser%2F2018-12-Dec%2Ftest.jpg%2F&max-keys=1&encoding-type=url. Are you sure you are using the correct region for this bucket? {"userId":1,"email":"admin@admin.com","exception":"[object] (Aws\\S3\\Exception\\PermanentRedirectException(code: 0): Encountered a permanent redirect while requesting https://bookstack.s3.us-west-1.amazonaws.com/?prefix=uploads%2Fimages%2Fuser%2F2018-12-Dec%2Ftest.jpg%2F&max-keys=1&encoding-type=url. Are you sure you are using the correct region for this bucket? at /var/www/html/vendor/aws/aws-sdk-php/src/S3/PermanentRedirectMiddleware.php:49)
[stacktrace]

.env File:

# Storage
STORAGE_TYPE=s3
# Amazon S3 Config
STORAGE_S3_KEY=ihaveaworkingkeyhere
STORAGE_S3_SECRET=andaworkingsecrethere
STORAGE_S3_REGION=us-west-1
STORAGE_S3_BUCKET=bookstack
# Storage URL
# Used to prefix image urls for when using custom domains/cdns
STORAGE_URL=https://bucket.trustmeit.exists/bookstack

Entries are of course sterilized. Similar entry / Relevant information: #1192 and Rocket.Chat Documentation

@armouredking

This comment has been minimized.

Copy link
Author

armouredking commented Dec 23, 2018

So looking around on Flysystem, it seems like the default plugin has a few bugs the developer has not corrected with regards to Minio usage. There is another repo here that purports fixes of the Flysystem adapter to include Minio support. Not sure if that's what is also needed for doing CEPH endpoints like #1192 wants.

At a minimum it seems you need the endpoint parameter, and the fork includes an additional parameter not present in the Flysystem plugin for "path style".

@ssddanbrown

This comment has been minimized.

Copy link
Member

ssddanbrown commented Dec 28, 2018

#1192 (comment) details potential steps.

@ssddanbrown ssddanbrown added this to the v0.25.1 milestone Jan 20, 2019

ssddanbrown added a commit that referenced this issue Jan 20, 2019

@ssddanbrown

This comment has been minimized.

Copy link
Member

ssddanbrown commented Jan 20, 2019

As per #1192 (comment), Will close this. #1230 has been opened to deal with proxy issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment