feat: custom s3 endpoint url for 'plugin-node' #2176
+4,009
−11,770
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relates to
#2174
Risks
Low. This affects only the
plugin-node
, and it changes logic in a way that is backward compatible.Background
What does this PR do?
This changes the
plugin-node
to, optionally, use a customAWS_S3_ENDPOINT
. If this value is not set, the existing behavior is used, which explicitly calls the official AWS S3 URL. If the value is set (e.g.,http://localhost:8014
), it instead uses this custom URL when reading/writing data. Closes #2174.What kind of change is this?
Feature; improves the S3 plugin functionality.
Why are we doing this? Any context or related work?
Eliza should make it so that AWS isn't the only S3 provider. Right now, it's an enshrined plugin. If we merge this PR, anyone that builds an S3-compatible tool can use the plugin; it becomes more flexible.
For reference, I'm building a web3 native object storage layer, which has S3 compatability—called Basin: https://basin.textile.io. We have an S3 adapter that works with MinIO, boto3, etc. I tested this plugin against our adapter, and everything worked as expected (more on this below).
Documentation changes needed?
plugin-node
README to mention this variable.env.example
fileTesting
Where should a reviewer start?
If you'd like to test this flow, you'll need to use some local S3 compatible server. A popular one is MinIO. Once you have the server running, it should log the local port. You can then set the
.env
variableAWS_S3_ENDPOINT
to this value (e.g.,http://localhost:8014
), and then calluploadFile
.Detailed testing steps
I tested this against our S3 adapter with both raw and resigned URLs. For example:
If
AWS_S3_ENDPOINT
is not set, then it uses the normal S3 format.Discord username
dtb_