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

feat: Supports upload files to AWS S3. #941

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

xwxtwd
Copy link
Contributor

@xwxtwd xwxtwd commented Dec 9, 2024

Relates to:

N/A (Internal feature implementation)

Risks

Low - This is an isolated service addition to plugin-node for S3 file upload functionality. Main risks:

  1. AWS credentials security
  2. File upload limits and validation
  3. S3 bucket permissions configuration

Background

What does this PR do?

Adds a new service to plugin-node that enables file uploads to AWS S3 storage. This includes:

New S3 service implementation
File upload handling
AWS SDK integration
Configuration for S3 bucket and credentials

What kind of change is this?

Features (non-breaking change which adds functionality)

Why are we doing this? Any context or related work?

After AI-generated NFT, need to upload the file to a network storage service.

Documentation changes needed?

My changes do not require a change to the project documentation.

Testing

Where should a reviewer start?

  1. Review the S3 service implementation
  2. Check AWS configuration setup
  3. Verify file upload functionality
  4. Review error handling and validation

Detailed testing steps

  1. Configure AWS credentials in environment variables. (.env)
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_REGION
  • AWS_S3_BUCKET
  • AWS_S3_UPLOAD_PATH
  1. Start the plugin-node service
const aws: AwsS3Service = runtime.getService(ServiceType.AWS_S3);
const res = await aws.uploadFile('your file path')
elizaLogger.log(res.url)
  1. Verify successful upload to S3 bucket
  2. Check proper error handling and responses

@odilitime odilitime merged commit c017522 into elizaOS:main Dec 10, 2024
3 checks passed
jnaulty added a commit to jnaulty/eliza that referenced this pull request Dec 11, 2024
- NodePlugin is now only created when all required AWS credentials are present
  (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_S3_BUCKET)
- GoatPlugin is now only created when ALCHEMY_API_KEY is present
- Added type annotations for plugins to handle undefined cases

These changes prevent unnecessary plugin initialization when required
credentials are missing and improve type safety.

Issues introduced in: elizaOS#941 and
elizaOS#898
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants