Speaker Avatars S3 Setup
This document explains how to set up S3 for hosting speaker avatars as a fallback when blockchainsummit.la is not responding.
Problem
Speaker avatars are currently hosted on blockchainsummit.la, which sometimes doesn't respond, causing avatars to not load in the application.
Solution
- Download all speaker avatars from blockchainsummit.la
- Upload them to S3
- Update the database with S3 URLs
- The application will use S3 URLs from the database, with blockchainsummit.la as fallback
Prerequisites
- AWS Account with S3 access
- S3 Bucket created (or use existing
hashpass-email-assetsbucket) - AWS Access Key ID and Secret Access Key with S3 permissions
- Environment variables configured in
.env:
AWS_REGION=us-east-2
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
AWS_S3_BUCKET_NAME=hashpass-email-assets
AWS_S3_CDN_URL=https://your-cdn-url.com # Optional, for CDN
Running the Script
node scripts/download-and-upload-speaker-avatars.mjs
The script will:
- Fetch all speakers from the database
- For each speaker with a blockchainsummit.la URL:
- Check if the avatar already exists in S3
- If not, download the image from blockchainsummit.la
- Upload to S3 at
speakers/avatars/foto-{speaker-name}.png - Update the database
imageurlfield with the S3 URL
S3 Bucket Structure
hashpass-email-assets/
└── speakers/
└── avatars/
├── foto-rafael-gago.png
├── foto-daniel-marulanda.png
└── ...
Database Update
The script updates the bsl_speakers.imageurl field with the S3 URL. The application code already uses s.imageurl || getSpeakerAvatarUrl(s.name), so it will automatically use the S3 URL from the database.
Fallback Logic
- Primary: Use
imageurlfrom database (S3 URL after script runs) - Fallback: Use
getSpeakerAvatarUrl(name)which always generates S3 URLs
Troubleshooting
AWS Credentials Error
If you see "The AWS Access Key Id you provided does not exist in our records":
- Check that
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYare set in.env - Verify the credentials are correct
- Ensure the IAM user has S3 permissions
Download Failures
If downloads fail:
- Check network connectivity
- Verify blockchainsummit.la is accessible
- Some images may have different paths (e.g.,
/2025/11/instead of/2025/09/)
S3 Upload Failures
If uploads fail:
- Check S3 bucket permissions
- Verify the bucket name is correct
- Ensure the IAM user has
s3:PutObjectpermission
Manual Upload
If the script fails, you can manually:
- Download images from blockchainsummit.la
- Upload to S3 using AWS Console or CLI
- Update database manually with S3 URLs