Minio Implementation for Amazon S3 #967

Closed
opened 2026-02-04 23:13:21 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @armouredking on GitHub (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

Originally created by @armouredking on GitHub (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](https://rocket.chat/docs/administrator-guides/file-upload/minio/)
OVERLORD added the 🛠️ Enhancement📖 Docs Update🏭 Back-End labels 2026-02-04 23:13:21 +03:00
Author
Owner

@armouredking commented on GitHub (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".

@armouredking commented on GitHub (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](https://github.com/coraxster/flysystem-aws-s3-v3-minio) 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".
Author
Owner

@ssddanbrown commented on GitHub (Dec 29, 2018):

https://github.com/BookStackApp/BookStack/issues/1192#issuecomment-450435087 details potential steps.

@ssddanbrown commented on GitHub (Dec 29, 2018): https://github.com/BookStackApp/BookStack/issues/1192#issuecomment-450435087 details potential steps.
Author
Owner

@ssddanbrown commented on GitHub (Jan 20, 2019):

As per https://github.com/BookStackApp/BookStack/issues/1192#issuecomment-455875603, Will close this. #1230 has been opened to deal with proxy issues.

@ssddanbrown commented on GitHub (Jan 20, 2019): As per https://github.com/BookStackApp/BookStack/issues/1192#issuecomment-455875603, Will close this. #1230 has been opened to deal with proxy issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#967