Skip to content
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
Closed

Minio Implementation for Amazon S3 #1195

armouredking opened this issue Dec 23, 2018 · 3 comments

Comments

@armouredking
Copy link

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":"[email protected]","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
Copy link
Author

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
Copy link
Member

#1192 (comment) details potential steps.

@ssddanbrown
Copy link
Member

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
Development

No branches or pull requests

2 participants