Files
s3mover/README.md
Paul Jenkins 20c1298a7f initial commit
2026-03-26 11:06:15 +00:00

57 lines
1.5 KiB
Markdown

# S3 Mover
A small web app with a Go backend and React frontend for listing, uploading, downloading, and deleting files in an S3 bucket.
## Structure
- `backend`: Go HTTP API for S3 operations
- `frontend`: React + Vite client
## Backend configuration
Set these environment variables before starting the API:
- `AWS_REGION`: AWS region for the bucket
- `S3_BUCKET`: target bucket name
- `S3_PREFIX`: optional folder prefix inside the bucket
- `FRONTEND_ORIGIN`: allowed browser origin for CORS, for example `http://localhost:5173`
- `SERVER_ADDR`: HTTP bind address, default `:8080`
- `AWS_ENDPOINT_URL`: optional custom S3-compatible endpoint
- `AWS_USE_PATH_STYLE`: set to `true` for MinIO and some S3-compatible providers
- `AWS_ACCESS_KEY_ID`: access key for S3-compatible storage
- `AWS_SECRET_ACCESS_KEY`: secret key for S3-compatible storage
Standard AWS credentials are supported through the normal SDK chain. You can also set `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN`.
For DigitalOcean Spaces, a typical configuration looks like:
```bash
AWS_REGION=nyc3
S3_BUCKET=your-space-name
AWS_ENDPOINT_URL=https://nyc3.digitaloceanspaces.com
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_USE_PATH_STYLE=false
FRONTEND_ORIGIN=http://localhost:5173
```
## Run locally
Backend:
```bash
cd backend
go mod tidy
go run .
```
Frontend:
```bash
cd frontend
npm install
VITE_API_BASE_URL=http://localhost:8080 npm run dev
```
Then open `http://localhost:5173`.