From github.com/scottlaird:
This replaces github.com/jszwec/s3fs/v2 with kelindar/s3. This will have slightly different performance characteristics, but should implement range requests properly. This means that using caddy.fs.s3 to stream large video files won't result in (mostly) full-file reads for each chunk read by the client.
| .dagger | ||
| .github | ||
| .editorconfig | ||
| .envrc | ||
| .gitignore | ||
| .golangci.yaml | ||
| Caddyfile | ||
| dagger.json | ||
| devenv.lock | ||
| devenv.nix | ||
| devenv.yaml | ||
| docker-compose.yaml | ||
| go.mod | ||
| go.sum | ||
| justfile | ||
| LICENSE | ||
| module.go | ||
| module.go~ | ||
| README.md | ||
Caddy FS module for AWS S3
Installation
Build Caddy using xcaddy:
xcaddy build --with github.com/sagikazarmark/caddy-fs-s3
Usage
{
filesystem my-s3-fs s3 {
bucket mybucket
region us-east-1
# endpoint <endpoint>
# profile <profile>
# use_path_style
}
}
example.com {
file_server {
fs my-s3-fs
}
}
Note
For a full parameter reference, check out the module documentation page.
Authentication
The module uses the AWS SDK default credential chain to find valid credentials.
The easiest way to try the module is setting static credentials either in your AWS credentials file or as environment variables:
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
Caddy will pick up the credentials automatically.
Development
For an optimal developer experience, it is recommended to install Nix and direnv.
Run Caddy with the following command:
just run up --ports 8080:80
When all coding and testing is done, please run the test suite:
just check
License
The project is licensed under the MIT License.